[slurm-users] How to use a pyhon virtualenv with srun?

Chris Samuel chris at csamuel.org
Mon Nov 18 07:17:04 UTC 2019

On 17/11/19 10:39 pm, Yann Bouteiller wrote:

> I have thought about it too, but I think the --block option that I use 
> in ray start is supposed to sleep indefinitely for this not to happen. 
> However maybe this is not taken into account due to the fact that I use 
> '&' at this end of the ray start command in the install_worker.sh script 
> for this call to be non-blocking when I launch install_worker.sh with 
> srun in the parent script?

The '&' symbol at the end of a command will put it into the background.

If you do that in a Slurm script, or in a script called from there, then 
that command can still be running when the main script exits and your 
job ends.

The way to fix that is to use the "wait" command to sleep until pending 
commands in the background complete.

Hope that helps!
  Chris Samuel  :  http://www.csamuel.org/  :  Berkeley, CA, USA

More information about the slurm-users mailing list