[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
grid [2018/11/27 16:28]
vidra qalter works on running jobs as well
grid [2020/01/27 20:31]
popel link http://aic.ufal.mff.cuni.cz
Line 160: Line 160:
   * **act_mem_free** (or amf) is a ÚFAL-specific option, which specifies the real amount of free memory (at the time of scheduling). You can specify it when submitting a job and it will be scheduled to a machine with at least this amount of memory free. In an ideal world, where no jobs are exceeding their ''mem_free'' requirements, we would not need this options. However, in real world it is recommended to use this option with the same value as ''mem_free'' to protect your job from failing with out-of-memory error (because of naughty jobs of other users).   * **act_mem_free** (or amf) is a ÚFAL-specific option, which specifies the real amount of free memory (at the time of scheduling). You can specify it when submitting a job and it will be scheduled to a machine with at least this amount of memory free. In an ideal world, where no jobs are exceeding their ''mem_free'' requirements, we would not need this options. However, in real world it is recommended to use this option with the same value as ''mem_free'' to protect your job from failing with out-of-memory error (because of naughty jobs of other users).
   * **h_vmem** is equivalent to setting ''ulimit -v'', i.e. it is a hard limit on the size of virtual memory (see RLIMIT_AS in ''man setrlimit''). If your job exceeds this limit, memory allocation fails (i.e., malloc or mmap will return NULL), and your job will probably crash on SIGSEGV. TODO: according to ''man queue_conf'', the job is killed with SIGKILL, not with SIGSEGV. Note that ''h_vmem'' specifies the maximal size of **allocated_memory, not used_memory**, in other words it is the VIRT column in ''top'', not the RES column. SGE does not use this parameter in any other way. Notably, job scheduling is not affected by this parameter and therefore there is no guarantee that there will be this amount of memory on the chosen machine. The problem is that some programs (e.g. Java with the default setting) allocate much more (virtual) memory than they actually use in the end. If we want to be ultra conservative, we should set ''h_vmem'' to the same value as ''mem_free''. If we want to be only moderately conservative, we should specify something like h_vmem=1.5*mem_free, because some jobs will not use the whole mem_free requested, but still our job will be killed if it allocated much more than declared. The default effectively means that your job has no limits.   * **h_vmem** is equivalent to setting ''ulimit -v'', i.e. it is a hard limit on the size of virtual memory (see RLIMIT_AS in ''man setrlimit''). If your job exceeds this limit, memory allocation fails (i.e., malloc or mmap will return NULL), and your job will probably crash on SIGSEGV. TODO: according to ''man queue_conf'', the job is killed with SIGKILL, not with SIGSEGV. Note that ''h_vmem'' specifies the maximal size of **allocated_memory, not used_memory**, in other words it is the VIRT column in ''top'', not the RES column. SGE does not use this parameter in any other way. Notably, job scheduling is not affected by this parameter and therefore there is no guarantee that there will be this amount of memory on the chosen machine. The problem is that some programs (e.g. Java with the default setting) allocate much more (virtual) memory than they actually use in the end. If we want to be ultra conservative, we should set ''h_vmem'' to the same value as ''mem_free''. If we want to be only moderately conservative, we should specify something like h_vmem=1.5*mem_free, because some jobs will not use the whole mem_free requested, but still our job will be killed if it allocated much more than declared. The default effectively means that your job has no limits.
 +    * For GPU jobs, it is usually better to use **h_data** instead of **h_vmem**. CUDA driver allocates a lot of "unused" virtual memory (tens of GB per card), which is counted in ''h_vmem'', but not in ''h_data''. All usual allocations (''malloc'', ''new'', Python allocations) seem to be included in ''h_data''.
   * It is recommended to **profile your task first** (see [[#profiling]] below), so you can estimate reasonable memory requirements before submitting many jobs with the same task (varying in parameters which do not affect memory consumption). So for the first time, declare mem_free with much more memory than expected and ssh to a given machine and check ''htop'' (sum all processes of your job) or (if the job is done quickly) check the epilog. When running other jobs of this type, set ''mem_free'' (and ''act_mem_free'' and ''h_vmem'') so you are not wasting resources, but still have some reserve.   * It is recommended to **profile your task first** (see [[#profiling]] below), so you can estimate reasonable memory requirements before submitting many jobs with the same task (varying in parameters which do not affect memory consumption). So for the first time, declare mem_free with much more memory than expected and ssh to a given machine and check ''htop'' (sum all processes of your job) or (if the job is done quickly) check the epilog. When running other jobs of this type, set ''mem_free'' (and ''act_mem_free'' and ''h_vmem'') so you are not wasting resources, but still have some reserve.
   * **s_vmem** is similar to ''h_vmem'', but instead of SIGSEGV/SIGKILL, the job is sent a SIGXCPU signal which can be caught by the job and exit gracefully before it is killed. So if you need it, set ''s_vmem'' to a lower value than ''h_vmem'' and implement SIGXCPU handling and cleanup.   * **s_vmem** is similar to ''h_vmem'', but instead of SIGSEGV/SIGKILL, the job is sent a SIGXCPU signal which can be caught by the job and exit gracefully before it is killed. So if you need it, set ''s_vmem'' to a lower value than ''h_vmem'' and implement SIGXCPU handling and cleanup.
Line 166: Line 167:
 ===== Advanced usage ===== ===== Advanced usage =====
  
-''qsub **-q** troja-all.q'' +''qsub **-q** cpu-troja.q'' 
-This way your job is submitted to the Troja queue. The default is ''ms-all.q''. You can also use e.g.+This way your job is submitted to the Troja queue. The default is ''cpu-ms.q''. You can also use e.g.
 ''-q '(troja*|ms*)''' to submit on any machine in those two queues (but **don't use ''-q '*'''** as this includes also [[:gpu|gpu.q]]), ''-q '(troja*|ms*)''' to submit on any machine in those two queues (but **don't use ''-q '*'''** as this includes also [[:gpu|gpu.q]]),
 ''-q '*@hector[14]''' to submit on hector1 or hector4, ''-q '*@hector[14]''' to submit on hector1 or hector4,
 ''-q '[tm]*@!(hector*|iridium)''' to submit on any troja/ms machine except hectors and iridium. ''-q '[tm]*@!(hector*|iridium)''' to submit on any troja/ms machine except hectors and iridium.
-However, usually you should specify just the queue (troja-all.q vs. ms-all.q), not a particular machine, and instead use ''-l'' to specify the needed resources in a general way.+However, usually you should specify just the queue (cpu-troja.q vs. cpu-ms.q), not a particular machine, and instead use ''-l'' to specify the needed resources in a general way.
  
 ''qsub **-l** ...'' ''qsub **-l** ...''
Line 189: Line 190:
  
 ''qsub **-b** y'' ''qsub **-b** y''
-Treat ''script.sh'' (or whatever is the name of the command you execute) as a binary, i.e. don't search for [[#in-script options]] within the file, don't transfer it to the qmaster and then to the execution node. This makes the execution a bit faster and it may prevent some rare but hard-to-detect errors caused SGE interpreting the script. The script must be available on the execution node via NFS, Lustre (which is our case), etc. With ''-b y'' (shortcut for ''-b yes''), ''script.sh'' can be script or a binary. With ''-b n'' (which is the default for ''qsub''), ''script.sh'' must be a script (text file).+Treat ''script.sh'' (or whatever is the name of the command you execute) as a binary, i.e. don't search for [[#in-script options]] within the file, don't transfer it to the qmaster and then to the execution node. This makes the execution a bit faster and it may prevent some rare but hard-to-detect errors caused SGE interpreting the script. The script must be available on the execution node via NFS, Lustre (which is our case), etc. With ''-b y'' (shortcut for ''-b yes''), ''script.sh'' can be an executable script or a binary (and you must provide full path, e.g. ''./script.sh''). With ''-b n'' (which is the default for ''qsub''), ''script.sh'' must be a script (text file).
  
 ''qsub **-M** popel@ufal.mff.cuni.cz,rosa@ufal.mff.cuni.cz **-m** beas'' ''qsub **-M** popel@ufal.mff.cuni.cz,rosa@ufal.mff.cuni.cz **-m** beas''
Line 310: Line 311:
   * ''cat /opt/LRC/REPORTER/LRC-UFAL/stats/userlist.weight'' -- all users sorted according to their activity (number of submitted jobs × their average duration), updated each night   * ''cat /opt/LRC/REPORTER/LRC-UFAL/stats/userlist.weight'' -- all users sorted according to their activity (number of submitted jobs × their average duration), updated each night
  
-  * [[http://ufaladm2/munin/ufal.hide.ms.mff.cuni.cz/lrc-headnode.ufal.hide.ms.mff.cuni.cz/index.html|Munin: graph of cluster usage by day and user]] and  [[http://ufaladm2/munin/ufal.hide.ms.mff.cuni.cz/apophis.ufal.hide.ms.mff.cuni.cz/index.html|Munin monitoring of Apophis disk server]] (both accessible only from ÚFAL network)+  * [[https://ufaladm2.ufal.hide.ms.mff.cuni.cz/munin/ufal.hide.ms.mff.cuni.cz/lrc-master.ufal.hide.ms.mff.cuni.cz/index.html|Munin: graph of cluster usage by day and user]] and  [[https://ufaladm2.ufal.hide.ms.mff.cuni.cz/munin/ufal.hide.ms.mff.cuni.cz/nfs-core.ufal.hide.ms.mff.cuni.cz/index.html|Munin monitoring of disk storage]] (both accessible only from ÚFAL network)
  
 ===== Profiling ===== ===== Profiling =====
Line 328: Line 329:
 ===== Other ===== ===== Other =====
   * There is a **great course [[http://ufal.mff.cuni.cz/courses/npfl102|Data intensive computing]]**, see the 2016 handouts if you missed the course. It covers the usage of [[http://spark.apache.org/|Spark]] (MapReduce/Hadoop alternative, but better) and HDFS (Hadoop filesystem).   * There is a **great course [[http://ufal.mff.cuni.cz/courses/npfl102|Data intensive computing]]**, see the 2016 handouts if you missed the course. It covers the usage of [[http://spark.apache.org/|Spark]] (MapReduce/Hadoop alternative, but better) and HDFS (Hadoop filesystem).
-  * This course had used a special **DLRC (Demo LRC) cluster** (students had to login with ''ssh -p 11422 ufallab.ms.mff.cuni.cz'' and special NPFL102-only LDAP logins) with six virtual machines on one physical. During the years when NPFL102 is not taught (e.g. 2017), the DLRC cluster has just one virtual machine. 
   * **Note:** soma hadoop basics and a lot of NoSQL technologies are covered by [[https://is.cuni.cz/studium/predmety/index.php?do=predmet&kod=NDBI040|Big Data Management and NoSQL Databases]]   * **Note:** soma hadoop basics and a lot of NoSQL technologies are covered by [[https://is.cuni.cz/studium/predmety/index.php?do=predmet&kod=NDBI040|Big Data Management and NoSQL Databases]]
 +  * There is a special cluster for Mgr (and Bc) students (but not for PhD and UFAL members): http://aic.ufal.mff.cuni.cz/
   * You can use environment variables ''$JOB_ID'', ''$JOB_NAME''.   * You can use environment variables ''$JOB_ID'', ''$JOB_NAME''.
   * One job can submit other jobs (but be careful with recursive:-)). A job submitted to the CPU cluster may submit GPU jobs (to the ''qpu.q'' queue).   * One job can submit other jobs (but be careful with recursive:-)). A job submitted to the CPU cluster may submit GPU jobs (to the ''qpu.q'' queue).

[ Back to the navigation ] [ Back to the content ]