Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
grid [2011/06/27 11:17] ufal Aktualizace informací o výpočetním clusteru |
grid [2017/09/27 18:56] popel |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | Cluster | + | LRC (Linguistic Research Cluster) is a name of ÚFAL' |
- | * lrc.ufal.hide.ms.mff.cuni.cz: | + | If you need GPU processing, see a special page about our [[:gpu|GPU cluster called DLL]] (which is actually |
- | * V následující tabulce je uveden seznam výpočetních uzlů clusteru (aktuální k 27.6.2011): | + | |
- | ^ Jméno | + | ===== List of Machines ===== |
- | | andromeda[1-13] | + | Last update: 2017/09. All machines have Ubuntu |
- | | fireball[1-10] | + | Some machines are at Malá Strana (ground floor, new server room built from Lindat budget), some are at Troja (5 km north-east). |
- | | hyperion[1-10] | 2xCore2 Intel Xeon 3 Ghz | 32 | Ubuntu 10.04 | | + | If you need to quickly distinguish which machine is located where, you can use your knowledge of [[https://en.wikipedia.org/ |
- | | orion[1-10] | 2xCore4 Intel Xeon 2 Ghz | 32 | Ubuntu 10.04 | | + | |
- | | pandora[1-10] | 2xCore2 Intel Xeon 2.6 Ghz | 16 | Ubuntu 10.04 | | + | |
- | | sol[1-8,11-13] | 2xCore4 AMD Opteron 2 Ghz | 16 | Ubuntu 10.04 | | + | |
- | | tauri[1-10] | + | |
- | | + | |
- | Frontovací systém umožňuje: | + | ==== Troja (troja-all.q) ==== |
+ | ^ Name ^ CPU type ^ GHz ^cores ^RAM(GB)^ note ^ | ||
+ | | achilles[1-8] | ||
+ | | hector[1-8] | ||
+ | | helena[1-8] | ||
+ | | paris[1-8] | ||
- | * využít na maximum výpočetní výkon | + | ==== MS = Malá Strana (ms-all.q) ==== |
- | * poslat mnoho úloh k řešení najednou, úlohy budou ale spuštěny teprve, když na to bude čas | + | |
- | * " | + | |
- | ===== Jak začít ===== | + | ^ Name ^ CPU type ^ GHz ^cores ^RAM(GB)^ note ^ |
+ | | andromeda[1-13] | ||
+ | | hydra[1-4] | ||
+ | | fireball[1-10] | ||
+ | | hyperion[1-9] | ||
+ | | lucifer[1-10] | ||
+ | | orion[1-6] | ||
+ | | orion[7-10] | ||
+ | | tauri[1-10] | ||
+ | | cosmos | ||
+ | | belzebub | ||
+ | | iridium | ||
+ | | twister[1, | ||
- | Jednou za život musíte provést | + | === 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& | ||
+ | | sol[1-5] | Intel | 2.6 | 4 | 16 | you can ssh here and compute | | ||
+ | | sol[6-8] | ||
- | ===== Ukázka užití SGE ===== | + | The two **lrc machines** are so called heads of the cluster. **No computation is allowed here**, i.e. no CPU-intensive, |
- | Tato posloupnost příkazů ukazuje, jak užít SGE: | + | Alternatively, you can ssh to one of the **sol machines** and submit jobs from here. It is allowed to compute here, which 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. |
- | < | + | The **pandora machines** are in a special cluster |
- | ssh lrc-two | + | |
- | # přihlašte se na hlavu clusteru | + | |
- | echo " | + | |
- | # vyrobte skript, který popisuje, co má úloha udělat | + | |
- | qsub -cwd -j y skript.sh | + | |
- | # zařaďte úlohu do fronty. | + | |
- | # Vlastně stačilo zavolat: qsub skript.sh | + | |
- | # Ale dodatečné parametry zařídily: | + | |
- | # -cwd ... skript bude spuštěn v aktuálním adresáři | + | |
- | # -V ... proměnné z vašeho prostředí budou zkopírovány do prostředí skriptu | + | |
- | # -j y ... standardní a chybový výstup bude spojen (jako to dělá nohup) | + | |
- | # Pořadí parametrů | + | |
- | qstat | + | |
- | qstat -u ' | + | |
- | # Podívejme se, jaké vaše úlohy běží. | + | |
- | # SGE chvíli čeká, než skript opravdu spustí. Pro malinké úlohy tedy SGE může představovat | + | |
- | # zbytečné zpoždění. | + | |
- | # -u '*' ukáže úlohy všech uživatelů na clusteri | + | |
- | cat skript.sh.oXXXXX | + | |
- | # vypište si výstup skriptu. XXXXX je ID jobu, které bylo přiděleno | + | |
- | # qsubem. Čili druhé poslání do fronty starší log typicky nepřepíše. | + | |
- | </ | + | |
- | A takto dopadl výstup našeho skriptu: | + | ===== Installation ===== |
- | < | + | Add the following line into your '~/.bash_profile' |
- | Warning: no access to tty (Bad file descriptor). | + | |
- | Thus no job control in this shell. | + | |
- | sol2.ufal.hide.ms.mff.cuni.cz | + | |
- | / | + | |
- | </ | + | |
- | Další užitečné příkazy a parametry: | + | source / |
- | < | + | 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. |
- | qsub -o LOG.stdout -e LOG.stderr skript.sh | + | Usually, this is the first line of your '~/.bash_profile' |
- | # když chcete přesměrovat výstup skriptu do určených souborů | + | |
- | qsub -S /bin/bash | + | |
- | # když chcete, aby skript běžel v bashi | + | |
- | qsub -V | + | |
- | # když chcete předat proměnné prostředí | + | |
- | qdel all | + | |
- | # když chcete zrušit všechny své joby (rušit cizí nesmíte) | + | |
- | </ | + | |
- | ** V.N.: "qdel all" mi nefunguje, nahradil jsem za:** | + | [ -f ~/.bashrc ] && source ~/.bashrc |
- | qdel " | + | |
+ | ===== Basic usage ===== | ||
+ | First, you need to ssh to the cluster head (lrc1 or lrc2) or to one of the sol machines. The full address is '' | ||
+ | < | ||
+ | ssh lrc1 | ||
+ | echo ' | ||
+ | # prepare a shell script describing your task | ||
+ | qsub -cwd -j y script.sh Hello World | ||
+ | # This submits your job to the default queue, which is currently '' | ||
+ | # Usually, there is a free slot, so the job will be scheduled within few seconds. | ||
+ | # We have used two handy qsub parameters: | ||
+ | # -cwd ... the script is executed in the current directory (the default is your home) | ||
+ | # -j y ... stdout and stderr outputs are merged and redirected to a file ('' | ||
+ | # We have also provided two parameters for our script " | ||
+ | # The qsub prints something like | ||
+ | # Your job 121144 (" | ||
+ | qstat | ||
+ | # This way we inspect all our jobs (both waiting in queue and scheduled, i.e. running). | ||
+ | qstat -u ' | ||
+ | # This shows jobs of all users. | ||
+ | qstat -j 121144 | ||
+ | # This shows detailed info about the job with this number (if it is still running). | ||
+ | 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 ' | ||
+ | </ | ||
+ | The output of our job should look like: | ||
- | ===== Pravidla pro správné používání clusteru | + | < |
+ | LRC:ubuntu 14.04: 8.1.7a Son of Grid Engine variables set... | ||
+ | lucifer5 | ||
+ | / | ||
+ | The second parameter is World | ||
+ | ======= | ||
+ | == Limits: | ||
+ | == Usage: | ||
+ | == Duration: 00:00:02 (2 s) | ||
+ | </ | ||
- | Základní pravidlo, které musíme všichni ctít, aby SGE plnilo svou úlohu dobře: | + | Our admins configured the SGE to print some extra info on stderr: the first line and then the epilog. |
+ | The '' | ||
+ | The '' | ||
- | | + | < |
+ | qdel 121144 | ||
+ | # This way you can delete (" | ||
+ | qdel \* | ||
+ | # This way you can delete all your jobs. Don't be afraid - you cannot delete others jobs. | ||
+ | </ | ||
- | Další doporučení: | + | ===== Rules ===== |
- | * Pokud možno používat '' | + | 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. |
- | * Dotaz: jak se kombinuje '' | + | |
- | * 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 přístupu ke sdíleným diskům. NFS server | + | |
- | * Informovat SGE, kolik paměti úloha žere, aby na strojích nedošla paměť: < | + | |
+ | * Read about our [[internal: | ||
+ | * While your jobs are running (or queued), check your jobs (esp. previously untested setups) and your email (esp. [[internal: | ||
+ | * You can ssh to any cluster machine, which can be useful e.g. to diagnose what's happening there (using '' | ||
+ | * However, **never execute any computing manually** on a cluster machine where you are sshed (i.e. not via '' | ||
+ | * For interactive work, you can use '' | ||
+ | * **Specify the memory and CPU requirements** (if higher than the defaults) and **don' | ||
+ | * 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 < | ||
+ | * 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 '' | ||
+ | * 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 '' | ||
- | Víc pravidel není. | ||
- | ===== Slušné chování ===== | + | === Memory |
- | Pokud chci spouštět úlohy, které poběží dlouhou dobu (hodiny, dny), nepustím je všechny najednou, aby cluster mohli využívat | + | * There are three commonly used options for specifying memory requirements: |
+ | * '' | ||
+ | * **mem_free** (or mf) specifies a // | ||
+ | * **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 '' | ||
+ | * **h_vmem** is equivalent to setting '' | ||
+ | * It is recommended to profile your task first, 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 '' | ||
+ | * **s_vmem** is similar to '' | ||
- | ===== Triky a opentlení ===== | ||
- | + | ===== Advanced usage ===== | |
- | ==== ~bojar/ | + | |
- | + | ||
- | qsubmit je jako qsub, ale příjemnější: | + | |
- | + | ||
- | * nemusíte vyrábět skript, vyrobí ho sám (pozn.: nemusíte vyrábět skript, když použijete přepínač '' | + | |
- | * nemusíte připisovat '' | + | |
< | < | ||
- | ~bojar/ | + | qsub -o LOG.stdout -e LOG.stderr |
- | </ | + | # to redirect std{out,err} to separate files with given names |
- | + | qsub -S /bin/bash | |
- | lépe funguje '' | + | # Choose the interpreter of your script. I think '' |
- | + | qsub -v PATH | |
- | ==== ~zeman/ | + | # |
- | + | qsub -V | |
- | Podobná věc pro '' | + | # když chcete předat proměnné |
- | + | man qsub qstat qhold queue_conf sge_types complex | |
- | <code tcsh> | + | # Find out all the details missing here. You'll have to do it one anyway. |
- | echo $* > $SCRIPTFILE | + | </ |
- | echo $* | + | |
- | echo qsub -cwd -V -S /bin/tcsh -m e $SCRIPTFILE | + | |
- | qsub -cwd -V -S /bin/tcsh -m e $SCRIPTFILE | + | |
- | qstat -u '*' | + | |
- | rm $SCRIPTFILE< | + | |
- | + | ||
- | Příklad spuštění: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | (Kdybych místo uvozovek použil apostrofy, nerozbalily by se mi proměnné. První argument (název skriptu) klidně mohl být v uvozovkách spolu s přesměrováním. Dal jsem ho ven jen proto, že potom '' | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== TectoMT: devel/ | + | |
- | + | ||
- | Jako '' | + | |
- | + | ||
- | | + | |
- | + | ||
- | Skript zadanou hromádku souboru rozdělí do '' | + | |
- | + | ||
- | Soubory možno zadat filelistem, nebo pomocí '' | + | |
- | + | ||
- | Je nutné buď zadat '' | + | |
- | + | ||
- | Parametr '' | + | |
- | + | ||
- | Parametr '' | + | |
- | Výstup každého jobu jde do vlastního logu, '' | + | * By default, all the resource requirements (specified with '' |
+ | * If you often run (ad-hoc) bash commands via '' | ||
- | Parametr '' | + | ===== Monitorování úloh ===== |
- | Bez '' | + | * '' |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * mem_total: celkova pamet uzlu | ||
+ | * mem_free: tedy kolik je jeste volne pameti z pametove quoty uzlu | ||
+ | * act_mem_free: | ||
+ | * mem_used: kolik je pameti skutecne pouzito | ||
+ | * '' | ||
+ | * 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 | ||
+ | * '' | ||
+ | * [[https:// | ||
===== Časté a záludné problémy ===== | ===== Časté a záludné problémy ===== | ||
Line 239: | Line 246: | ||
hard resource_list: | hard resource_list: | ||
- | ===== Synchronizace úloh (v Perlu) ===== | + | ==== Jak rezervovat více jader na stejném stroji pro 1 job ==== |
- | Pokud chci paralelizovat část úlohy (zde '' | + | < |
- | + | qsub -pe smp <pocet jader> | |
- | * Obalím svůj skript pro běh na gridu – vytvořím '' | + | |
- | | + | |
- | # | + | |
- | . / | + | |
- | + | ||
- | qrsh -cwd -V -p -50 -l mf=5g -now no ' | + | |
- | </code> | + | |
- | * Ve svém hlavním skriptu ho pak zavolám a posbírám výsledky: | + | |
- | < | + | |
- | use FileHandle; | + | |
- | use IPC:: | + | |
- | use threads; | + | |
- | use threads:: | + | |
- | my @threads; | + | |
- | my @results; | + | |
- | share(@results); | + | |
- | for (@inputs) | + | |
- | my $t = async { | + | |
- | my $reader; my $writer; | + | |
- | my $pid = open2($reader, | + | |
- | die " | + | |
- | $writer-> | + | |
- | print $writer " | + | |
- | $writer-> | + | |
- | for (< | + | |
- | chomp; | + | |
- | { | + | |
- | lock @results; | + | |
- | push @results, $_; | + | |
- | } | + | |
- | } | + | |
- | waitpid $pid, 0; # Pockame s ukoncenim vlakna na ukonceni ulohy v gridu | + | |
- | return $? >> 8; # Pokusime se ziskat navratovou hodnotu (netestoval jsem) | + | |
- | }; | + | |
- | push @threads, $t; | + | |
- | } | + | |
- | for (@threads) | + | |
- | die "Child exited with non-zero exit code" if $_-> | + | |
- | } | + | |
</ | </ | ||
- | Poznámky: | ||
- | * Pokud lze všechno předat parametry, nemusí se otevírat obousměrná roura a situace bude jednodušší | ||
- | * Pokud '' | ||
- | * Celý příklad je k vidění v Czengu od V.N. |