![]() |
GeMA
The GeMA main application
|
A few global variables are published on the Lua global environment by GeMA itself, and are available for being used during the orchestration and/or during the model loading.
Index:
userParams | |
---|---|
Description: | A global variable filled with the value provided by the user through the -u command line option. Can be of any Lua type, depending on the syntax used when passing the parameter. In particular, Lua tables can be used to provide the script with several run-time values. See the comments on Executing a simulation. |
Example:
userParamsStr | |
---|---|
Description: | Similar to userParams , this variable contains the string with the -u parameter value, before it was parsed by the Lua environment. |
Example:
options | |
---|---|
Description: | A global table, available during both model loading and orchestration, storing the set of user defined values for global simulation options. Includes options defined through the simulation object and through the configuration file (with preference for the previous if a field is defined in both). The table is keyed by option names. |
Example:
constants | |
---|---|
Description: | A global table, available during both model loading and orchestration, storing the set of user defined values for global simulation constants. Includes options defined through the simulation object and through the configuration file (with preference for the previous if a field is defined in both). The table is keyed by constant names. This table can also have entries for constants defined by plugins. Each plugin can define its own set of constants in the subtable constants.pluginName , where pluginName is the same name used for referencing the plugin. Most physics plugins use this option to publish maps associating material types with their codes. This maps are commonly referenced in property set definitions through constMap entries, such as in constMap = constants.HydroFemPhysics.materialModels . |
Example:
modelData | |
---|---|
Description: | The global variable giving access to the global model data object, which stores information about top-level model objects such as meshes, property sets and boundary conditions. Available only in the orchestration script. |
Example:
threadId | |
---|---|
Description: | A global variable, available during the orchestration script, storing the current thread id. This value will be 0 for the main thread and a unique number between 1 and maxWorkerThreads for worker threads. It is usefull for collecting "per-thread" results. |
Example:
numProcCores | |
---|---|
Description: | A global variable, defined only in the main thread, during the orchestration script, storing the number of processor cores available in the current hardware. Can be used to fine tune the number of desired worker threads in a parallel call. |
Example:
maxProcThreads | |
---|---|
Description: | A global variable, defined only in the main thread, during the orchestration script, storing the maximum number of concurrent threads supported by the current hardware. This can be different from numProcCores if the hardware supports Hyper-threading or similar technologies. Can be used to fine tune the number of desired worker threads in a parallel call. |
Example:
maxWorkerThreads | |
---|---|
Description: | A global variable, defined only in the main thread, during the orchestration script, storing the maximum number of worker threads that can be used in a parallel call. This value will be the same as options.maxThreads if that option was set at the simulation object or at the configuration file. Otherwise, it will be equal to maxProcThreads (the default if the maxThreads option is missing). |
Example:
userRestoreParameters | ||
---|---|---|
Description: | A global variable different from nil if the user provided either one of the following command line options: -restore , -restoretag or -restorelist . In that case, its value will be a Lua table with the fields described below. See the comments on Executing a simulation. Usually interpreted by the dump script library. When this library is loaded, this variable is set to nil to prevent global namespace polution and its previous contents can be queried through the dump library itself. | |
Fields: | state | The state number provided to the -restore command line option (either a positive number defining the simulation step where the state was saved or a negative number giving the state's backward position on the dump series, where -1 refers to the last saved state, -2 to the previous and so on). If the simulation was started with the -restoretag or -restorelist command options, this field will be filled with 0 (which is not a valid state). |
tag | The state tag provided to the -restoretag command line option. Otherwise, filled with the empty string. | |
list | A boolean value filled with true if the -restorelist option was present at the command line. | |
file | The file name provided to the -restorefile command line option. Otherwise, filled with the empty string. | |
noParRestore | A boolean value filled with true if the -noparrestore option was present at the command line. |
userNoDumpRequested | |
---|---|
Description: | A boolean global variable filled with true if the user provided the -nodump command line option. See the comments on Executing a simulation. Usually interpreted by the dump script library. When this library is loaded, this variable is set to nil to prevent global namespace polution and its previous contents can be queried through the dump library itself. |