An (Old) Automatic PC-GAMESS Batch Script

From a prior version of the site…

This batch script acts similar to GQueue for MacGamess, with the exception that you can't add files after the .bat file has been implemented (run). This new version automatically goes through a directory containing PC-GAMESS input (.inp) files and runs them without having to specify each name in a long batch file. all one has to do is double-click on the rungamess.bat file from a window and it will automatically start the command prompt and program.

There is a limit to the use of the FOR command in DOS that I've not yet found a way to overcome, so the actual batch script is divided into two files. The first, rungamess.bat, contains the code that collects the .inp files and passes each name sequentially to execute.bat, the file that actually starts PC-GAMESS and runs the calculation. While an annoyance to have two files, once they are placed you never have to touch them again (unless you want to pass parallel calculation parameters to the executable, which are done in the execute.bat file).

The image below shows an ideal setup for running these batch files to automate your calculations. The execute.bat file calls the PC-GAMESS executable as GAMESS.EXE. If you've a different name for the program (if you keep track of versions, for instance), go into execute.bat with Wordpad or Notepad and change accordingly. The file names (and batch files) will work universally across windows OS's provided you stick to the standard 8.3 format. That is, 8 letters for the filename and 3 for the extension. In Windows2000 and higher, long file names work just fine EXCEPT spaces and non-standard characters are prohibited (you're still running the calculations in DOS mode, remember). With your directory setup, just double-click on rungamess.bat and wait for the jobs to finish.

The batch files are provided below in full. You can download each file from the following links (they're just text files, so you may want to right-click and "Save As.") The internals are described below each in case changes are needed. When downloaded as the rungamess.txt file, rename this file to rungamess.bat to make it executable.

Download rungamess.txt

@echo off
[lots of echo and REM text]
[download the .txt file to read]
for %%f in (*.inp) do call execute %%f
del DICTNRY
del WORK16 
del MOINTS 
del WORK15 
del AOINTS 
del IRCDATA 
del AOINTS 

A lot of descriptive stuff about the file, most of which can be ignored. The only thing that may need changing is the deletion of the pause line to remove the break before the calculations go. There for the first time so you can see what's happening. Note, if you use a different file extension (instead of .inp), then change the batch file accordingly where noted. When downloaded as the execute.txt file, rename this file to execute.bat to make it executable.

Download execute.txt

echo The PC-GAMESS calculation for %1 is currently running.
@echo off
[lots of echo and REM text]
[download the .txt file to read]
GAMESS.EXE -i %1 -o %~n1.out 
move PUNCH %~n1.dat
del input

Mostly self-explanatory. The first echo line just keeps track on the screen (in the command prompt) of what calculation is going (where in the file list you are). The GAMESS.EXE line is the formal call for the program as per the readme files that come with it. The only file that NEEDS to be deleted is the input file. The PUNCH file comes out as just a name, while the unix version refers to it as a *.dat file. Useful info inside (depending), so I choose to save it by moving PUNCH to filename.dat. Leave in or remove accordingly.

That's it! Any questions, drop a line.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.