From ARILAHTI.,at,.finabo.abo.fi Tue Nov 8 08:24:45 1994 Received: from SILKE.ABO.FI for ARILAHTI # - at - # finabo.abo.fi by www.ccl.net (8.6.9/930601.1506) id HAA06620; Tue, 8 Nov 1994 07:28:39 -0500 From: Received: from finabo.abo.fi by finabo.abo.fi (PMDF V4.3-8 #7828) id <01HJ8N8DHA80CCK77N-!at!-finabo.abo.fi>; Tue, 8 Nov 1994 14:28:15 EET Date: Tue, 08 Nov 1994 14:28:15 +0200 (EET) Subject: Summary on multiple MOPAC runs To: chemistry |-at-| ccl.net Message-id: <01HJ8N8DKRLUCCK77N /at\finabo.abo.fi> X-VMS-To: IN%"chemistry-!at!-ccl.net" MIME-version: 1.0 Content-type: TEXT/PLAIN; CHARSET=US-ASCII Content-transfer-encoding: 7BIT 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 -x- at -x- 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" 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 < 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 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 ----------------------------------------------------------