Conda
Conda is an open source package and environment management system. It is the main method for install user-side applications or dependencies at CCI. In most situations conda install package-name is a direct in replacement for PIP in instructions or examples you may be following.
CCI recommends using Miniconda rather than the full Anaconda distribution.
NOTE: Ensure the proxy is configured in your environment before starting.
Installing Miniconda on PPC64le (DCS)¶
- Run:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-ppc64le.shto download the required files - Run:
bash Miniconda3-latest-Linux-ppc64le.sh -p ~/barn/miniconda3 - Read and accept the license terms, if prompted to run conda init, answer yes
- Run:
source ~/.bashrcto enable
The conda command should now be present in your environment.
You can search the Anaconda Cloud for available packages. Pay attention to the availability of packages for the architecture of the system you're using.
Instructions for installing specific package versions and sourcing from specific channels can be found at Managing Packages
Installing conda on x86 (NPL/ERP)¶
- Run:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - Run:
bash Miniconda3-latest-Linux-x86_64.sh -p ~/barn/miniconda3x86 - Read and accept the license terms, if prompted to run conda init, answer yes.
- Run
source ~/.bashrcto enable
Installing conda on AARCH64 (NGH)¶
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.shbash Miniconda3-latest-Linux-aarch64.sh- Read and accept the license terms.
- If this is the first conda install inside your project, let conda auto initialize your environment.
- When prompted to run conda init, answer yes.
NOTE: If this your second install of conda for a different architecture, do not run conda init.
Common Situations¶
Switching Conda between different architecture installations (or manually activating Conda)¶
Replace path to your Conda binary and activate:
eval "$(~/barn/<PATH TO MINICONDA INSTALL>/bin/conda shell.bash hook)"
Activating a conda environment in a sbatch file¶
Conda environments can be activated as part of a Slurm job:
#!/bin/bash
#Slurm Directives
#SBATCH -N 1
#SBATCH --time=00:10:00
#SBATCH --gres=gpu:1
source /gpfs/u/home/PROJ/PROJuser/barn/<PATH TO MINICONDA INSTALL>/etc/profile.d/conda.sh
conda activate ENVIRONMENT-NAME
#Run the script that does your work
srun /gpfs/u/home/PROJ/PROJuser/barn/worker.sh