SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
GNU Parallel s, i GNU Stow
Ziua Libert˘at, ii Programelor s, i 30 de ani de GNU ˆın B˘alt, i
Radu Dumbr˘aveanu
Universitatea de Stat “A. Russo” din B˘alt, i, Republica Moldova
B˘alt, i, 2013
GNU Parallel
GNU parallel este un program cu interfat, ˘a ˆın linia de comand˘a
(CLI) care permite utilizatorului executarea ˆın paralel a unei
comenzi sau a unui set de comenzi (script shell).
GNU Parallel
GNU parallel este un program cu interfat, ˘a ˆın linia de comand˘a
(CLI) care permite utilizatorului executarea ˆın paralel a unei
comenzi sau a unui set de comenzi (script shell).
Sintaxa:
parallel [optiuni] [comanda [argumente]] < lista de argumente
sau
parallel [optiuni] [comanda [argumente]] ::: argumente
Exemple clasice de utilizare
(echo ls; echo grep root /etc/passwd) | parallel
Exemple clasice de utilizare
(echo ls; echo grep root /etc/passwd) | parallel
parallel traceroute ::: foss.org.my debian.org freenetproject.org
Exemple clasice de utilizare
(echo ls; echo grep root /etc/passwd) | parallel
parallel traceroute ::: foss.org.my debian.org freenetproject.org
parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org
Exemple clasice de utilizare
(echo ls; echo grep root /etc/passwd) | parallel
parallel traceroute ::: foss.org.my debian.org freenetproject.org
parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org
find . −type f | parallel gzip
Exemple clasice de utilizare
(echo ls; echo grep root /etc/passwd) | parallel
parallel traceroute ::: foss.org.my debian.org freenetproject.org
parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org
find . −type f | parallel gzip
ls ∗.gz | parallel −X mv {} archive
Dificult˘at, i?
Dificult˘at, i?
Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu
mesajul de eroare:
The program ’parallel’ is currently not installed. You can
install it by typing:
sudo apt−get install moreutils
Dificult˘at, i?
Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu
mesajul de eroare:
The program ’parallel’ is currently not installed. You can
install it by typing:
sudo apt−get install moreutils
Nu urmat, i acest˘a indicat, ie; comanda parallel din pachetul
moreutils este cu totul altceva.
Modalit˘at, i de instalare
Putem instala parallel ˆın felul urm˘ator:
1 sudo apt−get install parallel
Modalit˘at, i de instalare
Putem instala parallel ˆın felul urm˘ator:
1 sudo apt−get install parallel
sau
1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2
2 tar xf parallel−20130922.tar.bz2
3 cd parallel−20130922
4 ./configure
5 make
6 make install
Modalit˘at, i de instalare
Putem instala parallel ˆın felul urm˘ator:
1 sudo apt−get install parallel
sau
1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2
2 tar xf parallel−20130922.tar.bz2
3 cd parallel−20130922
4 ./configure
5 make
6 make install
20130922 = versiunea parallel din 22.09.2013
Modalit˘at, i de instalare
Dac˘a nu sˆıntet, i root atunci:
creat, i dosarele ~/bin s, i ~/share apoi
1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2
2 tar xf parallel−20130922.tar.bz2
3 cd parallel−20130922
4 ./configure −−prefix=$HOME
5 make
6 make install
Modalit˘at, i de instalare
Sau dac˘a dorit, i s˘a utilizat, i parallel f˘ar˘a a-l instala (de exemplu
pentru a experimenta):
1 wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel
2 chmod 755 parallel
3 cp parallel sem
4 mv parallel sem ˜/bin/
Modalit˘at, i de instalare
Sau dac˘a dorit, i s˘a utilizat, i parallel f˘ar˘a a-l instala (de exemplu
pentru a experimenta):
1 wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel
2 chmod 755 parallel
3 cp parallel sem
4 mv parallel sem ˜/bin/
parallel este un script Perl, nu ai ce compila.
Mai mult˘a informat, ie pe
https://github.com/razrichter/gnu_parallel.
Dificult˘at, i?
Dificult˘at, i?
Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu
mesajul de eroare:
1 /bin/bash: {}: command not found
sau
1 /bin/bash: :::: command not found
Dificult˘at, i?
Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu
mesajul de eroare:
1 /bin/bash: {}: command not found
sau
1 /bin/bash: :::: command not found
Solut, ii:
Dificult˘at, i?
Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu
mesajul de eroare:
1 /bin/bash: {}: command not found
sau
1 /bin/bash: :::: command not found
Solut, ii:
ad˘augat, i opt, iunea --gnu (parallel --gnu ...);
sau sudo rm /etc/parallael/config;
sau http://stackoverflow.com/questions/16448887/
gnu-parallel-not-working-at-all
Exemple de utilizare (divizarea fis, ierelor mari pe blocuri)
cat fisiermare.sql | parallel −k −−pipe grep −i ”text”
cat bigfiledump.sql | parallel −k −−pipe −−block 2M 
grep −i ”text”
Exemple de utilizare (divizarea fis, ierelor mari pe blocuri)
cat fisiermare.sql | parallel −k −−pipe grep −i ”text”
cat bigfiledump.sql | parallel −k −−pipe −−block 2M 
grep −i ”text”
cat bigfiledump.sql | parallel −k −−pipe −−block 2M 
−−sshlogin server.example.com,server2.example.net 
grep −i ”text”
Modalit˘at, i de transmitere a parametrilor
Cum transmitem parametrii la comanda care trebuie executat˘a ˆın
paralel?
Modalit˘at, i de transmitere a parametrilor
Cum transmitem parametrii la comanda care trebuie executat˘a ˆın
paralel?
1) Prin intrarea standard:
1 seq 5 | parallel echo
2 1
3 2
4 3
5 4
6 5
Modalit˘at, i de transmitere a parametrilor
Accesul la parametri:
1 seq 5 | parallel echo ”parm={}”
2 param=1
3 param=2
4 param=3
5 param=4
6 param=5
Modalit˘at, i de transmitere a parametrilor
Mai mult, i parametri deodat˘a:
1 seq 10 | parallel −X echo
2 1 2 3 4 5
3 6 7 8 9 10
Modalit˘at, i de transmitere a parametrilor
2) Prin fis, iere:
1 parallel wget < adresse.lst
1 cat adrese.lst
2 foss.org.my
3 debian.org
4 freenetproject.org
Modalit˘at, i de transmitere a parametrilor
3) Prin linia de comand˘a:
1 parallel echo ::: 1 2 3 4
1 1
2 2
3 3
4 4
Modalit˘at, i de transmitere a parametrilor
3) Prin linia de comand˘a:
1 parallel echo ::: 1 2 3 4
1 1
2 2
3 3
4 4
sau
1 parallel unzip ::: ./∗.zip
Specificarea num˘arul de procese paralele
1) Num˘arul de procese = num˘arul de procesoare:
1 seq 10 20 | parallel −j+0 sleep
1 ps f −o pid,command
2 PID COMMAND
3 31379 −bash
4 32270  ps f −o pid,command
5 30463 −bash
6 30579  mc
7 30581  bash −rcfile .bashrc
8 32239  /usr/bin/perl −w /usr/bin/parallel −j+0 sleep
9 32268  sleep 10
10 32269  sleep 11
Specificarea num˘arul de procese paralele
2) Num˘arul maximal de procese, explicit:
1 seq 10 20 | parallel −j 5 sleep
1 ps f −o pid,command
2 PID COMMAND
3 31379 −bash
4 32523  ps f −o pid,command
5 30463 −bash
6 30579  mc
7 30581  bash −rcfile .bashrc
8 32487  /usr/bin/perl −w /usr/bin/parallel −j 5 sleep
9 32518  sleep 10
10 32519  sleep 11
11 32520  sleep 12
12 32521  sleep 13
13 32522  sleep 14
Specificarea num˘arul de procese paralele
3) Num˘arul de sarcini per procesor, explicit:
1 $ seq 10 20 | parallel −j 150% sleep
1 ps f −o pid,command
2 PID COMMAND
3 31379 −bash
4 32636  ps f −o pid,command
5 30463 −bash
6 30579  mc
7 30581  bash −rcfile .bashrc
8 32602  /usr/bin/perl −w /usr/bin/parallel −j 150% sleep
9 32632  sleep 10
10 32633  sleep 11
11 32634  sleep 12
Contraexemplu
1 cd dosarcu66925fisiere
2 /usr/bin/time cp −r ∗ /tmp
3 1.77user 49.62system 6:49.01elapsed 12%CPU
4 7692784inputs+7367600outputs (0major+320minor)
Contraexemplu
1 cd dosarcu66925fisiere
2 /usr/bin/time cp −r ∗ /tmp
3 1.77user 49.62system 6:49.01elapsed 12%CPU
4 7692784inputs+7367600outputs (0major+320minor)
1 cd dosarcu66925fisiere
2 ls . | /usr/bin/time parallel −j+0 cp −r {} /tmp
3 2.40user 37.61system 6:30.38elapsed 10%CPU
4 7402904inputs+7367600outputs (21major+27017minor)
Contraexemplu
1 cd dosarcu66925fisiere
2 /usr/bin/time cp −r ∗ /tmp
3 1.77user 49.62system 6:49.01elapsed 12%CPU
4 7692784inputs+7367600outputs (0major+320minor)
1 cd dosarcu66925fisiere
2 ls . | /usr/bin/time parallel −j+0 cp −r {} /tmp
3 2.40user 37.61system 6:30.38elapsed 10%CPU
4 7402904inputs+7367600outputs (21major+27017minor)
1 cd dosarcu66925fisiere
2 ls . | /usr/bin/time parallel −j 150% cp −r {} /tmp
3 2.51user 50.74system 12:55.95elapsed 6%CPU
4 7579504inputs+7367608outputs (27major+28524minor)
Adrese web
Pagina web
http://www.gnu.org/software/parallel
Manual s, i exemple
http://www.gnu.org/software/parallel/man.html
Sursele
http://savannah.gnu.org/git/?group=parallel
Adrese web
Tutoriale
http://savannah.gnu.org/projects/parallel
Video (partea I s, i II)
http://www.youtube.com/watch?v=OpaiGYxkSuQ
http://www.youtube.com/watch?v=P40akGWJ_gY
Miscelaneu
http://static.usenix.org/publications/login/2011-02/pdfs/Tange.pdf
http://wiki.scinethpc.ca/wiki/images/7/7b/Tech-talk-gnu-parallel.pdf
http://www.luga.de/Angebote/Vortraege/GNU_Parallel_LIT_2011/GNU_
Parallel_LIT_2011.pdf
http://www.admin-magazine.com/HPC/Articles/
GNU-Parallel-Multicore-at-the-Command-Line-with-GNU-Parallel
Adrese web
Comparat, ie cu alte comenzi (xargs, find -exec, make -j etc)
http://www.gnu.org/software/parallel/man.html#summary_table
GNU Stow
GNU Stow este un caz particular de manager de pachete.
Instalare:
1 sudo apt−get install stow
Instalarea pachetelor
Cum instal˘am un pachet cu ajutorul lui GNU Stow?
1 sudo make install prefix=/usr/local/stow/numepachet
2 cd /usr/local/stow
3 sudo stow numepachet
Instalarea pachetelor
Cum instal˘am un pachet cu ajutorul lui GNU Stow?
1 sudo make install prefix=/usr/local/stow/numepachet
2 cd /usr/local/stow
3 sudo stow numepachet
Pachetele care nu folosesc GNU AutoConf pot s˘a nu accepte
parametrul “prefix”, atunci este nevoie de modific˘ari ˆın fis, ierul
Makefile.
Eliminarea pachetelor
1 cd /usr/local/stow/
2 sudo stow −D numepachet
Exemplu: mai multe versiuni ale unuia s, i aceluias, i pachet
ˆın aceeas, i distribut, ie
Mai multe versiuni ale unuia s, i aceluias, i pachet ˆımpreun˘a.
1 cd numepachet−3.0
2 sudo make install prefix=/usr/local/stow/numepachet−3.0
3 cd numepachet−3.1−beta
4 sudo make install prefix=/usr/local/stow/numepachet−3.1−beta
Exemplu: mai multe versiuni ale unuia s, i aceluias, i pachet
ˆın aceeas, i distribut, ie
Putem accesa fis, iere ambelor pachete prin
1 /usr/local/stow/numepachet−3.0/bin/fisierbinar
s, i
2 /usr/local/stow/numepachet−3.1−beta/bin/fisierbinar
Iar dac˘a execut˘am
1 cd /usr/local/stow
2 sudo stow numepachet−3.0
atunci lansˆınd ˆın linia de comand˘a doar fisierbinar vom accesa
/usr/local/stow/numepachet-3.0/bin/fisierbinar.
Adrese web
Pagina web
http://www.gnu.org/software/stow/
Manual s, i exemple
http://www.gnu.org/software/stow/manual/

