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

NAME

Slurm::Sacctmgr::WCKey

SYNOPSIS

  use Slurm::Sacctmgr::WCKey;
  use Slurm::Sacctmgr;

  my $sacctmgr = new Slurm::Sacctmgr;
  my $list = Slurm::Sacctmgr::WCKey->sacctmgr_list($sacctmgr);

  #List all wckeys known to sacctmgr
  foreach $wckey (@$list)
  {     #wckey is a Slurm::Sacctmgr::WCKey object
        $name = $wckey->wckey;
        $cluster = $wckey->cluster;
        $user = $wckey->user;
        print "$name ($cluster) [$user]\n";
  }

  #Get a single wckey 
  $uname = 'payerle';
  $wckey = Slurm::Sacctmgr::WCKey->new_from_sacctmgr_by_name($sacctmgr,$uname);
  $defacct = $wckey->defaultaccount;
  print "Default account for wckey '$uname' is '$defacct'\n";

  ...

DESCRIPTION

Represents a WCKey entity in Slurm::Sacctmgr. Together with an instance of Slurm::Sacctmgr, this class allows one to issue commands to the Slurm sacctmgr command to list or show sacctmgr entities of type "wckey".

The Slurm::Sacctmgr class provides a Perlish wrapper around the actual Slurm sacctmgr command, thus the methods provided by this class largely map quite straightforwardly onto sacctmgr commands. When using the sacctmgr_list method for this class, the results from the sacctmgr command is automatically parsed and presented as objects of this class.

Objects of this class contain the following data members:

wckey: Workload Charactization Key
cluster: cluster for the WCKey
user: user for the WCKey

and these are the fields that will be set by the sacctmgr_list and similar methods. When filtering results, you can use any fields recognized by the sacctmgr command.

Most functionality is provided via the base classes,

Slurm::Sacctmgr::EntityBaseListable
Slurm::Sacctmgr::EntityBase

As a result, the whole Slurm::Sacctmgr::* family (for different entity types) all have a very similar wckey interface (basically the differences are what operations sacctmgr allows on different entity types, and how the results of list/show operations get parsed).

Since sacctmgr only allows one to show/list WCKeys, the only real method provided by this class is sacctmgr_list($sacctmgr, %where). This will return a list reference of all objects of entity type "wckey" matching the "where" clause. The "where" clause is a list of zero or more key => value pairs specifying the conditions. Only exact matching is supported, and keys cannot be usefully repeated (the "where" clause is treated as a hash, so later keys simply overwrite earlier keys). You can use any parameter the Slurm sacctmgr command allows you to filter on. If no key => value pairs are given, all entities of this type are returned.

EXPORT

Nothing. Pure OO interface.

SEE ALSO

Slurm::Sacctmgr::EntityBase
Slurm::Sacctmgr::EntityBaseListable
Slurm::Sacctmgr::EntityBaseAddDel
Slurm::Sacctmgr::EntityBaseModifiable
Slurm::Sacctmgr::EntityBaseRW
sacctmgr man page

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.