H foo if myprogc mpirecv mpianysource

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s 2) Communicators (Process Groups): –  MoIvaIng example #2: WriIng libraries using MPI void foo(…) { MPI_Send(…, dest=0, tag=1000, MPI_COMM_WORLD); } mylib.c: void bar(…) { MPI_Recv(…, src=1, tag=1000, MPI_COMM_WORLD); } #include “mylib.h” foo(…); if (…) { myprog.c: MPI_Recv(…, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD); else { MPI_Send(…, dest=myID- 1, tag=1000, MPI_COMM_WORLD); } bar(…); CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain 10 Primary MPI Concepts 2) Communicators (Process Groups): –  MoIvaIng example #2: WriIng libraries using MPI void foo(…) { MPI_Send(…, dest=0, tag=1000, MPI_COMM_MYLIB); } mylib.c: void bar(…) { MPI_Recv(…, src=1, tag=1000, MPI_COMM_MYLIB); } #include “mylib.h” foo(…); if (…) { myprog.c: MPI_Recv(…, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD); else { MPI_Send(…, dest=myID- 1, tag=1000, MPI_COMM_WORLD); } bar(…); CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain 11 Primary MPI Concepts 3) Collec/ves (Communicator- based OperaIons): –  many different styles of communicaIons/operaIons: •  •  •  •  •  •  barrier broadcast scamer/gather all- to- all red...
View Full Document

Ask a homework question - tutors are online