Browse Source

hmm: fix bug in parallel_run.sh preventing waiting

Justin Tracey 4 months ago
parent
commit
338aead827
1 changed files with 2 additions and 2 deletions
  1. 2 2
      hmm/parallel_run.sh

+ 2 - 2
hmm/parallel_run.sh

@@ -11,10 +11,10 @@ stats_dir_out="$2"
 n_files=$(ls "$stats_dir_in" | wc -l)
 N=$(( $n_files / $(nproc) ))
 
-ls "$stats_dir_in" | while mapfile -n $N files_per_proc && [ ${#files_per_proc[@]} -gt 0 ]; do
+while mapfile -n $N files_per_proc && [ ${#files_per_proc[@]} -gt 0 ]; do
         files="$(printf "$stats_dir_in/%s" "${files_per_proc[@]}")"
         python3 get_w.py "$stats_dir_out" $files &
-done
+done < <(ls "$stats_dir_in")
 wait
 
 echo "all done"