Weitere ähnliche Inhalte

Was ist angesagt?

主機自保指南
主機自保指南主機自保指南
主機自保指南維泰 蔡
 
Piratte installation
Piratte installationPiratte installation
Piratte installationKampa Lavanya
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memoryjulien pauli
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs董 伟明
 
Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Esehara Shigeo
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:wensheng wei
 
List command linux fidora
List command linux fidoraList command linux fidora
List command linux fidoraJinyuan Loh
 
CentOS_slide_ver1.0
CentOS_slide_ver1.0CentOS_slide_ver1.0
CentOS_slide_ver1.0Satoshi Kume
 
Terminal linux commands_ Fedora based
Terminal  linux commands_ Fedora basedTerminal  linux commands_ Fedora based
Terminal linux commands_ Fedora basedNavin Thapa
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commandsRishu Seth
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015Phillip Trelford
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshopjulien pauli
 
Drupal and Open shift (and php)
Drupal and Open shift (and php)Drupal and Open shift (and php)
Drupal and Open shift (and php)Phase2
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5julien pauli
 
Bash script (mask off remix)
Bash script (mask off remix)Bash script (mask off remix)
Bash script (mask off remix)Elaine Yeung
 

Was ist angesagt? (20)

主機自保指南
主機自保指南主機自保指南
主機自保指南
 
