User Tools

Site Tools


sysadminfaq

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
Last revision Both sides next revision
sysadminfaq [2015/03/26 17:04]
admin [II. Building Modules]
sysadminfaq [2015/03/26 17:12]
admin [II. Building Modules]
Line 13: Line 13:
 Modules are pretty easy when you get the hang of them. Basically all these ''​%%$<​VARIABLES>​%%''​ can be set in them, so that the user doesn'​t have to have big ''​%%.bashrc%%''​ entries. \\ As a starting point, look into the existing modulefiles at ''​%%/​cm/​shared/​modulefiles%%''​. Whatever is listed here get read out on a ''​%%module avail%%''​ call. \\ Modules are pretty easy when you get the hang of them. Basically all these ''​%%$<​VARIABLES>​%%''​ can be set in them, so that the user doesn'​t have to have big ''​%%.bashrc%%''​ entries. \\ As a starting point, look into the existing modulefiles at ''​%%/​cm/​shared/​modulefiles%%''​. Whatever is listed here get read out on a ''​%%module avail%%''​ call. \\
 To write your own modules, take an existing modulefile (for all that //tcl// messaging at the beginning), and modify it according to [[http://​modules.sourceforge.net/​man/​modulefile.html | this handy information]]. A workable template goes something like: \\ To write your own modules, take an existing modulefile (for all that //tcl// messaging at the beginning), and modify it according to [[http://​modules.sourceforge.net/​man/​modulefile.html | this handy information]]. A workable template goes something like: \\
-<code tcl> +<file tcl modtemplate
-Blah+#%Module -*- tcl -*- 
-</code>+## 
 +## dot modulefile 
 +## 
 +proc ModulesHelp { } { 
 +    puts stderr "​\tTell the user some help information here.
 +    puts stderr "​\tLike maybe list what the module does."​ 
 +
 + 
 +module-whatis "This gives the output from user@host>​ module whatis ****"​ 
 +module-whatis "It can also be multilined."​ 
 + 
 +### Here, list modules that conflict (e.g. openmpi vs. intel-mpi), modules to pre-load, and modules that are prerequired.  
 +conflict **** 
 +module load **** 
 +prereq **** 
 + 
 +### Here you can set variables, append and prepend paths.  
 +set              app_version ​           <some number>​ 
 +setenv ​          ​app_ROOT ​              /​cm/​shared/​apps/<​app dir> 
 +append-path PATH                   /​cm/​shared/​apps/​.../<​some path> 
 +</file>
  
 ------------------------- -------------------------
sysadminfaq.txt · Last modified: 2015/03/26 17:12 by admin