Purpose: Statistics and Plotting
Latest version: 23.3.0
Licence: Free of use
Open Source - BSD
Website: https://conda.io/en/latest/
Conda is an open source package management system and environment management system that quickly installs, runs and updates packages and their dependencies. It, also, easily creates, saves, loads and switches between environments. It was created for Python programs, but it can package and distribute software for any language (Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN...).
The 3.x version of Python should be your default choice, as the 2.7 version is deprecated as of 2020.
Software Information
Environments
One of the most powerful characteristic of CONDA is the use of virtual environments to set-up your project software needs. Each of them is independent, so the management of different versions of the same software can be done in a straight forward way.
Custom environments can be easily created by the user himself. Those custom environments are installed in /scratch/<user>/.conda/env/<env_name> by default.
Useful commands
Command | Description |
---|---|
conda env list | List available environments. |
conda activate env_name | Activate the environment env_name. |
conda list | List installed packages in the active conda environment. |
conda create -n my_env | Create an environment called my_env. The custom creation path is /scratch/<user>/.conda/envs/my_env. |
conda install package | Install the package in the active conda environment. |
#!/bin/bash #SBATCH -J conda_example #SBATCH -e conda_example.err #SBATCH -o conda_example.out #SBATCH -p std #SBATCH -n 1 #SBATCH -t 0-02:00 module load apps/conda/current ## # Modify the input and output files INPUT_FILE=example.py OUTPUT_FILE=example.log cp -r ${SLURM_SUBMIT_DIR}/${INPUT_FILE} ${SCRATCH} cd ${SCRATCH} # Modify the environment name conda activate environment_name srun python ${INPUT_FILE} > ${OUTPUT_FILE} cp ./${OUTPUT_FILE} ${SLURM_SUBMIT_DIR}
Sbatch options:
The options shown in the example are detailed below. For more information and a more comprehensive list of available options, see the sbatch command page.
- -J: Name for the job's allocation.
- -e: Name of the sterr redirection filename.
- -o: Name of the stdout redirection filename.
- -p: Name of the partition (queue) where the job will be submited.
-n: Number of tasks.
- -c: Number of cores per task.
- -t: Set the job's time limit. If the job don't finish before the time runs out, it will be killed.