The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Slurm::Sacctmgr::EntityBaseAddDel

SYNOPSIS

  package Slurm::Sacctmgr::Account;
  use base qw(Slurm::Sacctmgr::EntityBaseRW);

DESCRIPTION

This is the base class for entities managed by sacctmgr, for entities which support the full set of read/write commands, i.e. can do all of

add (i.e. inherits from Slurm::Sacctmgr::EntityBaseAddDel )
delete (i.e. inherits from Slurm::Sacctmgr::EntityBaseAddDel )
list (i.e. inherits from Slurm::Sacctmgr::EntityBaseListable )
modify (i.e. inherits from Slurm::Sacctmgr::EntityBaseModifiable )

And for most part, this class just inherits from the classes above. But it also defines

compare($sacctmgr, $instance2)

This compares the invocant to $instance2, field by field. It returns undef if no differences, or a list of triplets [ fieldname, value1, value2 ] for each field fieldname that differs, with value1 being the value in the invocant and value2 the value in instance2. Compares fields from _sacctmgr_fields. Array and hash refs are compared element by element; non-ref scalars that look like numbers are compared as numbers, otherwise as strings.

sacctmgr_save_me($sacctmgr, [ extra1 => val1, [ extra2=>val2 ... ]])

This is an instance method, and calls sacctmgr_modify to update the entity with the same name to the values of the Perl object. Obviously cannot be used to change the name of an object. If no entity exists in sacctmgr db, does same as sacctmgr_add_me.

NOTE: The extra arguments will override data members if there is a conflict.

NOTE: This method currently silently ignores differences in fields which cannot be updated. This includes values that can be read but not updated with a sacctmgr invocation on the particular entity type (e.g. 'coordinators' field for Slurm::Sacctmgr::Account), or fields that are not supported for the particular version of Slurm (while a value for a resource in a TRES variable that has a non-TRES analog will be set in non-TRES supporting Slurms, e.g. the cpu field of GrpTRESMins will be set via the GrpCPUMins analog, resource settings for which no such analog exists, e.g. gres/gpu, will just be silently ignored).

EXPORT

Nothing. Pure OO interface.

SEE ALSO

EntityBase

AUTHOR

Tom Payerle, payerle@umd.edu

COPYRIGHT AND LICENSE

Copyright (C) 2014-2016 by the University of Maryland.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.