5 viewing loaded modulefiles, 6 loading a modulefile, 1 loading a modulefile for the current session – HP XC System 3.x Software User Manual
Page 34: 2 automatically loading a modulefile at login, 7 unloading a modulefile, Viewing loaded modulefiles, Viewing loaded, Modulefiles, Loading a modulefile
3.5 Viewing Loaded Modulefiles
A loaded modulefile is a modulefile that has been explicitly loaded in your environment by the module
load
command. To view the modulefiles that are currently loaded in your environment, issue the module
list
command:
$ module list
3.6 Loading a Modulefile
You can load a modulefile in to your environment to enable easier access to software that you want to use
by executing the module load command. You can load a modulefile for the current session, or you can
set up your environment to load the modulefile whenever you log in to the system.
When loading a modulefile, note that certain modulefiles cannot be loaded while other modulefiles are
currently loaded. For example, this can happen with different versions of the same software. If a modulefile
you are attempting to load conflicts with a currently loaded modulefile, the modulefile will not be loaded
and an error message will be displayed.
If you encounter a modulefile conflict when loading a modulefile, you must unload the conflicting
modulefile before you load the new modulefile. See
“Modulefile Conflicts” (page 35)
for further information
about modulefile conflicts.
3.6.1 Loading a Modulefile for the Current Session
You can load a modulefile for your current login session as needed. To do this, issue the module load
command as shown in the following example, which illustrates the TotalView modulefile being loaded:
$ module load totalview
Loading a modulefile in this manner affects your environment for the current session only.
3.6.2 Automatically Loading a Modulefile at Login
If you frequently use one or more modulefiles that are not loaded when you log in to the system, you can
set up your environment to automatically load those modulefiles for you. A method for doing this is to
modify your shell startup script to include instructions to load the modulefile automatically.
For example, if you wanted to automatically load the TotalView modulefile when you log in, edit your
shell startup script to include the following instructions. This example uses bash as the login shell. Edit
the ~/.bashrc file as follows:
# if the 'module' command is defined, $MODULESHOME
# will be set
if [ -n "$MODULESHOME" ]; then
module load totalview
fi
From now on, whenever you log in, the TotalView modulefile is automatically loaded in your environment.
3.7 Unloading a Modulefile
In certain cases, you may find it necessary to unload a particular modulefile before you can load another
modulefile in to your environment, to avoid modulefile conflicts. See
for information
about modulefile conflicts.
You can unload a modulefile by using the module unload command, as shown in the following example:
$ module unload ifort/8.0
Unloading a modulefile that is loaded by default makes it inactive for the current session only — it will
be reloaded the next time you log in.
34
Configuring Your Environment with Modulefiles