Piratte installation
Piratte installationPiratte installation
Piratte installation
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memory
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs
 
Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.Fizz and buzz of computer programs in python.
Fizz and buzz of computer programs in python.
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
 
List command linux fidora
List command linux fidoraList command linux fidora
List command linux fidora
 
CentOS_slide_ver1.0
CentOS_slide_ver1.0CentOS_slide_ver1.0
CentOS_slide_ver1.0
 
Terminal linux commands_ Fedora based
Terminal  linux commands_ Fedora basedTerminal  linux commands_ Fedora based
Terminal linux commands_ Fedora based
 
Ngrep commands
Ngrep commandsNgrep commands
Ngrep commands
 
Intro commandline
Intro commandlineIntro commandline
Intro commandline
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
Drupal and Open shift (and php)
Drupal and Open shift (and php)Drupal and Open shift (and php)
Drupal and Open shift (and php)
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
Centos config
Centos configCentos config
Centos config
 
Bash script (mask off remix)
Bash script (mask off remix)Bash script (mask off remix)
Bash script (mask off remix)
 
TimeCryption
TimeCryptionTimeCryption
TimeCryption
 

Ähnlich wie GNU Parallel și GNU Stow

System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsashukiller7
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
HowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuHowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuA Jorge Garcia
 
Operating System Practice : Meeting 3 - operasi input output-slide
Operating System Practice : Meeting 3 - operasi input output-slideOperating System Practice : Meeting 3 - operasi input output-slide
Operating System Practice : Meeting 3 - operasi input output-slideSyaiful Ahdan
 
linux_Commads
linux_Commadslinux_Commads
linux_Commadstastedone
 
Basic command for linux
Basic command for linuxBasic command for linux
Basic command for linuxgt0ne
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Joachim Jacob
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformaticsBonnie Ng
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactAlessandro Selli
 
Continuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityContinuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityScyllaDB
 
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideOperating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideSyaiful Ahdan
 
Dev8d 2011-pipe2 py
Dev8d 2011-pipe2 pyDev8d 2011-pipe2 py
Dev8d 2011-pipe2 pyTony Hirst
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementLubomir Rintel
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux TroubleshootingKeith Wright
 
Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Ahmed El-Arabawy
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Jérôme Petazzoni
 
OverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxOverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxalfred4lewis58146
 

Ähnlich wie GNU Parallel și GNU Stow (20)

System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
HowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuHowTo Install openMPI on Ubuntu
HowTo Install openMPI on Ubuntu
 
Operating System Practice : Meeting 3 - operasi input output-slide
Operating System Practice : Meeting 3 - operasi input output-slideOperating System Practice : Meeting 3 - operasi input output-slide
Operating System Practice : Meeting 3 - operasi input output-slide
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
 
Basic command for linux
Basic command for linuxBasic command for linux
Basic command for linux
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Linux
LinuxLinux
Linux
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
Continuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityContinuous Go Profiling & Observability
Continuous Go Profiling & Observability
 
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideOperating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
 
Dev8d 2011-pipe2 py
Dev8d 2011-pipe2 pyDev8d 2011-pipe2 py
Dev8d 2011-pipe2 py
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service managementA journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)
 
OverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxOverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docx
 

Mehr von Radu Dumbrăveanu

About extensions of mappings into topologically complete spaces
About extensions of mappings into topologically complete spacesAbout extensions of mappings into topologically complete spaces
About extensions of mappings into topologically complete spacesRadu Dumbrăveanu
 
Structuri discrete - Curs5: Calculul propozițional
Structuri discrete - Curs5: Calculul propoziționalStructuri discrete - Curs5: Calculul propozițional
Structuri discrete - Curs5: Calculul propoziționalRadu Dumbrăveanu
 
