Hello,

On 27/01/14 16:50, Reuti wrote:
> Hi,
> 
> Am 27.01.2014 um 17:26 schrieb Txema Heredia:
> 
>> I have been trying to use modulefiles from my compute nodes with no avail.
>>
>> When a job starts, the modulecmd command is in the path, but the module 
>> function is nowhere to be found. I have tried to add calls to 
>> /etc/profile.d/modules.sh in both /etc/bashrc and ~/.bashrc, and even 
>> setting the queue shell to "/bin/bash -l" with no luck (it is not a valid 
>> shell). The only mens to have access to the "module" function is either to 
>> add ". /etc/profile.d/modules.sh"
> 
> This could also be done in a "starter_method" of the queue which calls the 
> real script:
> 
> #!/bin/bash
> . /etc/profile.d/modules.sh
> exec "${@}"

We use Modules a lot - including in cluster jobs. 

I don't actually have a starter_method like that set in the queue - although 
that seems like a good idea (thanks Reuti!). So it's possible without that.

>> at the beginning of my job script, or either log into the compute node in an 
>> interactive session and there softstop and restart the sge_execd daemon.
>>
>> What am I missing? How can I have the module function available in my jobs?
> 
> Any of the profiles are only sourced in case of "shell_start_mode 
> posix_compliant" in the queue definition and listing bash in `qconf -mconf` 
> "login_shells".
> 
> The module command is a function, which needs to be defined. For serial jobs 
> it should work to define the function in the submitting session, export the 
> function and use `qsub -v module ...`.

Yes; do have the shell set to posix_compliant. Not sure you really need it 
though.

What we tend to do is source /etc/profile.d/modules.sh in the job script - a 
simple example would be this:

#!/bin/sh                                    
#$ -S /bin/sh                                

OUTFILE="$HOME/moduletest_$(date "+%Y%m%d_%H:%M:%S")_$HOSTNAME_$JOB_ID.out"

echo "Job $JOB_NAME (job ID $JOB_ID) started by $USER, executed on $HOSTNAME" 
>> $OUTFILE
echo "PATH: $PATH" >> $OUTFILE
echo "ENVIRONMENT: $ENVIRONMENT" >> $OUTFILE
echo "SHELL: $SHELL" >> $OUTFILE

. /etc/profile.d/modules.sh

module load fast_ep/1175

echo "$(which fast_ep)" >> $OUTFILE
echo "PATH: $PATH" >> $OUTFILE

(I use this to test the nodes have the correct /etc/profile.d/modules.sh - so 
at least for us, this works :) $HOME - i.e. my home directory - is a globally 
mounted NFS share, which is why I output there).

Tina

> 
> -- Reuti
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
> 
> 


-- 
Tina Friedrich, Computer Systems Administrator, Diamond Light Source Ltd
Diamond House, Harwell Science and Innovation Campus - 01235 77 8442

-- 
This e-mail and any attachments may contain confidential, copyright and or 
privileged material, and are for the use of the intended addressee only. If you 
are not the intended addressee or an authorised recipient of the addressee 
please notify us of receipt by returning the e-mail and do not use, copy, 
retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not 
necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments 
are free from viruses and we cannot accept liability for any damage which you 
may sustain as a result of software viruses which may be transmitted in or with 
the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and 
Wales with its registered office at Diamond House, Harwell Science and 
Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 



_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to