2

I am a high school student attempting to write a script in bash that will submit jobs using the "qsub" command on a supercomputer utilizing a different number of cores. This script will then take the data on the number of cores and the time it took for the supercomputer to complete the simulation from each of the generated log files, called "log.lammps", and store this data in a separate file.

Because it will take each log file a different amount of time to be completely generated, I followed the steps from Monitoring a file until a string is found to have my script proceed when the last line of the log file with the string "Total wall time: " was generated.

Currently, I am using the following code in a loop so that this can be run for all the specified number of cores:

( tail -f -n0 log.lammps & ) | grep -q "Total wall time:"

However, running the script with this piece of code resulted in the log.lammps file being truncated and the script not completing even when the log.lammps file was completely generated.

Is there any other method for my script to only proceed when the submitted job is completed?

  • Can you use `qsub -W block=true` to have the qsub command block until the job is completed? That would be easiest, if it works... Check your local documentation with `man qsub` to see if your qsub accepts a similar argument that will have it wait until the job is finished. – filbranden Feb 27 '20 at 06:03
  • Maybe [those question & answers](https://stackoverflow.com/q/5024357) can help you?! – mpy Mar 03 '20 at 19:50
  • @filbranden I tried typing in man qsub into my mobaXterm but it gave me an error: ```sh: /usr/local/bin/less: No such file or directory Error executing formatting or display command.``` It then stated ```No manuel entry for qsub```. I would greatly appreciate it if you could clarify what this means and help me out. Thank you. – Yoshiki Kakehi Mar 13 '20 at 21:51

0 Answers0