SlideShare uma empresa Scribd logo
1 de 25
Using MPI
  Kazuki Ohta
Using MPI
•              HPC

    • vendor/hardware
    •                   program

•
MPI
•   MPI: Message-Passing Interface
    •                                 API

    •   Communicator,Point-to-Point
        Communication,Synchronization,One-Sided
        Communication,Collective, Datatypes, MPI-I/O
•
    •   MPICH2 (ANL), MVAPICH (Ohio), OpenMP
    •   C/C++/Fortran support
•
    • TCP/IP, Infiniband, Myrinet
    •                     shared-memory

•          OS

    • MPICH2    Windows
• HW
 • Infiniband, Myrinet   NIC



 • RDMA (Remote Direct Memory Access)
•   Scales to 100,000 processes
    •   MPI on a Million Processors [Paven 2009]
    •            algorithm

•                ”     ”

    •   1

    •
• William D. Gropp
 • http://www.cs.uiuc.edu/homes/wgropp/
• MPICH2
 • Paven Balaj
   • http://www.mcs.anl.gov/~balaji/
 • Darius Buntinas
   • http://www.mcs.anl.gov/~buntinas/
(                      )
$ cd
$ echo “secretword=xxxx” > ~/.mpd.conf
$ cp .mpd.conf .mpdpasswd
$ chmod 600 .mpd.conf .mpdpasswd
$ echo “seduesearcher:16” > mpdhosts
$ mpdboot -n 1 -f mpdhosts
$ mpdtrace
seduesearcher
#include <mpi.h>
int main(int argc, char **argv)
{
  int myrank;
  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
  printf(“rank = %d¥n”, myrank);
  MPI_Finalize();
}
$ mpicc hello.c
$ ruby -e ’16.times{ puts “seduesearcher” }’ >
machines
$ mpiexec -machinefile ./machines -n 16 ./a.out
rank = 4
rank = 2
rank = 0
rank = 1
rank = 8
rank = 3
.....
Point-to-Point
•   1 vs 1

    •   int MPI_Send(void *buf, int count,
        MPI_Datatype datatype, int dest, int tag,
        MPI_Comm comm);
    •   int MPI_Recv(void *buf, int count,
        MPI_Datatype datatype, int source, int tag,
        MPI_Comm, MPI_Status *status);
•   Eager Protocol / Rendezvous Protocol
Point-to-Point
#include <mpi.h>
#include <string.h>
int
main(int argc, char **argv)
{
  int nprocs;
  int myrank;
  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);

    char msg[1024];
    if (myrank == 0) {
      strcpy(msg, "Hello, from rank0");
      int dst;
      for (dst = 1; dst < nprocs; dst++)
        MPI_Send(msg, strlen(msg + 1), MPI_CHAR, dst, 99, MPI_COMM_WORLD);
    } else {
      MPI_Status status;
      MPI_Recv(msg, 1024, MPI_CHAR, MPI_ANY_SOURCE, 99, MPI_COMM_WORLD, &status);
      printf("rank%02d received: msg=%sn", myrank, msg);
    }

    MPI_Finalize();
}
• MPI
 •      /
MPI_Bcast
MPI_Scatter
MPI_Gather
MPI_AllGather



•
MPI_AlltoAll
MPI_Reduce
MPI_AllReduce
• MPI/IO
 •        I/O

 • Two-Phase I/O
 • Data Sieving
• BLAS
• GotoBLAS
 • http://www.tacc.utexas.edu/tacc-projects/
• ScaLAPACK
 • http://www.netlib.org/scalapack/
 •               ...
•   MPI version 3
    •   MPI Forum

    •   http://meetings.mpi-forum.org/
    •   http://meetings.mpi-forum.org/
        MPI_3.0_main_page.php
•   Fault-Torelance
•   Communication/Topology
•   etc.

Mais conteúdo relacionado

Mais procurados

Message Passing Interface (MPI)-A means of machine communication
Message Passing Interface (MPI)-A means of machine communicationMessage Passing Interface (MPI)-A means of machine communication
Message Passing Interface (MPI)-A means of machine communicationHimanshi Kathuria
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI IntroductionRohit Banga
 
The Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsThe Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsJeff Squyres
 
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen IIPorting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen IIGeorge Markomanolis
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPIAjit Nayak
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelIntel® Software
 
Bigdata Presentation
Bigdata PresentationBigdata Presentation
Bigdata PresentationYonas Gidey
 
