-
Notifications
You must be signed in to change notification settings - Fork 6
Command line Arguments
Fred Rothganger edited this page Dec 3, 2024
·
14 revisions
The app normally starts up a graphical user interface (GUI) that supports editing and running models. In some circumstances, you may want to use the app as a command-line utility without starting up the GUI. Once the utility work is completed, the app exits. If you specify more than one utility function, only the last one will be executed. The utility functions are:
- -export -- Converts a model to some other format and writes it to a file. You must use -model to specify the model. You may also specify -format and -file.
- -import -- Reads in the specified file and adds it to the primary repository. The format is determined automatically from the file contents and file name suffix.
- -install -- Unpacks the C and Python backend code into ~n2a/backend. This includes utility classes that you can use in other software projects, particularly for accessing model and output files.
- -run -- Runs a simulation in headless mode. The given model must exist in the current repository structure. Treats the current working directory as the job directory.
- -server={list} -- Runs the indicated server module(s). The list of module names is comma separated. Typically, a module is implemented by a plugin and offers a REST API on a TCP port.
- -study -- Runs multiple simulations as part of a systematic study as specified by $meta.study tags contained in the model.
Other options modify the app behavior when running either the GUI or a utility function.
- -csv -- For -run, converts output into standard comma-sparated-value (CSV) format. For -study, outputs list of completed jobs in CSV format.
- -format={name} -- Specifies the file format for export or import. In the case of export, if this argument is not given but the file is specified, then the format is derived from the file suffix. If neither are given, the app will default to its own internal format. In the case of import, this parameter can override the automatic format detection.
The following is a list of formats currently built into the app. Format names are long-form strings, including space characters. Case is ignored.- BibTeX
- C binary
- C library shared
- C library static
- EndNote
- GLIF
- N2A Native
- NeuroML
- PubMed
- RIS bibliography
- Vensim
- -file={path} -- Specifies the file for import or export. In the case of export, if this argument is not given, the destination is the current working directory with a name built from the model name and the format's usual file suffix.
- -model={name} -- Specifies the model to run, study, import or export. In the case of import, if not specified, then the model name is derived from the file name.
- -param={path} -- Read either a native file or a Dakota configuration file. If a Dakota configuration file, it is used in conjunction with -study. If a native file, it is used in conjunction with -run. It overrides keys in the model specified by -model.
- -plugin={name} -- Specifies a plugin class for explicit loading. Use a separate -plugin argument for each class. Note that any jar files in ~n2a/plugins will be loaded automatically using Java SPI, so they do not need to be listed.
- -pluginDir={path} -- Adds a directory to the plugin search path. Use a separate -pluginDir argument for each directory.
- {keypath}={value} -- Any command-line argument that does not start with a dash is treated as a model override. This is used in conjunction with -run, and works as an alternative to -param. The keypath is a dot-seperated list of names that specify the exact model element. The element gets set to value. This can be used to change an equation or some parameter. It can also be used to set the host or backend on which the model runs:
- $meta.backend=my-favorite-backend
- $meta.host=server123