C void bar mpirecv src1 tag1000 mpicommworld

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: I_COMM_WORLD); } mylib.c: void bar(…) { MPI_Recv(…, src=1, tag=1000, MPI_COMM_WORLD); } #include “mylib.h” foo(…); if (…) { myprog.c: MPI_Recv(…, src=myID+1, tag=1000, MPI_COMM_WORLD); else { MPI_Send(…, dest=myID- 1, tag=1000, MPI_COMM_WORLD); } bar(…); CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain 8 Primary MPI Concepts 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(…, src=myID+1, tag=1000, MPI_COMM_WORLD); else { MPI_Send(…, dest=myID- 1, tag=1000, MPI_COMM_WORLD); } bar(…); CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain 9 Primary MPI Concept...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online