Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:centro:servizos:hpc [2022/06/30 13:08] fernando.guillenen:centro:servizos:hpc [2024/03/13 10:37] (current) – [Sending a job to the queue system] fernando.guillen
Line 1: Line 1:
 ====== High Performance Computing (HPC) cluster ctcomp3  ====== ====== High Performance Computing (HPC) cluster ctcomp3  ======
-[[ https://web.microsoftstream.com/video/f5eba154-b597-4440-9307-3befd7597d78 | Video de la presentación del servicio (7/3/22) (Spanish only) ]]+[[ https://web.microsoftstream.com/video/f5eba154-b597-4440-9307-3befd7597d78 | Video of the presentation of the service (7/3/22) (Spanish only) ]]
 ===== Description ===== ===== Description =====
  
Line 18: Line 18:
 |  hpc-node[3-9]              Dell R740    2 x Intel Xeon Gold 5220R @2,2 GHz (24c)        192 GB    -                           | |  hpc-node[3-9]              Dell R740    2 x Intel Xeon Gold 5220R @2,2 GHz (24c)        192 GB    -                           |
 |  hpc-fat1                  |  Dell R840    4 x Xeon Gold 6248 @ 2.50GHz (20c)              1 TB      -                           | |  hpc-fat1                  |  Dell R840    4 x Xeon Gold 6248 @ 2.50GHz (20c)              1 TB      -                           |
-|  <del>hpc-gpu1</del> |  Dell R740   |  x Intel Xeon Gold 5220 CPU @ 2.20GHz (18c)    192 GB    2x Nvidia Tesla V100S       | +|  hpc-gpu[1-2  Dell R740    2 x Intel Xeon Gold 5220 CPU @ 2.20GHz (18c)    192 GB    2x Nvidia Tesla V100S       |
-|  hpc-gpu2   Dell R740    2 x Intel Xeon Gold 5220 CPU @ 2.20GHz (18c)    192 GB    2x Nvidia Tesla V100S       |+
 |  hpc-gpu3                  |  Dell R7525  |  2 x AMD EPYC 7543 @2,80 GHz (32c)              |  256 GB    2x Nvidia Ampere A100 40GB  | |  hpc-gpu3                  |  Dell R7525  |  2 x AMD EPYC 7543 @2,80 GHz (32c)              |  256 GB    2x Nvidia Ampere A100 40GB  |
 |  hpc-gpu4                  |  Dell R7525  |  2 x AMD EPYC 7543 @2,80 GHz (32c)              |  256 GB    1x Nvidia Ampere A100 80GB  | |  hpc-gpu4                  |  Dell R7525  |  2 x AMD EPYC 7543 @2,80 GHz (32c)              |  256 GB    1x Nvidia Ampere A100 80GB  |
-* Now ctgpgpu8. It will be integrated in the cluster soon. + 
-===== Accessing the system =====+===== Accessing the cluster =====
 To access the cluster, access must be requested in advance via [[https://citius.usc.es/uxitic/incidencias/add|incident form]]. Users who do not have access permission will receive an "incorrect password" message. To access the cluster, access must be requested in advance via [[https://citius.usc.es/uxitic/incidencias/add|incident form]]. Users who do not have access permission will receive an "incorrect password" message.
  
Line 114: Line 113:
   * Python 3.6.8   * Python 3.6.8
   * Perl 5.26.3   * Perl 5.26.3
 +GPU nodes, in addition: 
 +  * nVidia Driver 510.47.03 
 +  * CUDA 11.6 
 +  * libcudnn 8.7
 To use any other software not installed on the system or another version of the system, there are three options: To use any other software not installed on the system or another version of the system, there are three options:
   - Use Modules with the modules that are already installed (or request the installation of a new module if it is not available).   - Use Modules with the modules that are already installed (or request the installation of a new module if it is not available).
Line 143: Line 145:
 === uDocker ==== === uDocker ====
 [[ https://indigo-dc.gitbook.io/udocker/user_manual | uDocker manual ]] \\ [[ https://indigo-dc.gitbook.io/udocker/user_manual | uDocker manual ]] \\
-uDocker está instalado como un móduloasí que es necesario cargarlo en el entorno:+udocker is installed as a moduleso it needs to be loaded into the environment:
 <code bash> <code bash>
 ml uDocker ml uDocker
Line 149: Line 151:
  
 === Apptainer/Singularity === === Apptainer/Singularity ===
-[[ https://sylabs.io/guides/3.8/user-guide/Documentacion de Apptainer/Singularity ]] \\ +[[ https://sylabs.io/guides/3.8/user-guide/ | Apptainer/Singularity documentation]] \\ 
-Apptainer/Singularity está instalado en el sistema de cada nodopor lo que no es necesario hacer nada para usarlo.+Apptainer/Singularity is installed on each node's systemso you don't need to do anything to use it.
  
  
 ==== CONDA ==== ==== CONDA ====
-[[ https://docs.conda.io/en/latest/miniconda.html | Documentacion de Conda ]] \\ +[[ https://docs.conda.io/en/latest/miniconda.html | Conda Documentation ]] \\ 
-Miniconda es la versíon mínima de Anaconda y solo incluye el gestor de entornos conda, Python y unos pocos paquetes necesariosA partir de ahí cada usuario solo descarga e instala los paquetes que necesita.+Miniconda is the minimal version of Anaconda and only includes the conda environment manager, Python and a few necessary packagesFrom there on, each user only downloads and installs the packages they need.
 <code bash> <code bash>
-Obtener miniconda+Getting miniconda
 wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh
-Instalarlo +Install 
 sh Miniconda3-py39_4.11.0-Linux-x86_64.sh sh Miniconda3-py39_4.11.0-Linux-x86_64.sh
 +#  Initialize for bash shell
 +~/miniconda3/bin/conda init bash
 </code> </code>
  
-===== Uso de SLURM ===== +===== Using SLURM ===== 
-El gestor de colas en el cluster es [[ https://slurm.schedmd.com/documentation.html | SLURM ]]. \\ +The cluster queue manager is[[ https://slurm.schedmd.com/documentation.html | SLURM ]]. \\ 
-<note tip>El término CPU identifica un core físico de un socket. El hyperthreading está desactivadopor lo que cada nodo tiene disponibles tantas CPU como (nº sockets) * (nº cores físico por socket) tenga.</note> +<note tip>The term CPU identifies physical core in a socket. Hyperthreading is disabledso each node has as many CPUs available as (number of sockets) * (number of physical cores per socket) it has.</note> 
-== Recursos disponibles ==+== Available resources ==
 <code bash> <code bash>
 +hpc-login2 ~]# ver_estado.sh
 +=============================================================================================================
 +  NODO     ESTADO                        CORES EN USO                           USO MEM     GPUS(Uso/Total)
 +=============================================================================================================
 + hpc-fat1    up   0%[--------------------------------------------------]( 0/80) RAM:  0%     ---
 + hpc-gpu1    up   2%[||------------------------------------------------]( 1/36) RAM: 47%   V100S (1/2)
 + hpc-gpu2    up   2%[||------------------------------------------------]( 1/36) RAM: 47%   V100S (1/2)
 + hpc-gpu3    up   0%[--------------------------------------------------]( 0/64) RAM:  0%   A100_40 (0/2)
 + hpc-gpu4    up   1%[|-------------------------------------------------]( 1/64) RAM: 35%   A100_80 (1/1)
 + hpc-node1   up   0%[--------------------------------------------------]( 0/36) RAM:  0%     ---
 + hpc-node2   up   0%[--------------------------------------------------]( 0/36) RAM:  0%     ---
 + hpc-node3   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node4   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node5   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node6   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node7   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node8   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 + hpc-node9   up   0%[--------------------------------------------------]( 0/48) RAM:  0%     ---
 +=============================================================================================================
 +TOTALES: [Cores : 3/688] [Mem(MB): 270000/3598464] [GPU: 3/ 7]
 hpc-login2 ~]$ sinfo -e -o "%30N  %20c  %20m  %20f  %30G " --sort=N hpc-login2 ~]$ sinfo -e -o "%30N  %20c  %20m  %20f  %30G " --sort=N
-Hay un alias para este comando:+There is an alias for that command:
 hpc-login2 ~]$ ver_recursos hpc-login2 ~]$ ver_recursos
 NODELIST                        CPUS                  MEMORY                AVAIL_FEATURES        GRES                            NODELIST                        CPUS                  MEMORY                AVAIL_FEATURES        GRES                           
Line 179: Line 203:
 hpc-node[3-9]                   48                    187645                cpu_intel             (null) hpc-node[3-9]                   48                    187645                cpu_intel             (null)
  
-Para ver el uso actual de los recursos: (CPUS (Allocated/Idle/Other/Total))+To see current resource use: (CPUS (Allocated/Idle/Other/Total))
 hpc-login2 ~]$ sinfo -N -r -O NodeList,CPUsState,Memory,FreeMem,Gres,GresUsed hpc-login2 ~]$ sinfo -N -r -O NodeList,CPUsState,Memory,FreeMem,Gres,GresUsed
-Hay un alias para este comando:+There is an alias for that command:
 hpc-login2 ~]$ ver_uso hpc-login2 ~]$ ver_uso
 NODELIST            CPUS(A/I/O/T)       MEMORY              FREE_MEM            GRES                GRES_USED NODELIST            CPUS(A/I/O/T)       MEMORY              FREE_MEM            GRES                GRES_USED
Line 197: Line 221:
 hpc-node9           36/12/0/48          187645              127312              (null)              gpu:0,mps:0 hpc-node9           36/12/0/48          187645              127312              (null)              gpu:0,mps:0
 </code> </code>
-==== Nodos ==== +==== Nodes ==== 
-Un nodo es la unidad de computación de SLURM, y se corresponde con un servidor físico.+A node is SLURM's computation unit and corresponds to a physical server.
 <code bash> <code bash>
-Mostrar la información de un nodo:+Show node info:
 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 220: Line 244:
    ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s    ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s
 </code> </code>
-==== Particiones ==== +==== Partitions ==== 
-Las particiones en SLURM son grupos lógicos de nodosEn el cluster hay una única partición la que pertenecen todos los nodospor lo que no es necesario especificarla a la hora de enviar trabajos.+Partitions in SLURM are logical groups of nodesIn the cluster there is single partition to which all nodes belongso it is not necessary to specify it when submitting jobs.
 <code bash> <code bash>
-Mostrar la información de las particiones:+Show partition info:
 hpc-login2 ~]$ sinfo hpc-login2 ~]$ sinfo
-defaultPartition*    up   infinite     11   idle hpc-fat1,hpc-gpu[3-4],hpc-node[1-9] +defaultPartition*    up   infinite     11   idle hpc-fat1,hpc-gpu[1-4],hpc-node[1-9]
-# Cuando se incorporen al cluster ctgpgpu7 y 8 apareceran como los nodos hpc-gpu1 y 2 respectivamente.+
 </code> </code>
-==== Trabajos ==== +==== Jobs ==== 
-Los trabajos en SLURM son asignaciones de recursos un usuario durante un tiempo determinadoLos trabajos se identifican por un número correlativo o JOBID. \\ +Jobs in SLURM are resource allocations to user for a given timeJobs are identified by a sequential number or JOBID. \\ 
-Un trabajo (JOB) consiste en uno o más pasos (STEPS)cada uno consistente en una o más tareas (TASKS) que usan una o más CPUHay un STEP por cada programa que se ejecute de forma secuencial en un JOB y hay un TASK por cada programa que se ejecute en paraleloPor lo tanto en el caso más simple como por ejemplo lanzar un trabajo consistente en ejecutar el comando hostname el JOB tiene un único STEP y una única TASK.+JOB consists of one or more STEPS, each consisting of one or more TASKS that use one or more CPUsThere is one STEP for each program that executes sequentially in a JOB and there is one TASK for each program that executes in parallelTherefore in the simplest case such as launching a job consisting of executing the hostname command the JOB has a single STEP and a single TASK.
  
-==== Sistema de colas (QOS) ==== +==== Queue system (QOS) ==== 
-La cola a la que se envíe cada trabajo define la prioridad,los límites y también el "costerelativo para el usuario.+The queue to which each job is submitted defines the prioritythe limits and also the relative "costto the user.
 <code bash> <code bash>
-Mostrar las colas+Show queues
 hpc-login2 ~]$ sacctmgr show qos hpc-login2 ~]$ sacctmgr show qos