Structuri discrete - Curs3: Relații
Structuri discrete - Curs3: RelațiiStructuri discrete - Curs3: Relații
Structuri discrete - Curs3: RelațiiRadu Dumbrăveanu
 
Structuri discrete - Curs1: Mulțimi
Structuri discrete - Curs1: MulțimiStructuri discrete - Curs1: Mulțimi
Structuri discrete - Curs1: MulțimiRadu Dumbrăveanu
 
Curs 6: Cuplaje; Factorizări
Curs 6: Cuplaje; FactorizăriCurs 6: Cuplaje; Factorizări
Curs 6: Cuplaje; FactorizăriRadu Dumbrăveanu
 
Curs 3: Grafuri; Subgrafuri; Operații
Curs 3: Grafuri; Subgrafuri; OperațiiCurs 3: Grafuri; Subgrafuri; Operații
Curs 3: Grafuri; Subgrafuri; OperațiiRadu Dumbrăveanu
 
Curs 2: Grafuri Euler; Grafuri Hamilton
Curs 2: Grafuri Euler; Grafuri HamiltonCurs 2: Grafuri Euler; Grafuri Hamilton
Curs 2: Grafuri Euler; Grafuri HamiltonRadu Dumbrăveanu
 
Curs 1: Grafuri; Introducere
Curs 1: Grafuri; IntroducereCurs 1: Grafuri; Introducere
Curs 1: Grafuri; IntroducereRadu Dumbrăveanu
 
Metode de autentificare în moodle
Metode de autentificare în moodleMetode de autentificare în moodle
Metode de autentificare în moodleRadu Dumbrăveanu
 
Experiences of Moodle Administration
Experiences of Moodle AdministrationExperiences of Moodle Administration
Experiences of Moodle AdministrationRadu Dumbrăveanu
 

Mehr von Radu Dumbrăveanu (17)

What is git?
What is git?What is git?
What is git?
 
About extensions of mappings into topologically complete spaces
About extensions of mappings into topologically complete spacesAbout extensions of mappings into topologically complete spaces
About extensions of mappings into topologically complete spaces
 
Structuri discrete - Curs5: Calculul propozițional
Structuri discrete - Curs5: Calculul propoziționalStructuri discrete - Curs5: Calculul propozițional
Structuri discrete - Curs5: Calculul propozițional
 
Structuri discrete - Curs3: Relații
Structuri discrete - Curs3: RelațiiStructuri discrete - Curs3: Relații
Structuri discrete - Curs3: Relații
 
Structuri discrete - Curs1: Mulțimi
Structuri discrete - Curs1: MulțimiStructuri discrete - Curs1: Mulțimi
Structuri discrete - Curs1: Mulțimi
 
Curs 9: Grafuri orientate
Curs 9: Grafuri orientateCurs 9: Grafuri orientate
Curs 9: Grafuri orientate
 
Curs 8: Grafuri planare
Curs 8: Grafuri planareCurs 8: Grafuri planare
Curs 8: Grafuri planare
 
Curs 7: Colorare
Curs 7: ColorareCurs 7: Colorare
Curs 7: Colorare
 
Curs 6: Cuplaje; Factorizări
Curs 6: Cuplaje; FactorizăriCurs 6: Cuplaje; Factorizări
Curs 6: Cuplaje; Factorizări
 
Curs 5: Conexitate
Curs 5: ConexitateCurs 5: Conexitate
Curs 5: Conexitate
 
Curs 4: Arbori
Curs 4: ArboriCurs 4: Arbori
Curs 4: Arbori
 
Curs 3: Grafuri; Subgrafuri; Operații
Curs 3: Grafuri; Subgrafuri; OperațiiCurs 3: Grafuri; Subgrafuri; Operații
Curs 3: Grafuri; Subgrafuri; Operații
 
Curs 2: Grafuri Euler; Grafuri Hamilton
Curs 2: Grafuri Euler; Grafuri HamiltonCurs 2: Grafuri Euler; Grafuri Hamilton
Curs 2: Grafuri Euler; Grafuri Hamilton
 
Curs 1: Grafuri; Introducere
Curs 1: Grafuri; IntroducereCurs 1: Grafuri; Introducere
Curs 1: Grafuri; Introducere
 
Metode de autentificare în moodle
Metode de autentificare în moodleMetode de autentificare în moodle
Metode de autentificare în moodle
 
Experiences of Moodle Administration
Experiences of Moodle AdministrationExperiences of Moodle Administration
Experiences of Moodle Administration
 
Presentation
PresentationPresentation
Presentation
 

