Bright-Computing / bic

Bright-Illumina collaboration
GNU General Public License v2.0
4 stars 5 forks source link

hide-version works as intended, but crippled clean shell startup on qrsh submission #87

Closed fgeorgatos closed 7 years ago

fgeorgatos commented 7 years ago
[fgeorgatos@node42 ~]$ cat /home/fgeorgatos/.modulerc
#%Modules
hide-version CUDA/8.8.8
[fgeorgatos@node42 ~]$ ml use.own
[fgeorgatos@node42 ~]$ ml av CUDA

------------------------------- /home/fgeorgatos/privatemodules -------------------------------
   CUDA/7.5.18 (T)

  Where:
   T:  Testing

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

[fgeorgatos@node42 ~]$ mv /home/fgeorgatos/.modulerc /home/fgeorgatos/.modulerc.old
[fgeorgatos@node42 ~]$ ml av CUDA

------------------------------- /home/fgeorgatos/privatemodules -------------------------------
   CUDA/7.5.18 (T)    CUDA/8.8.8 (g,T,D)

  Where:
   g:  built for GPU
   T:  Testing
   D:  Default Module

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

[fgeorgatos@node42 ~]$ mv /home/fgeorgatos/.modulerc.old /home/fgeorgatos/.modulerc
[fgeorgatos@node42 ~]$ ml av CUDA

------------------------------- /home/fgeorgatos/privatemodules -------------------------------
   CUDA/7.5.18 (T)

  Where:
   T:  Testing

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

[fgeorgatos@node42 ~]$ logout
[root@node42 ~]# logout
Connection to node241 closed.
[root@zxyz-xyz-zxyz01 ~]# echo hostname|su - fgeorgatos -c 'module load sge;qrsh -V bash'
cmdModule.c(613):ERROR:102: Tcl command execution failed: hide-version CUDA/8.8.8

locate_module.c(1083):WARN:71: Error sourcing file '/home/fgeorgatos/.modulerc'
node241
[root@zxyz-xyz-zxyz01 ~]#
fgeorgatos commented 7 years ago

this could well be caused by Tcl modules, as opposed to Lmod, since we're dual stacked; this really looks as module language incompatibility, which hints at need for different markup for hidden bits

rtmclay commented 7 years ago

This error is coming from Tmod not Lmod. You'll have to wrap the hide-version command to hide it from Tmod. You should try something like this in your \~/.modulerc file:

#%Module
global env
if { [info exists env(LMOD_VERSION_MAJOR)]} {
    hide-version CUDA/8.8.8
}

It is clear that the error messages came from Tmod as it said it came from cmdModule.c(613): ... You'll never see an error like that from Lmod.

Lmod defines LMOD_VERSION_MAJOR during its execution and nowhere else you can use it to know that Lmod is processing a TCL file.

rtmclay commented 7 years ago

I have added to http://lmod.readthedocs.io/en/latest/040_FAQ.html to report the same information on how to have Lmod only code in a TCL file that might be read by Tmod.

fgeorgatos commented 7 years ago

@rtmclay : this was helpful, thanks!

Since I am conditional-clauses-averse I'd like to query, out of curiosity, if there could exist any alternative mechanism which is simply ignored by Tmod but understood by Lmod. fi. it could be a parameter while loading a variable or something of the sort.

Not asking for any implementation, just checking for future needs! ;-)

fgeorgatos commented 7 years ago

OK, false alarm on this one: this occured via the headnode which had no Lmod RPM, so it fall back to Tmod, as it should. Closing issue,

[root@zxyz-xyz-zxln01 ~]# echo hostname|su - fgeorgatos -c 'module load sge;module --version 2>&1|head -2'

Modules based on Lua: Version 7.4.9  2017-05-02 10:07 -05:00
[root@zxyz-xyz-zxln01 ~]# logout
Connection to ukch-dev-brln01 closed.
[root@zxyz-xyz-zxhn01 ~]# echo hostname|su - fgeorgatos -c 'module load sge;module --version 2>&1|head -2'
cmdModule.c(613):ERROR:102: Tcl command execution failed: hide-version CUDA/8.8.8

locate_module.c(1083):WARN:71: Error sourcing file '/home/fgeorgatos/.modulerc'
VERSION=3.2.10
DATE=2012-12-21