-Hay un alias que muestra solo la información más relevante:+There is an alias that shows only the relevant info:
 hpc-login2 ~]$ ver_colas hpc-login2 ~]$ ver_colas
-      Name   Priority           Flags UsageFactor                     MaxTRES     MaxWall     MaxTRESPU MaxJobsPU MaxSubmitPU  +      Name    Priority                                  MaxTRES     MaxWall            MaxTRESPU MaxJobsPU MaxSubmitPU  
----------- ---------- --------------- ----------- --------------------------- ----------- ------------- --------- -----------  +----------  ---------- ---------------------------------------- ----------- -------------------- --------- -----------  
-   regular        100     DenyOnLimit    1.000000   cpu=200,gres/gpu=1,node=4  4-04:00:00                      10          50  +   regular         100                cpu=200,gres/gpu=1,node=4  4-04:00:00       cpu=200,node=4        10          50  
-interactive       200     DenyOnLimit    1.000000                      node=1    04:00:00        node=1                   1  +interactive        200                                   node=1    04:00:00               node=1                   1  
-    urgent        300     DenyOnLimit    2.000000           gres/gpu=1,node=1    04:00:00        cpu=36                  15  +    urgent         300                        gres/gpu=1,node=1    04:00:00               cpu=36                  15  
-      long        100     DenyOnLimit    1.000000           gres/gpu=1,node=4  8-08:00:00                                      +      long         100                        gres/gpu=1,node=4  8-04:00:00                                         
-     large        100     DenyOnLimit    1.000000          cpu=200,gres/gpu=2  4-04:00:00                      10          25  +     large         100                       cpu=200,gres/gpu=2  4-04:00:00                                       10  
-     admin        500                    0.000000 +     admin         500                                                                                                  
 +     small         150                             cpu=6,node=2    04:00:00              cpu=400        40         100 
 </code> </code>
