diff --git a/scripts/beekeeper.pl b/scripts/beekeeper.pl index 225f23571e306807bfa984ba0561c30d5b6e35d5..a8b4d936b49afeba03cc92009a11c0c8b7700b70 100755 --- a/scripts/beekeeper.pl +++ b/scripts/beekeeper.pl @@ -91,7 +91,7 @@ sub main { 'meadow_options|lsf_options=s' => \$meadow_options, # 'lsf_options' is deprecated (please investigate the resource requirements, they may suit your needs way better) # worker control - 'jlimit=i' => \$self->{'job_limit'}, + 'job_limit|jlimit=i' => \$self->{'job_limit'}, 'batch_size=i' => \$self->{'batch_size'}, 'lifespan=i' => \$self->{'lifespan'}, 'logic_name=s' => \$self->{'logic_name'}, @@ -322,13 +322,11 @@ sub generate_worker_cmd { if ($self->{'run_job_id'}) { $worker_cmd .= " -job_id ".$self->{'run_job_id'}; } else { - $worker_cmd .= (defined($self->{'job_limit'}) ? " -limit $self->{'job_limit'}" : '') - . (defined($self->{'batch_size'}) ? " -batch_size $self->{'batch_size'}" : '') - . (defined($self->{'lifespan'}) ? " -lifespan $self->{'lifespan'}" : '') - . (defined($self->{'logic_name'}) ? " -logic_name $self->{'logic_name'}" : '') - . ($self->{'maximise_concurrency'} ? ' -maximise_concurrency 1' : '') - . (defined($self->{'retry_throwing_jobs'}) ? " -retry_throwing_jobs $self->{'retry_throwing_jobs'}" : '') - . ($self->{'hive_output_dir'} ? " -hive_output_dir $self->{'hive_output_dir'}" : ''); + foreach my $worker_option ('batch_size', 'job_limit', 'lifespan', 'logic_name', 'maximize_concurrency', 'retry_throwing_jobs', 'hive_output_dir') { + if(defined(my $value = $self->{$worker_option})) { + $worker_cmd .= " -${worker_option} $value"; + } + } } if ($self->{'reg_file'}) { @@ -505,7 +503,7 @@ __DATA__ =head2 Worker control - -jlimit <num> : #jobs to run before worker can die naturally + -job_limit <num> : #jobs to run before worker can die naturally -batch_size <num> : #jobs a worker can claim at once -lifespan <num> : lifespan limit for each worker -logic_name <string> : restrict the pipeline stat/runs to this analysis logic_name diff --git a/scripts/runWorker.pl b/scripts/runWorker.pl index 7ff20c40f0d4f34af0ee324ae8dce2f7047395b4..bdc7f18ecf87ed6f8aa17891a40998099ca10fad 100755 --- a/scripts/runWorker.pl +++ b/scripts/runWorker.pl @@ -66,7 +66,7 @@ GetOptions( 'rc_id=i' => \$self->{'rc_id'}, 'logic_name=s' => \$self->{'logic_name'}, 'batch_size=i' => \$self->{'batch_size'}, - 'limit=i' => \$self->{'job_limit'}, + 'job_limit|limit=i' => \$self->{'job_limit'}, 'lifespan=i' => \$self->{'lifespan'}, 'hive_output_dir|outdir=s' => \$self->{'hive_output_dir'}, # keep compatibility with the old name 'bk=s' => \$self->{'beekeeper'}, # deprecated and ignored @@ -295,7 +295,7 @@ __DATA__ -analysis_id <id> : analysis_id in db -logic_name <string> : logic_name of analysis to make this worker -batch_size <num> : #jobs to claim at a time - -limit <num> : #jobs to run before worker can die naturally + -job_limit <num> : #jobs to run before worker can die naturally -lifespan <num> : number of minutes this worker is allowed to run -hive_output_dir <path> : directory where stdout/stderr of the hive is redirected -bk <string> : beekeeper identifier (deprecated and ignored)