1

I am currently writing a python script to launch many simulations in parallel using this command repeatedly :

os.system("bsub -q reg -app ... file.cir")

And I need to retrieve the job ID list in order to know exactly when all the jobs are completed, to then process the data. My idea is simply to make a loop over the job id list and to check if each of them are completed.

I have tried using getpid() but I believe it only gives me the id of the python process running. I know bjobs gives you the list of processes running but from there I do not see how to parse the output with my Python file.

How can I do that ? Would there otherwise be an easier solution to find out when all the processes I run on the LSF cluster are over ?

  • Does this answer your question [How to determine pid of process started via os.system](https://stackoverflow.com/questions/20218570/how-to-determine-pid-of-process-started-via-os-system) – W-B Aug 24 '20 at 15:11
  • No, the python processes end as soon as the request is sent to the cluster, while the jobs still run in the background. I cannot use this method. – Event Rabbit Aug 25 '20 at 09:47

0 Answers0