[Neurodebian-devel] [RFC] Should we convert to use 'Modules' (http://modules.sourceforge.net/)?

Alex Waite alexqw85 at gmail.com
Wed Jan 29 12:32:59 UTC 2014


Whoops. Replying to list this time...

On 01/28/2014 06:20 PM, Yaroslav Halchenko wrote:
 >>>>>     Q: How we could enable per user per module specific settings?
 >>>>> [snip]
 >
 >>>> I think this is what `module load use.own` is for. Though I am not
 >>>> [snip]
 >
 >> Simply depend on the module in question,
 >> then setenv over the variable in question:
 >
 >> `module load use.own`
 >
 >> in ~/privatemodules/alex_freesurfer
 >
 >> #%Module#
 >> module load freesurfer
 >
 >> setenv          SUBJECTS_DIR            $env(HOME)/subj
 >> setenv          LOCAL_DIR               $env(FREESURFER_HOME)/alex_local
 >> ## EOB
 >
 >> `module load alex_freesurfer`

There's another, related option, though I'm not sure if this is the way 
envmod is intended to be used...

I edited the use.own module and removed "--append" from the las line. So 
it is now "module use $ownmoddir". This pushed the privatemodules to the 
front of the modulepath rather than the end.

Then, I created a ~/privatemodules/freesurfer file (rather than 
alex_freesurfer), thus overloading the freesurfer name. The modulefile 
content is the same as above, with one change: I couldn't simply `module 
load freesurfer` or even `module load freesurfer/5.1` (which should work 
IMO; I don't know why it doesn't). However, if I specify the entire path 
it works: `module load /usr/share/modules/modulefiles/freesurfer/5.1`

Then, the overload works correctly, and I can run `module load 
freesurfer` in my shell.

I'm not yet sure if this is a good idea or not, but it's another option.

Also, just as a note. The ~/.modulerc file could be problematic. 
According to https://www.nics.tennessee.edu/node/330 it is read /every/ 
time the `module` command is run (I see the same behavior on my 
machine). So if you load a module in your ~/.modulerc file, you can get 
the following situation:

alex at kitt:~$ cat ~/.modulerc
#%Module1.0
module load freesurfer
alex at kitt:~$ module list
Currently Loaded Modulefiles:
   1) freesurfer/default
alex at kitt:~$ module purge
alex at kitt:~$ module list
Currently Loaded Modulefiles:
   1) freesurfer/default

It'll purge, but it will come right back. :-/

---Alex




More information about the Neurodebian-devel mailing list