(Usage hints for this presentation)
COARE Operations
sbatchsrunThink of using Slurm as if you are preparing a meal.
The meal that you are going to cook is the job.
While the individual steps to accomplish this are your job steps.
This includes unpacking the ingredients, slicing the vegetables, boiling the water, etc..
But I’m a busy person…got no time for this :(
Can I outsource this and let the Mecha Chefs (compute nodes) do the cooking for me? :)
Well Yes! That’s the purpose of SLURM.
All we need is a text file that contains the necessary ingredients and procedures, we call this the job script.
Let the SLURMagic do it for you!
But I have specific requirements for which Mecha Chef (compute node) should do the job for me…
We need to talk about that!
| Option | Descripton |
|---|---|
| -c, –cpus-per-tasksq | Controls the number of CPUs allocated per task |
| –exclusive | Prevents sharing of allocated nodes with other jobs. Suballocates CPUs to job steps |
| -N, –nodes <min[-max]> | Controls the minimum/maximum number of nodes allocated to the job |
| -F, –nodefile | File containing a list of specific nodes to be selected for the job (salloc and sbatch only) |
| –mincpus <n> | Controls the minimum number of CPUs allocated per node |
| Options | Description |
|---|---|
| –ntasks-per-core | Controls the maximum number of tasks per allocated core |
| –ntasks-per-node <number> | Controls the maximum number of tasks per allocated node |
| -O, –overcommit | Allows fewer CPUs to be allocated than the number of tasks |
| -p, –partition <partitionnames> | Controls which partition is used for the job |
| -w, –nodelist <hostN or filename> | List of specific nodes to be allocated to the job |
| -x, –exclude <host1 or filename> | List of specific nodes to be excluded from allocation to the job |
Anaconda a.ka. Conda is a python package manager that simplifies the installation of scientific libraries and environment management.
Changing the env and pkgs location
conda config --add envs_dirs ~/scratch3/conda/envs
Manually modify the ~/.condarc
envs_dirs:
- ~/scratch3/conda/envs
- ~/scratch3/conda/pkgs
You need to manually create the envs and pkgs
mkdir –p ~/scratch3/conda/envs ~/scratch3/conda/env
If the envsdirs is not set, the path can be given during the creation
conda create --prefix ~/scratch3/conda/envs/myenv
conda search package_name conda search numpy
Search in a specific channel
conda search -c conda-forge package_name conda search -c bioconda biopython
conda activate myenv
conda install <package_name>
Install from specific channel,
conda install –c <channel_name> <package_name>
.sif extension is used on this file type.A container image is built using the command
singularity build <options> <fiel.sif> <target>
sudo singularity build lolcow.sif library://lolcow
lolcow.sif is a compressed and read-only SIF.singularity build --sandbox my_sandbox docker://ubuntu:slim
sudo singularity shell --writable lolcow/
We can convert containers from one format to another
sudo singularity build production.sif development/
Bootstrap: library
From: ubuntu:22.04
Stage: build
%setup
touch /file1
touch ${SINGULARITY_ROOTFS}/file2
%files
/file1
/file1 /opt
%environment
export LISTEN_PORT=54321
export LC_ALL=C
%post
apt-get update && apt-get install -y netcat
NOW=`date`
echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT
%runscript
echo "Container was created $NOW"
echo "Arguments received: $*"
exec echo "$@"
%startscript
nc -lp $LISTEN_PORT
%test
grep -q NAME=\"Ubuntu\" /etc/os-release
if [ $? -eq 0 ]; then
echo "Container base is Ubuntu as expected."
else
echo "Container base is not Ubuntu."
exit 1
fi
%labels
Author myuser@example.com
Version v0.0.1
%help
This is a demo container used to illustrate a def file that uses all
supported sections.
Bootstrap: docker
From: ubuntu:22.04
%post
apt-get -y update
apt-get -y install cowsay lolcat
%environment
export LC_ALL=C
export PATH=/usr/games:$PATH
%runscript
date | cowsay | lolcat
sudo singularity build lolcow.sif lolcow.def
sudo is required here because an elevated privilege is required
to install packages.--remote and --fakeroot, however --remote requires an enterprise
version of singularity
Bootstrap: library
From: ubuntu:22.04
%files
./PCOMCOT/* /opt/pcomcot/
%environment
export PATH="$PATH:/opt/pcomcot/src_PCOMCOT2.0"
%post
apt-get update && apt-get upgrade -y
apt-get install -y build-essential gfortran openmpi-bin openmpi-doc \
libopenmpi-dev libnetcdf-dev libnetcdff-dev
make -C /opt/pcomcot/src_PCOMCOT2.0
%labels
Version: pcomcot-2.0