SimGrid
3.16
Versatile Simulation of Distributed Systems
|
Changing the configuration of SimGrid components (grounding feature)
All modules of the SimGrid toolkit can be configured with this API. User modules and libraries can also use these facilities to handle their own configuration.
A configuration set contain several variables which have a unique name in the set and can take a given type of value. For example, it may contain a size variable, accepting int values.
It is impossible to set a value to a variable which has not been registered before. Usually, the module registers all the options it accepts in the configuration set, during its initialization and user code then set and unset values.
The easiest way to register a variable is to use the xbt_str_register_str function, which accepts a string representation of the config element descriptor. The syntax is the following:
<name>:<min nb>_to_<max nb>_<type>
For example, size:1_to_1_int
describes a variable called size which must take exactly one value, and the value being an integer. Set the maximum to 0 to disable the upper bound on data count.
Another example could be outputfiles:0_to_10_string
which describes a variable called outputfiles and which can take between 0 and 10 strings as value.
To some extend, configuration sets can be seen as typed hash structures.
TBD
Modules | |
User interface: changing values | |
This is the only interface you should use unless you want to let your own code become configurable with this. | |
Configuration type declaration and memory management | |
Registering stuff | |
This how to add new variables to an existing configuration set. | |
Getting the stored values | |
This is how to retrieve the values stored in the configuration set. | |