line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HPC::Runner::Command::submit_jobs::Utils::Scheduler::UseBatches; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
770
|
use Moose::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
has 'subcommand' => ( |
6
|
|
|
|
|
|
|
is => 'rw', |
7
|
|
|
|
|
|
|
isa => 'Str', |
8
|
|
|
|
|
|
|
default => 'execute_job', |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'desc' => ( |
12
|
|
|
|
|
|
|
is => 'rw', |
13
|
|
|
|
|
|
|
isa => 'Str', |
14
|
|
|
|
|
|
|
default => 'batches', |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub build_task_deps { |
18
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
19
|
0
|
|
|
|
|
|
my $batch_scheduler_id = shift; |
20
|
0
|
|
|
|
|
|
my $dep_scheduler_id = shift; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# my $batch_task_index = shift; |
23
|
|
|
|
|
|
|
# my $dep_task_index = shift; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# my $array_dep = [ $batch_scheduler_id, $dep_scheduler_id, ]; |
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
# return $array_dep; |
28
|
0
|
|
|
|
|
|
return $self->assign_scheduler_deps( $batch_scheduler_id, |
29
|
|
|
|
|
|
|
$dep_scheduler_id ); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub prepare_batch_indexes { |
33
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $self->jobs->{ $self->current_job }->batch_indexes; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
##TODO Write Tests |
39
|
|
|
|
|
|
|
sub gen_batch_index_str { |
40
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$DB::single = 2; |
43
|
|
|
|
|
|
|
my $counter = |
44
|
0
|
|
|
|
|
|
$self->job_counter - $self->jobs->{ $self->current_job }->{cmd_start} - 1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
## Cmds are 0 indexed |
47
|
|
|
|
|
|
|
## The first command in a job file is 0 |
48
|
|
|
|
|
|
|
# $DB::single = 2; |
49
|
|
|
|
|
|
|
my $start = |
50
|
0
|
|
|
|
|
|
$self->jobs->{ $self->current_job }->{batches}->[$counter]->{cmd_start}; |
51
|
0
|
|
|
|
|
|
return "$start"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub gen_counter_str { |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my ( $batch_counter, $job_counter ) = $self->prepare_counter; |
58
|
0
|
|
|
|
|
|
return $batch_counter; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |