„PRACE User Support” változatai közötti eltérés

Innen: KIFÜ Wiki
(The most simple commands)
a (Acknowledgement in publications)
 
(39 közbenső módosítás, amit 5 másik szerkesztő végzett, nincs mutatva)
1. sor: 1. sor:
 +
 +
 
== User Guide to obtain a digital certificate ==
 
== User Guide to obtain a digital certificate ==
  
146. sor: 148. sor:
  
 
<code>
 
<code>
     gsissh -p 2222 login.budapest.hpc.niif.hu
+
     gsissh -p 2222 prace-login.sc.niif.hu
 
</code>
 
</code>
  
195. sor: 197. sor:
  
 
<code>
 
<code>
     globus-url-copy file://task/myfile.c gsiftp://login.budapest.hpc.hu/home/task/myfile.c  
+
     globus-url-copy file://task/myfile.c gsiftp://prace-login.sc.niif.hu/home/prace/pr1hrocz/myfile.c  
 
</code>
 
</code>
  
214. sor: 216. sor:
 
* -stripe Use this parameter to initiate a “striped” GridFTP transfer that uses more than one node at the source and destination. As multiple nodes contribute to the transfer, each using its own network interface, a larger amount of the network bandwidth can be consumed than with a single system. Thus, at least for “big” (> 100 MB) files, striping can considerably improve performance.
 
* -stripe Use this parameter to initiate a “striped” GridFTP transfer that uses more than one node at the source and destination. As multiple nodes contribute to the transfer, each using its own network interface, a larger amount of the network bandwidth can be consumed than with a single system. Thus, at least for “big” (> 100 MB) files, striping can considerably improve performance.
  
==Usage of the Sun Grid Engine scheduler ==
+
==Usage of the SLURM scheduler ==
 
+
Website: http://slurm.schedmd.com
 
 
Basically the SGE is a scheduler, which divides the resources, computers into resource partitions. These are called queues. A queue can’t be larger than a physical resource; it can’t expand its borders. SGE registers a waiting list for the resources managed by itself, to which the posted computing tasks are directed. The scheduler searches for the resource defined by the description of the task and starts it. The task-resource coupling depends on the ability of the resources and the parameters of the tasks. In case the resources are overloaded, the tasks have to wait while the requested processor and memory becomes available.
 
 
 
 
 
The detailed documentation of the SGE can be found [http://docs.oracle.com/cd/E24901_01/doc.62/e21976.pdf here].
 
 
 
 
 
SGE version on all HPC sites: [http://gridscheduler.sourceforge.net/documentation.html Open Grid Scheduler (OGS/GE 2011.11p1)]
 
 
 
  
=== The most simple commands ===  
+
The schedule of the HPCs are CPU hour based. This means that the available core hours are divided between users on a monthly basis. All UNIX users are connected to one or more account. This scheduler account is connected to an HPC project and a UNIX group. HPC jobs can only be sent by using one of the accounts. The core hours are calculated by the multiplication of wall time (time spent running the job) and the CPU cores requested.
 +
For example reserving 2 nodes (48 cpu cores) at the NIIFI SC for 30 minutes gives 48 * 30 = 1440 core minutes = 24 core hours. Core hours are measured between the start and and the end of the jobs.
  
The most simple SGE command is the display of the cluster data:     
+
'''It is very important to be sure the application maximally uses the allocated resources. An empty or non-optimal job will consume allocated core time very fast. If the account run out of the allocated time, no new jobs can be submitted until the beginning of the next accounting period. Account limits are regenerated the beginning of each month.'''
  
 +
Information about an account can be listed with the following command:
 
<code>
 
<code>
     qhost
+
     sbalance
 
</code>
 
</code>
  
A possible outcome of this command can be:   
+
==== Example ====
{| class="wikitable" border="1"
+
After executing the command, the following table shows up for Bob. The user can access, and run jobs by using two different accounts (foobar, barfoo). He can see his name marked with * in the table. He shares both accounts with alice (Account column). The consumed core hours for the users are displayed in the second row (Usage), and the consumption for the jobs ran as the account is displayed in the 4th row. The last two row defines the allocated maximum time (Account limit), and the time available for the machine (Available).
|-
 
|HOSTNAME
 
|ARCH
 
|NCPU
 
|LOAD
 
|MEMTOT
 
|MEMUSE
 
|SWAPTO
 
|SWAPUS
 
|-
 
|global                 
 
|<nowiki>-</nowiki>       
 
  
|<nowiki>-</nowiki> 
+
<pre>
|<nowiki>-</nowiki> 
+
Scheduler Account Balance
|<nowiki>-</nowiki> 
+
---------- ----------- + ---------------- ----------- + ------------- -----------
 +
User            Usage |          Account      Usage | Account Limit  Available (CPU hrs)
 +
---------- ----------- + ---------------- ----------- + ------------- -----------
 +
alice                0 |          foobar          0 |            0          0
 +
bob *                0 |          foobar          0 |             0          0
  
|<nowiki>-</nowiki>
+
bob *                7 |           barfoo          7 |        1,000        993
 +
alice                0 |          barfoo          7 |        1,000        993
 +
</pre>
  
|<nowiki>-</nowiki> 
+
=== Estimating core time ===
|<nowiki>-</nowiki>
+
Before production runs, it is advised to have a core time estimate. The following command can be used for getting estimate:
|-
 
|cn01                     
 
|linux-x64 
 
|24 
 
|5.00
 
|62.9G 
 
|8.6G   
 
|0.0   
 
|0.0
 
|-
 
|cn02                     
 
|linux-x64 
 
|24 
 
|0.01
 
|62.9G 
 
|1.2G   
 
|0.0   
 
|0.0
 
|-
 
|cn03                     
 
|linux-x64 
 
|24 
 
|0.03
 
|62.9G 
 
|1.5G   
 
|0.0   
 
|0.0
 
|}
 
 
 
 
 
 
 
The first two columns define the names and types of the computers, which are in the cluster. The NCPU column shows the number of the available processor cores. LOAD shows the computer’s load for the moment (this value equals with the value demonstrated by the uptime UNIX command). The rest of the cells are: overall physical memory, the actual used memory, the available swap-memory, and the used swap. The global line marks all the information in total regarding the cluster.
 
 
 
We can have a look at the available queue-s with the following command:    
 
  
 
<code>
 
<code>
     qconf -sql
+
     sestimate -N NODES -t WALLTIME
 
</code>
 
</code>
 +
where <code>NODES</code> are the number of nodes to be reserved, <code>WALLTIME</code> is the maximal time spent running the job.
  
One probable outcome of the command:   
+
'''It is important to provide the core time to be reserved most precisely, because the scheduler queue the jobs based on this value. Generally, a job with shorter core time will be run sooner. It is advised to check the time used to run the job after completion with <code>sacct</code> command.'''
  
<code>
+
==== Example ====
    parael.q
 
    serial.q     
 
    test.q
 
</code>
 
 
 
 
 
To get more info about the state of the system use 
 
 
 
<code> 
 
    qstat -f
 
</code>
 
 
 
It shows which jobs run in which queues, and you can also get detailed info about the queues themselves (state, environment). The command can be used without the -f switch too, but it is less informative, since in this case only the jobs’ states will appear. The command’s outcome:                 
 
 
 
<code>
 
 
 
    queuename                      qtype resv/used/tot. load_avg arch      states     
 
    <nowiki>-------------------------------------------------------------------------------- </nowiki>
 
    test.q@cn.32                      BIP  0/3/24          3.15          linux-x64             
 
    905 1.00000 PI_SEQ_TES stefan      r    06/04/2011 09:12:14    1             
 
 
 
</code>
 
 
 
The first column of this table shows the name of the row, the second column marks the type (B-batch, I-interactive, C-checkpointing, P-parallel environment, E-error state). The third part of the column shows how many jobs can be run at the same time in the row. All in all, these values fit to the number of overall processor cores in the system. The second item of the column shows the free compartments at the moment.
 
 
 
If a running (scheduled) job is to be found in the queue, it is directly next to the name of the row, like the recent "PI_SEQ_TES", which runs in the test.q row. The tasks waiting for the resources, because it is overwhelmed or the preliminary conditions are not prompt, appear behind the sum row, listed as pending jobs. For example:   
 
 
 
<code>
 
    queuename                      qtype resv/used/tot. load_avg arch      states     
 
    <nowiki>--------------------------------------------------------------------------------- </nowiki> 
 
 
 
    parallel.q@cn31                BIP  0/24/24          22.3          linux-x64         
 
    <nowiki>--------------------------------------------------------------------------------- </nowiki>
 
 
 
    test.q@cn32                    BIP  0/24/24          23.5          linux-x64   
 
     
 
    <nowiki>############################################################################ </nowiki>
 
    - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS     
 
    <nowiki>############################################################################ </nowiki>
 
        905 0.00000 PI_SEQ_TES stefan      qw    06/04/2011 09:12:04    1       
 
</code>
 
 
 
 
 
 
 
 
 
Each task is given an identifier, which is a number (a job ID, or j_id), this is followed by the job’s priority (0 in both cases), then the job’s name, and the user who posted the job, and the qw marks, that the job is waiting for the queue. Finally the date of the registration for the waiting queue is next
 
 
 
When a job finishes running, this is created: jobname.ojobnumber in our actual catalog, which contains the error messages and stapled outputs created by the program..
 
 
 
=== Job submission ===
 
 
 
Back then, the SGE scheduler was designed to be able to operate different types of architectures. That’s why you can’t post binary files directly, only scripts, like the   
 
 
 
<code>
 
    qsub script.sh
 
</code>
 
 
 
command. The script describes the task, the main parameters of it, and its running. For example in the following script, the described ''hostname.sh'' task:   
 
 
 
<code>
 
    #!/bin/sh     
 
    #$ -N HOSTNAME     
 
    /bin/hostname
 
</code>
 
 
 
 
 
can be posted with the following command:     
 
 
 
<code>
 
    qsub hostname.sh
 
</code>
 
 
 
 
 
The scripts can be used for separating the different binaries:     
 
 
 
<code>
 
    #!/bin/sh       
 
    case `uname` in         
 
    SunOS) ./pi_sun         
 
    FreeBSD) ./pi_bsd       
 
    esac
 
</code>
 
 
 
With the following command, we can define the queue where the scheduler puts the job:
 
 
 
<code>
 
    qsub -q serial.q range.sh
 
</code>
 
 
 
 
 
The command qsub can be issued with a number of different switches, which are gathered in the following table:
 
 
 
{| class="wikitable" border="1"
 
|-
 
|Parameter
 
|Possible example
 
|Result
 
|-
 
| -N name
 
| -N Flow
 
|The job will appear under this name in the queue.
 
|-
 
| -cwd
 
| -cwd
 
|The output and the error files will appear in this actual catalog.
 
|-
 
| -S shell
 
| -S /bin/tcsh
 
|The shell in which the scripts run.
 
|-
 
| -j {y|n}
 
| -j y
 
|Joining the error and the output in one file.
 
|-
 
| -r {y|n}
 
| -r y
 
|After a restart, should the job restart too (from the beginning).
 
|-
 
| -M e-mail
 
| -M stefan@niif.hu
 
|Scheduler information will be sent to this address about the job.
 
|-
 
| -l
 
| -l h_cpu=0:15:0
 
|Chooses a queue for the job where 15 minutes of CPU time could be ensured. (hour:minute:second)
 
|-
 
| -l
 
| -l h_vmem=1G
 
|Chooses a computer for the job where 1 GB memory is available. In the case of parallel jobs its value is extended with the required number of slots. If this parameter is not given, the default setting will be the number of the maximum memory cores set up in the computers.
 
|-
 
| -l
 
| -l in
 
|Consuming resources, complex request. (This will be defined in the documentation written for the system administrators)
 
|-
 
| -binding
 
| -binding linear:4
 
|Chooses 4 CPU cores on the worker node-on and assignes in a fix way. Further information: [http://docs.oracle.com/cd/E24901_01/doc.62/e21976/chapter2.htm#autoId75 here].
 
|-
 
| -l
 
| -l exclusive=true
 
|Demand of exclusive task execution (another job will not be scheduled on the chosen computers). It can be used in the following sites: Szeged, Budapest és Debrecen.
 
|-
 
| -P
 
| -P niifi
 
|Chooses  a HPC project. This command will list the available HPC projects: ''qconf -sprjl''
 
|-
 
| -R
 
| -R y
 
|Resource reservation. This will cause that bigger parallel jobs will get higher priority.
 
|}
 
  
 +
Alice want to reserve 2 days 10 hours and 2 nodes, she checks, if she have enough time on her account.
 +
<pre>
 +
sestimate -N 2 -t 2-10:00:00
  
qsub command arguments can be added to the ~/.sge_request file. If this file exists then it will be added to the qsub arument list.
+
Estimated CPU hours: 2784
 +
</pre>
 +
Unfortunately, she couldn't afford to run this job.
  
Sometimes we want to delete a job before its running. For this you can use the     
+
=== Status information ===
  
 +
Jobs in the queue can be listed with <code>squeue</code> command, the status of the cluster can be retrieved with the <code>sinfo</code> command. All jobs sent will get a JOBID. The properties of a job can be retrieved by using this id. Status of a running or waiting job:
 
<code>
 
<code>
     qdel job_id
+
     scontrol show job JOBID
</code>
 
 
 
command.     
 
  
<code>
 
    qdel 903
 
 
</code>
 
</code>
  
The example deletes the job number 903.    
+
All jobs will be inserted into an accounting database. The properties of the completed jobs can be retrieved from this database. Detailed statistics can be viewed by using this command:
 
 
 
<code>
 
<code>
     qdel -f 903
+
     sacct -l -j JOBID
 
</code>
 
</code>
  
It can delete the running jobs immediately.
+
Memory used can be retrieved by using
 
 
For pending and then continuing jobs, use qmod {-s,-us}.     
 
 
 
 
<code>
 
<code>
     qmod -s 903     
+
     smemory JOBID
    qmod -us 903
 
 
</code>
 
</code>
  
 
+
Disk usage can be retrieved by this command:
The previous one suspends the running of number 903 (SIGSTOP), while the latter one allows (SIGCONT).
 
 
 
 
 
If there is a need to change the features (resource requirements) of a job put into the waiting list, it can be done with the command: ''qalter''     
 
 
 
 
 
 
<code>
 
<code>
     qalter -l h_cpu=0:12:0 903
+
     sdisk JOBID
 
</code>
 
</code>
  
 +
==== Example ====
  
The previous command alternates the hard-CPU requirements of the job number 903 (h_cpu) and changes it to 12 minutes. The switches of the qalter command are mainly overlap the ones of the qsub command.
+
There are 3 jobs in the queue. The first is an array job which is waiting for resources (PENDING). The second is an MPI job running on 4 nodes for 25 minutes now. The third is an OMP run running on one node, just started. The NAME of the jobs can be freely given, it is advised to use short, informative names.
  
 +
<pre>
 +
    squeue -l
  
In a special case, we have to execute the same task, but on different data. These tasks are the array jobs. With SGE we can upload several jobs to the waiting. For example in the pi task shown in previous chapter, it can be posted multiple times, with different parameters, with the following script:''array.sh''      
+
Wed Oct 16 08:30:07 2013             
 +
    JOBID PARTITION    NAME    USER    STATE      TIME TIMELIMIT  NODES NODELIST(REASON)
 +
591_[1-96]    normal    array   alice  PENDING      0:00    30:00      1 (None)
 +
      589    normal      mpi      bob  RUNNING      25:55  2:00:00      4 cn[05-08]
 +
      590    normal      omp    alice  RUNNING      0:25  1:00:00     1 cn09
 +
</pre>
  
 +
This two-node batch job had a typical load of 10GB virtual, and 6.5GB RSS memory per node.
  
<code>
+
<pre>
     #!/bin/sh     
+
     smemory 430
    #$ -N PI_ARRAY_TEST     
 
    ./pi_gcc `expr $SGE_TASK_ID \* 100000`
 
</code>
 
  
The SGE_TASK_ID is an internal integer used by the SGE, which created values for each running job. The interval can be set up when posting the block:     
+
MaxVMSize  MaxVMSizeNode  AveVMSize    MaxRSS MaxRSSNode    AveRSS
 +
---------- -------------- ---------- ---------- ---------- ----------
 +
10271792K          cn06  10271792K  6544524K      cn06  6544524K 
 +
10085152K          cn07  10085152K  6538492K      cn07  6534876K
 +
</pre>
  
 +
==== Checking jobs ====
  
 +
It is important to be sure the application fully uses the core time reserved. A running application can be monitored with the following command:
 
<code>
 
<code>
     qsub -t 1-7 array.sh
+
     sjobcheck JOBID
 
</code>
 
</code>
  
 +
===== Example =====
  
meaning that the array.sh program will run in seven issues, and the SGE_TASK_ID will have the value of 1, 2, ..., 7 in every running issue. The qstat -f shows how the block tasks are split:   
+
This job runs on 4 nodes. The LOAD group provides information about the general load of the machine, this is more or less equal to the number of cores. The CPU group gives you information about the exact usage. Ideally, values of the <code>User</code> column are over 90. If the value is below that, there is a problem with the application, or it is not optimal, and the run should be ended. This example job fully using ("maxing out") the available resources.
  
<code>
+
<pre>
 +
Hostname                    LOAD                      CPU              Gexec 
 +
CPUs (Procs/Total) [    1,    5, 15min] [  User,  Nice, System, Idle, Wio]
 +
cn08    24 (  25/  529) [ 24.83, 24.84, 20.98] [  99.8,  0.0,  0.2,  0.0,  0.0] OFF
 +
cn07    24 (  25/  529) [ 24.93, 24.88, 20.98] [  99.8,  0.0,  0.2,  0.0,  0.0] OFF
 +
cn06    24 (  25/  529) [ 25.00, 24.90, 20.97] [  99.9,  0.0,  0.1,  0.0,  0.0] OFF
 +
cn05    24 (  25/  544) [ 25.11, 24.96, 20.97] [  99.8,  0.0,  0.2,  0.0,  0.0] OFF
 +
</pre>
  
    <nowiki>--------------------------------------------------------------------------------- </nowiki>
+
==== Checking licenses ====
    test.q@uv                      BIP  0/0/30        8.15      linux-x64       
 
    <nowiki>--------------------------------------------------------------------------------- </nowiki> 
 
    uv.q@uv                        BIP  0/7/1110        8.15      linux-x64       
 
    907 1.00000 PI_ARRAY_T stefan      r    06/04/2011 10:34:14    1 1         
 
    907 0.50000 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 2         
 
    907 0.33333 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 3         
 
    907 0.25000 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 4         
 
    907 0.20000 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 5         
 
    907 0.16667 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 6         
 
    907 0.14286 PI_ARRAY_T stefan      t    06/04/2011 10:34:14    1 7   
 
</code>
 
  
It is clear, that behind the tasks there are their array index with which we can refer to the components to the task. For example, in the case of block tasks, there is a possibility to delete particular parts of the block. If we want to delete the subtasks from 5-7 of the previous task, the command    
+
The used and available licenses can be retrieved with this command:
  
 
<code>
 
<code>
     qdel -f 907.5-7
+
     slicenses
 
</code>
 
</code>
  
will delete chosen components, but leaves the tasks 907.1-4 intact.
+
==== Checking downtime ====
The result of the running is seven individual files, with seven different running solutions:
 
  
It can happen; that the task placed in the queue won’t start. This case the:    
+
In downtime periods, the scheduler doesn't start new jobs, but jobs can be sent. The periods can be retrieved by using the following command:
  
 
<code>
 
<code>
     qstat -j job_id
+
     sreservations
 
</code>
 
</code>
  
command will show the detailed scheduling information, containing which running parameters are unfulfilled by the task.
+
=== Running jobs ===
 
 
The priority of the different tasks only means the gradiation listed in the pending jobs. The scheduler will analyze the tasks in this order. Since it requires the reservation of resources, it is not sure, that the tasks will run exactly the same order.
 
  
If we wonder why a certain job won’t start, here’s how you can get information:    
+
Running applications in the HPC can be done in batch mode. This means all runs must have a job script containing the resources and commands needed. The parameters of the scheduler (resource definitions) can be given with the <code>#SBATCH</code> directive. Comparison of the schedulers, and the directives available at slurm are available at this [http://slurm.schedmd.com/rosetta.pdf table].
  
<code>
+
==== Obligatory parameters ====
    qalter -w v job_id
+
The following parameters are obligatory to provide:
</code>
+
<pre>
 +
#!/bin/bash
 +
#SBATCH -A ACCOUNT
 +
#SBATCH --job-name=NAME
 +
#SBATCH --time=TIME
 +
</pre>
  
One possible outcome     
+
where <code>ACCOUNT</code> is the name of the account to use (available accounts can be retrieved with the <code>sbalance</code> command), <code>NAME</code> is the short name of the job, <code>TIME</code> is the maximum walltime using <code>DD-HH:MM:SS</code> syntax.
 +
Acceptable time formats include "minutes", "minutes:seconds", "hours:minutes:seconds", "days-hours", "days-hours:minutes" and "days-hours:minutes:seconds".
  
 +
The following command submit jobs:
 
<code>
 
<code>
     Job 53505 cannot run in queue "szeged.q" because it is not contained in its hard queue list (-q)     
+
     sbatch jobscript.sh
    Job 53505 (-l NONE) cannot run in queue "cn46.szeged.hpc.niif.hu" because exclusive resource (exclusive) is already in use     
 
    Job 53505 (-l NONE) cannot run in queue "cn48.szeged.hpc.niif.hu" because exclusive resource (exclusive) is already in use     
 
    Job 53505 cannot run in PE "mpi" because it only offers 0 slots     
 
    verification: no suitable queues
 
 
</code>
 
</code>
  
You can check with this command where the jobs are running: 
+
If the submission was successful, the following is outputted:
 +
<pre>
 +
Submitted batch job JOBID
 +
</pre>
 +
where <code>JOBID</code> is the unique id of the job
  
 +
The following commmand cancels the job:
 
<code>
 
<code>
     qhost -j -q
+
     scancel JOBID
 
</code>
 
</code>
  
<code>
+
==== Job queues ====
    HOSTNAME                ARCH        NCPU  LOAD  MEMTOT  MEMUSE  SWAPTO  SWAPUS
 
    <nowiki>------------------------------------------------------------------------------- </nowiki>
 
    global                  -              -    -      -      -      -      -
 
    cn01                    linux-x64      48 41.43  126.0G    3.0G    0.0    0.0   
 
    serial.q            BI    0/42/48           
 
    120087 0.15501 run.sh    roczei      r    09/23/2012 14:25:51 MASTER 22   
 
    120087 0.15501 run.sh    roczei      r    09/23/2012 15:02:21 MASTER 78   
 
    120087 0.15501 run.sh    roczei      r    10/01/2012 07:58:21 MASTER 143   
 
    120087 0.15501 run.sh    roczei      r    10/01/2012 08:28:51 MASTER 144   
 
    120087 0.15501 run.sh    roczei      r    10/04/2012 17:41:51 MASTER 158   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 3   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 5   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 19   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 23   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 31   
 
    120340 0.13970 pwhg.sh    roczei      r    09/24/2012 23:24:51 MASTER 33   
 
    120340 0.13970 pwhg.sh    roczei      r    09/26/2012 13:42:51 MASTER 113   
 
    120340 0.13970 pwhg.sh    roczei      r    10/01/2012 07:43:06 MASTER 186   
 
    120340 0.13970 pwhg.sh    roczei      r    10/01/2012 07:58:36 MASTER 187   
 
    ...
 
</code>
 
  
 +
There are two separate queue (partition) available in the HPC, the <code>test</code> queue and the <code>prod</code> queue. Tha latter is for the production runs, the former is for testing purposes. In the test queue, 1 node can be allocated for the maximum of half hours, The default queue is <code>prod</code>. Test partition can be chosen with the following directive:
 +
<pre>
 +
#SBATCH --partition=test
 +
</pre>
  
=== Queue types ===
+
==== Quality of Service (QoS) ====
  
 +
There is an option for submitting low priority jobs. These jobs can be interrupted by any normal priority job at any time, but only the half of the time is billed to the account. Interrupted jobs will be automatically queued again. Therefore it is important to only run jobs that can be interrupted at any time, periodically saves their states (checkpoint) and can restart quickly.
 +
The default QoS is <code>normal</code>, non-interruptable.
  
''parallel.q'' - for paralel jobs (jobs can run maximum 31 days)
+
The following directive choses low priority:
 +
<pre>
 +
#SBATCH --qos=lowpri
 +
</pre>
  
 +
==== Memory settings ====
  
''serial.q'' - for serial jobs (jobs can run maximum 31 days)
+
1000 MB memory is allocated for 1 CPU core by default, more can be allocated with the following directive:
 +
<pre>
 +
#SBATCH --mem-per-cpu=MEMORY
 +
</pre>
 +
where <code>MEMORY</code> is given in MB. The maximum memory/core at NIIFI SC is 2600 MB.
  
 +
==== Email notification ====
 +
Sending mail when the status of the job change (start, stop, error):
 +
<pre>
 +
#SBATCH --mail-type=ALL
 +
#SBATCH --mail-user=EMAIL
 +
</pre>
 +
where <code>EMAIL</code> is the e-mail to notify.
  
''test.q'' - test queue, the job will be killed after 2 hours
+
==== Array jobs ====
 +
Array jobs are needed, when multiple one threaded (serial) jobs are to be sent (with different data). Slurm stores unique id of the instances in the <code>SLURM_ARRAY_TASK_ID</code> enviromnemt variable. It is possible to seperate threads of the array job by retrieving these ids. Output of the threads are written into <code>slurm-SLURM_ARRAY_JOB_ID-SLURM_ARRAY_TASK_ID.out</code> files. The scheduler uploads outputs tightly. It is useful to use multiply threads for a CPU core. [http://slurm.schedmd.com/job_array.html More on this topic]
  
 +
===== Example =====
 +
Alice user submits 96 serial job for a maximum of 24 hour run.
 +
on the expenses of 'foobar' account. The <code>#SBATCH --array=1-96</code> directive indicates, that it is an array job. The application
 +
can be run with the <code>srun</code> command. This is a shell script in this example.
 +
<pre>
 +
#!/bin/bash
 +
#SBATCH -A foobar
 +
#SBATCH --time=24:00:00
 +
#SBATCH --job-name=array
 +
#SBATCH --array=1-96
 +
srun envtest.sh
 +
</pre>
  
 +
==== MPI jobs ====
 +
Using MPI jobs, the number of MPI processes running on a node is to be given (<code>#SBATCH --ntasks-per-node=</code>). The most frequent case is to provide the number of CPU cores. Parallel programs should be started by using <code>mpirun</code> command.
  
 +
===== Example =====
 +
Bob user allocates 2 nodes, 12 hour for an MPI job, billing 'barfoo' account. 24 MPI thread will be started on each node. The stdout output is piped to <code>slurm.out</code> file (<code>#SBATCH -o</code>).
  
Getting information on the waiting line’s status:
+
<pre>
 +
#!/bin/bash
 +
#SBATCH -A barfoo
 +
#SBATCH --job-name=mpi
 +
#SBATCH -N 2
 +
#SBATCH --ntasks-per-node=24
 +
#SBATCH --time=12:00:00
 +
#SBATCH -o slurm.out
 +
mpirun ./a.out
 +
</pre>
  
 +
==== CPU binding ====
 +
Generally, the performance of MPI application can be optimized with CPU core binding. In this case, the threads of the paralel program won't be scheduled by the OS between the CPU cores, and the memory localization can be made better (less cache miss). It is advised to use memory binding. Tests can be run to define, what binding strategy gives the best performance for our application. The following settings are valid for OpenMPI environment. Further information on binding can be retrieved with <code>--report-bindings</code> MPI option. Along with the running commands, few lines of the detailed binding information are shown. It is important, that one should not use task_binding of the scheduler!
  
<code>
+
===== Binding per CPU core =====
    qstat -g c 
+
In this case, MPI fills CPU cores by the order of threads (rank).
</code>
 
 
 
 
 
<code>
 
    CUSTER QUEUE        CQLOAD  USED    RES  AVAIL  TOTAL aoACDS  cdsuE 
 
    <nowiki>-------------------------------------------------------------------------------- </nowiki>
 
    parallel.q          0.91    460      0    44    504    0      0 
 
    serial.q            0.84    200      0    40    240    0      0
 
    test.q              0.00      0      0    24      24    0      0
 
</code>
 
 
 
 
 
=== Running PVM job ===
 
 
 
 
 
To run the previously shown and translated gexample application, we need the following task-describing ''gexample.sh'' script: 
 
 
 
<code>   
 
    #!/bin/sh     
 
    #$ -N GEXAMPLE     
 
    ./gexample << EOL     
 
    30     
 
    5     
 
    EOL
 
</code>
 
 
 
We can submit this with the following command:     
 
 
 
<code>
 
    qsub -pe pvm 5 gexample.sh
 
</code>
 
 
 
The -pe pvm 5 command will tell to the SGE to create a PVM parallel computer machine with 5 virtual processors, and run the application in this.      
 
 
 
<code>
 
    uv.q@uv                        BIP  0/5/1110              5.15    linux-x64         
 
    908 1.00000 GEXAMPLE  stefan      r    06/04/2011 13:05:14    5
 
</code>
 
  
Also note that after the running two output files were created: one containing an attached standard error and standard output (GEXAMPLE.o908), another describing the working method of the (GEXAMLE.po908). The latter one is mainly for finding errors.
+
<pre>
 +
Command to run: mpirun --bind-to-core --bycore
  
 +
[cn05:05493] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05493] MCW rank 1 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05493] MCW rank 2 bound to socket 0[core 2]: [. . B . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05493] MCW rank 3 bound to socket 0[core 3]: [. . . B . . . . . . . .][. . . . . . . . . . . .]
 +
</pre>
  
=== Running MPI jobs ===
+
===== Binding based on CPU socket =====
 +
In this case, MPI threads are filling CPUs alternately.
 +
<pre>
 +
Command to run: mpirun --bind-to-core --bysocket
  
 +
[cn05:05659] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05659] MCW rank 1 bound to socket 1[core 0]: [. . . . . . . . . . . .][B . . . . . . . . . . .]
 +
[cn05:05659] MCW rank 2 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05659] MCW rank 3 bound to socket 1[core 1]: [. . . . . . . . . . . .][. B . . . . . . . . . .]
 +
</pre>
  
All computers are set up with several installations of the MPI system: vendor-specific MPI implementations, and MPICH system too. The default setup is the vendor-specific MPI.
+
===== Binding by nodes =====
 +
In this case, MPI threads are filling nodes alternately. At least 2 nodes needs to be allocated.
 +
<pre>
 +
Command to run: mpirun --bind-to-core --bynode
  
Running in the MPI environment is similar to the PVM environment. Let’s have a look at the example shown in the previous chapter connectivity. A very simple task which tests the MPI tasks’internal communication. Use the following connectivity.sh script to run it:    
+
[cn05:05904] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn05:05904] MCW rank 2 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn06:05969] MCW rank 1 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
 +
[cn06:05969] MCW rank 3 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
 +
</pre>
  
 +
==== OpenMP (OMP) jobs ====
 +
For OpenMP paralell applications, 1 node needs to be allocated, and the number of OMP threads needs to be provided with the <code>OMP_NUM_THREADS</code> environment variable. The variable needs to be written before the application (see example), or needs to be exported before executing the command:
 
<code>
 
<code>
    #!/bin/sh     
+
  export OMP_NUM_THREADS=24
    #$ -N CONNECTIVITY
 
 
</code>
 
</code>
  
<code>    
+
===== Example =====
    mpirun -np $NSLOTS ./connectivity
+
Alice user starts a 24 threaded OMP application for maximum 6 hours on the expenses of foobar account.
</code>
+
<pre>
 +
#!/bin/bash
 +
#SBATCH -A foobar
 +
#SBATCH --job-name=omp
 +
#SBATCH --time=06:00:00
 +
#SBATCH -N 1
 +
OMP_NUM_THREADS=24 ./a.out
 +
</pre>
  
Here, the $NLOTS variable indicates that how many processors should be used in the MPI environment. This equals with that number what we have reuired for  the parallel environment.
+
==== Hybrid MPI-OMP jobs ====
  
The job can be submitted with the following command:    
+
When an application uses MPI and OMP it is running in hybrid MPI-OMP mode. Good to know that Intel MKL linked applications MKL calls are OpenMP capable. Generally, the following distribution suggested: MPI process number is from 1 to the CPU socket number, OMP thread number is the number of CPU cores in a node, or the half or quarter of that (it depends on code). For the job script, the parameters of these two needs to be combined.
  
<code>
+
===== Example =====
    qsub -pe mpi 20 connectivity.sh
+
Alice user sent a hybrid job on the expenses of the 'foobar' account for 8 hours, and 2 nodes. 1 MPI process is running on one node using 24 OMP thread per node. For the 2 nodes, 2 MPI process is running, with 2x24 OMP threads
</code>
+
<pre>
 +
