Python/fr: Difference between revisions

Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 220: Line 220:
==== Creating virtual environments inside of your jobs (multi-nodes) ====
==== Creating virtual environments inside of your jobs (multi-nodes) ====


In order to run scripts accross multiple nodes, each nodes must have it own virtual environment activated.
In order to run scripts across multiple nodes, each node must have its own virtual environment activated.


1. In your submission script, create the virtual environment on each allocated nodes :
1. In your submission script, create the virtual environment on each allocated node:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
srun --ntasks $SLURM_NNODES --tasks-per-node=1 bash << EOF
srun --ntasks $SLURM_NNODES --tasks-per-node=1 bash << EOF
Line 235: Line 235:
</syntaxhighlight>
</syntaxhighlight>


2. Activate the virtual environment on the main node
2. Activate the virtual environment on the main node,
<syntaxhighlight lang="bash">source $SLURM_TMPDIR/env/bin/activate;</syntaxhighlight>
<syntaxhighlight lang="bash">source $SLURM_TMPDIR/env/bin/activate;</syntaxhighlight>


38,760

edits