hpcugent/Lmod-UGent

better error message when loading conflicting modules

Closed this issue · 2 comments

Users now get to see something like this, which is confusing them:

$ ml Python/2.7.11-intel-2016a

$ ml R/3.3.1-intel-2016b
Lmod has detected the following error:  Your site prevents the automatic swapping of modules with same name. You must explicitly unload the loaded version of "intel" before you can load the new
one. Use swap (or an unload followed by a load) to do this:

   $ module swap intel  intel/2016b

Alternatively, you can set the environment variable LMOD_DISABLE_SAME_NAME_AUTOSWAP to "no" to re-enable same name autoswapping. 
While processing the following module(s):
    Module fullname      Module Filename
    ---------------      ---------------
    R/3.3.1-intel-2016b  /apps/gent/SL6/sandybridge/modules/all/R/3.3.1-intel-2016b

If you don't understand the warning or error, contact the helpdesk at hpc@ugent.be

First of all, the swapping suggestion is confusing since it won't get them out of the woods.

@wpoely86 Can we provide a more meaningful error message here via a hook?

Something like

$ ml zlib/1.2.8-intel-2015b
$ ml ncurses/6.0-intel-2016a
Lmod has detected the following error:  You cannot load modules belonging to two different toolchains: a version of the module intel  is already loaded. Either unload the already loaded version or pick a version of the
module that works with the new toolchain. Use ml spider <module name> to see the available versions for a module. 

While processing the following module(s):
    Module fullname          Module Filename
    ---------------          ---------------
    ncurses/6.0-intel-2016a  /apps/gent/SL6/westmere/modules/all/ncurses/6.0-intel-2016a

If you don't understand the warning or error, contact the helpdesk at hpc@ugent.be

I would drop the Either... part, and would also insert more newlines?

I'd go for something like:

Lmod has detected the following error: You can not load modules using different toolchains.
A different version of the 'intel' module is already loaded (see output of 'ml').
You should load another 'ncurses' module for that is compatible with the currently loaded version of 'intel'.