#!/bin/bash
 +
#SBATCH -A foobar
 +
#SBATCH --job-name=mpiomp
 +
#SBATCH -N 2
 +
#SBATCH --time=08:00:00
 +
#SBATCH --ntasks-per-node=1
 +
#SBATCH -o slurm.out
 +
export OMP_NUM_THREADS=24
 +
mpirun ./a.out
 +
</pre>
  
With this command we instruct the scheduler to create a parallel MPI environment containing 20 processors, and reserve space for it in one of the queues. Once the space is available, the job starts:
+
==== Maple Grid jobs ====
 +
Maple can be run - similarly to OMP jobs - on one node. Maple module need to be loaded for using it. A grid server needs to be started, because Maple is working in client-server mode (<code>${MAPLE}/toolbox/Grid/bin/startserver</code>). This application needs to use license, which have to be given in the jobscript (<code>#SBATCH --licenses=maplegrid:1</code>). Starting of a Maple job is done by using
 +
<code>${MAPLE}/toolbox/Grid/bin/joblauncher</code> code.
  
<code>
+
===== Example =====
    uv.q@uv                        BIP  0/20/1110              20.30    linux-x64             
+
Alice user is running a Maple Grid application for 6 hours on the expenses of 'foobar' account:
    910 1.00000 CONNECTOVI stefan      r    06/04/2011 14:03:14    20     
+
<pre>
</code>
+
#!/bin/bash
 
+
#SBATCH -A foobar
Running the program will result in two files: the first one (CONNECTIVITY.o910) is the overlap of the result of the already run program standard output and standard error, while the second one (CONNECTIVITY.po910) is for the follow-up of the operation of the parallel environment. If the running is successful, this file is empty. The command -pe mpi 20 can be given in the script too with the directive #$ -pe mpi 20
+
#SBATCH --job-name=maple
 +
#SBATCH -N 1
 +
#SBATCH --ntasks-per-node=24
 +
#SBATCH --time=06:00:00
 +
#SBATCH -o slurm.out
 +
#SBATCH --licenses=maplegrid:1
  
'''Important notes: you should use mpirun.sge by SGI MPT on the Debrecen supercomputer'''  when you run a job under SGE. This can automatic parse which machines have been selected by SGE.
+
module load maple
  
This way you can check that you are using SGI MPT or not:   
+
${MAPLE}/toolbox/Grid/bin/startserver
 +
${MAPLE}/toolbox/Grid/bin/joblauncher ${MAPLE}/toolbox/Grid/samples/Simple.mpl
 +
</pre>
  
DEBRECEN[service0] ~ (1)$ type mpirun   
+
==== GPU compute nodes ====
 +
The Szeged site accomodates 2 GPU enabled compute nodes. Each GPU node has 6 Nvidia Tesla M2070 cards. The GPU nodes reside in a separate job queue (<code>--partition gpu</code>). To specify the number of GPUs set <code>--gres gpu:#</code> directive.
  
mpirun is hashed (/opt/nce/packages/global/sgi/mpt/2.04/bin/mpirun)   
+
===== Example =====
 +
Alice user submits to the foobar account a 4 GPU, 6 hour job.
 +
<pre>
 +
#!/bin/bash
 +
#SBATCH -A foobar
 +
#SBATCH --job-name=GPU
 +
#SBATCH --partition gpu
 +
#SBATCH --gres gpu:4
 +
#SBATCH --time=06:00:00
  
DEBRECEN[service0] ~ (0)$ type mpirun.sge   
+
$PWD/gpu_burnout 3600
 +
</pre>
  
mpirun.sge is hashed (/opt/nce/packages/global/sgi/mpt/2.04/bin/mpirun.sge)   
 
  
DEBRECEN[service0] ~ (0)$
+
== Extensions ==
 +
Extensions should be asked for at the Execution site (NIIF) at prace-support@niif.hu. All requests will be carefully reviewed and decided if eligable.
  
You should use mpirun binary directly if you are using SHF3 environment or you would like to use a more complex MPI run. However, you need to parse the SGE's PE_HOSTFILE environment variable in this case.
+
== Reporting after finishing project ==
 +
A report must be created after using PRACE resources. Please contact prace-support@niif.hu for further details.
  
=== Running OpenMP jobs ===
+
== Acknowledgement in publications ==
  
There are applications that either use the solutions of the operation system for multi-threaded program execution, or use a special library designed for this, like OpenMP. These applications have to be instructed how many threads they can use. The matrix multiplication algorithm presented in the previous chapter can be described with the following ''omp_mm.sh'' script     
+
PRACE
  
<code>
+
'''We acknowledge [PRACE/KIFÜ] for awarding us access to resource based in Hungary at [Budapest/Debrecen/Pécs/Szeged].'''
    #!/bin/sh     
 
    #$ -N OPENMP_MM     
 
</code>
 
 
 
<code>
 
    ./omp_mm
 
</code>
 
 
 
it can be submitted with this command which will use 6 threads
 
 
 
<code>
 
    qsub -pe openmp 6 omp_mm.sh
 
</code>
 
  
 +
KIFÜ
  
=== Checkpointing support ===
+
'''We acknowledge KIFÜ for awarding us access to resource based in Hungary at [Budapest/Debrecen/Pécs/Szeged].'''
  
 +
Where technical support has been received the following additional text should also be used:
 +
'''The support of [name of person/people] from KIFÜ, Hungary to the technical work is gratefully acknowledged.'''
  
At the moment the system doesn’t support any automatic checkpointing/restarting mechanism. If it is need, the application has to take care of it.
+
[[Category: HPC]]

A lap jelenlegi, 2019. október 29., 15:56-kori változata


User Guide to obtain a digital certificate

This document gives a short overview about how to require a digital certificate from NIIF CA for users, if the pre-registration form has been filled.

This guide is valid only for the Hungarian users.

If you are from a foreign country, and would like to get a certificate, here you can found your country's certification authority.


Installing NIIF CA root certificate

The first step is to download the "root certificate" ("NIIF CA Root Certificate" part), in the the format, which is known for the used browser or other SSL-using program. The browser asks wether to install/accept the certificate or not - accept or install the certificate in any cases. In addition, activate or allow the option which permits the browser to use the certificate to authenticate websites. Without that, it is not possible to reach the CA's web interface with secure protocol (https). The downloaded/installed certificate can be found in the certificate management modul of the browser.


Request a certificate

Request a certificate with openssl

  • Sing in into the certification registration website of the NIIF CA with our email address and password stored in the directory.
  • This site uses secure protocol (https), which the browser often indicates with a warning window - they should be acknowledged implicitly.
  • In the opening page - which is the public web surface of the CMS certificate management software - choose the "OpenSSL kliens kérelem benyújtása (PKCS#10)" (request an OpenSSL client) option. This leads to the datasheet, which must be filled in accordance with the printed datasheet. First, according to the purpose of the request, the corresponding field must be choosen (CSIRT, GRID, NIIF felhasználó, Független kutató, HBONE).
  • Copy the public part of our certificate in the field "PKCS#10". You can find a user guide about How to create a PKCS#10 certificate with openssl, which suitable for the NIIF CA requirements below.
  • A Challenge and a Request passwords must be given - both of them must be at least 8 characters long. Note them, because they needed for cancellation the certificate, or for the personal authentication.
  • Fill the other fields (name, email address, phone, organisation), and if there is anything, the CA operator should know, fill the last field with it. If everything is done, after a last check, click on the Elküld ("send") button on the bottom of the page.
  • In case of a successful PKCS#10 key-uploading, a page is opening with the confirmation of the successful certification request.

User Guide to create a PKCS#10 digital certification request with openssl

This paragraph gives a short overview about how to require a digital certificate from NIIF CA for users using openssl with the PKCS#10 format.The latest version of the openssl program can be downloaded from: Windows, Linux.

1. Download the openssl configuration file
To generate the CSR, there is a prewritten niif_ca_user_openssl.cnf file on the NIIF CA website.
The following modifications must be done in the config:


#purpose of the certificate

1.organizationalUnitName = Organizational Unit Name
1.organizationalUnitName_default = GRID # For example: GRID, HBONE, General Purpose
2.organizationalUnitName = Second Organizational Unit Name
2.organizationalUnitName_default = NIIF # For example: BME, ELTE, SZFKI, SZTAKI, NIIF, ...
commonName = Common Name (YOUR name) # User Name.
commonName_max = 64A


2. Create PKCS#10 reqquest
  • No existing secret key:

Run the

   openssl req -newkey rsa:1024 -config ./niif_ca_user_openssl.cnf -out new_csr.pem 

command, and answer the appearing questions at the prompt. The Institute (NIIF CA) and country (HU) datas should not be changed, or the request is going to be invalid. The certification request and the corresponding private key will be saved in the new_csr.pem and privkey.pem files. To gain acces to the private key, during the generating given "pass phrase" password must be used. In case of a forgotten password, the certificate will be unusable.

  • Existing private key (extend)

If there is an existing, previously generated private key (it must be at least a 1024 bit RSA key), which can be found in the old_key.pem file, then the following command creates the CSR

   openssl req -new -key ./old_key.pem -config ./niif_ca_user_openssl.cnf -out new_csr.pem


Personal Authentication

After the successful registration on the website, please visit the NIIF CA Registration Office personally with the copy of the pre-registration datasheet, the Request password and an ID document (ID card, passport).

Address:

NIIF Iroda
(RA Administrator)
Victor Hugo Str. 18-22.
H-1132 Budapest, HUNGARY
email: ca (at) niif (dot) hu
RA opening hours: Monday, 14:00 - 16:30 (CET)

During the authentication, the colleagues of the Registration Office verify the datas of the certificate and the user, and after the successful identification, they take the next steps in order to create the certification (it is not needed to wait for it).


Downloading the certificate

An email is going to arrive after the valid certificate has been completed (to the given email address during the request), and clicking on the URL in the email, the certificate can be downloaded. The saved certificate does not contain the private key.

If the certificate is installed into the browser, it is advised to export it with the private key in PKCS#12 format, so there will be a common backup with the private key and the certificate. Handle this backup carefully! If the private key lost, or gets into unauthorized hands, immediately request a certificate cancellation at the registration interface "Tanúsítvány visszavonása" (certificate cancellation) or at the Registration Office, and inform the concerned people!

Access with GSI-SSH

A user can access to the supercomputers by using the GSI-SSH protocol.

It requires a machine with a Globus installation that provides the gsissh client.

The needed credentials (these mean the private and public keys) must be created before entering the machine with the

   grid-proxy-init

or

   arcproxy

commands.

By default, the proxies are valid for 12 hours. It is possible to modify this default value with the following commands:

   arcproxy -c validityPeriod=86400

or

   grid-proxy-init -hours 24

Both of the previous commands set the validation of the proxies to 24 hours. Using the arcproxy, the validation time must be given in seconds.


To enter the site, the

   gsissh -p 2222 prace-login.sc.niif.hu

command has to be used.


GridFTP file transfer

In order to use GridFTP for file transfer, one needs a GridFTP client program that provides the interface between the user and a remote GridFTP server. There are several clients available for GridFTP, one of which is globus-url-copy, a command line tool which can transfer files using the GridFTP protocol as well as other protocols such as http and ftp. globus-url-copy is distributed with the Globus Toolkit and usually available on machines that have the Globus Toolkit installed.


Syntax

   globus-url-copy [options] sourceURL destinationURL

  • [options] The optional command line switches as described later.
  • sourceURL The URL of the file(s) to be copied. If it is a directory, it must end with a slash (/), and all files within that directory will be copied.
  • destURL The URL to which to copy the file(s). To copy several files to one destination URL, destURL must be a directory and be terminated with a slash (/).


Globus-url-copy supports multiple protocols, so the format of the source and destination URLs can be either

   file://path 


when you refer to a local file or directory or

   protocol://host[:port]/path


when you refer to a remote file or directory.

globus-url-copy is supporting other protocols such as http, https, ftp and gsiftp as well.


  • Example:

   globus-url-copy file://task/myfile.c gsiftp://prace-login.sc.niif.hu/home/prace/pr1hrocz/myfile.c 

This command uploads the myfile.c file from the locak task folder to the remote machine's home/task folder.


Command line options for globus-url-copy [options]

  • -help Prints usage information for the globus-url-copy program.
  • -version Prints the version of the globus-url-copy program.
  • -vb During the transfer, displays: (1) number of bytes transferred (2) performance since the last update (every 5 seconds) (3) average performance for the whole transfer


The following table lists parameters which you can set to optimize the performance of your data transfer:

  • -tcp-bs <size>Specifies the size (in bytes) of the TCP buffer to be used by the underlying GridFTP data channels.
  • -p <number of parallel streams> Specifies the number of parallel streams to be used in the GridFTP transfer.
  • -stripe Use this parameter to initiate a “striped” GridFTP transfer that uses more than one node at the source and destination. As multiple nodes contribute to the transfer, each using its own network interface, a larger amount of the network bandwidth can be consumed than with a single system. Thus, at least for “big” (> 100 MB) files, striping can considerably improve performance.

Usage of the SLURM scheduler

Website: http://slurm.schedmd.com

The schedule of the HPCs are CPU hour based. This means that the available core hours are divided between users on a monthly basis. All UNIX users are connected to one or more account. This scheduler account is connected to an HPC project and a UNIX group. HPC jobs can only be sent by using one of the accounts. The core hours are calculated by the multiplication of wall time (time spent running the job) and the CPU cores requested. For example reserving 2 nodes (48 cpu cores) at the NIIFI SC for 30 minutes gives 48 * 30 = 1440 core minutes = 24 core hours. Core hours are measured between the start and and the end of the jobs.

It is very important to be sure the application maximally uses the allocated resources. An empty or non-optimal job will consume allocated core time very fast. If the account run out of the allocated time, no new jobs can be submitted until the beginning of the next accounting period. Account limits are regenerated the beginning of each month.

Information about an account can be listed with the following command:

   sbalance

Example

After executing the command, the following table shows up for Bob. The user can access, and run jobs by using two different accounts (foobar, barfoo). He can see his name marked with * in the table. He shares both accounts with alice (Account column). The consumed core hours for the users are displayed in the second row (Usage), and the consumption for the jobs ran as the account is displayed in the 4th row. The last two row defines the allocated maximum time (Account limit), and the time available for the machine (Available).

Scheduler Account Balance
---------- ----------- + ---------------- ----------- + ------------- -----------
User             Usage |          Account       Usage | Account Limit   Available (CPU hrs)
---------- ----------- + ---------------- ----------- + ------------- -----------
alice                0 |           foobar           0 |             0           0
bob *                0 |           foobar           0 |             0           0

bob *                7 |           barfoo           7 |         1,000         993
alice                0 |           barfoo           7 |         1,000         993

Estimating core time

Before production runs, it is advised to have a core time estimate. The following command can be used for getting estimate:

   sestimate -N NODES -t WALLTIME

where NODES are the number of nodes to be reserved, WALLTIME is the maximal time spent running the job.

It is important to provide the core time to be reserved most precisely, because the scheduler queue the jobs based on this value. Generally, a job with shorter core time will be run sooner. It is advised to check the time used to run the job after completion with sacct command.

Example

Alice want to reserve 2 days 10 hours and 2 nodes, she checks, if she have enough time on her account.

sestimate -N 2 -t 2-10:00:00

Estimated CPU hours: 2784

Unfortunately, she couldn't afford to run this job.

Status information

Jobs in the queue can be listed with squeue command, the status of the cluster can be retrieved with the sinfo command. All jobs sent will get a JOBID. The properties of a job can be retrieved by using this id. Status of a running or waiting job:

   scontrol show job JOBID

All jobs will be inserted into an accounting database. The properties of the completed jobs can be retrieved from this database. Detailed statistics can be viewed by using this command:

   sacct -l -j JOBID

Memory used can be retrieved by using

   smemory JOBID

Disk usage can be retrieved by this command:

   sdisk JOBID

Example

There are 3 jobs in the queue. The first is an array job which is waiting for resources (PENDING). The second is an MPI job running on 4 nodes for 25 minutes now. The third is an OMP run running on one node, just started. The NAME of the jobs can be freely given, it is advised to use short, informative names.

    squeue -l

Wed Oct 16 08:30:07 2013              
     JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)
