Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| infra:howto:runjob [2025/02/05 16:03] – [Example using GPU sharding] remi | infra:howto:runjob [2026/03/11 10:25] (current) – [Quotas] marc | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| + | ===== Connection ===== | ||
| + | Currently, you have to SSH directly on one of the compute node, either server [[infra: | ||
| + | |||
| + | $ ssh firstname.lastname@disco.hevs.ch | ||
| + | $ ssh firstname.lastname@chacha.hevs.ch | ||
| + | | ||
| + | ** NOTE : Please note you have to connect from the school network or the HEVS VPN to be able to connect on those servers ** | ||
| + | |||
| + | TODO : Change doc when the jump host will be ready | ||
| ===== Environment ===== | ===== Environment ===== | ||
| - | On either server [[infra: | + | |
| + | 2. You have also another symlink **shared_dataset** for jobs that needs to be run on several nodes : this filesystem is shared between nodes. | ||
| - | NOTE : If you are working as a team on these data, **please ask for a group creation** so we can add members in it and apply suitable permissions. | + | 3. Your .bashrc / .zshrc contains by default the variable **APPTAINER_TMPDIR** set to **/ |
| + | |||
| + | 4. By default, you are the only one seeing your data : If you are working as a team on these data, **please ask for a group creation** so we can add members in it and apply suitable permissions. | ||
| Line 25: | Line 37: | ||
| To avoid having everyone installing their libraries installed on the system or on their user directly on the physical servers, we need you to keep them cleanly packed in a container : That way you can both install what you want inside this container, and you can do it without needing any root priviledge on the server you are sharing with other researchers. | To avoid having everyone installing their libraries installed on the system or on their user directly on the physical servers, we need you to keep them cleanly packed in a container : That way you can both install what you want inside this container, and you can do it without needing any root priviledge on the server you are sharing with other researchers. | ||
| - | See [[infra: | + | **For examples, see : [[infra: |
| ===== Run your application via SLURM ===== | ===== Run your application via SLURM ===== | ||
| - | Now that you have your container ready in the Apptainer file format | + | To be able to run a job on the ISC Compute Center, you **MUST** run it under [[https:// |
| - | To run your job via SLURM you need to create a sbatch script : | + | **For examples, see : [[infra: |
| - | (Note: for now we don't have Modules or LMod installed, we might add it later : hence the module commands commented) | ||
| - | ==== Example for a serial job ==== | ||
| - | < | + | More information on our **[[infra: |
| - | # | + | ===== Storage considerations ===== |
| - | #SBATCH --job-name=application | + | |
| - | #SBATCH --nodes=1 # node count | + | |
| - | #SBATCH --ntasks=1 # total number of tasks across all nodes | + | |
| - | #SBATCH --cpus-per-task=1 # cpu-cores per task (>1 if multi-threaded tasks) | + | |
| - | #SBATCH --mem=4G # total memory per node (4 GB per cpu-core is default) | + | |
| - | #SBATCH --time=00: | + | |
| - | #SBATCH --mail-type=begin # send email when job begins | + | |
| - | #SBATCH --mail-type=end # send email when job ends | + | |
| - | #SBATCH --mail-user=email@domain.org | + | |
| - | #module purge | + | |
| - | apptainer run application.sif < | + | |
| - | </ | + | |
| + | ==== Filesystems structure ==== | ||
| - | ==== Example for a parallel MPI code ==== | + | On each server, your user is created with the following home directory : |
| - | < | + | ls -l /home/user.name |
| - | #!/bin/bash | + | |
| - | #SBATCH --job-name=solar | + | lrwxrwxrwx |
| - | #SBATCH --nodes=1 | + | |
| - | #SBATCH --ntasks=4 # total number of tasks across all nodes | + | lrwxrwxrwx |
| - | #SBATCH --cpus-per-task=1 | + | |
| - | #SBATCH --mem-per-cpu=4G | + | |
| - | #SBATCH --time=00:05:00 # total run time limit (HH: | + | |
| - | #SBATCH --mail-type=begin | + | |
| - | #SBATCH --mail-type=end | + | |
| - | #SBATCH --mail-user=email@domain.org | + | |
| - | #module purge | + | |
| - | #module load openmpi/gcc/4.1.2 | + | |
| - | srun apptainer exec solar.sif | + | |
| - | </code> | + | |
| + | * **.apptainer** is your cache directory for your containers, use '' | ||
| + | * **datasets** is your main directory for all your work material, do NOT use directly / | ||
| + | * **results** is located on a shared filesystem between all Slurm nodes to allow you to run jobs anywhere : as long as you write the output of your job in results, you will be able to access it whatever node the job had run on. | ||
| + | * **shared_datasets** is located on a shared filesystem between all Slurm nodes to allow you to run jobs anywhere : when your job needs to get the same data from several nodes, use this directory. **NOTE :** you will have less performances for fast reads/ | ||
| - | ==== Example using GPUs ==== | ||
| - | < | + | ==== Data retention |
| - | # | + | |
| - | #SBATCH --job-name=tensorflow | + | |
| - | #SBATCH --nodes=1 # node count | + | |
| - | #SBATCH --ntasks=1 # total number of tasks across all nodes | + | |
| - | #SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks) | + | |
| - | #SBATCH --mem-per-cpu=4G # memory per cpu-core (4G per cpu-core is default) | + | |
| - | #SBATCH --time=00: | + | |
| - | #SBATCH --gres=gpu:1 # number of gpus per node | + | |
| - | #SBATCH --mail-type=begin # send email when job begins | + | |
| - | #SBATCH --mail-type=end | + | |
| - | #SBATCH --mail-user=email@domain.org | + | |
| - | #module purge | + | |
| - | apptainer exec --nv ./ | + | |
| - | </ | + | |
| - | Note the **--nv** flag that allows | + | On the ISC Compute Center, |
| - | ==== Example | + | - **Local datasets :** Data life is short here, for now cleaning is not automated but will probably be in the future. Useful for a large volume of data to be processed on one server, and with the fastest I/O available. |
| + | - **Shared datasets and results :** Data life is short here, for now cleaning is not automated but will probably be in the future. Useful for a large volume of data to be processed on several servers, and with reasonable I/O. (with some network latency due to NFS) | ||
| + | - **Filer mount :** Data life is long, and backuped : this is where you can store data, results and other files for a longer time. By default you don't have a filer mount, it is the [[https:// | ||
| + | **NOTE :** Please note the filer storage is slow, it is not advised to run a job directly | ||
| - | Sharding is a generic way of SLURM to use fragments of a GPU for a job, leaving room for other researchers, | + | **TODO :** set auto-cleaning |
| - | < | ||
| - | #!/bin/bash | ||
| - | #SBATCH --partition=Disco | ||
| - | #SBATCH --job-name=tensorflow | ||
| - | #SBATCH --nodes=1 | ||
| - | #SBATCH --ntasks=1 | ||
| - | #SBATCH --cpus-per-task=4 | ||
| - | #SBATCH --mem-per-cpu=4G | ||
| - | #SBATCH --time=02: | ||
| - | #SBATCH --gres=shard: | ||
| - | #SBATCH --mail-type=begin | ||
| - | #SBATCH --mail-type=end | ||
| - | #SBATCH --mail-user=email@domain.org | ||
| - | #module purge | ||
| - | apptainer exec --nv ./ | ||
| - | </ | ||
| - | Note the **--nv** flag that allows you to use the GPU from your container without being root. Here, the partition has been requested to be specifically run on the Disco node, which has max 80 shards. On Chacha the limit is 96 shards. | ||
| - | ==== Execute your batch file ==== | + | ==== Quotas |
| + | - The root filesystem (/, including /home) for every researchers is 20GB for convenience. For students, this quota is lowered to 10GB to encourage proper infrastructure usage / coding with a lower threshold. | ||
| + | - On local and shared datasets, quota will be set on a case by case basis | ||
| - | Then you can run your sbatch script | + | ==== Cleaning ==== |
| + | - Users must regularly clean the Apptainer cache using '' | ||
| + | - Don't keep data directly on your / | ||
| + | - When you create new apptainer containers, the .sif files can be quite big : don't store them in / | ||
| - | sbatch ./ | ||
| ===== Good practice ===== | ===== Good practice ===== | ||
| - | ==== Storage | + | ==== Coding |
| - **Don' | - **Don' | ||
| * [[https:// | * [[https:// | ||
| Line 130: | Line 99: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| - | - Currently your vscode caches | + | - Currently your vscode caches |
| - | - Users must regularly clean the Apptainer cache using '' | + | |
| - | + | ||
| - | ==== Filesystems structure ==== | + | |
| - | + | ||
| - | On each server, your user is created with the following home directory : | + | |
| - | ls -l / | + | |
| - | lrwxrwxrwx | + | |
| - | drwx------ | + | |
| - | lrwxrwxrwx | + | |
| - | lrwxrwxrwx | + | |
| - | + | ||
| - | * **.apptainer** is your cache directory for your containers, use '' | + | |
| - | * **datasets** is your main directory for all your work material, do NOT use directly / | + | |
| - | * **results** is a shared filesystem between all Slurm nodes to allow you to run jobs anywhere : as long as you write the output of your job in results, you will be able to access it whatever node the job had run on. | + | |
| + | ==== Automation ==== | ||
| + | If you need to use Cron to schedule something, you need to ask for your user to be added to the / | ||