Assignment cn tl
Assignment cn tlAssignment cn tl
Assignment cn tlH K
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareC4Media
 
Presentation
PresentationPresentation
PresentationLior Boim
 
Parallel program design
Parallel program designParallel program design
Parallel program designZongYing Lyu
 
Introduction to Clime
Introduction to ClimeIntroduction to Clime
Introduction to ClimeMosky Liu
 
BPF - All your packets belong to me
BPF - All your packets belong to meBPF - All your packets belong to me
BPF - All your packets belong to me_xhr_
 

Mais procurados (20)

Message Passing Interface (MPI)-A means of machine communication
Message Passing Interface (MPI)-A means of machine communicationMessage Passing Interface (MPI)-A means of machine communication
Message Passing Interface (MPI)-A means of machine communication
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI Introduction
 
Mpi Java
Mpi JavaMpi Java
Mpi Java
 
The Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsThe Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's Terms
 
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen IIPorting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
My ppt hpc u4
My ppt hpc u4My ppt hpc u4
My ppt hpc u4
 
MPI
MPIMPI
MPI
 
Parallel computing(2)
Parallel computing(2)Parallel computing(2)
Parallel computing(2)
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next Level
 
More mpi4py
More mpi4pyMore mpi4py
More mpi4py
 
mpi4py.pdf
mpi4py.pdfmpi4py.pdf
mpi4py.pdf
 
Bigdata Presentation
Bigdata PresentationBigdata Presentation
Bigdata Presentation
 
Assignment cn tl
Assignment cn tlAssignment cn tl
Assignment cn tl
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @Cloudflare
 
Presentation
PresentationPresentation
Presentation
 
Parallel program design
Parallel program designParallel program design
Parallel program design
 
Introduction to Clime
Introduction to ClimeIntroduction to Clime
Introduction to Clime
 
BPF - All your packets belong to me
BPF - All your packets belong to meBPF - All your packets belong to me
BPF - All your packets belong to me
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 

Destaque

Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPIMajong DevJfu
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI Hanif Durad
 
message passing interface
message passing interfacemessage passing interface
message passing interfaceZTech Proje
 
Introduction to Parallel Programming
Introduction to Parallel ProgrammingIntroduction to Parallel Programming
Introduction to Parallel ProgrammingUNIST
 
병렬처리와 성능향상
병렬처리와 성능향상병렬처리와 성능향상
병렬처리와 성능향상shaderx
 
Converged solutions for HPC and Big Data Analytics using Clusters and Clouds
Converged solutions for HPC and Big Data Analytics using Clusters and CloudsConverged solutions for HPC and Big Data Analytics using Clusters and Clouds
Converged solutions for HPC and Big Data Analytics using Clusters and Cloudsinside-BigData.com
 
Gpu Systems
Gpu SystemsGpu Systems
Gpu Systemsjpaugh
 
Introduction to Linux #1
Introduction to Linux #1Introduction to Linux #1
Introduction to Linux #1UNIST
 
2node cluster
2node cluster2node cluster
2node clustersprdd
 
High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPIAnkit Mahato
 
오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0sprdd
 
The Business of Social Media
The Business of Social Media The Business of Social Media
The Business of Social Media Dave Kerpen
 
The hottest analysis tools for startups
The hottest analysis tools for startupsThe hottest analysis tools for startups
The hottest analysis tools for startupsLiane Siebenhaar
 
10 Steps of Project Management in Digital Agencies
10 Steps of Project Management in Digital Agencies 10 Steps of Project Management in Digital Agencies
10 Steps of Project Management in Digital Agencies Alemsah Ozturk
 
Lost in Cultural Translation
Lost in Cultural TranslationLost in Cultural Translation
Lost in Cultural TranslationVanessa Vela
 

Destaque (20)

Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI
 
Open MPI 2
Open MPI 2Open MPI 2
Open MPI 2
 
MPI History
MPI HistoryMPI History
MPI History
 
message passing interface
message passing interfacemessage passing interface
message passing interface
 
Introduction to Parallel Programming
Introduction to Parallel ProgrammingIntroduction to Parallel Programming
Introduction to Parallel Programming
 
병렬처리와 성능향상
병렬처리와 성능향상병렬처리와 성능향상
병렬처리와 성능향상
 
Converged solutions for HPC and Big Data Analytics using Clusters and Clouds
Converged solutions for HPC and Big Data Analytics using Clusters and CloudsConverged solutions for HPC and Big Data Analytics using Clusters and Clouds
Converged solutions for HPC and Big Data Analytics using Clusters and Clouds
 