-# Priority: es la prioridad relativa de cada cola. \\ +# Priority: is the relative priority of each queue. \\ 
-# DenyonLimit: el trabajo no se ejecuta si no cumple los límites de la cola \\ +# DenyonLimit: job will not be executed if it doesn't comply with the queue limits \\ 
-# UsageFactor: el coste relativo para el usuario de ejecutar un trabajo en esa cola \\ +# UsageFactor: relive cost for the user to execute jobs on that queue \\ 
-# MaxTRES: límites por cada trabajo \\ +# MaxTRES: limnits applied to each job \\ 
-# MaxWall: tiempo máximo que puede estar el trabajo en ejecución \\ +# MaxWall: maximum time the job can run \\ 
-# MaxTRESPU: límites globales por usuario \\ +# MaxTRESPU: global limits per user \\ 
-# MaxJobsPU: Número máximo de trabajos que un usuario puede tener en ejecución. \\ +# MaxJobsPU: Maximum number of jobs a user can have running simultaneously. \\ 
-# MaxSubmitPU: Número máximo de trabajos que un usuario puede tener en total encolados y en ejecucuón.\\+# MaxSubmitPU: Maximum number of jobs that a user can have in total both queued and running.\\
    
-==== Envío de un trabajo al sistema de colas ==== +==== Sending a job to the queue system ==== 
-== Especificación de recursos == +== Requesting resources == 
-Por defectosi se envía un trabajo sin especificar nada el sistema lo envia la QOS por defecto (regular) y le asigna un nodouna CPU y toda la memoria disponibleEl límite de tiempo para la ejecución del trabajo es el de la cola (4 días y horas).  +By defaultif you submit job without specifying anything, the system submits it to the default (regular) QOS and assigns it a nodeCPU and 4 GBThe time limit for job execution is that of the queue (4 days and hours).  
-Esto es muy ineficientelo ideal es especificar en la medida de lo posible al menos tres parámetros a la hora de enviar los trabajos+This is very inefficientthe ideal is to specify as much as possible at least three parameters when submitting jobs
-  -  %%El número de nodos (-N --nodes), tareas (-n --ntasks) y/o CPU por tarea (-c --cpus-per-task).%% +  -  %%Node number (-N or --nodes), tasks (-n or --ntasks) and/or CPUs per task (-c or --cpus-per-task).%% 
-  -  %%La memoria (--mem) por nodo o la memoria por cpu (--mem-per-cpu).%% +  -  %%Memory (--mem) per node or memory per cpu (--mem-per-cpu).%% 
-  -  %%El tiempo estimado de ejecución del trabajo ( --time )%%+  -  %%Job execution time ( --time )%%
  
