Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

After performing a conda activate on a login node, typically the related set environment variables will be inherited agter after performing an salloc. But, notice what happens to the command-line prompt:

Code Block
[salexan5@mblog1 ~@mblog1]$ conda activate py_env
(py_env) [salexan5@mblog1 ~]$ python --version
Python 3.12.4

(py_env) [salexan5@mblog1 ~@mblog1]$ salloc -A arcc -t 10:00
salloc: Granted job allocation 1243597
salloc: Nodes mbcpu-025 are ready for job
[salexan5@mbcpumbcpu-025 ~]$ python --version
Python 3.12.4

Which conda cConda environment is currently active?

Info

We would suggest, as with performing a module purge, to conda activate environments explicitly after performing an salloc, and within you scripts that you sbatch.

Code Block
[salexan5@mblog1 ~@mblog1]$ salloc -A arcc -t 10:00
salloc: Granted job allocation 1243600
salloc: Nodes mbcpu-025 are ready for job
[salexan5@mbcpu@mbcpu-025 ~]$ module purge
[salexan5@mbcpu@mbcpu-025 ~]$ module load miniconda3
[salexan5@mbcpu@mbcpu-025 ~]$ conda activate py_env
(py_env) [salexan5@mbcpu@mbcpu-025 ~]$ python --version
Python 3.12.4

Again, since this is now detailed within an sbatch-ed script, ARCC can see and replicate exactly what you are doing when there is an issue.

...

Expand
titlerun_conda.sh
Code Block
#!/bin/bash
#SBATCH --account=arccanetrain<project-name>
#SBATCH --time=10:00
#SBATCH --job-name=conda_test
#SBATCH --output=conda_results_%A.out

echo "SLURM_JOB_ID:" $SLURM_JOB_ID
start=$(date +'%D %T')
echo "Start:" $start

module load miniconda3/24.3.0
conda activate /cluster/medbow/project/arcc<project-name>/salexan5<username>/conda/py_env
python --version

end=$(date +'%D %T')
echo "End:" $end

...