Skip to content

Commit e747db4

Browse files
author
Matthew McEneaney
committed
fix: Remove unnecessary control flow options.
1 parent ec91e62 commit e747db4

1 file changed

Lines changed: 3 additions & 41 deletions

File tree

bin/run-detectors-timelines.sh

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ outputDir=""
1818
numThreads=8
1919
singleTimeline=""
2020
declare -A modes
21-
for key in list build skip-mya focus-timelines focus-qa run-slurm after-slurm single series submit swifjob debug help; do
21+
for key in list build skip-mya focus-timelines focus-qa run-slurm after-slurm submit debug help; do
2222
modes[$key]=false
2323
done
2424

@@ -69,19 +69,9 @@ usage() {
6969
*** EXECUTION CONTROL OPTIONS: choose only one, or the default will generate a
7070
Slurm job description and print out the suggested \`sbatch\` command
7171
72-
--single run only the first job, locally; useful for
73-
testing before submitting jobs to slurm
74-
75-
--series run all jobs locally, one at a time; useful
76-
for testing on systems without slurm
77-
7872
--submit submit the slurm jobs, rather than just
7973
printing the \`sbatch\` command
8074
81-
--swifjob run this on a workflow runner, where the input
82-
files are found in ./; overrides some other settings; this is NOT meant
83-
to be used interactively, but rather as a part of a workflow
84-
8575
--debug enable debug mode: run a single timeline with stderr and stdout printed to screen;
8676
it is best to use this with the '-t' option to debug specific timeline issues
8777
@@ -349,22 +339,7 @@ EOF
349339
[ ! -s $joblist ] && printError "there are no timeline jobs to run" && continue
350340
slurm=$(echo $joblist | sed 's;.list$;.slurm;')
351341

352-
# either generate single/sequential run scripts
353-
if ${modes['single']} || ${modes['series']} || ${modes['swifjob']}; then
354-
localScript=$(echo $joblist | sed 's;.list$;.local.sh;')
355-
echo "#!/usr/bin/env bash" > $localScript
356-
echo "set -e" >> $localScript
357-
if ${modes['single']}; then
358-
head -n1 $joblist >> $localScript
359-
else # ${modes['series']} || ${modes['swifjob']}
360-
cat $joblist >> $localScript
361-
fi
362-
chmod u+x $localScript
363-
exelist+=($localScript)
364-
365-
# otherwise generate slurm description
366-
else
367-
cat > $slurm << EOF
342+
cat > $slurm << EOF
368343
#!/bin/sh
369344
#SBATCH --ntasks=1
370345
#SBATCH --job-name=$slurmJobName
@@ -389,20 +364,7 @@ EOF
389364
echo """
390365
$sep
391366
"""
392-
if ${modes['single']} || ${modes['series']} || ${modes['swifjob']}; then
393-
if ${modes['single']}; then
394-
echo "RUNNING ONE SINGLE JOB LOCALLY:"
395-
elif ${modes['series']}; then
396-
echo "RUNNING ALL JOBS SEQUENTIALLY, LOCALLY:"
397-
fi
398-
for exe in ${exelist[@]}; do
399-
echo """
400-
$sep
401-
EXECUTING: $exe
402-
$sep"""
403-
$exe
404-
done
405-
elif ${modes['submit']}; then
367+
if ${modes['submit']}; then
406368
echo "SUBMITTING JOBS TO SLURM"
407369
echo $sep
408370
for exe in ${exelist[@]}; do sbatch $exe; done

0 commit comments

Comments
 (0)