[Lmod-users] When using depends_on, setenv via a function is not unset by unload
A Lua based environment module system that reads TCL modulefiles.
Brought to you by:
rtmclay
|
From: Shelly J. <js...@um...> - 2020-08-26 18:37:56
|
Suppose I have a module, hello, that depends_on('cuda/11.0.2'). I was
hoping to be able to use something like
#-----------------------------
local installDir = "/sw/arcts/centos7/hello/1.0"
local app = "hello"
depends_on('cuda/11.0.2')
local cuda_home = os.getenv('CUDA_HOME')
setenv('THINGY', cuda_home)
#-----------------------------
That seems to work, so long as the cuda/11.0.2 module is already
loaded when I load hello/1.0. That is, when cuda/11.0.2 was not
loaded by depends_on().
If the cuda/11.0.2 module is not loaded when hello/1.0 gets loaded,
then upon unloading hello, I get
Lmod Warning: Syntax error in file: /home/bennet/Lmod/hello/1.0.lua
with command: setenv, one or more arguments are not strings.
So, it seems that it might be unloading the module on which hello
depends before unsetting the variables that hello sets, leading to the
os.getenv('CUDA_HOME') not getting properly evaluated. Would it not
be better to unset while the depended upon module was still active?
This seems like it could be a bug.
Thanks!
Shelly
Shelly Johnson
Research Applications Specialist
XSEDE Campus Champion
Advanced Research Computing - TS
University of Michigan
|