Kürzlich hochgeladen

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Kürzlich hochgeladen (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

GNU Parallel și GNU Stow

  • 1. GNU Parallel s, i GNU Stow Ziua Libert˘at, ii Programelor s, i 30 de ani de GNU ˆın B˘alt, i Radu Dumbr˘aveanu Universitatea de Stat “A. Russo” din B˘alt, i, Republica Moldova B˘alt, i, 2013
  • 2. GNU Parallel GNU parallel este un program cu interfat, ˘a ˆın linia de comand˘a (CLI) care permite utilizatorului executarea ˆın paralel a unei comenzi sau a unui set de comenzi (script shell).
  • 3. GNU Parallel GNU parallel este un program cu interfat, ˘a ˆın linia de comand˘a (CLI) care permite utilizatorului executarea ˆın paralel a unei comenzi sau a unui set de comenzi (script shell). Sintaxa: parallel [optiuni] [comanda [argumente]] < lista de argumente sau parallel [optiuni] [comanda [argumente]] ::: argumente
  • 4. Exemple clasice de utilizare (echo ls; echo grep root /etc/passwd) | parallel
  • 5. Exemple clasice de utilizare (echo ls; echo grep root /etc/passwd) | parallel parallel traceroute ::: foss.org.my debian.org freenetproject.org
  • 6. Exemple clasice de utilizare (echo ls; echo grep root /etc/passwd) | parallel parallel traceroute ::: foss.org.my debian.org freenetproject.org parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org
  • 7. Exemple clasice de utilizare (echo ls; echo grep root /etc/passwd) | parallel parallel traceroute ::: foss.org.my debian.org freenetproject.org parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org find . −type f | parallel gzip
  • 8. Exemple clasice de utilizare (echo ls; echo grep root /etc/passwd) | parallel parallel traceroute ::: foss.org.my debian.org freenetproject.org parallel −j0 ping −nc 3 ::: foss.org.my gnu.org freenetproject.org find . −type f | parallel gzip ls ∗.gz | parallel −X mv {} archive
  • 10. Dificult˘at, i? Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu mesajul de eroare: The program ’parallel’ is currently not installed. You can install it by typing: sudo apt−get install moreutils
  • 11. Dificult˘at, i? Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu mesajul de eroare: The program ’parallel’ is currently not installed. You can install it by typing: sudo apt−get install moreutils Nu urmat, i acest˘a indicat, ie; comanda parallel din pachetul moreutils este cu totul altceva.
  • 12. Modalit˘at, i de instalare Putem instala parallel ˆın felul urm˘ator: 1 sudo apt−get install parallel
  • 13. Modalit˘at, i de instalare Putem instala parallel ˆın felul urm˘ator: 1 sudo apt−get install parallel sau 1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2 2 tar xf parallel−20130922.tar.bz2 3 cd parallel−20130922 4 ./configure 5 make 6 make install
  • 14. Modalit˘at, i de instalare Putem instala parallel ˆın felul urm˘ator: 1 sudo apt−get install parallel sau 1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2 2 tar xf parallel−20130922.tar.bz2 3 cd parallel−20130922 4 ./configure 5 make 6 make install 20130922 = versiunea parallel din 22.09.2013
  • 15. Modalit˘at, i de instalare Dac˘a nu sˆıntet, i root atunci: creat, i dosarele ~/bin s, i ~/share apoi 1 wget ftp://ftp.gnu.org/gnu/parallel/parallel−20130922.tar.bz2 2 tar xf parallel−20130922.tar.bz2 3 cd parallel−20130922 4 ./configure −−prefix=$HOME 5 make 6 make install
  • 16. Modalit˘at, i de instalare Sau dac˘a dorit, i s˘a utilizat, i parallel f˘ar˘a a-l instala (de exemplu pentru a experimenta): 1 wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel 2 chmod 755 parallel 3 cp parallel sem 4 mv parallel sem ˜/bin/
  • 17. Modalit˘at, i de instalare Sau dac˘a dorit, i s˘a utilizat, i parallel f˘ar˘a a-l instala (de exemplu pentru a experimenta): 1 wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel 2 chmod 755 parallel 3 cp parallel sem 4 mv parallel sem ˜/bin/ parallel este un script Perl, nu ai ce compila. Mai mult˘a informat, ie pe https://github.com/razrichter/gnu_parallel.
  • 19. Dificult˘at, i? Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu mesajul de eroare: 1 /bin/bash: {}: command not found sau 1 /bin/bash: :::: command not found
  • 20. Dificult˘at, i? Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu mesajul de eroare: 1 /bin/bash: {}: command not found sau 1 /bin/bash: :::: command not found Solut, ii:
  • 21. Dificult˘at, i? Lansarea oric˘arei comenzi ce cont, ine parallel se sfˆırs, es, te cu mesajul de eroare: 1 /bin/bash: {}: command not found sau 1 /bin/bash: :::: command not found Solut, ii: ad˘augat, i opt, iunea --gnu (parallel --gnu ...); sau sudo rm /etc/parallael/config; sau http://stackoverflow.com/questions/16448887/ gnu-parallel-not-working-at-all
  • 22. Exemple de utilizare (divizarea fis, ierelor mari pe blocuri) cat fisiermare.sql | parallel −k −−pipe grep −i ”text” cat bigfiledump.sql | parallel −k −−pipe −−block 2M grep −i ”text”
  • 23. Exemple de utilizare (divizarea fis, ierelor mari pe blocuri) cat fisiermare.sql | parallel −k −−pipe grep −i ”text” cat bigfiledump.sql | parallel −k −−pipe −−block 2M grep −i ”text” cat bigfiledump.sql | parallel −k −−pipe −−block 2M −−sshlogin server.example.com,server2.example.net grep −i ”text”
  • 24. Modalit˘at, i de transmitere a parametrilor Cum transmitem parametrii la comanda care trebuie executat˘a ˆın paralel?
  • 25. Modalit˘at, i de transmitere a parametrilor Cum transmitem parametrii la comanda care trebuie executat˘a ˆın paralel? 1) Prin intrarea standard: 1 seq 5 | parallel echo 2 1 3 2 4 3 5 4 6 5
  • 26. Modalit˘at, i de transmitere a parametrilor Accesul la parametri: 1 seq 5 | parallel echo ”parm={}” 2 param=1 3 param=2 4 param=3 5 param=4 6 param=5
  • 27. Modalit˘at, i de transmitere a parametrilor Mai mult, i parametri deodat˘a: 1 seq 10 | parallel −X echo 2 1 2 3 4 5 3 6 7 8 9 10
  • 28. Modalit˘at, i de transmitere a parametrilor 2) Prin fis, iere: 1 parallel wget < adresse.lst 1 cat adrese.lst 2 foss.org.my 3 debian.org 4 freenetproject.org
  • 29. Modalit˘at, i de transmitere a parametrilor 3) Prin linia de comand˘a: 1 parallel echo ::: 1 2 3 4 1 1 2 2 3 3 4 4
  • 30. Modalit˘at, i de transmitere a parametrilor 3) Prin linia de comand˘a: 1 parallel echo ::: 1 2 3 4 1 1 2 2 3 3 4 4 sau 1 parallel unzip ::: ./∗.zip
  • 31. Specificarea num˘arul de procese paralele 1) Num˘arul de procese = num˘arul de procesoare: 1 seq 10 20 | parallel −j+0 sleep 1 ps f −o pid,command 2 PID COMMAND 3 31379 −bash 4 32270 ps f −o pid,command 5 30463 −bash 6 30579 mc 7 30581 bash −rcfile .bashrc 8 32239 /usr/bin/perl −w /usr/bin/parallel −j+0 sleep 9 32268 sleep 10 10 32269 sleep 11
  • 32. Specificarea num˘arul de procese paralele 2) Num˘arul maximal de procese, explicit: 1 seq 10 20 | parallel −j 5 sleep 1 ps f −o pid,command 2 PID COMMAND 3 31379 −bash 4 32523 ps f −o pid,command 5 30463 −bash 6 30579 mc 7 30581 bash −rcfile .bashrc 8 32487 /usr/bin/perl −w /usr/bin/parallel −j 5 sleep 9 32518 sleep 10 10 32519 sleep 11 11 32520 sleep 12 12 32521 sleep 13 13 32522 sleep 14
  • 33. Specificarea num˘arul de procese paralele 3) Num˘arul de sarcini per procesor, explicit: 1 $ seq 10 20 | parallel −j 150% sleep 1 ps f −o pid,command 2 PID COMMAND 3 31379 −bash 4 32636 ps f −o pid,command 5 30463 −bash 6 30579 mc 7 30581 bash −rcfile .bashrc 8 32602 /usr/bin/perl −w /usr/bin/parallel −j 150% sleep 9 32632 sleep 10 10 32633 sleep 11 11 32634 sleep 12
  • 34. Contraexemplu 1 cd dosarcu66925fisiere 2 /usr/bin/time cp −r ∗ /tmp 3 1.77user 49.62system 6:49.01elapsed 12%CPU 4 7692784inputs+7367600outputs (0major+320minor)
  • 35. Contraexemplu 1 cd dosarcu66925fisiere 2 /usr/bin/time cp −r ∗ /tmp 3 1.77user 49.62system 6:49.01elapsed 12%CPU 4 7692784inputs+7367600outputs (0major+320minor) 1 cd dosarcu66925fisiere 2 ls . | /usr/bin/time parallel −j+0 cp −r {} /tmp 3 2.40user 37.61system 6:30.38elapsed 10%CPU 4 7402904inputs+7367600outputs (21major+27017minor)
  • 36. Contraexemplu 1 cd dosarcu66925fisiere 2 /usr/bin/time cp −r ∗ /tmp 3 1.77user 49.62system 6:49.01elapsed 12%CPU 4 7692784inputs+7367600outputs (0major+320minor) 1 cd dosarcu66925fisiere 2 ls . | /usr/bin/time parallel −j+0 cp −r {} /tmp 3 2.40user 37.61system 6:30.38elapsed 10%CPU 4 7402904inputs+7367600outputs (21major+27017minor) 1 cd dosarcu66925fisiere 2 ls . | /usr/bin/time parallel −j 150% cp −r {} /tmp 3 2.51user 50.74system 12:55.95elapsed 6%CPU 4 7579504inputs+7367608outputs (27major+28524minor)
  • 37. Adrese web Pagina web http://www.gnu.org/software/parallel Manual s, i exemple http://www.gnu.org/software/parallel/man.html Sursele http://savannah.gnu.org/git/?group=parallel
  • 38. Adrese web Tutoriale http://savannah.gnu.org/projects/parallel Video (partea I s, i II) http://www.youtube.com/watch?v=OpaiGYxkSuQ http://www.youtube.com/watch?v=P40akGWJ_gY Miscelaneu http://static.usenix.org/publications/login/2011-02/pdfs/Tange.pdf http://wiki.scinethpc.ca/wiki/images/7/7b/Tech-talk-gnu-parallel.pdf http://www.luga.de/Angebote/Vortraege/GNU_Parallel_LIT_2011/GNU_ Parallel_LIT_2011.pdf http://www.admin-magazine.com/HPC/Articles/ GNU-Parallel-Multicore-at-the-Command-Line-with-GNU-Parallel
  • 39. Adrese web Comparat, ie cu alte comenzi (xargs, find -exec, make -j etc) http://www.gnu.org/software/parallel/man.html#summary_table
  • 40. GNU Stow GNU Stow este un caz particular de manager de pachete. Instalare: 1 sudo apt−get install stow
  • 41. Instalarea pachetelor Cum instal˘am un pachet cu ajutorul lui GNU Stow? 1 sudo make install prefix=/usr/local/stow/numepachet 2 cd /usr/local/stow 3 sudo stow numepachet
  • 42. Instalarea pachetelor Cum instal˘am un pachet cu ajutorul lui GNU Stow? 1 sudo make install prefix=/usr/local/stow/numepachet 2 cd /usr/local/stow 3 sudo stow numepachet Pachetele care nu folosesc GNU AutoConf pot s˘a nu accepte parametrul “prefix”, atunci este nevoie de modific˘ari ˆın fis, ierul Makefile.
  • 43. Eliminarea pachetelor 1 cd /usr/local/stow/ 2 sudo stow −D numepachet
  • 44. Exemplu: mai multe versiuni ale unuia s, i aceluias, i pachet ˆın aceeas, i distribut, ie Mai multe versiuni ale unuia s, i aceluias, i pachet ˆımpreun˘a. 1 cd numepachet−3.0 2 sudo make install prefix=/usr/local/stow/numepachet−3.0 3 cd numepachet−3.1−beta 4 sudo make install prefix=/usr/local/stow/numepachet−3.1−beta
  • 45. Exemplu: mai multe versiuni ale unuia s, i aceluias, i pachet ˆın aceeas, i distribut, ie Putem accesa fis, iere ambelor pachete prin 1 /usr/local/stow/numepachet−3.0/bin/fisierbinar s, i 2 /usr/local/stow/numepachet−3.1−beta/bin/fisierbinar Iar dac˘a execut˘am 1 cd /usr/local/stow 2 sudo stow numepachet−3.0 atunci lansˆınd ˆın linia de comand˘a doar fisierbinar vom accesa /usr/local/stow/numepachet-3.0/bin/fisierbinar.
  • 46. Adrese web Pagina web http://www.gnu.org/software/stow/ Manual s, i exemple http://www.gnu.org/software/stow/manual/