NERSCPowering Scientific Discovery Since 1974

User Environment

There are two primary ways that users can control their environment:  CHOS and modules.


Carver runs Scientific Linux 6.4 as its native operating system.  The native operating system is not intended for general use.  Instead, the chos utility is used to create a Scientific Linux environment on both the login nodes and in batch jobs.  Scientific Linux 5.5 (sl5carver) is the default; Scientific Linux 6.3 (sl6carver) is also available.

To automatically select a system version you need to create a file in your home directory named .chos-carver (with the dot at the beginning). In this file you should have one and only one line:

In your .chos-carver file: The operating system you get:
sl5carver 64-bit Scientific Linux 5.5
sl6carver 64-bit Scientific Linux 6.3

When you log in you should have a full working environment with the OS of your choice.  Note that it can be dangerous to put the chos command in the standard shell startup files (eg, .bashrc.ext, .cshrc.ext, etc).

For most day-to-day work, the above approach is sufficient.  However, there are times when it may be necessary to move between OS versions, for example, when migrating applications from one OS release to another (e.g., from SL5.5 to SL6.3).

You can switch "live" between OS versions. To do that, set the CHOS variable to the OS you want to get and then run the "chos" command. For example, in csh/tcsh:

setenv CHOS sl6carver;chos

Or, in bash:

export CHOS=sl6carver;chos bash -l

The above commands will start a new shell; in that shell, the OS environment will be that specified by the CHOS environment variable.  Note that the above process will restore your modules environment to the default configuration; that is, any modules that you had loaded interactively will have to be reloaded after executing the chos command.

By default your batch jobs will run under the CHOS version from which you submitted them.  If you want your batch jobs to run under a different CHOS environment from the one in which you are interactively working, you can set the CHOS variable to the environment you want while submitting the job. This can be done as follows:

qsub -v CHOS=sl6carver ...

Note that if you submit a batch job from a non-default CHOS environment, and you are using "-v" to propagate variables into the batch job, you must specify the CHOS value also.  For example, using the default CHOS environment, you can do this:

qsub -v var1,var2,var3 your_script.pbs

If you are using a non-default CHOS environment (e.g., sl6carver), you must submit your job this way:

qsub -v var1,var2,var3,CHOS=sl6carver your_script.pbs

To see which CHOS environment you are currently in, use the chosenv command; to see what CHOS environments are available, use the chosavail command.  Note that the only supported user environments are those documented here; if you choose any other OS environment, unpredictable behavior may result.

Cron jobs must specify a CHOS environment to run in, otherwise they will run in a minimal CHOS environment that does not have access to modules or most system software. For example, to run a cron job in SL6.3:

0 */6 * * * CHOS=sl6carver chos <your_script>


Carver uses environment modules to control access to third-party software; more information is available here.