line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/local/bin/perl |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
#Part of Slurm::Sacctmgr: Perl wrapper for Slurm's sacctmgr cmd |
4
|
|
|
|
|
|
|
#Represents an Trackable Resource (TRES) |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Slurm::Sacctmgr::Tres; |
7
|
34
|
|
|
34
|
|
17042
|
use strict; |
|
34
|
|
|
|
|
52
|
|
|
34
|
|
|
|
|
935
|
|
8
|
34
|
|
|
34
|
|
138
|
use warnings; |
|
34
|
|
|
|
|
31
|
|
|
34
|
|
|
|
|
963
|
|
9
|
34
|
|
|
34
|
|
137
|
use base qw(Slurm::Sacctmgr::EntityBaseListable); |
|
34
|
|
|
|
|
34
|
|
|
34
|
|
|
|
|
14703
|
|
10
|
34
|
|
|
34
|
|
164
|
use Carp qw(carp croak); |
|
34
|
|
|
|
|
34
|
|
|
34
|
|
|
|
|
5406
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
# Globals |
14
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
17
|
|
|
|
|
|
|
# Accessors |
18
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#Accessors common to all versions of slurm > 15.x |
21
|
|
|
|
|
|
|
#(TRES not available at ALL before then) |
22
|
|
|
|
|
|
|
my @simple_accessors = qw( |
23
|
|
|
|
|
|
|
name |
24
|
|
|
|
|
|
|
id |
25
|
|
|
|
|
|
|
type |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my @all_accessors = ( |
29
|
|
|
|
|
|
|
@simple_accessors, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@simple_accessors); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
35
|
|
|
|
|
|
|
# Overloaded methods |
36
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _rw_fields($) |
39
|
1403
|
|
|
1403
|
|
1189
|
{ my $class = shift; |
40
|
1403
|
|
|
|
|
2617
|
return [ @all_accessors ]; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _sacctmgr_name_field($) |
44
|
90
|
|
|
90
|
|
133
|
{ my $class = shift; |
45
|
90
|
|
|
|
|
166
|
return 'id'; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _sacctmgr_fields_in_order($$) |
49
|
702
|
|
|
702
|
|
986
|
{ my $class = shift; |
50
|
702
|
|
|
|
|
617
|
my $sacctmgr = shift; |
51
|
702
|
|
|
|
|
621
|
my @fields; |
52
|
702
|
50
|
|
|
|
1625
|
if ( $sacctmgr->sacctmgr_cmd_supports('trackable_resources') ) |
53
|
702
|
|
|
|
|
1752
|
{ @fields= @all_accessors; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
702
|
|
|
|
|
1641
|
return [ @fields ]; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
60
|
|
|
|
|
|
|
# Constructors, etc |
61
|
|
|
|
|
|
|
#------------------------------------------------------------------- |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#All inherited |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |