mampac — Sequentially execute multiple input files.


The mampac utility is useful for executing a group of AMPAC input files or even an entire test suite of input files. Mampac runs in the background and AMPAC jobs are executed sequentially. A simple summary of the each AMPAC job is written to the file MAMPAC.LOG. To monitor the progress of mampac while it is running, use tail -f MAMPAC.LOG in the same directory in which mampac is running.

AMPAC 9 no longer supports version control. (In previous versions, AMPAC would avoid overwritting previous results files by appending a version number to each of the result files.) Care should be taken in running jobs to not overwrite previous output files associated with the input file.

Mampac can be run in three different modes.

  1. Run all AMPAC input files (*.dat) in the current directory (mampac).

  2. Recursively run all input files (*.dat) in the current directory and all sub-directories (mampac -r).

  3. Run a select group of files. Wildcards are expanded allowing easy specification of groups of files. For example, to run all jobs in the current directory starting with test, use mampac test*.dat.


mampac [-r] [-mem]  [-nproc=#|all|most|half] {filename(s)}



Recursively search directories and run AMPAC jobs [default current directory only].


Turn on memory profiling (see below for details).


Specifies the number of processors to use--equivalent to NPROC. This is ignored if an NPROC command appears on the job's keyword line.


Run each of the specified AMPAC jobs in the background. When filename(s) are specified, the -r option is ignored. Multiple filenames can be entered separated by spaces. UNIX file globbing (for example, using * as a wildcard) is also supported.

Memory Profiling

The memory profiling option is a new feature that allows users to determine the amount of memory used by a particular job. As AMPAC is being used to study larger and larger systems, it is important for users to be able to know how much memory a job requires so as to estimate how big of a system can be run on their computer. In many cases, top or ps is sufficient for this purpose, however, memory profiling provides a much more detailed report and so can provide information that these other commands cannot.

Using -mem will cause the AMPAC job to be run in the background while the script repeatedly polls the job using the ps -el command once per second until it finishes. The results for filename.dat will appear in a seperate file named filename.mem in plain text format. The maximum memory used by the job is also reported to the screen.

There are a few things to keep in mind in using this feature. The memory usage should be considered approximate and may vary slightly each time the job is run because we are only looking at snapshots. The results should only be compared to jobs running under the same operating system, since operating systems vary in how they report memory. Jobs that complete in a few seconds or less will likely produce no results and report zero memory consumption, since it may finish before there is a chance to test for memory usage.


When mampac is launched a small amount of text is written to the screen:

Process: 8668
Running AMPAC 9.0 for *.dat in directory:

To check the status of your job, type cat MAMPAC.LOG.

The text file named MAMPAC.LOG is written to the current working directory:

Running AMPAC 9.0 for *.dat in directory:

Tue Jun 10 15:15:49 CDT 2008

Submitting AMPAC 9.0 Data file:  Ammonia.dat
Running in Temporary Directory:  amp8675
AMPAC: /home/semo/Ampac/program/ampac.exe

Tue Jun 10 15:15:50 CDT 2008

Submitting AMPAC 9.0 Data file:  Ammonium.dat
Running in Temporary Directory:  amp8675
AMPAC: /home/semo/Ampac/program/ampac.exe

Tue Jun 10 15:15:51 CDT 2008

... additional output ...

Tue Jun 10 15:16:43 CDT 2008

Submitting AMPAC 9.0 Data file:  Water.dat
Running in Temporary Directory:  amp8675
AMPAC: /home/semo/Ampac/program/ampac.exe

Tue Jun 10 15:16:44 CDT 2008
16.4u 19.8s 1:04 56%

See also:

Chapter 5, Presenting Input to the Program