Subject: Running Mopac in batch from SYBYL

From: [email-masked] (Tudor Oprea)
Date: Fri, 28 Oct 94 10:45:38 MDT

This was posted yesterday. I assume the SPL may be useful to others..

>> From: [email-masked] < Ari Lahti >
>> Date: Fri, 28 Oct 1994 13:56:53 +0200 (EET)
>> Subject: CCL:MOPAC necessarily batch?
>> 
>> I need to start a lot (>100) of MOPAC runs one after another
>> from a UNIX script. How can I make sure that no more than one
>> MOPAC is running at a time? 
>> 
>> I have tried deleting '&' from the .com file, but MOPAC still
>> goes batch (obviously the routine 'ta_batch' makes it do so in
>> any case). I have tried adding 'wait' in my script, but - 
>> strangely enough - it doesn't seem to work either. 'at' would
>> be clumsy to be used in my case.
>> 
>> So, how could I either make MOPAC run in the foreground or
>> make my script wait for the batch to end?
>> 
>> 
>> Thanks in advance.
>> 
>> Ari Lahti, Abo Akademi University
>> 
>> 
>> --------------------------------------------------------------
>> 
>> 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: [email-masked]
>> 
>> ---------------------------------------------------------------

Ari,

From the 'ta_batch' keyword I assume that you wish to run these
in Sybyl. There are several ways to do this:
one is to get a stand alone verision of Mopac from QCPE and have
it run from a shell script (like the one written by Manish Sud
from Biosym), and that will run Mopac in batch. This would help
UPGRADE your Mopac from 5.0 to Mopac93, by the way..
another way is to tell Sybyl to use the 'at' command - which you
can find using menubar to run Mopac - it will prompt you to
'run_it_now' and you can put each job to start after 30 min or
1 hr (whatever your estimate for 1 job is).
Another way, to run it interactively in SYBYL, is to introduce
the following SPL into Sybyl (with the take command) and have
both Sybyl and Mopac run - essentially the script awaits for
the *.sta file to be written (which is done when Mopac has
successfully run in the Sybyl version), and then launch the
next one. 
The script was written by me and Chris L. Waller ..
and for a while i found it useful..

## This is to run Mopac AM1 via MOPAC 5 in Sybyl for ALL molecules in database
## Written by Tudor I. Oprea and Chris L. Waller

## First tell Sybyl it's a macro called am1
uims define macro am1 sybylbasic
## Then stop the [C],[G] or [Q]
set cgq 0
## input database name
setvar a %prompt(string "database" "Enter database name")
## open database in read_only mode
da op $a re
## Start reading molecules in for processing
for i in %database(*)
da get "$i" m1
## Look for mopac DONE jobs
if %not(%dir($i.sta))
echo calculating MOPAC AM1 ...
## NOTE: CHANGE TO SUIT - USE geo_all OR 1SCF for geometry
## and method (AM1, PM3 etc.) to change Hamiltonian
qcpe m1 mopac setup $i \
method am1 \
time 6200 \
other "NOINTER GRAPH" \
## NOTE: For Sulfur you need a file called PAR for the
## S parameters, and the EXTERNAL=PAR PARASOK keywords above!!!
done \
"$i" 'machine_NAME' run_it_now
## change 'machine_NAME' to suit

## Now wait for this calculation to finish before starting a new one
while %not(%dir($i.sta))
echo process MOPAC still RUNNING
echo to keep the succession, do not press C,G or Q now!
wait 60
endwhile
echo mopac DONE
## If this molecule was already calculated, skip the whole procedure
else
echo this molecule is already Mopac DONE!
endif

endfor
.

## NOTE: do not delete the '.' after endfor - it's needed in SYBYL

--Tudor

****************************************************************************
*  Tudor I. Oprea, MD PhD			Tel: (505) 667 2682	   *
*  Postdoctoral Research Associate		Fax: (505) 665 3493        *
*  Theoretical Biology and Biophysics (T-10)	Email:			   *
*  Los Alamos National Laboratory		[email-masked]	   *
*  Mail Stop K710, Los Alamos NM 87545					   *
****************************************************************************