User Tools

Site Tools


environment_modules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
environment_modules [2021/07/06 15:14]
root
environment_modules [2022/01/26 09:52] (current)
root
Line 1: Line 1:
 ===== Environment Modules ===== ===== Environment Modules =====
  
-**This page applies only to the new cluster.** +Environment modules allow you to control which software (and which version of that software) is available in your environment. For instance, at the time of writing, the cluster has 4 different version of standard R installed: 3.5.3, 3.6.3, 4.0.5, 4.1.0. When you first log in and try to run R the OS will respond with "command not found". To activate R in your environment you would type:
- +
-Environment modules allow you to control which software (and which version of that software) is available in your environment. For instance the new cluster has 4 different version of standard R installed: 3.5.3 +
-, 3.6.3, 4.0.5, 4.1.0. When you first log in and try to run R the OS will respond with "command not found". To activate R in your environment you would type:+
  
 <code> <code>
Line 30: Line 27:
 </code> </code>
  
-There's a shorthand version of the module command: **ml**. To load a module you can use just:+There's a shorthand version of the **module** command: **ml**. To load a module you can use just:
  
 <code> <code>
Line 62: Line 59:
  
  
-==== Where to Load Modules ====+==== Where run Module Load Commands ====
  
 You have several options as to where to use "module load" commands. You have several options as to where to use "module load" commands.
Line 93: Line 90:
 This would generate an error because of the latest version of R already being loaded.  This would generate an error because of the latest version of R already being loaded. 
  
-So, in your script you should unload R before loading the new version.+So, in your script you could unload R before loading the new version.
  
 <code> <code>
Line 151: Line 148:
 === Python and Perl === === Python and Perl ===
  
-Since various OS level tools need python and perl there are version of these languages installed system-wide. No module needed. These are python3 (version 3.8.5) and perl (version 5.30.0). You are welcome to use these, but there are also modules with slightly different versions:+Since various OS level tools need python and perl there are versions of these languages installed system-wide. No module needed. These are python3 (version 3.8.5) and perl (version 5.30.0). You are welcome to use these, but there are also modules with slightly different versions:
  
- * python 2.7.18 for older software that requires python2 +  * python 2.7.18 for older software that requires python2 
- * python 3.9.5 +  * python 3.9.5 
- * perl 5.34.0+  * perl 5.34.0
  
 The system-wide python is accessible only as "python3". When a python module is loaded just "python" will start up the relevant version of python.  The system-wide python is accessible only as "python3". When a python module is loaded just "python" will start up the relevant version of python. 
Line 186: Line 183:
 </code> </code>
  
-Or you can do it from within R, and don't need to know any details like the specific version number:+Or you can do it from within R, and then you won't need to know any details like the specific version number - the R program that you have started will fill them in for you:
  
 <code> <code>
 dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE) dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
 </code> </code>
 +
 +=== Rscript and the "#!" Hack ===
 +
 +If you have used 
 +
 +<code>
 +#!/usr/bin/Rscript
 +</code>
 +
 +as the first line of your R scripts so that you can run them just like programs on the old cluster, they will no longer work on the new cluster. This is because there is no interpreter at /usr/bin/Rscript on the new cluster.
 +
 +On the new cluster you should load an R module (possibly from within your .bashrc file so that R is always available when you log in), and then use:
 +
 +<code>
 +#!/usr/bin/env Rscript
 +</code>
 +
 +at the top of your R scripts.
 +
  
environment_modules.1625598881.txt.gz · Last modified: 2021/07/06 15:14 by root