Summary on multiple MOPAC runs
For some time ago, I asked for help in how to make only one
MOPAC run at a time in a sequence of MOPAC runs. Here comes
the summary. Thanks to everybody who responded.
regards
--ari
----------------------------------------------------------
Ari Lahti, M.D., M.Sc.
Dept. Phys. Chem.
Abo Akademi University
Porthansg. 4-6
FIN-20500 Abo
Finland
tel.: 358-21-654617
fax:* 358-21-654706
e-mail: arilahti' at \`abo.fi
----------------------------------------------------------
From: aiba' at \`volta.vmsmail.ethz.ch (Aiaz Bakassov, Phys. Chem., ETH Zurich)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
..the best solution turned to be what I really disliked:
to call operating system from FORTRAN program.
This allows you to NOT care about any queues,
for FORTRAN proceeds operator by operator.
For UNIX the tool is UNIX FORTRAN function
"system". The lines in the FORTRAN program look
like:
INTEGER ISTAT
CHARACTER COMMAND*(80)
....
COMMAND='here is an appropriate UNIX command'
ISTAT=SYSTEM(COMMAND)
and you can put as many UNIX commands as you want
just call SYSTEM(..) again and again
with new commands inside.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
So, the overall FORTRAN program goes
ONCE into a normal batch queue. Important is this:
the calls for your MOPAC runs are successive
because FORTRAN waits till the previous operator
has been completed. So, you would have only
one MOPAC at time! Is this what you needed ?
Best regards and wish you success!
----------------------------------------------------------
From: soperpd' at \`nylon.es.dupont.com (Paul D. Soper)
Ari,
I have one solution for this problem. I generate the .csh
file for the job by simply telling MOPAC not to start running
immediately. Each of these .csh files is copied to a directory
used only for job control.
A file named job_list is created which has one .csh file name
per line. A script called run_next then...
1) Takes the first line (file name) from job_list
2) Adds some lines to the end of the file so it
will execute run_next when it is done
3) Submits the modifed .csh file to the batch processing
system
This is run_next:
#!/bin/csh
set home_dir = `pwd`
while (1 == 1)
if (! -e job_list) then
echo "job_list not found on" `date +"%D at %T"` >>
job_history.txt
break
endif
if (-z job_list) then
echo "job_list empty on" `date +"%D at %T"` >>
job_history.txt
break
endif
set job = `head -1 job_list`
tail +2 job_list > list.tmp
mv list.tmp job_list
if (! -e $job) then
echo "$job not found on" `date +" %D at %T"` >>
job_history.txt
else if (-z $job) then
echo "$job empty on" `date +" %D at %T"` >>
job_history.txt
else
echo "## The rest of this deck was added by the user"
>> $job
echo "" >> $job
echo "cd $home_dir" >>
$job
echo 'echo '"$job"' `date +" ended on %D at %T"`
>> job_history.txt' >> $job
echo "run_next"
>> $job
echo ""
>> $job
echo "$job" `date +" begun on %D at %T "` `bsub -q
parallel $job` >> job_history.txt
break
endif
end
exit
I hope this gives you some ideas.
Good luck,
Paul
----------------------------------------------------------
From: jxh' at \`biosym.com (Joerg Hill)
If I need to wait for a job to complete I use the following script:
----------------------------- waitforjob ------------------------------
# procedure which waits for termination of process with process id $1
if [ "$1" != "" ]
then
jobid=$1
else
# no jobid means big sleep
jobid=1
fi
echo waiting for process $jobid
while [ `ps -p $jobid | wc -l` -gt 1 ]
do
sleep 120
done
--------------------------------- EOF ----------------------------------
Use it with the process ID of the job you are waiting for as parameter.
Joerg-R. Hill
----------------------------------------------------------
From: "Dr. Daniel L. Severance" <dan' at \`sage.Syntex.Com>
Hi,
I'm not sure what's in the MOPAC batch script, but you could modify
it to submit the job using the UNIX batch command. The file
/usr/lib/cron/queuedefs contains a line like:
b.2j2n90w
which tells the UNIX batch command to only allow 2jobs to run at a time
(2j) and give them a nice value of 2 (2n) and wait 90 seconds between
checking to see if one of the running jobs is finished before submitting
another (90w). Every 90secs it checks to see if a slot is open, then
goes back to sleep for another 90 secs. until it finds that one job has
finished.
To use batch in your script just put the string:
/bin/batch <<!
before the commands which submit the job, and the string:
!
At the end of script before the exit (if you have one). Then you can
go ahead and submit them all at once, but they will only run in pairs (in
this example).
Good luck!
Dan
----------------------------------------------------------
From: btluke' at \`VNET.IBM.COM
Ari,
When I ported MOPAC7 to the RS/6000, I modified the program so
that it simply reads a file called MOPNAMES. This file is a
list of input file names and the program then runs each job in
order and builds the names of the output files from the input
file names.
This program is available from the Quantum Chemistry Program
Exchange (QCPE) in either an RS/6000 version or in a distributed
version. This latter version uses PVM (a free message passing
protocol) to sequentially run each job on a netwrok of workstations
or on an SP1/SP2 scallable-parallel machine. This means that
each machine/node is given an input file and the "master" process
waits until a node is finished before a new one is sent to it.
Brian
Brian T. Luke, Ph.D.
IBM Corporation
btluke' at \`vnet.ibm.com
----------------------------------------------------------
From: Richard Bone <rgab' at \`trpntech.com>
Reply to: RE>CCL:MOPAC necessarily batch?
Hi, I saw your message. Appended is some notes I made for myself
when I set up MOPAC93 at my former place of work. I think they
confirm your conclusion:
-------------------------------------
4. To use the submit-command
To stack mopac93 jobs up - just type
submit <dataset root-name>
and the file will be added to a .qjob file in $mopacdir.
*************************** SOME THINGS TO NOTE ************
*************
i) Do not run the mopac shell-script as a background process (&)
ii) If you run mopac93 from a script file you will have to put the line
'source $mopacdir/mopac93.csh'
at the top.
iii) DO NOT stagger jobs in a script file; they will all run concurrently.
iv) To stagger jobs use the "submit" command.
v) Peculiarity of data-set names: NO "." - Your dataset root names
may
not contain a period (.) - use underscore (_) or hyphen (-) instead.
Richard Bone
----------------------------------------------------------