Amax Gpu Hpc
Amax Gpu HpcAmax Gpu Hpc
Amax Gpu Hpc
 
ISBI MPI Tutorial
ISBI MPI TutorialISBI MPI Tutorial
ISBI MPI Tutorial
 
Gpu Systems
Gpu SystemsGpu Systems
Gpu Systems
 
Introduction to Linux #1
Introduction to Linux #1Introduction to Linux #1
Introduction to Linux #1
 
2node cluster
2node cluster2node cluster
2node cluster
 
High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPI
 
오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0
 
The Business of Social Media
The Business of Social Media The Business of Social Media
The Business of Social Media
 
The hottest analysis tools for startups
The hottest analysis tools for startupsThe hottest analysis tools for startups
The hottest analysis tools for startups
 
10 Steps of Project Management in Digital Agencies
10 Steps of Project Management in Digital Agencies 10 Steps of Project Management in Digital Agencies
10 Steps of Project Management in Digital Agencies
 
Lost in Cultural Translation
Lost in Cultural TranslationLost in Cultural Translation
Lost in Cultural Translation
 
Flyer
FlyerFlyer
Flyer
 

Semelhante a Using MPI

Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPIyaman dua
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM Mark Rees
 
HPAT presentation at JuliaCon 2016
HPAT presentation at JuliaCon 2016HPAT presentation at JuliaCon 2016
HPAT presentation at JuliaCon 2016Ehsan Totoni
 
Machine Learning on Code - SF meetup
Machine Learning on Code - SF meetupMachine Learning on Code - SF meetup
Machine Learning on Code - SF meetupsource{d}
 
Herding cats & catching fire: Workday's telemetry & middleware
Herding cats & catching fire: Workday's telemetry & middlewareHerding cats & catching fire: Workday's telemetry & middleware
Herding cats & catching fire: Workday's telemetry & middlewareSensu Inc.
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docxeugeniadean34240
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projectsVincent Terrasi
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab FileKandarp Tiwari
 
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...KAI CHU CHUNG
 

Semelhante a Using MPI (20)

Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx
 
Presentation1
Presentation1Presentation1
Presentation1
 
Lecture9
Lecture9Lecture9
Lecture9
 
MPI
MPIMPI
MPI
 
Lecture10
Lecture10Lecture10
Lecture10
 
OpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel ComputingOpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel Computing
 
myHadoop 0.30
myHadoop 0.30myHadoop 0.30
myHadoop 0.30
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
 
HPAT presentation at JuliaCon 2016
HPAT presentation at JuliaCon 2016HPAT presentation at JuliaCon 2016
HPAT presentation at JuliaCon 2016
 
Machine Learning on Code - SF meetup
Machine Learning on Code - SF meetupMachine Learning on Code - SF meetup
Machine Learning on Code - SF meetup
 
Herding cats & catching fire: Workday's telemetry & middleware
Herding cats & catching fire: Workday's telemetry & middlewareHerding cats & catching fire: Workday's telemetry & middleware
Herding cats & catching fire: Workday's telemetry & middleware
 
Who moved my pixels?!
Who moved my pixels?!Who moved my pixels?!
Who moved my pixels?!
 
Usp
UspUsp
Usp
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
 
Python para equipos de ciberseguridad
Python para equipos de ciberseguridad Python para equipos de ciberseguridad
Python para equipos de ciberseguridad
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes  with ...
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
 

Mais de Kazuki Ohta

Optimization Techniques at the I/O Forwarding Layer
Optimization Techniques at the I/O Forwarding LayerOptimization Techniques at the I/O Forwarding Layer
Optimization Techniques at the I/O Forwarding LayerKazuki Ohta
 
修士中間発表
修士中間発表修士中間発表
修士中間発表Kazuki Ohta
 
Hadoop @ Java CCC 2008 Spring
Hadoop @ Java CCC 2008 SpringHadoop @ Java CCC 2008 Spring
Hadoop @ Java CCC 2008 SpringKazuki Ohta
 
Googleの基盤クローン Hadoopについて
Googleの基盤クローン HadoopについてGoogleの基盤クローン Hadoopについて
Googleの基盤クローン HadoopについてKazuki Ohta
 
Sedue at Hatena::Bookmark
Sedue at Hatena::BookmarkSedue at Hatena::Bookmark
Sedue at Hatena::BookmarkKazuki Ohta
 