591_[1-96]    normal    array    alice  PENDING       0:00     30:00      1 (None)
       589    normal      mpi      bob  RUNNING      25:55   2:00:00      4 cn[05-08]
       590    normal      omp    alice  RUNNING       0:25   1:00:00      1 cn09

This two-node batch job had a typical load of 10GB virtual, and 6.5GB RSS memory per node.

    smemory 430

 MaxVMSize  MaxVMSizeNode  AveVMSize     MaxRSS MaxRSSNode     AveRSS
---------- -------------- ---------- ---------- ---------- ----------
10271792K           cn06  10271792K   6544524K       cn06   6544524K   
10085152K           cn07  10085152K   6538492K       cn07   6534876K 

Checking jobs

It is important to be sure the application fully uses the core time reserved. A running application can be monitored with the following command:

   sjobcheck JOBID

Example

This job runs on 4 nodes. The LOAD group provides information about the general load of the machine, this is more or less equal to the number of cores. The CPU group gives you information about the exact usage. Ideally, values of the User column are over 90. If the value is below that, there is a problem with the application, or it is not optimal, and the run should be ended. This example job fully using ("maxing out") the available resources.

Hostname                     LOAD                       CPU              Gexec  
 CPUs (Procs/Total) [     1,     5, 15min] [  User,  Nice, System, Idle, Wio]
