Skip to content

Shell function module not defined in Batch job

The shell function module can be used to define certain environment variables, using modulefiles.

This function is defined on interactive nodes such as lxplus, but may not be defined inside jobs running on lxbatch worker nodes. To define it, use something like this in your shell script:

if [[ $(type -t module) != function ]]
then
    . /etc/profile.d/modules.sh
fi
module load mpi/mpich-3.0-x86_64


Last update: March 20, 2024