Переглянути джерело

hmm: fix bug in parallel_run.sh preventing waiting

Justin Tracey 4 місяців тому
батько
коміт
338aead827
1 змінених файлів з 2 додано та 2 видалено
  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"