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

Gabe Turner gabe at msi.umn.edu
Fri Jun 8 09:00:53 MDT 2007


On Thu, Jun 07, 2007 at 05:21:49PM -0400, David Backeberg wrote:
> 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.

We get around this problem by having users explicitly launch bash in login
mode in their submission scripts.

#!/bin/bash -l
#PBS -l <resources>
<commands>

This actually works just fine.  The module command itself is really just a
shell function:

% grep 'module()' /usr/local/share/modules/init/bash
module() { eval `/usr/local/modules/$MODULE_VERSION/bin/modulecmd bash $*`; }


The module init script needs to be sourced, and the only way I've been able
to get this to work reliably is to use bash in login mode.  If you're using
tcsh, it should act like a login shell by default, in which case I have no
idea what's causing the problem you're seeing.

HTH,

Gabe


-- 
Gabe Turner                                             gabe at msi.umn.edu
UNIX System Administrator,
University of Minnesota
Supercomputing Institute                          http://www.msi.umn.edu


More information about the torqueusers mailing list