Skip to content

Commit

Permalink
fix: sleep a random time to work around GNU parallel bug (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jan 11, 2023
1 parent 3d045e6 commit 7a02aea
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/bcftools_call/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_joint][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk3_hc/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk3_hc][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk3_ug/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk3_ug][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/combine_gvcfs/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/discover/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
2 changes: 1 addition & 1 deletion snappy_wrappers/wrappers/gatk4_hc/genotype/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
export -f run-shard
# Perform parallel execution
mkdir -p $TMPDIR/parallel
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_gvcf][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel --plain -j $num_threads 'run-shard {{#}} {{}}'
Expand Down
1 change: 1 addition & 0 deletions snappy_wrappers/wrappers/gatk4_hc/joint/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
export -f run-shard
# Perform parallel execution
(set -x; sleep $(echo "scale=3; $RANDOM/32767*10" | bc)s) # sleep up to 10s to work around bug
num_threads={snakemake.config[step_config][variant_calling][gatk4_hc_joint][num_threads]}
cat $TMPDIR/final_intervals.txt \
| parallel -j $num_threads 'run-shard {{#}} {{}}'
Expand Down

0 comments on commit 7a02aea

Please sign in to comment.