-A mayores puede ser interesante añadir los siguientes parámetros+In addition, it may be interesting to add the following parameters
-|  -J    %%--job-name%%  |Nombre para el trabajoPor defectonombre del ejecutable  | +|  -J    %%--job-name%%  |Job nameDefaultexecutable name  | 
-|  -q    %%--qos%%       |Nombre de la cola a la que se envía el trabajoPor defecto: regular +|  -q    %%--qos%%       |Name of the queue to which the job is sentDefault: regular 
-|  -o    %%--output%%    |Fichero o patrón de fichero al que se redirige toda la salida estandar y de error. +|  -o    %%--output%%    |File or file pattern to which all standard and error output is redirected.  | 
-|        %%--gres%%      |Tipo y/o número de GPUs que se solicitan para el trabajo |+|        %%--gres%%      |Type and/or number of GPUs requested for the job  |
 |  -C    %%--constraint%%  |Para especificar que se quieren nodos con procesadores Intel o AMD (cpu_intel o cpu_amd)  | |  -C    %%--constraint%%  |Para especificar que se quieren nodos con procesadores Intel o AMD (cpu_intel o cpu_amd)  |
-|    |  %%--exclusive%%  |Para solicitar que el trabajo no comparta nodos con otros trabajos.  | +|    |  %%--exclusive%%  |To specify that you want nodes with Intel or AMD processors (cpu_intel or cpu_amd)  | 
-|  -w  |  %%--nodelist%%   |Lista de nodos en los que ejecutar el trabajo  |+|  -w  |  %%--nodelist%%   |List of nodes to run the job on  |
  
