[ 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 [2007/09/12 19:22]
zeman Už to dávno nejsou jenom soly.
grid [2017/09/27 12:01]
popel
Line 1: Line 1:
-====== Sun Grid Engine (SGE) ======+====== ÚFAL Grid Engine (LRC) ======
  
-Cluster (shlukneboli grid (mřížsíťje skupina počítačů, na kterých běží software pro automatické umístění vašeho výpočtu na dosud nevytížený stroj. Cluster na ÚFALu se nazývá LRC (Linguistic Research Cluster) a clustrovací software na něm je Sun Grid Engine. Do clusteru jsou zařazené tyto počítače:+LRC (Linguistic Research Clusteris a name of ÚFAL's computational grid/clusterwhich has (as of 2017/09about 1600 CPU cores (115 servers + 2 submission heads), with total 10 TiB of RAM. It uses [[https://en.wikipedia.org/wiki/Oracle_Grid_Engine|(Sun/Oracle/Son of) Grid Engine]] software (SGE) for job scheduling etcYou can submit many computing tasks (jobs) at once, they will be placed in a queue and once a machine (slot) with the required capabilities (e.g. RAM, number of cores) is available, your job will be executed (scheduled) on this machine. This way we can maximize the usefulness of the computing resources and divide it among users in a fair way.
  
-  * fireball1 až 10 (na každém 4 procesory Intel Xeon 3 GHz16 GB paměti, Fedora 7) +If you need GPU processingsee special page about our [[:gpu|GPU cluster called DLL]] (which is actually subsystem of LRC with independent queue ''gpu.q'').
-  * tauri1 až 10 (na každém 4 procesory Intel Xeon 3 GHz, 16 GB paměti, Fedora 7) +
-  * orion1 až 10 (na každém 4 procesory Intel Xeon 2 GHz, 16 GB paměti, 12.9.2007 naplánovaná odstávka na reinstalaci) +
-  * sol1 až 10 (na každém 4 procesory AMD Opteron Dual Core 2 GHz, 16 GB paměti, 12.9.2007 naplánovaná odstávka na reinstalaci)+
  
-Frontovací systém umožňuje:+===== List of Machines ===== 
 +Last update2017/09. All machines have Ubuntu 14.04. 
 +Some machines are at Malá Strana (ground floor, new server room built from Lindat budget), some are at Troja (5 km north-east). 
 +If you need to quickly distinguish which machine is located where, you can use your knowledge of [[https://en.wikipedia.org/wiki/Trojan_War|Trojan war]]-related heroes, ''qhost -q'', or the tables below. 
  
-  * využít na maximum výpočetní výkon +==== Troja (troja-all.q) ==== 
-  * poslat mnoho úloh k řešení najednou, úlohy budou ale spuštěny teprve, když na to bude čas +^ Name                ^ CPU type            ^ GHz ^cores ^RAM(GB)^ note ^ 
-  * "spravedlivě" dělit strojový čas mezi zájemce+| achilles[1-8]       | Intel               | 3.2 |   32 |  128 |  | 
 +| hector[1-8]         | Intel               | 1.3 |   32 |  128 |  | 
 +| helena[1-8]         | Intel               | 2.6 |   32 |  128 |  | 
 +| paris[1-8]          | Intel               | 2.4 |   32 |  128 |  |
  
-Jednou za život musíte provést [[Základní nastavení SGE]], abyste SGE mohli používat.+==== MS = Malá Strana (ms-all.q) ====
  
 +^ Name                ^ CPU type            ^ GHz ^cores ^RAM(GB)^ note ^
 +| andromeda[1-13]     | AMD 2xCore4 Opteron | 2.8 |    8 |   32 |  |
 +| hydra[1-4]          | AMD                 | 2.6 |   16 |  128 |  |
 +| fireball[1-10]      |Intel ??2xCore4 Xeon | 3.0 |    4 |   32 |  |
 +| hyperion[1-9]       | Intel 2xCore2 Xeon  | 3.0 |    4 |   32 |  |
 +| lucifer[1-10]       |Intel ??2xCore4 Xeon | 2.4 |   16 |  128 |  |
 +| orion[1-6]          | Intel 2xCore4 Xeon  | 2.3 |    8 |   32 |  |
 +| orion[7-10]         | Intel               | 2.0 |    4 |   32 |  |
 +| tauri[1-10]         |Intel ??2xCore4 Xeon | 3.0 |    4 |   32 |  |
 +| cosmos              | Intel 4xCore2 Xeon  | 2.9 |    8 |  256 |  |
 +| belzebub            | Intel 8xCore4 Xeon  | 2.9 |   32 |  256 |  |
 +| iridium             |Intel ??2xCore4 Xeon | 1.9 |   16 |  512 | also in ''gpu.q'' |
 +| twister[1,2]        | Intel 2xCore4 Xeon  | 2.4 |    8 |   48 | also in ''gpu.q'' |
  
-===== Pravidla pro správné používání clusteru =====+=== Outside LRC cluster (but located as MS) === 
 +^ Name                ^ CPU type            ^ GHz ^cores ^ RAM(GB)^ note  ^ 
 +| lrc[1,2]            | Intel               | 2.3 |    4 |   45 | **no computing here**, just submit jobs | 
 +| pandora[1-10]       | 2xCore2 Intel Xeon  | 2.6 |      |   16 | special cluster&queue ''ms-guests.q''   | 
 +| sol[1-5]            | Intel               | 2.6 |    4 |   16 | you can ssh here and compute | 
 +| sol[6-8]            | Intel               | 2.0 |    8 |   16 | you can ssh here and compute |
  
-Základní pravidlokteré musíme všichni ctít, aby SGE plnilo svou úlohu dobře:+The two **lrc machines** are so called heads of the cluster. **No computation is allowed here**i.e. no CPU-intensive, disk-intensive nor RAM-intensive computation (very simple scripts are OK). You should just ssh to ''lrc1'' or ''lrc2'' and submit your jobs as described bellow.
  
-  Nespouštět úlohy ručně(O ručně spuštěných úlohách SGE nemá informaciklidně na daný uzel pošle ještě další úlohy z fronty.) +Alternatively, you can ssh to one of the **sol machines** and submit jobs from hereIt is allowed to compute herewhich is useful e.g. when you have a script which submits your jobs, but it also collects statistics from the jobs outputs (and possibly submits new jobs conditioned on the statistics). However, the sol machines are relatively slow and may be occupied by your colleagues, so for bigger (longer) tasks, always prefer submission as separate jobs. 
-  Pokud možno používat ''nice''+ 
-  * Uklízet po sobě lokální dataprotože jinak si tam už nikdo nic užitečného nepustí.+The **pandora machines** are in a special cluster (not accessible from lrc) and queue **ms-guests.q** available for our colleagues from KSVI and for students of [[http://ufal.mff.cuni.cz/courses/npfl102|Data intensive computing]] (see the 2016 handouts if you missed the course). 
 + 
 +===== Installation ===== 
 + 
 +Add the following line into your '~/.bash_profile'. 
 + 
 +  source /net/projects/SGE/user/sge_profile 
 + 
 +This detects if you are on one of the cluster machines (including lrc and sol) and sets env variables accordingly. It also prints a status message. 
 +Usuallythis is the first line of your '~/.bash_profile' and the second-and-last line is
  
-Víc pravidel není.+  [ -f ~/.bashrc ] && source ~/.bashrc
  
-===== Ukázka užití SGE =====+===== Basic usage =====
  
-Tato posloupnost příkazů ukazujejak užít SGE:+Firstyou need to ssh to the cluster head (lrc1 or lrc2) or to one of the sol machines. The full address is ''lrc1.ufal.hide.ms.mff.cuni.cz'', but you can use just ''ssh lrc1'' ("hide" means it is accessible only from the ÚFAL network, not from outside; if working from home/Eduroam, you need to [[internal:remote-access|login/VPN]] to the ÚFAL network first).
  
 <code> <code>
-ssh sol7 +ssh lrc1 
-  # přihlašte se na nějaký ze solů +echo 'hostname; pwd; echo The second parameter is $2' script.sh 
-echo "hostname; pwdskript.sh +  # prepare a shell script describing your task 
-  # vyrobte skript, který popisuje, co má úloha udělat +qsub -cwd -j y script.sh Hello World 
-qsub -cwd -j y skript.sh +  # This submits your job to the default queue, which is currently ''ms-all.q''
-  # zařaďte úlohu do fronty+  # Usually, there is a free slot, so the job will be scheduled within few seconds
-  # Vlastně stačilo zavolat: qsub skript.sh +  # We have used two handy qsub parameters
-  # Ale dodatečné parametry zařídily+  #  -cwd  ... the script is executed in the current directory (the default is your home
-  #  -cwd  ... skript bude spuštěn v aktuálním adresáři (a nikoli homu+  #  -j y  ... stdout and stderr outputs are merged and redirected to file (''script.sh.o*''
-  #  -j y  ... standardní chybový výstup bude spojen (jako to dělá nohup+  # We have also provided two parameters for our script "Hello" and "World". 
-  # Pořadí parametrů **je** důležité, co je za jménem skriptu, to se předává skriptu.+  # The qsub prints something like 
 +  #   Your job 121144 ("script.sh") has been submitted
 qstat qstat
-  # Podívejme sejaké úlohy běží+  # This way we inspect all our jobs (both waiting in queue and scheduledi.e. running). 
-  # SGE chvíli čeká, než skript opravdu spustíPro malinké úlohy tedy SGE může představovat +qstat -u '*' | less 
-  # zbytečné zpoždění+  # This shows jobs of all users. 
-cat skript.sh.oXXXXX +qstat -j 121144 
-  # vypište si výstup skriptuXXXXX je ID jobu, které bylo přiděleno +  # This shows detailed info about the job with this number (if it is still running)
-  # qsubem. Čili druhé poslání do fronty starší log typicky nepřepíše.+less script.sh.o* 
 +  # We can inspect the job's output (in our case stored in script.sh.o121144)
 +  # Hint: if the job is still running, press F in 'less' to simulate 'tail -f'.
 </code> </code>
  
-A takto dopadl výstup našeho skriptu:+The output of our job should look like:
  
 <code> <code>
-Warningno access to tty (Bad file descriptor). +LRC:ubuntu 14.04: 8.1.7a Son of Grid Engine variables set... 
-Thus no job control in this shell. +lucifer5 
-sol2.ufal.hide.ms.mff.cuni.cz +/home/popel/tmp 
-/export/home/bojar+The second parameter is World 
 +======= EPILOG: Tue Sep 26 19:49:05 CEST 2017 
 +== Limits:    
 +== Usage:    cpu=00:00:00, mem=0.00000 GB s, io=0.00000 GB, vmem=N/A, maxvmem=N/
 +== Duration: 00:00:02 (2 s)
 </code> </code>
  
-Další užitečné íkazy a parametry:+Our admins configured the SGE to print some extra info on stderr: the first line and then the epilog. 
 +The ''mem=XY GB s'' means gigabytes of RAM used //times// the duration of the job in seconds, so don't be afraid XY is usually a very high number (unlike in this toy example). 
 +The ''maxvmem'' means the peak virtual memory consumption (which is useful for setting ''h_vmem'', see below). 
 + 
 +<code> 
 +qdel 121144 
 +  # This way you can delete ("kill") a job with a given number, or comma-or-space separated list of job numbers. 
 +qdel \* 
 +  # This way you can delete all your jobs. Don't be afraid - you cannot delete others jobs. 
 +</code> 
 + 
 +===== Rules ===== 
 +The purpose of these rules is to prevent your jobs to damage the work of your colleagues and to divide the resources among users in a fair way. 
 + 
 +  * Read about our [[internal:linux-network|network]] first (so you know that e.g. reading big data from your home in 200 parallel jobs is not a good idea). Ask your colleagues (possibly via [[internal:mailing-lists|devel]]) if you are not sure, esp. if you plan to submit jobs with unusual/extreme disk/mem/CPU requirements. 
 +  * While your jobs are running (or queued), check your jobs (esp. previously untested setups) and your email (esp. [[internal:mailing-lists|devel]]) regularly. If you really need to leave e.g. for two-week vacation offline, consult it first with it@ufal (whether they can kill your jobs if needed). 
 +  * You can ssh to any cluster machine, which can be useful e.g. to diagnose what's happening there (using ''htop'' etc.). 
 +  * However, **never execute any computing manually** on a cluster machine where you are sshed (i.e. not via ''qsub'' or ''qrsh''). If you break this rule, your task will take CPU and memory, but the SGE will not know, so it may schedule other users' jobs on the same machine and **their jobs may fail** or run slowly. The sol machines are an exception from this rule. 
 +  * For interactive work, you can use ''qrsh'', but please try to end the job (exit with Ctrl+D) once finished with your work, especially if you ask for a lot of memory or CPUs (see below). One semi-permanent qrsh job (with non-extreme CPU/mem requirements) per user is acceptable. 
 +  * **Specify the memory and CPU requirements** (if higher than the defaults) and **don't exceed them**. 
 +    * 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). 
 +    * <code>qsub -hard -l mem_free=8G -l act_mem_free=8G -l h_vmem=8G</code>  
 + 
 + 
 +Další doporučení: 
 +  * Uklízet po sobě lokální data, protože jinak si tam už nikdo nic užitečného nepustí. 
 +  * Vyhnout se hodně divokému paralelnímu ístupu ke sdíleným diskům. NFS server to pak nepěkně zpomalí pro všechny. Distribuujte tedy i data. 
 +  * Pokud chci spouštět úlohy, které poběží dlouhou dobu (hodiny, dny), nepustím je všechny najednou, aby cluster mohli využívat i ostatní. 
 + 
 +===== Advanced usage ===== 
 + 
 +Other useful commands:
  
 <code> <code>
Line 68: Line 136:
 qsub -S /bin/bash qsub -S /bin/bash
   # když chcete, aby skript běžel v bashi   # když chcete, aby skript běžel v bashi
-qdel all+qsub -V 
 +  # když chcete předat proměnné prostředí 
 +qdel \*
   # když chcete zrušit všechny své joby (rušit cizí nesmíte)   # když chcete zrušit všechny své joby (rušit cizí nesmíte)
 </code> </code>
  
-===== Triky a opentlení ===== 
  
-==== ~bojar/tools/qsubmit ====+ 
 +==== ~bojar/tools/shell/qsubmit ====
  
 qsubmit je jako qsub, ale příjemnější: qsubmit je jako qsub, ale příjemnější:
  
-  * nemusíte vyrábět skript, vyrobí ho sám+  * nemusíte vyrábět skript, vyrobí ho sám (pozn.: nemusíte vyrábět skript, když použijete přepínač ''-b y'')
   * nemusíte připisovat ''-cwd -j y -S /bin/bash''   * nemusíte připisovat ''-cwd -j y -S /bin/bash''
- 
  
 <code> <code>
-~bojar/tools/qsubmit "bashovy_prikaz < prismeruj > presmeruj 2> atd..."+~bojar/tools/shell/qsubmit "bashovy_prikaz < prismeruj > presmeruj 2> atd..."
 </code>  </code> 
  
 +lépe funguje ''~{stepanek,pajas}/bin/qcmd'' (nemusí se kvotovat parametry, správně počítá čas běhu...)
 +
 +===== Monitorování úloh =====
 +
 +  * ''qstat [-u user]'' -- seznam úloh aktuálně běžících / ve frontě
 +  * ''qhost'' -- dostupné zdroje
 +  * ''/SGE/REPORTER/LRC-UFAL/bin/lrc_users_real_mem_usage -u user -w'' -- aktuální využití paměti uživatelem
 +  * ''/SGE/REPORTER/LRC-UFAL/bin/lrc_users_limits_requested -w'' -- nárokované požadavky uživatelů
 +  * ''/SGE/REPORTER/LRC-UFAL/bin/lrc_nodes_meminfo'' -- vypis vsech uzlu a stav vytiznosti pameti.
 +    * mem_total: celkova pamet uzlu
 +    * mem_free: tedy kolik je jeste volne pameti z pametove quoty uzlu
 +    * act_mem_free: kolik uzlu OPRAVDU zbyva volne pameti
 +    * mem_used: kolik je pameti skutecne pouzito
 +  * ''/SGE/REPORTER/LRC-UFAL/bin/lrc_state_overview'' -- celkový přehled o clusteru
 +    * celkovy pocet jader, pocet vyuzitych jader
 +    * celkova velikost RAM, kolik je ji fyzicky nepouzite, kolik je ji jeste nerezervovane
 +    * po jednotlivych uzivatelich (zrovna pocitajicich) -- kolik jim bezi uloh, kolik jich maji ve fronte a kolik z nich je ve stavu hold
 +  * ''cat /SGE/REPORTER/LRC-UFAL/stats/userlist.weight'' -- seznam uživatelů clusteru seřazený podle dosavadní aktivity (počet odeslaných úloh × čas, který běžely), aktualizovaný každý den v&nbsp;noci
 +  * [[https://ufaladm2.ufal.hide.ms.mff.cuni.cz/munin/ufal.hide.ms.mff.cuni.cz/lrc1.ufal.hide.ms.mff.cuni.cz/lrc_users.html|Munin: graf vytíženosti clusteru podle uživatelů]] (viditelný pouze ze sítě ÚFAL)
  
 ===== Časté a záludné problémy ===== ===== Časté a záludné problémy =====
  
-==== Submitnutý job nesmí znovu submitovat ==== 
  
-Pokud se nemýlímnení dovoleno použít ''qsub'' ve skriptu/programukterý je už přes ''qsub'' spuštěn.+==== Submitnutý job může znovu submitovat ==== 
 + 
 +Danovy starší zkušenosti s clusterem PBS (nikoli SGE) říkaly, že tohle nejde. Ale jde to, aspoň u nás. Příkazy ''qsub'' a spol. jsou kromě hlavy clusteru dostupné i na všech strojích clusterusamozřejmě pokud váš soubor ''.bashrc'', ''.cshrc'' apod. zajistí, že se i na nich provede inicializace prostředí SGE. 
 + 
  
 ==== Proměnné prostředí, nastavení vlastního prostředí ==== ==== Proměnné prostředí, nastavení vlastního prostředí ====
Line 98: Line 189:
  
 Zatím nevím přesně, které ze souborů ''.login'', ''.bashrc'' ap. SGE spouští, jestli vůbec nějaké. Naopak, experimentálně jsem ověřil, že ''qsub -S /bin/bash skript'' nenačte žádný z ''.bashrc'', ''.bash_profile'', ''.login'', ani ''.profile''. Zatím nevím přesně, které ze souborů ''.login'', ''.bashrc'' ap. SGE spouští, jestli vůbec nějaké. Naopak, experimentálně jsem ověřil, že ''qsub -S /bin/bash skript'' nenačte žádný z ''.bashrc'', ''.bash_profile'', ''.login'', ani ''.profile''.
 +
 +Z toho například také vyplývá, že bez ošetření se jako **Java** používá
 +
 +   java version "1.5.0"
 +   gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)
 +
 +Pokud chcete submittovaný program pouštět ve svém oblíbeném prostředí (např. nastavení ''PATH''), musíte v obalujícím skriptu příslušné ''.bash*'' načíst. Vždy je ale bezpečnější všude psát plné cesty, než spoléhat na PATH.
  
 ==== Jiný shell ==== ==== Jiný shell ====
Line 142: Line 240:
 fi fi
 </code> </code>
 +
 +==== Jak zjistit, jaké zdroje jsem pro svou úlohu požadoval ====
 +
 +<code>qstat -j 973884,982737,984029,984030,984031,984034,984036 | grep resource
 +hard resource_list:         mem_free=50g
 +hard resource_list:         mem_free=200g
 +hard resource_list:         mem_free=16g
 +hard resource_list:         mem_free=16g
 +hard resource_list:         mem_free=16g
 +hard resource_list:         mem_free=31g</code>
 +
 +==== Jak rezervovat více jader na stejném stroji pro 1 job ====
 +
 +<code>
 +qsub -pe smp <pocet jader>
 +</code>
 +

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