rrConfig

class Config

read or store default values.

Many of RoadRunner classes use a number of configuration parameters. Most of these can be set using the Config class. The values stored in the Config class only determine the default values of parameters.

The Config class will look in the following locations for the config file, and will load the values from the first config file it finds. If it does not find a config file in one of the following locations, a default set of configuration parameters are used. The search locations of the config file are:

#1: the ROADRUNNER_CONFIG environment variable

#2: try the user’s home directory for roadrunner.conf, i.e.:

/Users/andy/roadrunner.conf

#3: try the user’s home directory for .roadrunner.conf, i.e.:

/Users/andy/.roadrunner.conf

#4: try the same directory as the roadrunner shared library, this will be the same directory as the python _roadrunner.pyd python extension module, i.e.:

/Users/andy/local/lib/roadrunner.conf

#5: try one directory up from the where the shared library or program is at, i.e.:

/Users/andy/local/roadrunner.conf

The conf file is just a plain text file of where each line may be key / value std::pair separated by a :”, i.e.

KEY_NAME : Value Any line that does not match this format is ignored, and keys that are not found are also ignored. Therefore, any line that does not start w* ith a word character is considered a comment.

All of the configuration managment functions are static method of the Config class, and all of the configuration keys are static attributes * of the Config class, these are documented in the Configuration Functions section.

As all of the Config class methods are static, one never instantiates the Config class.

Public Types

enum Keys

Values:

enumerator LOADSBMLOPTIONS_CONSERVED_MOIETIES

perform conservation analysis.

This causes a re-ordering of the species, so results generated with this flag enabled can not be compared index wise to results generated otherwise.

currently only implemented with the C code generating model

enumerator LOADSBMLOPTIONS_RECOMPILE

Should the model be recompiled? The LLVM ModelGenerator maintins a hash table of currently running models.

If this flag is NOT set, then the generator will look to see if there is already a running instance of the given model and use the generated code from that one.

If only a single instance of a model is run, there is no need to cache the models, and this can safetly be enabled, realizing some performance gains.

enumerator LOADSBMLOPTIONS_READ_ONLY

If this is set, then a read-only model is generated.

A read-only model can be simulated, but no code is generated to set model values, i.e. parameters, amounts, values, etc…

It takes a finite amount of time to generate the model value setting functions, and if they are not needed, one may see some performance gains, especially in very large models.

enumerator LOADSBMLOPTIONS_MUTABLE_INITIAL_CONDITIONS

Generate accessor functions to allow changing of initial conditions.

enumerator LOADSBMLOPTIONS_OPTIMIZE_GVN

GVN - This pass performs global value numbering and redundant load elimination cotemporaneously.

enumerator LOADSBMLOPTIONS_OPTIMIZE_CFG_SIMPLIFICATION

CFGSimplification - Merge basic blocks, eliminate unreachable blocks, simplify terminator instructions, etc…

enumerator LOADSBMLOPTIONS_OPTIMIZE_INSTRUCTION_COMBINING

InstructionCombining - Combine instructions to form fewer, simple instructions.

This pass does not modify the CFG, and has a tendency to make instructions dead, so a subsequent DCE pass is useful.

enumerator LOADSBMLOPTIONS_OPTIMIZE_DEAD_INST_ELIMINATION

DeadInstElimination - This pass quickly removes trivially dead instructions without modifying the CFG of the function.

It is a BasicBlockPass, so it runs efficiently when queued next to other BasicBlockPass’s.

enumerator LOADSBMLOPTIONS_OPTIMIZE_DEAD_CODE_ELIMINATION

DeadCodeElimination - This pass is more powerful than DeadInstElimination, because it is worklist driven that can potentially revisit instructions when their other instructions become dead, to eliminate chains of dead computations.

enumerator LOADSBMLOPTIONS_OPTIMIZE_INSTRUCTION_SIMPLIFIER

InstructionSimplifier - Remove redundant instructions.

enumerator LOADSBMLOPTIONS_USE_MCJIT

Use the LLVM MCJIT JIT engine.

Defaults to false.

The MCJIT is the new LLVM JIT engine, it is not as well tested as the original JIT engine. Does NOT work on LLVM 3.1

