Computing Environment

Customizing Your Environment

The way you interact with the DC3 computer can be controlled via certain startup scripts that run when you log in and at other times. You can customize some of these scripts, which are called "dot files" by setting environment variables and aliases in them. There are several "standard" dot-files, such files are .bash_profile, .bashrc, .zshrc, .cshrc, .kshrc, .login, .profile, .tcshrc, or .zprofile. Which of those you modify depends on your choice of shell, although note that DC3 recommends the bash. The table below contains examples of basic customizations. Note that when making changes such as these it's always a good idea to have two terminal sessions active on the machine so that you can back out changes if needed!

bash csh
export ENVAR=value setenv ENVAR value
export PATH=$PATH:/new/path set PATH = ( $PATH /new/path)
alias ll='ls -lrt’ alias ll “ls –lrt”

Modules

Easy access to software is controlled by the LMOD module utility. With modules, you can easily manipulate your computing environment to choose applications and programming libraries. In order to have an access to the software one must execute in the command line and/or add in the $HOME/.bash_profile the following line:

source /groups/ocean/software/setup_dc3_environment.sh

If you want to change software environment you "load", "rm," and "swap" modules. A small set of module commands below can do most of what you'll want to do.

ml list
The first command of interest is "ml list", which will show you your currently loaded modules. When you first log in, you have a number of modules loaded for you.

ml avail
Let's say you want to use a different compiler. The "ml avail" command will list all available modules. You can use the module's name stem to do a useful search.

ml swap
Let's say I want to use the INTEL compilers instead of GCC. Here's how to make the change:

ml swap gcc/8.3.0 intel/17.1.0

Now you are using the INTEL compilers (C, C++, FORTRAN) version 17.1.0. Note that modules doesn't give you any feedback about whether the swap command did what you wanted it to do, so always double-check your environment using the "ml list" command.

ml load
There is plenty of software that is not loaded by default. You can use the "ml avail" command to see what modules are available.

For example, if you want to use the OpenBLAS linear algebra library. Try "ml avail openblas" The default version is 0.3.6, but say you'd rather use some features available only in version 0.2.6. In that case, just load that module. If you want to use the default version, you can type either "ml load openblas" or "ml load openblas/0.3.6", either will work.