Guest User

Untitled

a guest
Jan 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/zsh
  2. # vim:ft=zsh
  3.  
  4. # Say you want 10 parallel processes. Condor submit file should look like:
  5. #
  6. # Executable = ./par_run.sh
  7. # Arguments = $(Process) 10 TheFileList /output/directory
  8. # Queue 10
  9. #
  10. # Then every process runs on 1 out of 10 files.
  11.  
  12. set -eu
  13. myproc=$1
  14. numproc=$2
  15. filelist=$3
  16. outdir=$4
  17.  
  18. myfilelist=$filelist.proc=$myproc.host=$(hostname -s).pid=$$
  19. awk "NR % $numproc == $myproc" < $filelist > $myfilelist
  20.  
  21. for infile in $(cat $myfilelist); {
  22. outfile=${infile:r:t}.smalltweet
  23. cmd="cat $infile | zcat | python hose_filter.py > $outdir/$outfile"
  24. date
  25. echo "$cmd"
  26. (time (eval $cmd) ) 2>&1 ## Comment out for testing
  27. }
Add Comment
Please, Sign In to add comment