enumerator SIMULATEOPTIONS_STEPS

The number of steps at which the output is sampled.

The samples are evenly spaced. When a simulation system calculates the data points to record, it will typically divide the duration by the number of time steps. Thus, for X steps, the output will have X+1 data rows. see SimulateOptions::steps

enumerator SIMULATEOPTIONS_DURATION

see SimulateOptions::duration

enumerator SIMULATEOPTIONS_ABSOLUTE

see SimulateOptions::absolute

enumerator SIMULATEOPTIONS_RELATIVE

see SimulateOptions::relative

enumerator SIMULATEOPTIONS_STRUCTURED_RESULT

see SimulateOptions::STRUCTURED_RESULT

enumerator SIMULATEOPTIONS_STIFF

Is the model a stiff system? setting this to stiff causes RoadRunner to load a stiff solver which could potentially be extremly slow see SimulateOptions::STIFF.

enumerator SIMULATEOPTIONS_MULTI_STEP

The MULTI_STEP option tells the solver to take a series of internal steps and then return the solution at the point reached by that step.

In simulate, this option will likely be slower than normal mode, but may be useful to monitor solutions as they are integrated.

This is intended to be used in combination with the IntegratorListener. It this option is set, and there is a IntegratorListener set, RoadRunner::integrate will run the integrator in a series of internal steps, and the listner will by notified at each step.

Highly Experimental!!! see SimulateOptions::MULTI_STEP

enumerator SIMULATEOPTIONS_DETERMINISTIC_VARIABLE_STEP

Do variable time step integration when using a deterministic integrator.

enumerator SIMULATEOPTIONS_STOCHASTIC_VARIABLE_STEP

Do variable time step integration when using stochastic integrators.

enumerator SIMULATEOPTIONS_INTEGRATOR

Default integrator to use, currently supports a std::string of “CVODE” or “Gillespie”, default is “CVODE”.

enumerator SIMULATEOPTIONS_INITIAL_TIMESTEP

A user specified initial time step.

If this is <= 0, the integrator will attempt to determine a safe initial time stpe.

Note, for each number of steps given to RoadRunner::simulate or RoadRunner::oneStep, the internal integrator may take many many steps to reach one of the external time steps. This value specifies an initial value for the internal integrator time step. see SimulateOptions::initialTimeStep

enumerator SIMULATEOPTIONS_MINIMUM_TIMESTEP

Specfify The Minimum Time Step That The Internal Integrator Will Use.

Uses Integrator Estimated Value If <= 0. see SimulateOptions::minumumTimeStep

enumerator SIMULATEOPTIONS_MAXIMUM_TIMESTEP

Specify The Maximum Time Step Size That The Internal Integrator Will Use.

Uses Integrator Estimated Value If <= 0. see SimulateOptions::maximumTimeStep

enumerator SIMULATEOPTIONS_MAXIMUM_NUM_STEPS

Specify The Maximum Number Of Steps The Internal Integrator Will Use Before Reaching The User Specified Time Span.

Uses The Integrator Default Value If <= 0. see SimulateOptions::maximumNumSteps

enumerator ROADRUNNER_DISABLE_WARNINGS

Disable SBML conserved moiety warnings.

this disables warnings based on the following bitfields:

ROADRUNNER_DISABLE_WARNINGS_STEADYSTATE: disable the warning in RoadRunner::steadyState about possible singular jacobian.

ROADRUNNER_DISABLE_WARNINGS_CONSERVED_MOIETY: disable the conserved moieties warning if enabled when loading a sbml document.

enumerator ROADRUNNER_DISABLE_PYTHON_DYNAMIC_PROPERTIES

RoadRunner by default dynamically generates accessor properties for all sbml symbol names on the model object when it is retrieved in Python.

This feature is very nice for interactive use, but can slow things down. If this feature is not needed, it can be disabled here.

enumerator SBML_APPLICABLEVALIDATORS

a hex value consisting of a combination of the following values:

IdCheckON 0x01 IdCheckOFF 0xfe SBMLCheckON 0x02 SBMLCheckOFF 0xfd SBOCheckON 0x04 SBOCheckOFF 0xfb MathCheckON 0x08 MathCheckOFF 0xf7 UnitsCheckON 0x10 UnitsCheckOFF 0xef OverdeterCheckON 0x20 OverdeterCheckOFF 0xdf PracticeCheckON 0x40 PracticeCheckOFF 0xbf AllChecksON 0x7f

The default value is AllChecksON & UnitsCheckOFF

enumerator ROADRUNNER_JACOBIAN_STEP_SIZE

default step size for Jabobian finite differece calculations

enumerator MODEL_RESET

A bitfield (unsigned integer) consisting of the values in SelectionRecord::SelectionType.

This value determines which values of the model are reset to their origin SBML specified values.

Current valid values can be a combination of:

SelectionRecord::SelectionType::TIME, SelectionRecord::SelectionType::RATE, SelectionRecord::SelectionType::BOUNDARY, SelectionRecord::SelectionType::FLOATING, SelectionRecord::SelectionType::GLOBAL_PARAMETER, SelectionRecord::SelectionType::CONSREVED_MOIETY, SelectionRecord::SelectionType::COMPARTMENT, SelectionRecord::SelectionType::ALL.

Note, if RATE is specified, this will cause all global parameters defined by rate rules to be reset, even if GLOBAL_PARAMETER is NOT specified.

The default value is TIME | RATE | FLOATING

enumerator CVODE_MIN_ABSOLUTE

The minumum absolute error that the CVODE integrator supports in order to to pass the sbml test suite using the default integtator.

If a test suite config file is loaded, and the relative error is higher than CVODE_MIN_ABSOLUTE, it should be lowered to CVODE_MIN_ABSOLUTE.

enumerator CVODE_MIN_RELATIVE

The minumum relative error that the CVODE integrator supports in order to to pass the sbml test suite using the default integtator.

If a test suite config file is loaded, and the relative error is higher than CVODE_MIN_RELATIVE, it should be lowered to CVODE_MIN_RELATIVE.

enumerator SIMULATEOPTIONS_COPY_RESULT

make a copy of the simulation result in Python.

enumerator STEADYSTATE_PRESIMULATION

Flag for starting steady state analysis with simulation.

enumerator STEADYSTATE_PRESIMULATION_MAX_STEPS

Maximum number of steps that can be taken for presimulation before steady state analysis.

enumerator STEADYSTATE_PRESIMULATION_TIME

End time for presimulation steady state analysis.

enumerator STEADYSTATE_APPROX

Flag for using steady state approximation routine when steady state solver fails.

enumerator STEADYSTATE_APPROX_TOL

Tolerance for steady state approximation routine.

enumerator STEADYSTATE_APPROX_MAX_STEPS

Maximum number of steps that can be taken for steady state approximation routine.

enumerator STEADYSTATE_APPROX_TIME

End time for steady state approximation routine.

enumerator STEADYSTATE_RELATIVE

Specifies the relative tolerance.

enumerator STEADYSTATE_MAXIMUM_NUM_STEPS

Maximum number of steps for steady state solvers.

enumerator STEADYSTATE_MINIMUM_DAMPING

Minimum damping factor for steady state solvers.

enumerator STEADYSTATE_BROYDEN

Switches on Broyden method.

enumerator STEADYSTATE_LINEARITY

Specifies linearity of the problem.

enumerator ROADRUNNER_JACOBIAN_MODE

Determines the mode that the RoadRunner Jacobian calculations will be be performed in.

The Jacobian can be calculated either with respect to amounts or concentrations. Default is concentrations.

This can be either ROADRUNNER_JACOBIAN_MODE_AMOUNTS or ROADRUNNER_JACOBIAN_MODE_CONCENTRATIONS.

enumerator TEMP_DIR_PATH

Directory path where roadrunner should store temp files.

If empty, the system specified temp dir is used. Paths may have enviormnent variables, i.e. ${HOME}/tmp

May have environment variables contained in the path. On Unix, a tilde as first character in the path is replaced with the path to user’s home directory.

enumerator LOGGER_LOG_FILE_PATH

Path to where the logger should write a roadrunner log file.

If no path is specified, the log file will be written as a “roadrunner.log” in the temp dir.