Google Perf Tools (tcmalloc) の使い方
Google Perf Tools (tcmalloc) の使い方Google Perf Tools (tcmalloc) の使い方
Google Perf Tools (tcmalloc) の使い方Kazuki Ohta
 

Mais de Kazuki Ohta (6)

Optimization Techniques at the I/O Forwarding Layer
Optimization Techniques at the I/O Forwarding LayerOptimization Techniques at the I/O Forwarding Layer
Optimization Techniques at the I/O Forwarding Layer
 
修士中間発表
修士中間発表修士中間発表
修士中間発表
 
Hadoop @ Java CCC 2008 Spring
Hadoop @ Java CCC 2008 SpringHadoop @ Java CCC 2008 Spring
Hadoop @ Java CCC 2008 Spring
 
Googleの基盤クローン Hadoopについて
Googleの基盤クローン HadoopについてGoogleの基盤クローン Hadoopについて
Googleの基盤クローン Hadoopについて
 
Sedue at Hatena::Bookmark
Sedue at Hatena::BookmarkSedue at Hatena::Bookmark
Sedue at Hatena::Bookmark
 
Google Perf Tools (tcmalloc) の使い方
Google Perf Tools (tcmalloc) の使い方Google Perf Tools (tcmalloc) の使い方
Google Perf Tools (tcmalloc) の使い方
 

Using MPI

  • 1. Using MPI Kazuki Ohta
  • 3. HPC • vendor/hardware • program •
  • 4. MPI • MPI: Message-Passing Interface • API • Communicator,Point-to-Point Communication,Synchronization,One-Sided Communication,Collective, Datatypes, MPI-I/O • • MPICH2 (ANL), MVAPICH (Ohio), OpenMP • C/C++/Fortran support
  • 5. • TCP/IP, Infiniband, Myrinet • shared-memory • OS • MPICH2 Windows
  • 6. • HW • Infiniband, Myrinet NIC • RDMA (Remote Direct Memory Access)
  • 7. Scales to 100,000 processes • MPI on a Million Processors [Paven 2009] • algorithm • ” ” • 1 •
  • 8. • William D. Gropp • http://www.cs.uiuc.edu/homes/wgropp/
  • 9. • MPICH2 • Paven Balaj • http://www.mcs.anl.gov/~balaji/ • Darius Buntinas • http://www.mcs.anl.gov/~buntinas/
  • 10. ( ) $ cd $ echo “secretword=xxxx” > ~/.mpd.conf $ cp .mpd.conf .mpdpasswd $ chmod 600 .mpd.conf .mpdpasswd $ echo “seduesearcher:16” > mpdhosts $ mpdboot -n 1 -f mpdhosts $ mpdtrace seduesearcher
  • 11. #include <mpi.h> int main(int argc, char **argv) { int myrank; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); printf(“rank = %d¥n”, myrank); MPI_Finalize(); }
  • 12. $ mpicc hello.c $ ruby -e ’16.times{ puts “seduesearcher” }’ > machines $ mpiexec -machinefile ./machines -n 16 ./a.out rank = 4 rank = 2 rank = 0 rank = 1 rank = 8 rank = 3 .....
  • 13. Point-to-Point • 1 vs 1 • int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); • int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm, MPI_Status *status); • Eager Protocol / Rendezvous Protocol
  • 14. Point-to-Point #include <mpi.h> #include <string.h> int main(int argc, char **argv) { int nprocs; int myrank; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); char msg[1024]; if (myrank == 0) { strcpy(msg, "Hello, from rank0"); int dst; for (dst = 1; dst < nprocs; dst++) MPI_Send(msg, strlen(msg + 1), MPI_CHAR, dst, 99, MPI_COMM_WORLD); } else { MPI_Status status; MPI_Recv(msg, 1024, MPI_CHAR, MPI_ANY_SOURCE, 99, MPI_COMM_WORLD, &status); printf("rank%02d received: msg=%sn", myrank, msg); } MPI_Finalize(); }
  • 23. • MPI/IO • I/O • Two-Phase I/O • Data Sieving
  • 24. • BLAS • GotoBLAS • http://www.tacc.utexas.edu/tacc-projects/ • ScaLAPACK • http://www.netlib.org/scalapack/ • ...
  • 25. MPI version 3 • MPI Forum • http://meetings.mpi-forum.org/ • http://meetings.mpi-forum.org/ MPI_3.0_main_page.php • Fault-Torelance • Communication/Topology • etc.

Notas do Editor