Difference between revisions of "Mas param"
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{Related|MAS Applications}} |
'''mas_param''' is a [[MAS]] utility program which can be used to read and write [[libconfig]] files, most commonly the [[experiment.cfg]] file, from the command line. | '''mas_param''' is a [[MAS]] utility program which can be used to read and write [[libconfig]] files, most commonly the [[experiment.cfg]] file, from the command line. | ||
− | + | __TOC__ | |
== Usage == | == Usage == | ||
Running mas_param without any parameters will produce a usage summary. In general, mas_param can be invoked as: | Running mas_param without any parameters will produce a usage summary. In general, mas_param can be invoked as: | ||
Line 26: | Line 26: | ||
full output full type and data for all params | full output full type and data for all params | ||
− | * The '''bash''', '''csh''', '''idl_template''' commands dump the contents of the input file | + | * The '''bash''', '''csh''', '''idl_template''' commands dump the contents of the input file as variable declarations in the specified language to the specified output file, or standard out if none is given. If a prefix or suffix is specified, it will be affixed to the variable names in the output. |
* The '''info''' command dumps the data type and length for the specified parameter, or all parameters, to standard out. One parameter's metadata is output per line with the format: | * The '''info''' command dumps the data type and length for the specified parameter, or all parameters, to standard out. One parameter's metadata is output per line with the format: | ||
Line 37: | Line 37: | ||
:* '''dimension''' indicates whether the parameter is an array or not. It is either '''simple''' or '''array''' | :* '''dimension''' indicates whether the parameter is an array or not. It is either '''simple''' or '''array''' | ||
:* '''length''' is the total number of values in the variable. For non-array parameters, this is always 1 | :* '''length''' is the total number of values in the variable. For non-array parameters, this is always 1 | ||
+ | |||
+ | * The '''full''' command outputs the same information as '''info''', but additionally appends the data value(s) to the end of the line for every parameter, with the format: | ||
+ | |||
+ | name : type : dimension : length : data | ||
+ | |||
+ | :For array parameters, data values are separated by spaces. | ||
* The '''get''' command returns the value of the parameter given. For array parameters, the values will be separated by spaces. | * The '''get''' command returns the value of the parameter given. For array parameters, the values will be separated by spaces. | ||
Line 47: | Line 53: | ||
Because mas_param can be useful outside of MCE operations, it is possible to build mas_param on architectures which do not have the capability to control MCEs (for example MacOS X). To do this, disable the linux-specific parts of [[MAS]] by passing '''<tt>--disable-mce-ops</tt>''' to the MAS <tt>./configure</tt> script. This will disable building almost all of MAS, including the kernel module, the [[mce.cfg|hardware configuration files]], and the system init scripts, plus all the applications which interact with the MCE (ie. everything except for mas_param and [[mas_var]]). | Because mas_param can be useful outside of MCE operations, it is possible to build mas_param on architectures which do not have the capability to control MCEs (for example MacOS X). To do this, disable the linux-specific parts of [[MAS]] by passing '''<tt>--disable-mce-ops</tt>''' to the MAS <tt>./configure</tt> script. This will disable building almost all of MAS, including the kernel module, the [[mce.cfg|hardware configuration files]], and the system init scripts, plus all the applications which interact with the MCE (ie. everything except for mas_param and [[mas_var]]). | ||
+ | |||
+ | [[Category:MAS Applications]] |
Latest revision as of 14:06, 12 September 2017
mas_param is a MAS utility program which can be used to read and write libconfig files, most commonly the experiment.cfg file, from the command line.
Contents
Usage
Running mas_param without any parameters will produce a usage summary. In general, mas_param can be invoked as:
mas_param [OPTION]... COMMAND
The options are:
-m <mas config> choose a particular mas config file. -n <card> use the configuration for the specified fibre card. Ignored if not running Multicard MAS. -s <source file> config file to parse. Default: ${MAS_DATA}/experiment.cfg -f <output filename> filename for output (stdout/source file by default) -v print version string and exit
A command is one of:
bash [prefix] output data as bash variable declarations csh [prefix] output data as csh variable declarations idl_template <suffix> output idl code for the target format info [param] print type info for param (or all params) get <param> output value of the variable <param> set <param> <datum>... set the value of variable <param> full output full type and data for all params
- The bash, csh, idl_template commands dump the contents of the input file as variable declarations in the specified language to the specified output file, or standard out if none is given. If a prefix or suffix is specified, it will be affixed to the variable names in the output.
- The info command dumps the data type and length for the specified parameter, or all parameters, to standard out. One parameter's metadata is output per line with the format:
name : type : dimension : length
- where:
- name is the name of the parameter
- type is the parameter's data type, one of float, integer, or string
- dimension indicates whether the parameter is an array or not. It is either simple or array
- length is the total number of values in the variable. For non-array parameters, this is always 1
- The full command outputs the same information as info, but additionally appends the data value(s) to the end of the line for every parameter, with the format:
name : type : dimension : length : data
- For array parameters, data values are separated by spaces.
- The get command returns the value of the parameter given. For array parameters, the values will be separated by spaces.
- The set command updates the input file by setting the specified parameter to the value(s) given. If no output file is specified, the input file will be modified in-place. If the parameter is an array and fewer values are given than the length of the array, remaining elements will be left unchanged. Extra values given are ignored.
Building mas_param on MacOS X
mas_param is built and installed automatically with a normal MAS install on linux systems.
Because mas_param can be useful outside of MCE operations, it is possible to build mas_param on architectures which do not have the capability to control MCEs (for example MacOS X). To do this, disable the linux-specific parts of MAS by passing --disable-mce-ops to the MAS ./configure script. This will disable building almost all of MAS, including the kernel module, the hardware configuration files, and the system init scripts, plus all the applications which interact with the MCE (ie. everything except for mas_param and mas_var).