Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:centro:servizos:hpc [2025/12/05 09:27] – edición externa 127.0.0.1 | en:centro:servizos:hpc [2025/12/05 10:04] (current) – [Using SLURM] fernando.guillen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== High Performance Computing Cluster (HPC) ctcomp3 ====== | + | ====== High-Performance Computing Cluster (HPC) ctcomp3 ====== |
| [[ https:// | [[ https:// | ||
| ===== Description ===== | ===== Description ===== | ||
| - | The cluster | + | The cluster |
| - | * 9 general computing | + | * 9 servers |
| - | * 1 "fat node" for jobs requiring a lot of memory. | + | * 1 "fat node" for memory-intensive tasks. |
| * 6 servers for GPU computing. | * 6 servers for GPU computing. | ||
| - | Users only have direct access to the login node, which has more limited | + | Users only have direct access to the login node, which has more limited |
| All nodes are interconnected by a 10Gb network. \\ | All nodes are interconnected by a 10Gb network. \\ | ||
| - | There is distributed storage accessible from all nodes with 220 TB capacity | + | There is distributed storage accessible from all nodes with a capacity of 220 TB connected |
| \\ | \\ | ||
| - | ^ Name | + | ^ Name ^ Model ^ Processor |
| - | | hpc-login2 | + | | hpc-login2 |
| - | | hpc-node[1-2] | + | | hpc-node[1-2] |
| - | | hpc-node[3-9] | + | | hpc-node[3-9] |
| - | | hpc-fat1 | + | | hpc-fat1 |
| - | | hpc-gpu[1-2] | + | | hpc-gpu[1-2] |
| - | | hpc-gpu3 | + | | hpc-gpu3 |
| - | | hpc-gpu4 | + | | hpc-gpu4 |
| + | | hpc-gpu5 | ||
| + | | hpc-gpu6 | ||
| ===== Connection to the system ===== | ===== Connection to the system ===== | ||
| - | To access the cluster, you must request it in advance through the [[https:// | + | To access the cluster, you must request it in advance through the [[https:// |
| - | Access is made via SSH to the login node (172.16.242.211): | + | Access is done via an SSH connection |
| <code bash> | <code bash> | ||
| ssh < | ssh < | ||
| Line 30: | Line 33: | ||
| ===== Storage, directories, | ===== Storage, directories, | ||
| - | <note warning> No backup is made of any of the file systems | + | <note warning> No backup is made of any of the cluster' |
| - | Users' HOME in the cluster is on the shared file system, so it is accessible from all nodes in the cluster. | + | Users' HOME on the cluster is on the shared file system, so it is accessible from all nodes in the cluster. |
| - | Each node has a local scratch partition of 1 TB, which is deleted | + | Each node has a local scratch partition of 1 TB, which is deleted |
| - | For data that needs to be shared | + | For data that must be shared |
| - | ^ Directory | + | ^ Directory |
| | Home | %%$HOME%% | | Home | %%$HOME%% | ||
| | Local Scratch | | Local Scratch | ||
| | Group Folder | | Group Folder | ||
| - | %%* storage is shared%% | + | %%* storage is shared%% |
| === IMPORTANT NOTICE === | === IMPORTANT NOTICE === | ||
| - | The shared file system | + | The shared file system |
| * Create the image file in your home: | * Create the image file in your home: | ||
| <code bash> | <code bash> | ||
| Line 46: | Line 49: | ||
| truncate example.ext4 -s 20G | truncate example.ext4 -s 20G | ||
| </ | </ | ||
| - | * Create a file system | + | * Create a file system |
| <code bash> | <code bash> | ||
| ## mkfs.ext4 -T small -m 0 image.name | ## mkfs.ext4 -T small -m 0 image.name | ||
| ## -T small optimized options for small files | ## -T small optimized options for small files | ||
| - | ## -m 0 Do not reserve | + | ## -m 0 No space reserved |
| mkfs.ext4 -T small -m 0 example.ext4 | mkfs.ext4 -T small -m 0 example.ext4 | ||
| </ | </ | ||
| * Mount the image (using SUDO) with the script | * Mount the image (using SUDO) with the script | ||
| <code bash> | <code bash> | ||
| - | ## By default, it will be mounted | + | ## By default, it is mounted |
| sudo mount_image.py example.ext4 | sudo mount_image.py example.ext4 | ||
| </ | </ | ||
| Line 65: | Line 68: | ||
| The file can only be mounted from a single node if done in readwrite mode, but can be mounted from any number of nodes in readonly mode. | The file can only be mounted from a single node if done in readwrite mode, but can be mounted from any number of nodes in readonly mode. | ||
| </ | </ | ||
| - | The mount script has the following | + | The mount script has these options: |
| < | < | ||
| - | --mount-point path < | + | --mount-point path < |
| - | --rw <-- (optional) By default, it is mounted readonly; with this option, it is mounted readwrite. | + | --rw <-- (optional) By default, it is mounted readonly, with this option, it is mounted readwrite. |
| </ | </ | ||
| - | The unmount script has the following | + | The unmount script has these options: |
| - | < | + | < |
| --mount-point | --mount-point | ||
| </ | </ | ||
| - | ===== File and Data Transfer | + | ===== File and data transfer |
| === SCP === | === SCP === | ||
| From your local machine to the cluster: | From your local machine to the cluster: | ||
| Line 84: | Line 87: | ||
| scp filename < | scp filename < | ||
| </ | </ | ||
| - | [[https:// | + | [[https:// |
| === SFTP === | === SFTP === | ||
| - | To transfer multiple files or to navigate | + | To transfer multiple files or to navigate the file system. |
| <code bash> | <code bash> | ||
| < | < | ||
| Line 96: | Line 99: | ||
| sftp> quit | sftp> quit | ||
| </ | </ | ||
| - | [[https:// | + | [[https:// |
| === RSYNC === | === RSYNC === | ||
| [[ https:// | [[ https:// | ||
| === SSHFS === | === SSHFS === | ||
| Requires installation of the sshfs package.\\ | Requires installation of the sshfs package.\\ | ||
| - | Allows, for example, to mount the user's home from hpc-login2: | + | Allows, for example, to mount the user's home on hpc-login2: |
| <code bash> | <code bash> | ||
| ## Mount | ## Mount | ||
| Line 108: | Line 111: | ||
| fusermount -u < | fusermount -u < | ||
| </ | </ | ||
| - | [[https:// | + | [[https:// |
| ===== Available Software ===== | ===== Available Software ===== | ||
| - | All nodes have the basic software installed by default with AlmaLinux 8.4, particularly: | + | All nodes have the basic software |
| * GCC 8.5.0 | * GCC 8.5.0 | ||
| * Python 3.6.8 | * Python 3.6.8 | ||
| * Perl 5.26.3 | * Perl 5.26.3 | ||
| - | On GPU nodes, additionally: | + | On the nodes with GPU, additionally: |
| - | * nVidia Driver | + | * nVidia Driver |
| * CUDA 11.6 | * CUDA 11.6 | ||
| * libcudnn 8.7 | * libcudnn 8.7 | ||
| - | To use any other software not installed | + | To use any other software not installed |
| - | - Use Modules with the already installed | + | - Use Modules with the modules that are already installed (or request the installation of a new module if it is not available) |
| - Use a container (uDocker or Apptainer/ | - Use a container (uDocker or Apptainer/ | ||
| - Use Conda | - Use Conda | ||
| - | A module is the simplest solution to use software without modifications or dependencies | + | A module is the simplest solution to use software without modifications or difficult |
| - | A container is ideal when the dependencies are complicated and/or the software is highly customized. It is also the best solution if what you seek is reproducibility, | + | A container is ideal when dependencies are complicated and/or the software is highly customized. It is also the best solution if the goal is reproducibility, |
| - | Conda is the best solution if you need the latest version of a library or program or packages not available otherwise.\\ | + | Conda is the best solution if what is needed is the latest version of a library or program or packages not available otherwise.\\ |
| Line 139: | Line 142: | ||
| # View loaded modules in your environment: | # View loaded modules in your environment: | ||
| module list | module list | ||
| - | # ml can be used as an abbreviation for the command | + | # Can use ml as an abbreviation for the module |
| ml avail | ml avail | ||
| - | # To obtain | + | # To get information about a module: |
| ml spider < | ml spider < | ||
| </ | </ | ||
| - | ==== Running | + | |
| + | |||
| + | ==== Running | ||
| === uDocker ==== | === uDocker ==== | ||
| [[ https:// | [[ https:// | ||
| Line 154: | Line 159: | ||
| === Apptainer/ | === Apptainer/ | ||
| - | [[ https://sylabs.io/guides/3.8/ | + | [[ https://apptainer.org/docs/user/1.4/ | Apptainer Documentation ]] \\ |
| - | Apptainer/ | + | Apptainer is installed on the system of each node, so nothing needs to be done to use it. |
| ==== CONDA ==== | ==== CONDA ==== | ||
| [[ https:// | [[ https:// | ||
| - | Miniconda is the minimal | + | Miniconda is the minimum |
| <code bash> | <code bash> | ||
| # Get miniconda | # Get miniconda | ||
| Line 169: | Line 175: | ||
| </ | </ | ||
| ===== Using SLURM ===== | ===== Using SLURM ===== | ||
| - | The queue manager in the cluster is [[ https:// | + | The job manager in the cluster is [[ https:// |
| - | <note tip>The term CPU identifies | + | <note tip>The term CPU refers to a physical core of a socket. Hyperthreading is disabled, so each node has as many CPUs available |
| == Available Resources == | == Available Resources == | ||
| <code bash> | <code bash> | ||
| - | hpc-login2 ~]# check_status.sh | + | hpc-login2 ~]# ver_estado.sh |
| ============================================================================================================= | ============================================================================================================= | ||
| - | NODE STATE CORES IN USE | + | NODE STATUS |
| ============================================================================================================= | ============================================================================================================= | ||
| | | ||
| Line 182: | Line 188: | ||
| | | ||
| | | ||
| + | | ||
| + | | ||
| | | ||
| | | ||
| Line 192: | Line 200: | ||
| | | ||
| ============================================================================================================= | ============================================================================================================= | ||
| - | TOTAL: [Cores : 3/688] [Mem(MB): 270000/ | + | TOTALS: [Cores : 3/688] [Mem(MB): 270000/ |
| hpc-login2 ~]$ sinfo -e -o " | hpc-login2 ~]$ sinfo -e -o " | ||
| # There is an alias for this command: | # There is an alias for this command: | ||
| - | hpc-login2 ~]$ check_resources | + | hpc-login2 ~]$ ver_recursos |
| NODELIST | NODELIST | ||
| hpc-fat1 | hpc-fat1 | ||
| hpc-gpu[1-2] | hpc-gpu[1-2] | ||
| hpc-gpu3 | hpc-gpu3 | ||
| - | hpc-gpu4 | + | hpc-gpu4 |
| + | hpc-gpu[5-6] | ||
| hpc-node[1-2] | hpc-node[1-2] | ||
| hpc-node[3-9] | hpc-node[3-9] | ||
| - | # To view current resource usage: (CPUS (Allocated/ | + | # To see current resource usage: (CPUS (Allocated/ |
| hpc-login2 ~]$ sinfo -N -r -O NodeList, | hpc-login2 ~]$ sinfo -N -r -O NodeList, | ||
| # There is an alias for this command: | # There is an alias for this command: | ||
| - | hpc-login2 ~]$ check_usage | + | hpc-login2 ~]$ ver_uso |
| NODELIST | NODELIST | ||
| hpc-fat1 | hpc-fat1 | ||
| + | hpc-gpu1 | ||
| + | hpc-gpu2 | ||
| hpc-gpu3 | hpc-gpu3 | ||
| hpc-gpu4 | hpc-gpu4 | ||
| + | hpc-gpu5 | ||
| + | hpc-gpu6 | ||
| hpc-node1 | hpc-node1 | ||
| hpc-node2 | hpc-node2 | ||
| Line 226: | Line 239: | ||
| A node is the computing unit of SLURM and corresponds to a physical server. | A node is the computing unit of SLURM and corresponds to a physical server. | ||
| <code bash> | <code bash> | ||
| - | # Show information about a node: | + | # Show node information: |
| hpc-login2 ~]$ scontrol show node hpc-node1 | hpc-login2 ~]$ scontrol show node hpc-node1 | ||
| NodeName=hpc-node1 Arch=x86_64 CoresPerSocket=18 | NodeName=hpc-node1 Arch=x86_64 CoresPerSocket=18 | ||
| Line 247: | Line 260: | ||
| </ | </ | ||
| ==== Partitions ==== | ==== Partitions ==== | ||
| - | Partitions in SLURM are logical groups of nodes. | + | Partitions in SLURM are logical groups of nodes. |
| <code bash> | <code bash> | ||
| - | # Show information | + | # Show partition |
| hpc-login2 ~]$ sinfo | hpc-login2 ~]$ sinfo | ||
| defaultPartition* | defaultPartition* | ||
| - | # When ctgpgpu7 and 8 are added to the cluster, they will appear as nodes hpc-gpu1 and 2 respectively. | + | # When ctgpgpu7 and 8 are incorporated into the cluster, they will appear as nodes hpc-gpu1 and 2 respectively. |
| </ | </ | ||
| ==== Jobs ==== | ==== Jobs ==== | ||
| - | Jobs in SLURM are resource assignments | + | Jobs in SLURM are resources allocations |
| - | A job (JOB) consists of one or more steps (STEPS), each consisting of one or more tasks (TASKS) that use one or more CPUs. There is one STEP for each program that runs sequentially in a JOB and one TASK for each program that runs in parallel. Therefore, in the simplest case, such as launching a job consisting of executing the hostname | + | A job (JOB) consists of one or more steps (STEPS), each consisting of one or more tasks (TASKS) that use one or more CPUs. There is one STEP for each program that is executed |
| ==== Queue System (QOS) ==== | ==== Queue System (QOS) ==== | ||
| The queue to which each job is sent defines the priority, limits, and also the " | The queue to which each job is sent defines the priority, limits, and also the " | ||
| <code bash> | <code bash> | ||
| - | # Show the queues | + | # Show queues |
| hpc-login2 ~]$ sacctmgr show qos | hpc-login2 ~]$ sacctmgr show qos | ||
| # There is an alias that shows only the most relevant information: | # There is an alias that shows only the most relevant information: | ||
| - | hpc-login2 ~]$ check_queues | + | hpc-login2 ~]$ show_queues |
| Name | Name | ||
| ---------- ---------- ------------------------------ ----------- -------------------- --------- ----------- | ---------- ---------- ------------------------------ ----------- -------------------- --------- ----------- | ||
| Line 277: | Line 290: | ||
| </ | </ | ||
| # Priority: is the relative priority of each queue. \\ | # Priority: is the relative priority of each queue. \\ | ||
| - | # DenyonLimit: the job does not run if it does not meet the queue limits. \\ | + | # DenyLimit: the job does not execute |
| - | # UsageFactor: | + | # UsageFactor: |
| - | # MaxTRES: limits per job. \\ | + | # MaxTRES: |
| - | # MaxWall: maximum time a job can run. \\ | + | # MaxWall: maximum time that the job can run \\ |
| - | # MaxTRESPU: global limits per user. \\ | + | # MaxTRESPU: global limits per user \\ |
| - | # MaxJobsPU: Maximum number of jobs a user can have running. \\ | + | # MaxJobsPU: Maximum number of jobs that a user can have running. \\ |
| - | # MaxSubmitPU: | + | # MaxSubmitPU: |
| ==== Submitting a job to the queue system ==== | ==== Submitting a job to the queue system ==== | ||
| == Resource Specification == | == Resource Specification == | ||
| - | By default, if a job is submitted without specifying anything, the system sends it to the default QOS (regular) and assigns | + | By default, if a job is submitted without specifying anything, the system sends it to the default QOS (regular) and assigns a node, one CPU, and 4 GB of RAM. The time limit for job execution is that of the queue (4 days and 4 hours). |
| - | This is very inefficient; | + | This is very inefficient; |
| - %%The number of nodes (-N or --nodes), tasks (-n or --ntasks), and/or CPUs per task (-c or --cpus-per-task).%% | - %%The number of nodes (-N or --nodes), tasks (-n or --ntasks), and/or CPUs per task (-c or --cpus-per-task).%% | ||
| - | - %%The memory (--mem) per node or the memory per CPU (--mem-per-cpu).%% | + | - %%The memory (--mem) per node or memory per CPU (--mem-per-cpu).%% |
| - %%The estimated execution time of the job (--time)%% | - %%The estimated execution time of the job (--time)%% | ||
| Line 296: | Line 309: | ||
| | -J | | -J | ||
| | -q | | -q | ||
| - | | -o | + | | -o |
| | | | | ||
| - | | -C | + | | -C |
| | | %%--exclusive%% | | | %%--exclusive%% | ||
| - | | -w | %%--nodelist%% | + | | -w | %%--nodelist%% |
| - | == How resources are allocated | + | == How resources are assigned |
| - | By default, the resource | + | By default, the allocation method |
| == Calculating priority == | == Calculating priority == | ||
| - | When a job is submitted | + | When a job is sent to the queue system, the first thing that happens is that it checks |
| - | If resources are available, the job runs immediately, but if not, it is queued. Each job has an assigned priority that determines the order in which jobs in the queue are executed | + | If resources are available, the job executes directly, but if not, it gets queued. Each job has an assigned priority that determines the order in which jobs are executed |
| - | The fair share is a dynamic calculation | + | The fair share is a dynamic calculation |
| <code bash> | <code bash> | ||
| hpc-login2 ~]$ sshare -l | hpc-login2 ~]$ sshare -l | ||
| Line 317: | Line 330: | ||
| user_name | user_name | ||
| </ | </ | ||
| - | # RawShares: is the amount | + | # RawShares: is the quantity |
| - | # NormShares: Is the previous amount normalized to the total assigned | + | # NormShares: Is the previous amount normalized to the total allocated |
| - | # RawUsage: Is the amount | + | # RawUsage: Is the number |
| - | # NormUsage: | + | # NormUsage: |
| - | # FairShare: The FairShare factor between 0 and 1. The more the cluster is used, the closer it will be to 0 and the lower the priority.\\ | + | # FairShare: The FairShare factor between 0 and 1. The more the cluster is used, the closer it will approach |
| == Submitting jobs == | == Submitting jobs == | ||
| Line 349: | Line 362: | ||
| </ | </ | ||
| 2. SALLOC \\ | 2. SALLOC \\ | ||
| - | Used to immediately | + | Used to obtain |
| <code bash> | <code bash> | ||
| - | # Get 5 nodes and launch a job. | + | # Obtain |
| hpc-login2 ~]$ salloc -N5 myprogram | hpc-login2 ~]$ salloc -N5 myprogram | ||
| - | # Get interactive access to a node (Press Ctrl+D to end access): | + | # Obtain |
| hpc-login2 ~]$ salloc -N1 | hpc-login2 ~]$ salloc -N1 | ||
| - | # Get exclusive interactive access to a node | + | # Obtain |
| hpc-login2 ~]$ salloc -N1 --exclusive | hpc-login2 ~]$ salloc -N1 --exclusive | ||
| </ | </ | ||
| 3. SRUN \\ | 3. SRUN \\ | ||
| - | Used to launch a parallel job (it is preferable to using mpirun). It is interactive and blocking. | + | Used to launch a parallel job (it is preferable to use mpirun). It is interactive and blocking. |
| <code bash> | <code bash> | ||
| # Launch a hostname on 2 nodes | # Launch a hostname on 2 nodes | ||
| Line 369: | Line 382: | ||
| ==== Using nodes with GPU ==== | ==== Using nodes with GPU ==== | ||
| - | To specifically request | + | To specifically request |
| | %%--gres%% | | %%--gres%% | ||
| | %%--gpus or -G%% | Request for GPUs by JOB | %%--gpus=[type]: | | %%--gpus or -G%% | Request for GPUs by JOB | %%--gpus=[type]: | ||
| - | There are also options %% --gpus-per-socket, | + | There are also the options %% --gpus-per-socket, |
| Examples: | Examples: | ||
| <code bash> | <code bash> | ||
| ## View the list of nodes and GPUs: | ## View the list of nodes and GPUs: | ||
| - | hpc-login2 ~]$ check_resources | + | hpc-login2 ~]$ show_resources |
| - | ## Request 2 arbitrary | + | ## Request 2 any GPUs for a JOB, add: |
| --gpus=2 | --gpus=2 | ||
| ## Request one A100 of 40G on one node and one A100 of 80G on another, add: | ## Request one A100 of 40G on one node and one A100 of 80G on another, add: | ||
| Line 384: | Line 397: | ||
| - | ==== Monitoring | + | ==== Monitoring |
| <code bash> | <code bash> | ||
| - | ## List all jobs in the queue | + | ## Listing |
| hpc-login2 ~]$ squeue | hpc-login2 ~]$ squeue | ||
| - | ## List the jobs of a user | + | ## Listing |
| hpc-login2 ~]$ squeue -u < | hpc-login2 ~]$ squeue -u < | ||
| ## Cancel a job: | ## Cancel a job: | ||
| Line 394: | Line 407: | ||
| ## List recent jobs | ## List recent jobs | ||
| hpc-login2 ~]$ sacct -b | hpc-login2 ~]$ sacct -b | ||
| - | ## Detailed historical information | + | ## Detailed historical information |
| hpc-login2 ~]$ sacct -l -j < | hpc-login2 ~]$ sacct -l -j < | ||
| - | ## Debug information | + | ## Debug information |
| hpc-login2 ~]$ scontrol show jobid -dd < | hpc-login2 ~]$ scontrol show jobid -dd < | ||
| ## View resource usage of a running job: | ## View resource usage of a running job: | ||
| Line 402: | Line 415: | ||
| </ | </ | ||
| - | ==== Controlling | + | ==== Controlling |
| - | == Exit Codes == | + | == Exit codes == |
| By default, these are the exit codes of the commands: | By default, these are the exit codes of the commands: | ||
| ^ SLURM command | ^ SLURM command | ||
| - | | salloc | + | | salloc |
| - | | srun | The highest among all executed | + | | srun | The highest among all tasks executed |
| - | | sbatch | + | | sbatch |
| == STDIN, STDOUT, and STDERR == | == STDIN, STDOUT, and STDERR == | ||
| Line 418: | Line 431: | ||
| And the options are: | And the options are: | ||
| * //all//: default option. | * //all//: default option. | ||
| - | * // | + | * // |
| * //taskid//: Only redirects from/to the specified TASK id. | * //taskid//: Only redirects from/to the specified TASK id. | ||
| * // | * // | ||
| - | * //filename pattern//: | + | * //filename pattern//: |
| **SBATCH: | **SBATCH: | ||
| - | By default "/ | + | By default, "/ |
| | %%-i, --input=< | | %%-i, --input=< | ||
| | %%-o, --output=< | | %%-o, --output=< | ||
| | %%-e, --error=< | | %%-e, --error=< | ||
| - | The filename_pattern | + | The reference |
| - | ==== Sending | + | ==== Sending |
| Jobs can be configured to send emails under certain circumstances using these two parameters (**BOTH ARE REQUIRED**): | Jobs can be configured to send emails under certain circumstances using these two parameters (**BOTH ARE REQUIRED**): | ||
| | %%--mail-type=< | | %%--mail-type=< | ||
| Line 437: | Line 450: | ||
| - | ==== Job States | + | ==== Job statuses |
| <code bash> | <code bash> | ||
| hpc-login2 ~]# squeue -l | hpc-login2 ~]# squeue -l | ||
| Line 443: | Line 456: | ||
| 6547 defaultPa | 6547 defaultPa | ||
| - | ## View the usage state of the cluster's queues: | + | ## Check queue usage status |
| - | hpc-login2 ~]$ check_queues_status.sh | + | hpc-login2 ~]$ queue_status.sh |
| JOBS PER USER: | JOBS PER USER: | ||
| -------------- | -------------- | ||
| Line 468: | Line 481: | ||
| * PD PENDING Job is awaiting resource allocation. | * PD PENDING Job is awaiting resource allocation. | ||
| - | [[ https:// | + | [[ https:// |
| - | If a job is not running, a reason | + | If a job is not running, |