May have environment variables contained in the path. On Unix, a tilde as first character in the path is replaced with the path to user’s home directory.

enumerator RANDOM_SEED

Seed for random numbers, should be a integer.

If this value is negative, then the system time is used for the random seed.

enumerator PYTHON_ENABLE_NAMED_MATRIX

use new numpy arrays with row/column names experimental

enumerator LLVM_SYMBOL_CACHE

cache llvm symbols durring sbml compilation.

enumerator OPTIMIZE_REACTION_RATE_SELECTION

optimize reaction rate selection durring integration.

enumerator LOADSBMLOPTIONS_PERMISSIVE

Relax SBML restrictions.

Allows some idiosyncrasies of e.g. JDesigner that libSBML does not officially support. See: https://groups.google.com/forum/#!topic/sbml-discuss/u3NK14RUHvE

Specifics: allows use time in user-defined functions, allows use of booleans in scalars

enumerator MAX_OUTPUT_ROWS

Set the maximum number of rows in the output matrix.

When simulate is called with variable stepping and tight tolerances the resulting output matrix will be very large. This setting cuts off the computation after a certain number of rows are reached.

enumerator ALLOW_EVENTS_IN_STEADY_STATE_CALCULATIONS

Enable or disable steady state calculations when a model contains events.

If true, steady state calculations will be carried out irrespective of whether events are present or not.

If false, steady state calculations will not be carried out in the presence of events.

enumerator VALIDATION_IN_REGENERATION
enumerator K_ROWS_PER_WRITE
enumerator LLVM_BACKEND

An enum value that indicates which llvm JIT compiler is being used.

enumerator LLJIT_OPTIMIZATION_LEVEL

Optimization level when using LLJit.

Either NONE, LESS, DEFAULT or AGGRESSIVE

enumerator LLJIT_NUM_THREADS

How many threads to use when building models with LLJit.

Defaults to the number of cores

enumerator METABOLIC_CONTROL_ANALYSIS_FLUX_THRESHOLD

The flux threshold when calculating the scaled control coefficients of fluxes.

enumerator METABOLIC_CONTROL_ANALYSIS_DIFFERENTIAL_STEP_SIZE

The differential step size when calculating the scaled control coefficients of fluxes.

enumerator METABOLIC_CONTROL_ANALYSIS_STEADY_STATE_THRESHOLD

The differential step size when calculating the scaled control coefficients of fluxes.

enumerator CONFIG_END

Needs to be the last item in the enum, no mater how many other items are added, this is used internally to create a static array.

enum LLVM_BACKEND_VALUES

Values:

enumerator MCJIT
enumerator LLJIT
enum LLJIT_OPTIMIZATION_LEVELS

Values:

enumerator NONE
enumerator LESS
enumerator DEFAULT
enumerator AGGRESSIVE
enum ROADRUNNER_DISABLE_WARNINGS_VALUES

Values:

enumerator ROADRUNNER_DISABLE_WARNINGS_STEADYSTATE
enumerator ROADRUNNER_DISABLE_WARNINGS_CONSERVED_MOIETY
enum ROADRUNNER_JACOBIAN_MODE_VALUES

Values:

enumerator ROADRUNNER_JACOBIAN_MODE_AMOUNTS
enumerator ROADRUNNER_JACOBIAN_MODE_CONCENTRATIONS

Public Static Functions

static std::string getString(Keys)

read the config value as a std::string.

static int getInt(Keys)

read the config value as an integer.

static bool getBool(Keys)
static double getDouble(Keys)

read the config value as a double.

static std::string getConfigFilePath()

If a config file was found in one of the above locations, its full path is returned here.

Otherwise, if no file was found, an empty std::string is returned.

static void setValue(Keys, Setting value)

set the value of a config key.

note, this value is only used in any new objects created after it has been set.

static Setting getValue(Keys)
static void readConfigFile(const std::string &path)

Read all of the values stored in a configuration file and set all the keys to these values.

static void writeConfigFile(const std::string &path)

write the currently set configuration values to a config file.

The contents of the file are cleared and the new values written.

static Keys stringToKey(const std::string &key)
static std::vector<std::string> getKeyList()