NERSCPowering Scientific Discovery Since 1974

Save and restore programming environment versions

The default programming environment on Cori changes over time. Usually the Cray Developer Toolkit (CDT) version is upgraded about every six months on Cori so that users can get benefit from the enhanced software features and performance. However, if you need to compile a code with a specific version of CDT which is not  the default version anymore, or if your code works best with a mix of default and non-default software modules and you want to recompile with the same set of modules, then you can use the Cray provided cdt modules or the module snapshot feature to restore the compilation environment where your code was built previously. 

Module Snapshot

The module subcommand "snapshot" is available starting from modules/3.2.10.5. The command captures the currently loaded modules and saves the list into a file for later restore. Here is how to use it:

To save the current module environment into a file, do

module snapshot -f filename

The file can be provided with a full path or just with a file name. If a full path is not given, then the snapshot will be saved in your ${HOME}/.module_snapshots directory. An environment variable, MODULE_SNAPSHOT_DIR can be used to use an alternative location. 

To restore later, do

module restore filename

If a file is not provided with a full path, then the $MODULE_SNAPSHOT_DIR will be searched first, followed by $HOME/.module_snapshots. 

Here is the demo: 

save modules

restore modules 

CDT modules

The cdt modules are provided by Cray to do a clean switch between different CDT modules. Type module avail cdt to see the available cdt modules.

cdt switch