blib/lib/HPCD/uni/Stage.pm

filter: Statementstmt 70.5% 24 / 34 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 72.7% 8 / 11 Podpod n/a totaltotal 60.3% 32 / 53 CC 4 SCAR 14.2
CC
4
Cov
60%
_get_submit_timeouts
12.0
_analyse_completion_state
6.0
_build_cluster_specific_valid_resources
2.0
CRAP 4.1
« Build ↑ Summary blib/lib/HPCI/Template.pm »
1 package HPCD::uni::Stage;
2  
3 ### INCLUDES ##################################################################
4  
5 # safe Perl
6 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 20 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 20 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 20 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 20 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 20 ▶use HPCD::uni::Run;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 with qw(HPCI::Stage), HPCI::get_extra_roles('uni', 'stage');
18  
19 sub _build_cluster_specific_valid_resources {
20 return (
21 0 ▶ h_time => undef,
Subroutine _build_cluster_specific_valid_resources: not called CC=1 SCAR=6.9
22 s_time => undef,
23 )
24 }
25  
26 =head1 NAME
27  
28 HPCD::uni::Stage
29  
30 =head1 SYNOPSIS
31  
32 This is a HPCD internal module, loaded by HPCD::uni::Group to
33 provide stage objects for uni clusters.
34  
35 It consumes the HPCI::Stage role.
36  
37 =cut
38  
39 has '+runs' => (
40 isa => 'ArrayRef[HPCD::uni::Run]',
41 );
42  
43 has '_run_class' => (
44 is => 'ro',
45 isa => 'Str',
46 init_arg => undef,
47 default => "HPCD::uni::Run",
48 );
49  
50 =head1 METHODS
51  
52 =head2 _analyse_completion_state
53  
54 Checks the completion info from when execution of this stage has
55 finished, and determine whether it:
56  
57 - succeeded
58 - failed but can be retried (never for this driver)
59 - failed irrevocably
60  
61 =cut
62  
63 sub _analyse_completion_state {
64 0 ▶ my $self = shift;
Subroutine _analyse_completion_state: not called CC=2 SCAR=17.9
65 0 my $run = shift;
66 0 my $stats = $run->stats;
67 0 $self->debug( "Stats from finished stage(" . $self->name . "): " . Dumper($stats) );
68 my $new_state =
69 0 == $stats->{exit_status}
70 0 ▶ ? 'pass'
Branch: 1 branch
BranchTrueFalseTotal
0 == $stats->{'exit_status'} ? : 0 0 0
71 : 'fail';
72 0 $self->_set_state($new_state);
73 }
74  
75 sub _get_submit_timeouts {
76 0 ▶ my $self = shift;
Subroutine _get_submit_timeouts: not called CC=3 SCAR=24.8
77 0 my $res = $self->_use_resources_required;
78 return
79 $self->_time_to_secs( $res->{s_time} // 0 ),
80 0 ▶ $self->_time_to_secs( $res->{h_time} // 0 );
Condition0%0/4
$res->{"s_time"} // 0
l!l
00
$res->{"h_time"} // 0
l!l
00
MC/DC0%0/1
$res->{"s_time"} // 0
$res->{"s_time"}
MC/DC0%0/1
$res->{"h_time"} // 0
$res->{"h_time"}
Truth table0%0/2
A
A= $res->{"s_time"}
Aresult
11
00
Truth table0%0/2
A
A= $res->{"h_time"}
Aresult
11
00
81 }
82  
83 =head1 AUTHOR
84  
85 John Macdonald - Boutros Lab
86  
87 =head1 ACKNOWLEDGEMENTS
88  
89 Paul Boutros, Phd, PI - Boutros Lab
90  
91 The Ontario Institute for Cancer Research
92  
93 =cut
94  
95 1;
96  
« Build ↑ Summary blib/lib/HPCI/Template.pm »