We set up module on Hydra to facilitate management and usage of different versions of a single software, such as multiple Python distributions, on the same machine. Many supercomputing centers, including NERSC, use the module utility to manage software.
module
The module utility is available from CentOS base repo. So one can simply install it with:
Python
So far we’ve installed 2 Python distributions, not counting the stock Python 2.7.5 that comes with CentOS7, on Hydra: Anaconda3 4.4.0 for Python 3.6 & Anaconda2 4.4.0 for Python 2.7.
Create a directory /etc/modulefiles/python to hold modulefiles for Python distributions:
Create a modulefile /etc/modulefiles/python/anaconda3 for Anaconda Python 3.6:
Create a modulefile /etc/modulefiles/python/anaconda2 for Anaconda Python 2.7:
Create a file /etc/modulefiles/python/.version to make python\anaconda3 the default python module:
A few quick examples:
CUDA
So far we’ve only installed CUDA 8.0 on Hydra; but we’ll install new versions when they become available.
Create a directory /etc/modulefiles/cuda to hold modulefiles for CUDA:
Create a modulefile /etc/modulefiles/cuda/8.0 for CUDA 8.0:
Create a file /etc/modulefiles/cuda/.version to make cuda\8.0 the default cuda module:
Loading modules into your default environment
To automatically load the default python & cuda modules to your environment whenever you log in, append the following 2 lines to ~/.bashrc (assuming your shell is bash):