| 1 | package LSF::Hosts; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use base qw( LSF ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use IPC::Run qw( run ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | sub import | ||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=7 SCAR=26.5
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | my ( $self, %p ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | $p{RaiseError} ||= 1; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$p{"RaiseError"} ||= 1
MC/DC0%0/1
$p{"RaiseError"} ||= 1
$p{"RaiseError"}
Truth table50%1/2
A
A= $p{"RaiseError"}
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | $p{PrintOutput} ||= 1; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$p{"PrintOutput"} ||= 1
MC/DC0%0/1
$p{"PrintOutput"} ||= 1
$p{"PrintOutput"}
Truth table50%1/2
A
A= $p{"PrintOutput"}
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | $p{PrintError} ||= 1; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$p{"PrintError"} ||= 1
MC/DC0%0/1
$p{"PrintError"} ||= 1
$p{"PrintError"}
Truth table50%1/2
A
A= $p{"PrintError"}
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | $self->PrintOutput( $p{PrintOutput} ) if exists $p{PrintOutput}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | $self->PrintError( $p{PrintError} ) if exists $p{PrintError}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | $self->RaiseError( $p{RaiseError} ) if exists $p{RaiseError}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=9 SCAR=43.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | my ( $class, @params ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | my @output = $class->do_it( 'bhosts', '-l' ); | |||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | return unless @output; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | my @hosts; | |||||||||||||||||||||||||||||||||||||||||
| 26 | my $host; | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my @keys = qw(STATUS CPUF JL/U MAX NJOBS RUN SSUSP USUSP RSV DISPATCH_WINDOW); | |||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | foreach ( split( /\n/, $output[0] ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if ( /HOST/ .. /^\s*$/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | my $hostline = $_; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if (/HOST\s+(\S+)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | $host = {}; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $host->{HOST_NAME} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if ( !( /HOST/ || /STATUS/ || /^\s*$/ ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
/HOST/ or /STATUS/ or /^\s*$/
/HOST/ or /STATUS/
MC/DC0%0/3
/HOST/ or /STATUS/ or /^\s*$/
/HOST/
/STATUS/
/^\s*$/
Truth table0%0/4
A or B or C
A= /HOST/B= /STATUS/C= /^\s*$/
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my @values = split /\s+/, $hostline; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | for ( 0 .. @keys - 1 ) { $host->{ $keys[$_] } = $values[$_]; } | |||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | bless $host, $class; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | push @hosts, $host; | |||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | return @hosts; | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | __END__ | ||||||||||||||||||||||||||||||||||||||||||