The GeMA application is a simple command line application that should be run from the Windows console. The installed version creates a desktop icon that opens a console with the PATH
adjusted to include the gema application. From this console, to run a simulation whose main file is named myModel.lua
, just changing the current directory to the one containing the model file and typing "gema myModel.lua"
at the command prompt is enough.
The execution will print messages to the console and will also save the same messages to the "runlog.txt" file, located by default in the current directory. The printing and logging behavior can be changed by editing the GeMA default configuration file or by providing a custom one as a command line parameter. See Configuration options for the available options. It can also be changed by using some command line options.
Typing "gema -h"
will show the set of command line options. They are:
General parameters:
- [-c config file]: Optional file with global configuration options. If not defined, the global config file in the executable directory will be used.
- [-u parameters]: Optional user parameters that will be available to the input model file as the
userParams
global variable. See below.
- [-r result file]: The output log file, overriding the log configuration given by the configuration file.
- [-version]: Prints the GeMA version and revision information and exits (independently of any other parameters).
- [-pversion]: Prints the GeMA + plugins version and revision information and exits (independently of any other parameters).
Path parameters:
- [-l logPath]: User supplied value for the
$LOG
path macro. This is the standard path for placing the "runlog.txt" file and by default points to the current directory.
- [-i inputPath]: User supplied value for the
$INPUT
path macro. By default, it points to the simulation file directory.
- [-o outputPath]: User supplied value for the
$OUTPUT
path macro. By default, it points to the simulation file directory.
Simulation monitoring parameters:
- [-monitor]: Overrides the settings in the config file to enable the monitor server. Connection parameters will be read from the config file (or assume default values).
- [-nomonitor]: Overrides the settings in the config file to disable the monitor server.
- [-local [port]]: Overrides the settings in the config file to enable the monitor server, listening for connections at the localhost interface. The optional port parameter specifies the listening port. If absent or equal to 0, a random port will be chosen by the system.
- [-s connectionFile]: Overrides the settings in the config file to define the name of the file that will be written by the monitor server to publish the adresses in which the server is listening for connections.
- [-wait timeout]: When present, GeMA waits at most timeout mili seconds for a client connection before starting to load the model. A value of 0 means that it should wait until a connection is estabilished.
Log parameters:
- [-quiet]: Overrides the log configuration from the config file to print only warnings and errors.
- [-verbose]: Overrides the log configuration from the config file to enable every possible messages.
- [-memory]: Overrides the log configuration from the config file to enable memory messages.
- [-nomemory]: Overrides the log configuration from the config file to disable memory messages.
- [-time]: Overrides the log configuration from the config file to enable time messages.
- [-notime]: Overrides the log configuration from the config file to disable time messages.
- [-server]: Overrides the log configuration from the config file to enable sending log messages through the monitor server if monitoring is enabled.
- [-noserver]: Overrides the log configuration from the config file to disable sending log messages through the monitor server.
- [-noconsole]: Overrides the log configuration from the config file to disable console logging.
- [-regression]: Adds extra tags to the log file aiding numeric results comparisson during regression tests. Should not be needed outside the regression test scripts.
State dump parameters:
- [-restore [state]]:Requests the simulation to start by restoring a state saved by a previous run through the dump script library. The state can be defined by the saved state step number or by its backward position on the dump series, where -1 refers to the last saved state, -2 to the previous and so on. If state is missing, -1 will be assumed, restoring the last saved state.
- [-restoretag tag]: Requests the simulation to start by restoring a state saved by a previous run, through the dump script library, and identified by the given tag.
- [-restorelist]: Prints the list of available restore states and exits.
- [-restorefile file]: Defines the name of the dump file that should be used by the restore request. The given file can be either a dump control file (.ldmp) or a specific dump file (.dmp). In the later case the state passed to the
-restore
parameter will be ignored. If -restorefile
is missing, the default dump control file will be used (a file with the same base name of the simulation file with an added _dump_control.ldmp
suffix).
- [-noparrestore]: Don't restore user parameters when restoring a state. The value specified by
-u
will be preserved. Use with care.
- [-nodump]: Informs the dump script library to ignore any state dump requests.
When providing user parameters to the simulation, the value after the -u
option should be quoted for the operating system to recognize it as a single parameter whenever it contains a space. The parameter value (without the extra quotes) will be interpreted as a Lua expression that will be evaluated and its result stored at the userParams
variable. Examples:
Command | Lua type | Value |
gema -u 10 myModel.lua | number | 10 |
gema -u "10" myModel.lua | number | 10 |
gema -u xxx myModel.lua | nil | nil |
gema -u "xxx" myModel.lua | nil | nil |
gema -u 'xxx' myModel.lua | string | xxx |
gema -u "'xxx'" myModel.lua | string | xxx |
gema -u "'xxx yyy'" myModel.lua | string | xxx yyy |
gema -u "'xxx \"yyy\"'" myModel.lua | string | xxx "yyy" |
gema -u "{a = 10, b = 20}" myModel.lua | table | {a = 10, b = 20} |