-== Cómo se asignan los recursos == +== How resources are allocated == 
-Por defecto el método de asignación entre nodos es la asignación en bloque se asignan todos los cores disponibles en un nodo antes de usar otro). El método de asignación por defecto dentro de cada nodo es la asignación cíclica  (se van repartiendo por igual los cores requeridos entre los sockests disponibles en el nodo). +The default allocation method between nodes is block allocation (all available cores on a node are allocated before using another node). The default allocation method within each node is cyclic allocation (the required cores are distributed equally among the available sockets in the node). 
  
-== Calculo de la prioridad == +== Priority calculation == 
-Cuando se envía un trabajo al sistema de colaslo primero que ocurre es que se comprueba si los recursos solicitados entran dentro de los límites fijados en la cola correspondienteSi supera alguno se cancela el envío. \\ +When a job is submitted to the queuing systemthe first thing that happens is that the requested resources are checked to see if they fall within the limits set in the corresponding queueIf it exceeds any of them, the submission is cancelled. \\ 
-Si hay recursos disponibles el trabajo se ejecuta directamentepero si no es así se encolaCada trabajo tiene asignada una prioridad que determina el orden en que se ejecutan los trabajos de la cola cuando quedan recursos disponiblesPara determinar la prioridad de cada trabajo se ponderan factoresel tiempo que lleva esperando en la cola (25%), la prioridad fija que tiene la cola(25%) y el fairshare del usuario (50%). \\ +If resources are availablethe job is executed directly, but if not, it is queuedEach job is assigned a priority that determines the order in which the jobs in the queue are executed when resources are availableTo determine the priority of each job, factors are weightedthe time it has been waiting in the queue (25%), the fixed priority of the queue (25%) and the user'fairshare (50%). \\ 
-El fairshare es un cálculo dinámico que hace SLURM para cada usuario y es la diferencia entre los recursos asignados y los recursos consumidos lo largo de los últimos 14 días+The fairshare is dynamic calculation made by SLURM for each user and is the difference between the resources allocated and the resources consumed over the last 14 days.
 <code bash> <code bash>
 hpc-login2 ~]$ sshare -l  hpc-login2 ~]$ sshare -l 
Line 289: Line 313:
 user_name         100    0.071429        4833    0.001726    0.246436 user_name         100    0.071429        4833    0.001726    0.246436
 </code> </code>
-# RawShares: es la cantidad de recursos en términos absolutos asignada al usuarioEs igual para todos los usuarios.\\ +# RawShares: Is the amount of resources allocated to the user in absolute terms It is the same for all users.\\ 
-# NormShares: Es la cantidad anterior normalizada a los recursos asignados en total.\\ +# NormShares: This is the above amount normalised to the total allocated resources.\\ 
-# RawUsage: Es la cantidad de segundos/cpu consumida por todos los trabajos del usuario.\\ +# RawUsage: The number of seconds/cpu consumed by all user jobs.\\ 
-# NormUsage: Cantidad anterior normalizada al total de segundos/cpu consumidos en el cluster.\\ +# NormUsage: RawUsage normalised to total seconds/cpu consumed in the cluster.\\ 
-# FairShare: El factor FairShare entre 1. Cuanto mayor uso del cluster, más se aproximará a y menor será la prioridad.\\+# FairShare: The FairShare factor between and 1. The higher the cluster usagethe closer to and the lower the priority.\\
  
