File Coverage

blib/lib/HPC/Runner/Command/execute_job.pm
Criterion Covered Total %
statement 12 18 66.6
branch 2 6 33.3
condition n/a
subroutine 3 4 75.0
pod n/a
total 17 28 60.7


line stmt bran cond sub pod time code
1             package HPC::Runner::Command::execute_job;
2              
3 1     1   2655 use MooseX::App::Command;
  1         3169  
  1         5  
4 1     1   174011 use JSON;
  1         4  
  1         14  
5              
6             extends 'HPC::Runner::Command';
7              
8             with 'HPC::Runner::Command::Logger::JSON';
9             with 'HPC::Runner::Command::Utils::Base';
10             with 'HPC::Runner::Command::Utils::Log';
11             with 'HPC::Runner::Command::Utils::Git';
12             with 'HPC::Runner::Command::execute_job::Utils::MCE';
13              
14             command_short_description 'Execute commands';
15             command_long_description
16             'Take the parsed files from hpcrunner.pl submit_jobs and executes the code';
17              
18             option 'batch_index_start' => (
19             is => 'rw',
20             isa => 'Num',
21             required => 0,
22             predicate => 'has_batch_index_start',
23             documentation =>
24             'Counter to tell execute_array where to start reading in the infile.'
25             . ' Omit this option in order to run in single node.'
26             );
27              
28             sub BUILD {
29 1     1   47 my $self = shift;
30              
31 1         24 $self->gen_load_plugins;
32 1         342 $self->job_load_plugins;
33              
34 1         23 my $job_meta;
35 1 50       47 if ( $self->metastr ) {
36 0         0 $job_meta = decode_json( $self->metastr );
37             }
38 1 50       10 return unless defined $job_meta;
39              
40 0 0         if(exists $job_meta->{job_cmd_start}){
41 0           $self->counter($job_meta->{job_cmd_start} + $self->batch_index_start);
42             }
43              
44             # my $tar = $self->set_archive;
45             # $self->archive($tar);
46             }
47              
48             sub execute {
49 0     0     my $self = shift;
50              
51 0           $self->git_things;
52 0           $self->run_mce;
53             }
54              
55             1;