-
- if (id == 0) { /* Process 0 (the receiver) does this */
- for (i=1; i<ntasks; i++) {
- err = MPI_Recv(msg, 2, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, \
- &status); /* Receive a message */
- source_id = status.MPI_SOURCE; /* Get id of sender */
- printf("Received message %d %d from process %d\n", msg[0], msg[1], \
- source_id);
+
+ if (id == 0) { /* Process 0 (the receiver) does this */
+ for (i = 1; i < ntasks; i++) {
+ err = MPI_Recv(msg, 2, MPI_INT, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, &status); /* Receive a message */
+ source_id = status.MPI_SOURCE; /* Get id of sender */
+ printf("Received message %d %d from process %d\n", msg[0], msg[1],
+ source_id);