-== Envío de trabajos ==+== Job submission == 
 +  - sbatch
   - salloc   - salloc
   - srun   - srun
-  - sbatch 
  
-1. SALLOC \\ +1. SBATCH \\ 
-Sirve para obtener de forma inmediata una asignación de recursos (nodos). En cuanto se obtiene se ejecuta el comando especificado o una shell en su defecto.  +Used to send script to the queuing systemIt is batch-processing and non-blocking.
-<code bash> +
-# Obtener 5 nodos y lanzar un trabajo. +
-hpc-login2 ~]$ salloc -N5 myprogram +
-# Obtener acceso interactivo un nodo (Pulsar Ctrl+D para terminar el acceso): +
-hpc-login2 ~]$ salloc -N1  +
-</code> +
-2SRUN \\ +
-Sirve para lanzar un trabajo paralelo ( es preferible a usar mpirun ). Es interactivo y bloqueante. +
-<code bash> +
-# Lanzar un hostname en 2 nodos +
-hpc-login2 ~]$ srun -N2 hostname +
-hpc-node1 +
-hpc-node2 +
-</code> +
-3. SBATCH \\ +
-Sirve para enviar un script al sistema de colas. Es de procesamiento por lotes y no bloqueante.+
 <code bash> <code bash>
 # Crear el script: # Crear el script:
-hpc-login2 ~]$ vim trabajo_ejemplo.sh+hpc-login2 ~]$ vim test_job.sh
     #!/bin/bash     #!/bin/bash
-    #SBATCH --job-name=prueba            # Job name+    #SBATCH --job-name=test              # Job name
     #SBATCH --nodes=1                    # -N Run all processes on a single node        #SBATCH --nodes=1                    # -N Run all processes on a single node   
     #SBATCH --ntasks=1                   # -n Run a single task        #SBATCH --ntasks=1                   # -n Run a single task   
Line 328: Line 336:
     #SBATCH --mem=1gb                    # Job memory request     #SBATCH --mem=1gb                    # Job memory request
     #SBATCH --time=00:05:00              # Time limit hrs:min:sec     #SBATCH --time=00:05:00              # Time limit hrs:min:sec
-    #SBATCH --qos=urgent                 # Cola +    #SBATCH --qos=urgent                 # Queue 
-    #SBATCH --output=prueba_%j.log       # Standard output and error log+    #SBATCH --output=test%j.log          # Standard output and error log
  
     echo "Hello World!"     echo "Hello World!"
  
-hpc-login2 ~]$ sbatch trabajo_ejemplo.sh +hpc-login2 ~]$ sbatch test_job.sh 
 </code> </code>
 +2. SALLOC \\
 +It is used to immediately obtain an allocation of resources (nodes). As soon as it is obtained, the specified command or a shell is executed. 
 +<code bash>
 +# Get 5 nodes and launch a job.
 +hpc-login2 ~]$ salloc -N5 myprogram
 +# Get interactive access to a node (Press Ctrl+D to exit):
 +hpc-login2 ~]$ salloc -N1 
 +# Get interactive EXCLUSIVE access to a node
 +hpc-login2 ~]$ salloc -N1 --exclusive
 +</code>
 +3. SRUN \\
 +It is used to launch a parallel job (preferable to using mpirun). It is interactive and blocking.
 +<code bash>
 +# Launch the hostname command on 2 nodes
 +hpc-login2 ~]$ srun -N2 hostname
 +hpc-node1
 +hpc-node2
 +</code>
 +
  
-==== Uso de los nodos con GPU ==== +==== GPU use ==== 
-Para solicitar específicamente una asignación de GPUs para un trabajo hay que añadir a sbatch srun las opciones:  +To specifically request GPU allocation for a job, options must be added to sbatch or srun:  
-|  %%--gres%%  |  Solicitud de gpus por NODE  |  %%--gres=gpu[[:type]:count],...%% +|  %%--gres%%  |  Request gpus per NODE  |  %%--gres=gpu[[:type]:count],...%% 
-|  %%--gpus o -G%%  |  Solicitud de gpus por JOB  |  %%--gpus=[type]:count,...%% +|  %%--gpus o -G%%  |  Request gpus per JOB  |  %%--gpus=[type]:count,...%% 
-También existen las opciones %% --gpus-per-socket,--gpus-per-node y --gpus-per-task%%,\\+There are also the options %% --gpus-per-socket,--gpus-per-node y --gpus-per-task%%,\\
 Ejemplos: Ejemplos:
 <code bash> <code bash>
