Running RMG

Running RMG from the Command Line in Linux

This section assumes that RMG is already installed according to the directions in Section Linux installation. Additionally, it is assumed that you have created a directory (either in your home directory or elsewhere) in which the initialization file condition.txt has been placed. In the example, we assume that we have created a directory /hexane_pyro, which contains the condition file hexane_pyro.txt.

  1. Change the current working directory to the directory with the condition file:

    $ cd /hexane_pyro/
  2. Run the following Java command to launch the program (all one line):

    $ java -Xmx500m -classpath $RMG/bin/RMG.jar RMG hexane_pyro.txt

When RMG is started, it creates several subdirectories: 2Dmolfiles, 3Dmolfiles, chemkin, fame, frankie, GATPFit, InChI, ODESolver, Pruning, QMfiles and Restart. By default these are in the directory from which you ran the command, but to configure them see Configuring paths using Environment Variables.

In this example, all of the output from RMG is piped to a file output.log. The > output part of the command is optional but recommended. The Java option -Xmx500m is hardware specific. In this example, we assume that we can allot five hundred megabytes of memory for Java Virtual Machine running RMG; please consult a guide to Java for more information. On unix systems we recommend allocating less than half of your available virtual memory, because of the way the Java Virtual Machine forks processes.

To see the content of the output file as it is being generated, use the command: $ tail -f output.log.

Running RMG from the Command Line in Windows

To run RMG in Windows: Open a DOS-prompt, change the current working directory to the directory with the condition file, and run the following Java command to launch the program. In this example, the condition file is located in a (new) folder named conditionFiles:

cd "%rmg%"\conditionFiles
java -Xmx500m -jar "%rmg%"\bin\RMG.jar condition.txt


The name of the input file does not have to be condition.txt.

A log file containing the same information printed to the console, plus additional details, is automatically saved for you to RMG.log in the same directory as the condition file. Redirection of stdout to a file is no longer required.

Running RMG using Batch Scripts in Windows

As of version 3.2, several batch scripts have been provided to make running RMG on Windows more straightforward. These can be found along with the example condition files in the examples directory. There are currently three such scripts:

  • RMG.bat - For running general RMG mechanism generation jobs
  • PopulateReactions.bat - For generating possible reactions and kinetics of a set of species
  • ThermoDataEstimator.bat - For estimating the thermodynamics of a set of species

The easiest way to use them is:

  1. Create the condition or input file for the job you wish to run. For general RMG jobs this file should be named condition.txt. For other jobs this file should be named input.txt.
  2. Copy the batch script corresponding to the job you wish to run to the folder containing the condition file. For best results, this folder should only contain the condition file and the batch script at this step. The batch script will happily overwrite existing files if they correspond to files created by RMG, including the results of a previous RMG run.
  3. Double-click the batch script to start the job. A console window will appear. After a few seconds a line of text should appear that tells you the job has been started. If RMG is not setup correctly, an error message will appear instead telling you what needs to be done. As the job runs, output will be sent to the file RMG.log in the same directory as the condition file.
  4. Close the console window when the job is finished. The batch script will print a line of text when the job is completed. This line of text does not reflect whether or not the job was successful; check the tail of RMG.log for that information.


You can edit the batch script file using a program like Notepad if you want to change thing like the filenames or memory allocation.

Configuring paths using Environment Variables

You can control where a lot of output and temporary files are stored by manipulating environment variables before running RMG. This can be useful for running on networked clusters of computers, eg. for running several jobs concurrently that can share the same quantum mechanics calculations results, or for saving your temporary scratch files on a local (fast) hard disk, and your final results on a shared network drive.

An example bash script provided in the 1,3-hexadiene example directory, demonstrates the variables and their default values:

The same approach should work for Windows.

You can also pass the variables when you call the program, eg:

$ RMG_QM_LIBRARY=$HOME/myQMlibrary java -Xmx500m -classpath $RMG/bin/RMG.jar RMG condition.txt