Changeset d2c4b37c in OpenModelica
- Timestamp:
- 2021-08-31T12:33:50+02:00 (3 years ago)
- Children:
- 8749b7da
- Parents:
- c28db79
- git-author:
- Mahder Gebremedhin <mahder.gebremedhin@…> (08/31/21 12:10:51)
- git-committer:
- Mahder Gebremedhin <mahder.gebremedhin@…> (08/31/21 12:33:50)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/SimulationRuntime/c/simulation/options.c
rec5d9716 rd2c4b37c 114 114 // Flag is already specified earlier. Check repetition policy. 115 115 else if(!handle_repeated_flag(j)) { 116 // repetition is inv laid for this Flag116 // repetition is invalid for this Flag 117 117 return 1; 118 118 } … … 136 136 // Option is already specified earlier. Check repetition policy. 137 137 else if(!handle_repeated_option(j, argv+i, 0 /*Not sticky*/)) { 138 // repetition is inv laid for this option138 // repetition is invalid for this option 139 139 return 1; 140 140 } … … 160 160 // Option is already specified earlier. Check repetition policy. 161 161 else if (!handle_repeated_option(j, argv+i, 1 /*Sticky*/)) { 162 // repetition is inv laid for this option162 // repetition is invalid for this option 163 163 return 1; 164 164 } -
OMCompiler/SimulationRuntime/c/util/simulation_options.c
rec5d9716 rd2c4b37c 222 222 /* FLAG_LSS_MAX_DENSITY */ "[double (default 0.2)] value specifies the maximum density for using a linear sparse solver", 223 223 /* FLAG_LSS_MIN_SIZE */ "[int (default " EXPANDSTRING(DEFAULT_FLAG_LSS_MIN_SIZE) ")] value specifies the minimum system size for using a linear sparse solver", 224 /* FLAG_LV */ "[string list] value specifies the logging level ",224 /* FLAG_LV */ "[string list] value specifies the logging level. This flag is allowed to be repeated with REPLACE policy.", 225 225 /* FLAG_LV_TIME */ "[double list] specifying time interval to allow loging in", 226 226 /* FLAG_MAX_BISECTION_ITERATIONS */ "[int (default 0)] value specifies the maximum number of bisection iterations for state event detection or zero for default behavior", … … 444 444 /* FLAG_LV */ 445 445 " Value (a comma-separated String list) specifies which logging levels to\n" 446 " enable. Multiple options can be enabled at the same time.", 446 " enable. Multiple options can be enabled at the same time.\n" 447 " Repetition policy: REPLACE.", 447 448 /* FLAG_LV_TIME */ 448 449 " Interval (a comma-separated Double list with two elements) specifies in which\n" -
doc/UsersGuide/source/simulationflags.rst
r7e93f676 rd2c4b37c 7 7 .. _cruntime-simflags : 8 8 9 10 Repetition of Simulation Flags and Options 11 ------------------------------------------------- 12 Unless it is explicitly specified otherwise, it **is an error** to specify any of the simulation Flags/Options more than once. 13 14 15 Repetition policies for specific flags 16 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 If a Flag/Option is allowed to be repeated, there are three different policies under which it can be processed. 18 19 - **Ignore**: Repeated instances of the Flag/Option will be ignored with a warning. For example 20 21 .. code-block:: bash 22 23 $ sim_exe -cx=file1 -cx=file2 24 $ sim_exe -cx=file1 25 26 are equivalent except for the warning issued in the first case. 27 28 - **Replace**: Repeated instances of an option will override the current value. (Not applicable for Flags.) 29 30 .. code-block:: bash 31 32 $ sim_exe -cx=file1 -cx=file2 33 $ sim_exe -cx=file2 34 35 are equivalent except for the warning issued in the first case. 36 37 38 - **Combine**: Repeated instances of the option's values will be combined as if they were given as values for a single specification of the option. (Not applicable for Flags.) 39 40 .. code-block:: bash 41 42 $ sim_exe -cx=file1 -cx=file2 43 $ sim_exe -cx=file1,file2 44 45 are equivalent except for the warning issued in the first case. Assuming the option supports multiple values. 46 47 48 Please check the entry below (or the help messages) for each flag/option to find out if a it is allowed to be repeated and what the specific repetition rules are for it. 49 50 Order of flags/options from OpenModelica tools 51 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 52 The final order of flag/option specifications are dependent on where they are specified. 53 54 If you are running the simulation executable directly then you have complete control of how the flags are ordered as it will be exactly the way you pass them on the command line. 55 56 If you are instead using the different OpenModelica tools to perform simulation or if you are using scripts, the order is as follows: 57 58 1. Flags/options from annotations in Modelica code are applied. 59 60 2. Flags/options specified in the script are applied. 61 62 3. Flags/options specified outside the script on the command line are applied. 63 64 65 9 66 OpenModelica (C-runtime) Simulation Flags 10 67 -----------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.