[ 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 [2017/09/27 19:10]
popel
grid [2017/09/27 20:45]
popel [Rules]
Line 120: Line 120:
     * If your job needs more than one CPU (on a single machine) for most of the time, reserve the given number of CPU cores (and SGE slots) with <code>qsub -pe smp <number-of-CPU-cores></code> As you can see in [[#List of Machines]], the maximum is 32 cores. If your job needs e.g. up to 110% CPU most of the time and just occasionally 200%, it is OK to reserve just one core (so you don't waste). TODO: when using ''-pe smp -l mf=8G,amf=8G,h_vmem=12G'', which memory limits are per machine and which are per core?     * If your job needs more than one CPU (on a single machine) for most of the time, reserve the given number of CPU cores (and SGE slots) with <code>qsub -pe smp <number-of-CPU-cores></code> As you can see in [[#List of Machines]], the maximum is 32 cores. If your job needs e.g. up to 110% CPU most of the time and just occasionally 200%, it is OK to reserve just one core (so you don't waste). TODO: when using ''-pe smp -l mf=8G,amf=8G,h_vmem=12G'', which memory limits are per machine and which are per core?
     * If you are sure your job needs less than 1GB RAM, then you can skip this. Otherwise, if you need e.g. 8 GiB, you must always use ''qsub'' (or ''qrsh'') with ''-l mem_free=8G''. You should specify also ''act_mem_free'' with the same value and ''h_vmem'' with possibly a slightly bigger value. See [[#memory]] for details. TL;DR: <code>qsub -l mem_free=8G,act_mem_free=8G,h_vmem=12G</code>      * If you are sure your job needs less than 1GB RAM, then you can skip this. Otherwise, if you need e.g. 8 GiB, you must always use ''qsub'' (or ''qrsh'') with ''-l mem_free=8G''. You should specify also ''act_mem_free'' with the same value and ''h_vmem'' with possibly a slightly bigger value. See [[#memory]] for details. TL;DR: <code>qsub -l mem_free=8G,act_mem_free=8G,h_vmem=12G</code> 
-  * Be kind to your colleagues. If you are going to submit jobs that effectively occupy more than one fifth of our cluster for more than several hours, check if the cluster is free (with ''qstat -g c'' or ''qstat -u \*'') and/or ask your colleagues if they don't plan to use the cluster intensively in the near future. Note that if you allocate one slot (CPU core) on a machine, but (almost) all its RAM, you have effectively occupied the whole machine and all its cores.+  * Be kind to your colleagues. If you are going to submit jobs that effectively occupy **more than one fifth of our cluster for more than several hours**, check if the cluster is free (with ''qstat -g c'' or ''qstat -u \*'') and/or ask your colleagues if they don't plan to use the cluster intensively in the near future. Note that if you allocate one slot (CPU core) on a machine, but (almost) all its RAM, you have effectively occupied the whole machine and all its cores. If you are submitting **more than 100 jobs**, consider using setting them a low priority (''-p -1024'', see below) or use [[#qunhold]]. Don't submit more than ca 2000 jobs at once (this can overload the SGE).
  
  
Line 136: Line 136:
 ===== Advanced usage ===== ===== Advanced usage =====
  
-  <code>qsub -o LOG.stdout -e LOG.stderr</code> +''qsub **-p** -100'' 
-    redirect std{out,err} to separate files with given names +Define a priority of your job as a number between -1024 and 0Only SGE admins may use a number higher than 0. The default is 0, i.e. the highest possible priority. SGE uses the priority to decide when to start which pending job in the queue (it computes a real number called ''prior'', which is reported in ''qstat'', which grows as the job is waiting in the queue). Note that once a job is started, you cannot "unschedule" it, so from that moment on, it is irrelevant what was its priority. 
-     +''qsub **-o** LOG.stdout **-e** LOG.stderr'' 
-<code> +redirect std{out,err} to separate files with given names
-qsub -S /bin/bash +
-  # Choose the interpreter of your scriptI think ''/bin/bash'' is now (2017/09) the default (but it used to be ''csh''). +
-qsub -v PATH +
-  # export given environment variable from the current shell to the job +
-qsub -+
-  # export all environment variables +
-man qsub qstat qhold queue_conf sge_types complex +
-  # Find out all the gory details which are missing hereYou'll have to do it one anyway:-)+
-</code>+
  
-  * By default, all the resource requirements (specified with ''-l'') and queue requirements (specified with ''-q'') are //hard//, i.e. your job won't be scheduled unless they can be fulfilled. You can use **''-soft''** to mark all following requirements as nice-to-have. And with **''-hard''** you can switch back to hard requirements. +''qsub **-@** optionfile'' 
-  * If you often run (ad-hoc) bash commands via ''qsub'', check two alternative qsub wrappers ''~bojar/tools/shell/qsubmit'' or ''~stepanek/bin/qcmd'', which allow you to enter the command on command line without creating any temp script filesThe wrappers have also other features (some qsub options have changed default values). ''qcmd'' is older, but unlike ''qsubmit'' it has POD documentation, correct time computation and you don't need to quote the command.+Instead of specifying all the ''qsub'' options on the command line, you can store them in a file (you can use # comments in the file)See also [[#In-script options]].
  
 +''qsub **-a** 12312359''
 +Execute your job no sooner than at the given time (in ''[YY]MMDDhhmm'' format). An alternative to ''sleep 3600 && qsub ... &''.
 +
 +''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 a script or a binary. 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''
 +Specify the emails where you want to be notified when the job has been **b** started, **e** ended, **a** aborted or rescheduled, **s** suspended.
 +
 +''qsub **-hold_jid** 121144,121145''
 +The current job is not executed before all the specified jobs are completed.
 +
 +''qsub **-now** y''
 +Start the job immediately or not at all, i.e. don't put it as pending to the queue. This is the default for ''qrsh'', but you can change it with ''-now n'' (which is the default for ''qsub'').
 +
 +''qsub **-N** my-name''
 +By default the name of a job (which you can see e.g. in ''qstat'') is the name of the ''script.sh''. This way you can override it.
 +
 +
 +''qsub **-S** /bin/bash''
 +The hashbang (''!#/bin/bash'') in your ''script.sh'' is ignored, but you can change the interpreter with ''-S''. I think ''/bin/bash'' is now (2017/09) the default (but it used to be ''csh'').
 +
 +''qsub **-v** PATH''
 +Export a given environment variable from the current shell to the job.
 +
 +''qsub **-V**''
 +Export all environment variables. (This is not so needed now, when bash is the default interpreter and it seems your ''~/.bashrc'' is always sourced.)
 +
 +''qsub **-soft** -l ... **-hard** -l ... -q ...''
 +By default, all the resource requirements (specified with ''-l'') and queue requirements (specified with ''-q'') are //hard//, i.e. your job won't be scheduled unless they can be fulfilled. You can use ''-soft'' to mark all following requirements as nice-to-have. And with ''-hard'' you can switch back to hard requirements.
 +
 +''**qalter**''
 +You can change some properties of already submitted jobs, which are still waiting in the queue (//pending//).
 +
 +''**man** qsub qstat qhold queue_conf sge_types complex''
 +Find out all the gory details which are missing here. You'll have to do it one day anyway:-).
 +
 +=== qsub wrappers ===
 +
 +If you often run (ad-hoc) bash commands via ''qsub'', check ''~bojar/tools/shell/**qsubmit**'' or ''~stepanek/bin/**qcmd**'', which allow you to enter the command on command line without creating any temp script files. The wrappers have also other features (some qsub options have changed default values). ''qcmd'' is older, but unlike ''qsubmit'' it has POD documentation, correct time computation and you don't need to quote the command.
 +
 +=== qunhold ===
 +''~stepanek/bin/qunhold'' tries to keep the number of running SGE jobs under a given threshold: all jobs over the threshold are held. If the number of running jobs goes below the threshold (default: 100), 10 jobs (by default) are unheld. Beware: if your jobs submit new jobs, you can get far over the threshold!
 +
 +=== In-script options ===
 +
 +If you don't use ''-b y'', you can write the ''qsub'' options into ''script.sh'' instead of providing them on the command line. So your ''script.sh'' can be e.g.
 +
 +  #$ -l mem_free=10G,act_mem_free=10G,h_vmem=10G
 +  #$ -pe smp 8
 +  #$ -cwd -j y
 +  #$ -N name-of-my-job
 +  ./what/to/run
 +
 +and you execute it now simply with ''qsub script.sh''.
 +
 +=== Array jobs ===
 +
 +If you have a set of tasks (of the same type) and want to run them on multiple machines,...
 +TODO
 ===== Monitorování úloh ===== ===== Monitorování úloh =====
  

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