cn08    24 (   25/  529) [ 24.83, 24.84, 20.98] [  99.8,   0.0,   0.2,   0.0,   0.0] OFF
cn07    24 (   25/  529) [ 24.93, 24.88, 20.98] [  99.8,   0.0,   0.2,   0.0,   0.0] OFF
cn06    24 (   25/  529) [ 25.00, 24.90, 20.97] [  99.9,   0.0,   0.1,   0.0,   0.0] OFF
cn05    24 (   25/  544) [ 25.11, 24.96, 20.97] [  99.8,   0.0,   0.2,   0.0,   0.0] OFF

Checking licenses

The used and available licenses can be retrieved with this command:

   slicenses

Checking downtime

In downtime periods, the scheduler doesn't start new jobs, but jobs can be sent. The periods can be retrieved by using the following command:

   sreservations

Running jobs

Running applications in the HPC can be done in batch mode. This means all runs must have a job script containing the resources and commands needed. The parameters of the scheduler (resource definitions) can be given with the #SBATCH directive. Comparison of the schedulers, and the directives available at slurm are available at this table.

Obligatory parameters

The following parameters are obligatory to provide:

#!/bin/bash
#SBATCH -A ACCOUNT
#SBATCH --job-name=NAME
#SBATCH --time=TIME

where ACCOUNT is the name of the account to use (available accounts can be retrieved with the sbalance command), NAME is the short name of the job, TIME is the maximum walltime using DD-HH:MM:SS syntax. Acceptable time formats include "minutes", "minutes:seconds", "hours:minutes:seconds", "days-hours", "days-hours:minutes" and "days-hours:minutes:seconds".

The following command submit jobs:

   sbatch jobscript.sh

If the submission was successful, the following is outputted:

Submitted batch job JOBID

where JOBID is the unique id of the job

The following commmand cancels the job:

   scancel JOBID

Job queues

There are two separate queue (partition) available in the HPC, the test queue and the prod queue. Tha latter is for the production runs, the former is for testing purposes. In the test queue, 1 node can be allocated for the maximum of half hours, The default queue is prod. Test partition can be chosen with the following directive:

#SBATCH --partition=test

Quality of Service (QoS)

There is an option for submitting low priority jobs. These jobs can be interrupted by any normal priority job at any time, but only the half of the time is billed to the account. Interrupted jobs will be automatically queued again. Therefore it is important to only run jobs that can be interrupted at any time, periodically saves their states (checkpoint) and can restart quickly. The default QoS is normal, non-interruptable.

The following directive choses low priority:

#SBATCH --qos=lowpri

Memory settings