-## Ver la lista de nodos y gpus:+## See the list of nodes and gpus:
 hpc-login2 ~]$ ver_recursos hpc-login2 ~]$ ver_recursos
-## Solicitar GPU cualesquiera para un JOB, añadir:+## Request any GPUs for a JOB, add:
 --gpus=2 --gpus=2
-## Solicitar una A100 de 40G en un nodo y una A100 de 80G en otroañadir:+## Request a 40G A100 at one node and an 80G A100 at another nodeadd:
 --gres=gpu:A100_40:1,gpu:A100_80: --gres=gpu:A100_40:1,gpu:A100_80:
 </code> </code>
  
  
-==== Monitorización de los trabajos ====+==== Job monitoring ====
 <code bash> <code bash>
-## Listado de todos los trabajos en la cola+## List all jobs in the queue
 hpc-login2 ~]$ squeue hpc-login2 ~]$ squeue
-## Listado de los trabajos de un usuario            +## Listing a user's jobs            
 hpc-login2 ~]$ squeue -u <login> hpc-login2 ~]$ squeue -u <login>
-## Cancelar un trabajo:+## Cancel a job:
 hpc-login2 ~]$ scancel <JOBID> hpc-login2 ~]$ scancel <JOBID>
-## Lista de trabajos recientes+## List of recent jobs:
 hpc-login2 ~]$ sacct -b hpc-login2 ~]$ sacct -b
-## Información histórica detallada de un trabajo:+## Detailed historical information for a job:
 hpc-login2 ~]$ sacct -l -j <JOBID> hpc-login2 ~]$ sacct -l -j <JOBID>
-## Información de debug de un trabajo para troubleshooting:+## Debug information of a job for troubleshooting:
 hpc-login2 ~]$ scontrol show jobid -dd <JOBID> hpc-login2 ~]$ scontrol show jobid -dd <JOBID>
-## Ver el uso de recursos de un trabajo en ejecución:+## View the resource usage of a running job:
 hpc-login2 ~]$ sstat <JOBID> hpc-login2 ~]$ sstat <JOBID>
 </code> </code>
-==== Controlar la salida de los trabajos ==== +==== Configure job output ==== 
-== Códigos de salida == +== Exit codes == 
-Por defecto estos son los códigos de salida de los comandos:+By default these are the output codes of the commands:
 ^  SLURM command  ^  Exit code  ^ ^  SLURM command  ^  Exit code  ^
-|  salloc  |  0 en caso de éxito, 1 si no se puedo ejecutar el comando del usuario  | +|  salloc  |  0 success, 1 if the user's command cannot be executed  | 
-|  srun  |  El más alto de entre todas las tareas ejecutadas o 253 para un error out-of-mem +|  srun  |  The highest among all executed tasks or 253 for an out-of-mem error.  | 
-|  sbatch  |  0 en caso de éxitosi noel código de salida correspondiente del proceso que falló  |+|  sbatch  |  0 successif notthe corresponding exit code of the failed process  |
  
 == STDIN, STDOUT y STDERR == == STDIN, STDOUT y STDERR ==
 **SRUN:**\\ **SRUN:**\\
-Por defecto stdout stderr se redirigen de todos los TASKS a el stdout stderr de srunstdin se redirecciona desde el stdin de srun a todas las TASKS. Esto se puede cambiar con+By default stdout and stderr are redirected from all TASKS to srun'stdout and stderr, and stdin is redirected from srun's stdin to all TASKS. This can be changed with
-|  %%-i, --input=<opcion>%%    |  +|  %%-i, --input=<option>%%    |  
-|  %%-o, --output=<opcion>%%   | +|  %%-o, --output=<option>%%   | 
-|  %%-e, --error=<opcion>%%   | +|  %%-e, --error=<option>%%   | 
-Y las opciones son+And options are
-  * //all//: opción por defecto+  * //all//: by default
-  * //none//: No se redirecciona nada+  * //none//: Nothing is redirected
-  * //taskid//: Solo se redirecciona desde y/o al TASK id especificado+  * //taskid//: Redirects only to and/or from the specified TASK id. 
-  * //filename//: Se redirecciona todo desde y/o al fichero especificado+  * //filename//: Redirects everything to and/or from the specified file
-  * //filename pattern//: Igual que filename pero con un fichero definido por un [[ https://slurm.schedmd.com/srun.html#OPT_filename-pattern | patrón ]]+  * //filename pattern//: Same as the filename option but with a file defined by a [[ https://slurm.schedmd.com/srun.html#OPT_filename-pattern | pattern ]].
  
 **SBATCH:**\\ **SBATCH:**\\
