[torqueusers] still having modules environment / Torque shell interaction problems

David Backeberg david.backeberg at case.edu
Thu Jun 7 15:21:49 MDT 2007


I jumped the gun this afternoon in saying the problem has been
resolved with my Torque / modules environment interaction. (in the
thread with title about prologue / epilogue).

Here's what I've been able to determine by adding comments to various
/etc/profile and /etc/profile.d scripts.

1) Torque definitely munges /etc/profile, and then /etc/profile.d/*.sh
scripts when setting up the Torque shell.

2) variables set in the /etc/profile.d/modules-env.sh and export-ed,
are properly set in the PBS script environment. For instance, I can
echo $MODULEPATH and the correct value is displayed.

3) for reasons I haven't been able to determine, the actual modules
command somehow escapes the PBS script environment, so I'm still
getting "command not found" when using the module command in my PBS
scripts, but it's not because /etc/profile.d/modules.sh. It's as if
the PBS shell somehow gets amnesia, or forks off a clone shell that
doesn't get the value.

After suffering with the problem for a long time with modules-env.sh
built for version 3.1.6-9, I upgraded to 3.2.5, and really still have
the same problem. Here's the two ways, neither of which seem to be
working for me:

from 3.1.6-9, /etc/profile.d/modules-env.sh...
export MODULESHOME=/usr/local/modules-env-3.1.6-9
. $MODULESHOME/init/ksh
module load modules


from 3.2.5, /etc/profile.d/modules-env.sh
if [ "${MODULE_VERSION:-}" = "" ]; then
        export MODULE_VERSION

module() { eval `/usr/local/modules-env-3.2.5/Modules/$MODULE_VERSION/bin/module
cmd bash $*`; }


4) If I explicitly put a command in my PBS submission script to source
/etc/profile.d/modules-env.sh, the subsequent module commands are
properly recognized by the PBS command shell.

Thanks, hopefully this is something that's not just limited to my settings.

More information about the torqueusers mailing list