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?

0 Answers0