Changeset d2c4b37c in OpenModelica


Ignore:
Timestamp:
2021-08-31T12:33:50+02:00 (3 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
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)
Message:

Add description of sim exe flag repetition rules.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/c/simulation/options.c

    rec5d9716 rd2c4b37c  
    114114        // Flag is already specified earlier. Check repetition policy.
    115115        else if(!handle_repeated_flag(j)) {
    116           // repetition is invlaid for this Flag
     116          // repetition is invalid for this Flag
    117117          return 1;
    118118        }
     
    136136        // Option is already specified earlier. Check repetition policy.
    137137        else if(!handle_repeated_option(j, argv+i, 0 /*Not sticky*/)) {
    138           // repetition is invlaid for this option
     138          // repetition is invalid for this option
    139139          return 1;
    140140        }
     
    160160        // Option is already specified earlier. Check repetition policy.
    161161        else if (!handle_repeated_option(j, argv+i, 1 /*Sticky*/)) {
    162           // repetition is invlaid for this option
     162          // repetition is invalid for this option
    163163          return 1;
    164164        }
  • OMCompiler/SimulationRuntime/c/util/simulation_options.c

    rec5d9716 rd2c4b37c  
    222222  /* FLAG_LSS_MAX_DENSITY */              "[double (default 0.2)] value specifies the maximum density for using a linear sparse solver",
    223223  /* 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.",
    225225  /* FLAG_LV_TIME */                      "[double list] specifying time interval to allow loging in",
    226226  /* FLAG_MAX_BISECTION_ITERATIONS */     "[int (default 0)] value specifies the maximum number of bisection iterations for state event detection or zero for default behavior",
     
    444444  /* FLAG_LV */
    445445  "  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.",
    447448  /* FLAG_LV_TIME */
    448449  "  Interval (a comma-separated Double list with two elements) specifies in which\n"
  • doc/UsersGuide/source/simulationflags.rst

    r7e93f676 rd2c4b37c  
    77.. _cruntime-simflags :
    88
     9
     10Repetition of Simulation Flags and Options
     11-------------------------------------------------
     12Unless it is explicitly specified otherwise, it **is an error** to specify any of the simulation Flags/Options more than once.
     13
     14
     15Repetition policies for specific flags
     16^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     17If 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
     48Please 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
     50Order of flags/options from OpenModelica tools
     51^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     52The final order of flag/option specifications are dependent on where they are specified.
     53
     54If 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
     56If you are instead using the different OpenModelica tools to perform simulation or if you are using scripts, the order is as follows:
     57
     581. Flags/options from annotations in Modelica code are applied.
     59
     602. Flags/options specified in the script are applied.
     61
     623. Flags/options specified outside the script on the command line are applied.
     63
     64
     65
    966OpenModelica (C-runtime) Simulation Flags
    1067-----------------------------------------
Note: See TracChangeset for help on using the changeset viewer.