1000 MB memory is allocated for 1 CPU core by default, more can be allocated with the following directive:

#SBATCH --mem-per-cpu=MEMORY

where MEMORY is given in MB. The maximum memory/core at NIIFI SC is 2600 MB.

Email notification

Sending mail when the status of the job change (start, stop, error):

#SBATCH --mail-type=ALL
#SBATCH --mail-user=EMAIL

where EMAIL is the e-mail to notify.

Array jobs

Array jobs are needed, when multiple one threaded (serial) jobs are to be sent (with different data). Slurm stores unique id of the instances in the SLURM_ARRAY_TASK_ID enviromnemt variable. It is possible to seperate threads of the array job by retrieving these ids. Output of the threads are written into slurm-SLURM_ARRAY_JOB_ID-SLURM_ARRAY_TASK_ID.out files. The scheduler uploads outputs tightly. It is useful to use multiply threads for a CPU core. More on this topic

Example

Alice user submits 96 serial job for a maximum of 24 hour run. on the expenses of 'foobar' account. The #SBATCH --array=1-96 directive indicates, that it is an array job. The application can be run with the srun command. This is a shell script in this example.

#!/bin/bash
#SBATCH -A foobar
#SBATCH --time=24:00:00
#SBATCH --job-name=array
#SBATCH --array=1-96
srun envtest.sh

MPI jobs

Using MPI jobs, the number of MPI processes running on a node is to be given (#SBATCH --ntasks-per-node=). The most frequent case is to provide the number of CPU cores. Parallel programs should be started by using mpirun command.

Example

Bob user allocates 2 nodes, 12 hour for an MPI job, billing 'barfoo' account. 24 MPI thread will be started on each node. The stdout output is piped to slurm.out file (#SBATCH -o).

#!/bin/bash
#SBATCH -A barfoo
#SBATCH --job-name=mpi
#SBATCH -N 2
#SBATCH --ntasks-per-node=24
#SBATCH --time=12:00:00
#SBATCH -o slurm.out
mpirun ./a.out

CPU binding

Generally, the performance of MPI application can be optimized with CPU core binding. In this case, the threads of the paralel program won't be scheduled by the OS between the CPU cores, and the memory localization can be made better (less cache miss). It is advised to use memory binding. Tests can be run to define, what binding strategy gives the best performance for our application. The following settings are valid for OpenMPI environment. Further information on binding can be retrieved with --report-bindings MPI option. Along with the running commands, few lines of the detailed binding information are shown. It is important, that one should not use task_binding of the scheduler!

Binding per CPU core

In this case, MPI fills CPU cores by the order of threads (rank).

Command to run: mpirun --bind-to-core --bycore

[cn05:05493] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05493] MCW rank 1 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05493] MCW rank 2 bound to socket 0[core 2]: [. . B . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05493] MCW rank 3 bound to socket 0[core 3]: [. . . B . . . . . . . .][. . . . . . . . . . . .]
Binding based on CPU socket

In this case, MPI threads are filling CPUs alternately.

Command to run: mpirun --bind-to-core --bysocket

[cn05:05659] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05659] MCW rank 1 bound to socket 1[core 0]: [. . . . . . . . . . . .][B . . . . . . . . . . .]
[cn05:05659] MCW rank 2 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05659] MCW rank 3 bound to socket 1[core 1]: [. . . . . . . . . . . .][. B . . . . . . . . . .]
Binding by nodes

In this case, MPI threads are filling nodes alternately. At least 2 nodes needs to be allocated.

Command to run: mpirun --bind-to-core --bynode

[cn05:05904] MCW rank 0 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
[cn05:05904] MCW rank 2 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]
[cn06:05969] MCW rank 1 bound to socket 0[core 0]: [B . . . . . . . . . . .][. . . . . . . . . . . .]
[cn06:05969] MCW rank 3 bound to socket 0[core 1]: [. B . . . . . . . . . .][. . . . . . . . . . . .]

OpenMP (OMP) jobs

For OpenMP paralell applications, 1 node needs to be allocated, and the number of OMP threads needs to be provided with the OMP_NUM_THREADS environment variable. The variable needs to be written before the application (see example), or needs to be exported before executing the command:

 export OMP_NUM_THREADS=24

Example

Alice user starts a 24 threaded OMP application for maximum 6 hours on the expenses of foobar account.

#!/bin/bash
#SBATCH -A foobar
#SBATCH --job-name=omp
#SBATCH --time=06:00:00
#SBATCH -N 1
OMP_NUM_THREADS=24 ./a.out

Hybrid MPI-OMP jobs

When an application uses MPI and OMP it is running in hybrid MPI-OMP mode. Good to know that Intel MKL linked applications MKL calls are OpenMP capable. Generally, the following distribution suggested: MPI process number is from 1 to the CPU socket number, OMP thread number is the number of CPU cores in a node, or the half or quarter of that (it depends on code). For the job script, the parameters of these two needs to be combined.

Example

Alice user sent a hybrid job on the expenses of the 'foobar' account for 8 hours, and 2 nodes. 1 MPI process is running on one node using 24 OMP thread per node. For the 2 nodes, 2 MPI process is running, with 2x24 OMP threads

#!/bin/bash
#SBATCH -A foobar
#SBATCH --job-name=mpiomp
#SBATCH -N 2
#SBATCH --time=08:00:00
#SBATCH --ntasks-per-node=1
#SBATCH -o slurm.out
export OMP_NUM_THREADS=24
mpirun ./a.out

Maple Grid jobs

Maple can be run - similarly to OMP jobs - on one node. Maple module need to be loaded for using it. A grid server needs to be started, because Maple is working in client-server mode (${MAPLE}/toolbox/Grid/bin/startserver). This application needs to use license, which have to be given in the jobscript (#SBATCH --licenses=maplegrid:1). Starting of a Maple job is done by using ${MAPLE}/toolbox/Grid/bin/joblauncher code.

Example

Alice user is running a Maple Grid application for 6 hours on the expenses of 'foobar' account:

#!/bin/bash
#SBATCH -A foobar
#SBATCH --job-name=maple
#SBATCH -N 1
#SBATCH --ntasks-per-node=24
#SBATCH --time=06:00:00
#SBATCH -o slurm.out
#SBATCH --licenses=maplegrid:1

module load maple

${MAPLE}/toolbox/Grid/bin/startserver
${MAPLE}/toolbox/Grid/bin/joblauncher ${MAPLE}/toolbox/Grid/samples/Simple.mpl

GPU compute nodes

The Szeged site accomodates 2 GPU enabled compute nodes. Each GPU node has 6 Nvidia Tesla M2070 cards. The GPU nodes reside in a separate job queue (--partition gpu). To specify the number of GPUs set --gres gpu:# directive.

Example

Alice user submits to the foobar account a 4 GPU, 6 hour job.

#!/bin/bash
#SBATCH -A foobar
#SBATCH --job-name=GPU
#SBATCH --partition gpu
#SBATCH --gres gpu:4
#SBATCH --time=06:00:00

$PWD/gpu_burnout 3600


Extensions

Extensions should be asked for at the Execution site (NIIF) at prace-support@niif.hu. All requests will be carefully reviewed and decided if eligable.

Reporting after finishing project

A report must be created after using PRACE resources. Please contact prace-support@niif.hu for further details.

Acknowledgement in publications

PRACE

We acknowledge [PRACE/KIFÜ] for awarding us access to resource based in Hungary at [Budapest/Debrecen/Pécs/Szeged].

KIFÜ

We acknowledge KIFÜ for awarding us access to resource based in Hungary at [Budapest/Debrecen/Pécs/Szeged].

Where technical support has been received the following additional text should also be used: The support of [name of person/people] from KIFÜ, Hungary to the technical work is gratefully acknowledged.