[slurm-users] prolog not passing env var to job

Brian Andrus toomuchit at gmail.com
Fri Feb 12 21:34:08 UTC 2021


Your prolog script is run by/as the same user as slurmd, so any 
environment variables you set there will not be available to the job 
being run.

See: https://slurm.schedmd.com/prolog_epilog.html for info.

Brian Andrus


On 2/12/2021 1:27 PM, mercan wrote:
> Hi;
>
> Prolog and TaskProlog are different parameters and scripts. You should 
> use the TaskProlog script to set env. variables.
>
> Regards;
>
> Ahmet M.
>
>
> 13.02.2021 00:12 tarihinde Herc Silverstein yazdı:
>>
>> 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
>>
>



More information about the slurm-users mailing list