[slurm-users] prolog not passing env var to job
Sarlo, Jeffrey S
JSarlo at Central.UH.EDU
Fri Feb 12 21:17:37 UTC 2021
In our taskprolog file we have something like
#!/bin/sh
echo export SCRATCHDIR=/scratch/${SLURM_JOBID}
________________________________
From: slurm-users <slurm-users-bounces at lists.schedmd.com> on behalf of Herc Silverstein <herc.silverstein at schrodinger.com>
Sent: Friday, February 12, 2021 3:12 PM
To: slurm-users at schedmd.com <slurm-users at schedmd.com>
Subject: [slurm-users] prolog not passing env var to job
Hi,
I have a prolog script that is being run via the slurm.conf Prolog= setting. I've verified that it's being executed on the compute node. My problem is that I cannot get environment variables that I set in this prolog to be set/seen in the job. For example the prolog:
#!/bin/bash
...
export CUDA_MPS_PIPE_DIRECTORY=blah
...
is not part of the job's env vars. Someone had suggested that a "print" statement needs to be used. So I tried:
print export CUDA_MPS_PIPE_DIRECTORY=blah
but this doesn't work either. Is this is really just for print-ing as its name implies? Or is that how one actually has to do it and somehow the syntax I'm using isn't quite right?
The documentation says:
The task prolog is executed with the same environment as the user tasks to be initiated. The standard output of that program is read and processed as follows:
export name=value sets an environment variable for the user task
unset name clears an environment variable from the user task
print ... writes to the task's standard output.
The above functionality is limited to the task prolog script.
Basically, I'd like to know how to get an arbitrary environment variable passed on to the job via the prolog.
We are using slurm 20.02.5 on CentOS 7.
Thanks,
Herc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20210212/866c525e/attachment.htm>
More information about the slurm-users
mailing list