Jump to navigation Jump to search


All calculations in OPTUM G2 are processed by the calculation core OPTUM G2Cmd.exe. This is in principle a stand-alone program that communicates with the graphical user interface (GUI) to process input data and visualize results. It is therefore possible to bypass the GUI entirely and use OPTUM G2 in command line mode. This is done by executing OPTUM G2Cmd.exe with the input file and various settings as arguments.
To use the command line version of OPTUM G2, first open a Windows command prompt (cmd.exe). Directions on the usage of OPTUM G2Cmd can be accessed at any time by executing OPTUM G2Cmd without arguments (see Figure 1.1).

Figure 1.1: Windows command prompt.

To process an OPTUM G2 project file, OPTUM G2Cmd should be executed with the filename as argument:

  • OPTUM G2Cmd FileName.g2x

The input file name must have extension g2x. This generates an output file FileName.results.g2x which can be opened in OPTUM G2 as any other project file.
If the input file is located in a folder different from the current one, the full path should be specified, for example:

  • OPTUM G2Cmd C:\OptumProjects\FoundationProject\FileName.g2x

If the input file or the path contain spaces, the whole path should be enclosed by quotation marks, for example:

  • OPTUM G2Cmd "C:\OptumProjects\Foundation Project\File Name.g2x"

1.1 Optional arguments

As indicated in Figure 1.1, three additional optional arguments are possible. These regard results output, log file output and the information shown in the command prompt upon execution.
Example 1:

  • OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x

This generates a project file, FileNameResults.g2x, containing results. The project file can opened with OPTUM G2 as any other project file.
Example 2:

  • OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x /log:ResLog.txt

This generates a project file, FileNameResults.g2x, containing results and in addition a file, ResLog.txt, containing the analysis log.
Example 3:

  • OPTUM G2Cmd FileName.g2x /output:FileNameResults.g2x /log:ResLog.txt /echo

This is the same Example 2 except the analysis progress is written to the command line prompt as shown in Figure 1.2. The argument /echo may be used on its own or with any of the other arguments.

Figure 1.2: Output of analysis progress using the /echo argument.

1.2 Running through MATLAB

OPTUM G2 may be run through MATLAB using the dos function. This simply invokes the Windows command prompt and no results will be available in MATLAB upon completion of the analysis. Tools such as xlmread and xml2struct are useful in the further processing of the results through MATLAB. The latter tool is distributed along with OPTUM G2.

1.3 Setting up projects for command line processing

When setting up input files for processing with OPTUM G2Cmd, it is advised to first use the regular OPTUM G2 graphical user interface to create a template project file that resembles the final desired project file as much as possible. This file, an easily decipherable xml file, can be read and modified with any text editor.
Finally, if more than one project file is to be processed, it is advised to use a batch file (a regular text file with extension bat) to set up the runs. An example is shown in Figure 1.3. This file is then executed via the command prompt by entering its name.

Figure 1.3: Batch file for processing multiple (five) projects.

Back to OPTUM G2 main page