Explorar el Código

hmm: fix bug in parallel_run.sh preventing waiting

Justin Tracey hace 4 meses
padre
commit
338aead827
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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"