« blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/UseArrays.pm
↑ Summary
blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/Job.pm »
| 1 | package HPC::Runner::Command::submit_jobs::Utils::Scheduler::UseBatches; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | has 'subcommand' => ( | |
| 6 | is => 'rw', | ||
| 7 | isa => 'Str', | ||
| 8 | default => 'execute_job', | ||
| 9 | ); | ||
| 10 | |||
| 11 | 1 | has 'desc' => ( | |
| 12 | is => 'rw', | ||
| 13 | isa => 'Str', | ||
| 14 | default => 'batches', | ||
| 15 | ); | ||
| 16 | |||
| 17 | sub build_task_deps { | ||
| 18 | 0 | ▶ | my $self = shift; |
|
Subroutine
build_task_deps: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 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 | ▶ | my $self = shift; |
|
Subroutine
prepare_batch_indexes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 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 | ▶ | my $self = shift; |
|
Subroutine
gen_batch_index_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 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 | ▶ | my $self = shift; |
|
Subroutine
gen_counter_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 56 | |||
| 57 | 0 | my ( $batch_counter, $job_counter ) = $self->prepare_counter; | |
| 58 | 0 | return $batch_counter; | |
| 59 | } | ||
| 60 | |||
| 61 | 1 | 1; | |