4. Initializing your Environment - bregord/emcee-on-calcul-quebec GitHub Wiki

All work done on a high performance computing system is dependent on the environment. This involves the directory structure of your home directory, the modules containing your compiler and MPI implementation, as well the virtual environments containing your python packages.

##Directory Structure While it is not necessary to create a directory structure, it is recommended as it aids organization and automation. To initialize your directory structure with the provided scripts, simply run this command:

  python donut.py --init

which will create a directory called workspace in your home directory. Inside workspace, will be 3 directories named jobs, programs, and data.

##Modules

All systems (with the exception of Psi) are equipped with a module system to make the installation of various common software packages easier and more intuitive.

All ineraction with modules is done with the module command. To list modules available to the user, simply run the command

 module avail

To list the modules a user currently has installed,

 module list

To add a module, simply type the following command followed by the name of the module (which is seen with the avail flag above)

 module load name/of/module

To remove:

 module unload

More information regarding installing software not found in the modules, or making your own can be found here

List of modules available on Colosse

List of modules available on Guillimin

[List of modules available on Hades and Briaree](https://wiki.calculquebec.ca/w/Modules_available_on_Briar
%C3%A9e)

List of modules available on MP2

List of modules available on MS2

Note: Psi doesn't use a module system

##Persisting an environment (Optional)

Upon exiting a session, all modules you have loaded will be unloaded. Whenever you start a new session, you will have to load all the modules again. There are two ways to prevent this.

###.modules file method In your home directory should be a file called .modules. If there isn't, create it.

To add modules you want to load upon every session, use the following commands:

To add a module to the list of modules to initialize upon a new session:

 module initadd name/of/module

To remove:

 module initrm name/of/module

To list the modules on the initialization list:

module initlist

###.bash_profile method Enter the commands you would to load modules as above, but into your .bash_profile file in your home directory on the system you are working on. Whenever you start a session, these commands will be run and your modules will be loaded.

##Virtual Environment To create a virtual environment using python 3, simply create a new directory and use the following command:

  pyvenv /name/of/directory/to/use/as/env/here

And in python 2.7, use the virtualenv command instead of pyenv

To activate it:
source /env/bin/activate

Once it is activated, simply use pip to install

To deactivate, simply type
deactivate

More information about pyenv can be found on the python documentation site here, and information on virtualenv can be found on Kenneth Reitz's guide here