Mas var

From MCEWiki
Revision as of 15:44, 8 August 2012 by Mhasse (talk | contribs) (Created page with ''''mas_var''' is a program for determining MAS configuration information (especially paths to scripts, data directories, and other configuration files). It was developed to repl…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

mas_var is a program for determining MAS configuration information (especially paths to scripts, data directories, and other configuration files). It was developed to replace the environment-based approach that existed previously, especially for systems where more than one fibre card is in use. mas_var queries the mas.cfg configuration file to get the system configuration.

mas_var as a replacement for the MAS environment variables

The scripts and tuning programs no longer require that the $MAS_* environment variables be defined. Instead, they will run mas_var to determine the necessary paths, based on information in mas.cfg.

The standard MAS environment variables can be set using mas_var

When running from the command line it is sometimes convenient to have the $MAS_* variables defined, and to update $PATH and $PYTHONPATH for the MAS software. To achieve this in bash, run:

eval `mas_var -e -s`

This line can put in a user's .bashrc, to be run at login. Note that this is a replacement for "source $MAS_ROOT/template/mas_env.bash".

Environment variables override the settings in mas.cfg

Note that environment variables can be used to override the settings in mas.cfg -- this can be useful in cases where one would like to temporarily switch script trees or data directories.

For example:

user@ubuntu:~$ mas_var --script-dir
/usr/mce/mce_script//script
user@ubuntu:~$ export MAS_SCRIPT=/home/user/code/mce_script/script
user@ubuntu:~$ mas_var --script-dir
/home/user/code/mce_script/script