-Por defecto "/dev/null" está abierto en el stdin del script stdout stderror se redirigen un fichero de nombre "slurm-%j.out"Esto se puede cambiar con:+By default "/dev/null" is open in the script's stdin and stdout and stderror are redirected to file named "slurm-%j.out"This can be changed with:
 |  %%-i, --input=<filename_pattern>%%  | |  %%-i, --input=<filename_pattern>%%  |
 |  %%-o, --output=<filename_pattern>%%  | |  %%-o, --output=<filename_pattern>%%  |
 |  %%-e, --error=<filename_pattern>%%  | |  %%-e, --error=<filename_pattern>%%  |
-La referencia de filename_pattern está [[ https://slurm.schedmd.com/sbatch.html#SECTION_%3CB%3Efilename-pattern%3C/B%3E | aquí ]].+The reference of filename_pattern is [[ https://slurm.schedmd.com/sbatch.html#SECTION_%3CB%3Efilename-pattern%3C/B%3E | here ]].
  
-==== Envío de correos ==== +==== Sending mail ==== 
-Se pueden configurar los JOBS para que envíen correos en determinadas circunstancias usando estos dos parámetros (**SON NECESARIOS AMBOS**): +JOBS can be configured to send mail in certain circumstances using these two parameters (**BOTH ARE REQUIRED**): 
-|  %%--mail-type=<type>%%  |  Opciones: BEGIN, END, FAIL, REQUEUE, ALL, TIME_LIMIT, TIME_LIMIT_90, TIME_LIMIT_50. +|  %%--mail-type=<type>%%  |  Options: BEGIN, END, FAIL, REQUEUE, ALL, TIME_LIMIT, TIME_LIMIT_90, TIME_LIMIT_50. 
-|  %%--mail-user=<user>%%  |  La dirección de correo de destino.  |+|  %%--mail-user=<user>%%  |  The destination mailing address.  |
  
  
  
-==== Estados de los trabajos en el sistema de colas ====+==== Status of Jobs in the queuing system ====
 <code bash> <code bash>
 hpc-login2 ~]# squeue -l hpc-login2 ~]# squeue -l
 JOBID PARTITION     NAME     USER      STATE       TIME  NODES NODELIST(REASON) JOBID PARTITION     NAME     USER      STATE       TIME  NODES NODELIST(REASON)
 6547  defaultPa  example <username>  RUNNING   22:54:55      1 hpc-fat1 6547  defaultPa  example <username>  RUNNING   22:54:55      1 hpc-fat1
 +
 +## Check status of queue use:
 +hpc-login2 ~]$ estado_colas.sh
 +JOBS PER USER:
 +--------------
 +       usuario.uno:  3
 +       usuario.dos:  1
 +
 +JOBS PER QOS:
 +--------------
 +             regular:  3
 +                long:  1
 +
 +JOBS PER STATE:
 +--------------
 +             RUNNING:  3
 +             PENDING:  1
 +==========================================
 +Total JOBS in cluster:  4
 </code> </code>
-Estados (STATE) más comunes de un trabajo:+Common job states:
   * R RUNNING Job currently has an allocation.   * R RUNNING Job currently has an allocation.
   * CD COMPLETED Job has terminated all processes on all nodes with an exit code of zero.    * CD COMPLETED Job has terminated all processes on all nodes with an exit code of zero. 
Line 416: Line 462:
   * PD PENDING Job is awaiting resource allocation.   * PD PENDING Job is awaiting resource allocation.
    
-[[ https://slurm.schedmd.com/squeue.html#SECTION_JOB-STATE-CODES | Lista completa de posibles estados de un trabajo ]].\\+[[ https://slurm.schedmd.com/squeue.html#SECTION_JOB-STATE-CODES | Full list of possible job statuses ]].\\
  
-Si un trabajo no está en ejecución aparecerá una razón debajo de REASON:[[ https://slurm.schedmd.com/squeue.html#SECTION_JOB-REASON-CODES | Lista de las razones ]] por las que un trabajo puede estar esperando su ejecución.+If a job is not running, a reason will be displayed underneath REASON:[[ https://slurm.schedmd.com/squeue.html#SECTION_JOB-REASON-CODES | reason list ]] for which a job may be awaiting execution.