hpcugent / Lmod-UGent

spec files of Lmod for UGent-HPC
8 stars 7 forks source link

Give nicer error to users when loading modules from different toolchains #11

Closed wpoely86 closed 7 years ago

wpoely86 commented 7 years ago

Fixes #9

With this:

$ ml zlib/1.2.8-intel-2014b
$ ml ncurses
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'. Use 'ml spider ncurses' to get an overview of the available versions. 

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
wpoely86 commented 7 years ago

What does this do:

$ ml zlib/1.2.8-intel-2015a
$ ml zlib/1.2.8-intel-2016a
Lmod has detected the following error:  A different version of the 'zlib' module is already loaded (see output of 'ml'). 

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

$ ml ncurses/6.0-intel-2016a
Lmod has detected the following error:  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'. Use 'ml spider ncurses' to get an overview of the available versions. 

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
wpoely86 commented 7 years ago

Now:

$ ml GSL
Lmod has detected the following error:  A different version of the 'intel' module is already loaded (see output of 'ml').
You should load another 'GSL' module for that is compatible with the currently loaded version of 'intel'.
Use 'ml spider GSL' to get an overview of the available versions. 

While processing the following module(s):
    Module fullname      Module Filename
    ---------------      ---------------
    GSL/2.1-intel-2016b  /apps/gent/SL6/sandybridge/modules/all/GSL/2.1-intel-2016b

If you don't understand the warning or error, contact the helpdesk at hpc@ugent.be
boegel commented 7 years ago

@wpoely86 looks good, but can we avoid the excessive vertical whitespace when loading a module that is already loaded?

[11:30:46] vsc40023@test2802:~/vsc-testing/module $ ml Python/2.7.9-intel-2015a 
[11:30:56] vsc40023@test2802:~/vsc-testing/module $ ml 

Currently Loaded Modules:
  1) cluster/.banette (S)   3) icc/2015.1.133-GCC-4.9.2     5) iccifort/2015.1.133-GCC-4.9.2                  7) iimpi/7.2.3-GCC-4.9.2                   9) intel/2015a              11) zlib/1.2.8-intel-2015a       13) ncurses/5.9-intel-2015a
  2) GCC/4.9.2              4) ifort/2015.1.133-GCC-4.9.2   6) impi/5.0.2.044-iccifort-2015.1.133-GCC-4.9.2   8) imkl/11.2.1.133-iimpi-7.2.3-GCC-4.9.2  10) bzip2/1.0.6-intel-2015a  12) libreadline/6.3-intel-2015a  14) Python/2.7.9-intel-2015a

  Where:
   S:  Module is Sticky, requires --force to unload or purge
[11:30:58] vsc40023@test2802:~/vsc-testing/module $ ml Python/3.4.3-intel-2015a
Lmod has detected the following error:  A different version of the 'Python' module is already loaded (see output of 'ml'). 

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

[11:31:04] vsc40023@test2802:~/vsc-testing/module $ ml matplotlib/1.4.3-intel-2015a-Python-3.4.3 
Lmod has detected the following error:  A different version of the 'Python' module is already loaded (see output of 'ml').
You should load another 'matplotlib' module for that is compatible with the currently loaded version of 'Python'.
Use 'ml spider matplotlib' to get an overview of the available versions. 

While processing the following module(s):
    Module fullname                            Module Filename
    ---------------                            ---------------
    matplotlib/1.4.3-intel-2015a-Python-3.4.3  /apps/gent/SL6/westmere/modules/all/matplotlib/1.4.3-intel-2015a-Python-3.4.3

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

[11:32:01] vsc40023@test2802:~/vsc-testing/module $ 
boegel commented 7 years ago

@wpoely86 ping on avoiding the excessive vertical whitespace?

wpoely86 commented 7 years ago

Now:

$ ml zlib/1.2.8-intel-2015a
$ ml zlib/1.2.8-intel-2015b
Lmod has detected the following error:  A different version of the 'zlib' module is already loaded (see output of 'ml'). 

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

$ ml ncurses/5.9-intel-2014b
Lmod has detected the following error:  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'.
Use 'ml spider ncurses' to get an overview of the available versions. 
While processing the following module(s):
    Module fullname          Module Filename
    ---------------          ---------------
    ncurses/5.9-intel-2014b  /apps/gent/SL6/westmere/modules/all/ncurses/5.9-intel-2014b

If you don't understand the warning or error, contact the helpdesk at hpc@ugent.be
boegel commented 7 years ago

lgtm