Using MPI
Upcoming SlideShare
Loading in...5
×
 

Using MPI

on

  • 2,968 views

introduction to MPI

introduction to MPI

Statistics

Views

Total Views
2,968
Views on SlideShare
2,965
Embed Views
3

Actions

Likes
3
Downloads
58
Comments
0

2 Embeds 3

http://www.slideshare.net 2
http://www.techgig.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Using MPI Using MPI Presentation Transcript

  • 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.