« blib/script/hpcrunner.pl
↑ Summary
blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/UseBatches.pm »
| 1 | package HPC::Runner::Command::submit_jobs::Utils::Scheduler::UseArrays; | ||
| 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_array', | ||
| 9 | ); | ||
| 10 | |||
| 11 | 1 | has 'desc' => ( | |
| 12 | is => 'rw', | ||
| 13 | isa => 'Str', | ||
| 14 | default => 'tasks', | ||
| 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 | 0 | my $batch_task_index = shift; | |
| 22 | 0 | my $dep_task_index = shift; | |
| 23 | |||
| 24 | 0 | my $array_dep = [ | |
| 25 | $batch_scheduler_id . '_' . $batch_task_index, | ||
| 26 | $dep_scheduler_id . '_' . $dep_task_index, | ||
| 27 | ]; | ||
| 28 | |||
| 29 | 0 | return $array_dep; | |
| 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 | sub gen_batch_index_str { | ||
| 39 | 0 | ▶ | my $self = shift; |
|
Subroutine
gen_batch_index_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 40 | |||
| 41 | 0 | my $counter = $self->jobs->{ $self->current_job }->{cmd_start} + 1; | |
| 42 | 0 | return "$counter"; | |
| 43 | } | ||
| 44 | |||
| 45 | sub gen_array_str { | ||
| 46 | 0 | ▶ | my $self = shift; |
|
Subroutine
gen_array_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 47 | 0 | my $batch_indexes = shift; | |
| 48 | |||
| 49 | 0 | my $batch_index_start = $batch_indexes->{batch_index_start} - 1; | |
| 50 | 0 | my $batch_index_end = $batch_indexes->{batch_index_end} - 1; | |
| 51 | |||
| 52 | my $start_array = | ||
| 53 | $self->jobs->{ $self->current_job }->{batches}->[$batch_index_start] | ||
| 54 | 0 | ->{cmd_start} + $self->jobs->{ $self->current_job }->{cmd_start}; | |
| 55 | |||
| 56 | my $end_array = | ||
| 57 | $self->jobs->{ $self->current_job }->{batches}->[$batch_index_end] | ||
| 58 | 0 | ->{cmd_start} + $self->jobs->{ $self->current_job }->{cmd_start}; | |
| 59 | |||
| 60 | my $array_str = | ||
| 61 | $start_array . "-" | ||
| 62 | . $end_array . ':' | ||
| 63 | 0 | . $self->jobs->{ $self->current_job }->commands_per_node; | |
| 64 | |||
| 65 | 0 | return $array_str; | |
| 66 | } | ||
| 67 | |||
| 68 | sub gen_counter_str { | ||
| 69 | 0 | ▶ | my $self = shift; |
|
Subroutine
gen_counter_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 70 | |||
| 71 | 0 | my ( $batch_counter, $job_counter ) = $self->prepare_counter; | |
| 72 | 0 | return $job_counter; | |
| 73 | } | ||
| 74 | |||
| 75 | 1 | 1; | |