Author Topic: HELP IN RUNNING PROGRAMS IN A QUEUE  (Read 1919 times)

0 Members and 1 Guest are viewing this topic.

Offline msg

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Reputation: 0
    • View Profile
HELP IN RUNNING PROGRAMS IN A QUEUE
« on: April 28, 2011, 12:15 »
recently we have made use of the workstation license with mpi support(making use of all the 4 cores).but it was observed that only 1 program could be run at a time.also unlike the other versions other programs could not be put in a queue,which is a better usage of time unlike the problem that i am facing now...that is waiting for the present running program to get over and then manually sending the next program to run...could you help me in this regard that is i need your help in putting all the programs in a queue in the workstation,so that when one gets over,the next one automatically runs(like in the job manager).whta can i do for this?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5413
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: HELP IN RUNNING PROGRAMS IN A QUEUE
« Reply #1 on: April 29, 2011, 10:33 »
If you are using Linux (or Cygwin under Windows), I would suggest making either a simple loop in a bash script, or just enter all scripts explicitly. So, if you have the following scripts to run "script1.py", "script2.py", and "script3.py", you can either do
Code
#!/bin/bash
for script in script*.py ; do
    mpiexec ... atkpython $script > $script.log
done
or
Code
#!/bin/bash
mpiexec ... atkpython script1.py > script1.log
mpiexec ... atkpython script2.py > script2.log
mpiexec ... atkpython script3.py > script3.log
NOTE that you should NOT use "&" to put the job in the background The first option is better if you have many scripts as you don't have to write the filenames out explicitly. Of course you have to fix the path etc of atkpython and add the relevant options for mpiexec. The scripts above should be saved in a file, like "run.sh" which should be given executable flags (chmod u+x run.sh). The you run the script as "./run.sh".