diff --git a/02-MSA-hello-world-gpu/hello-world.c b/02-MSA-hello-world-gpu/hello-world.c index 9d501bc9ff1e73e01ef888629f768d6d778af464..89fcd007fe72257a350205c7006d2a5c34f62aea 100644 --- a/02-MSA-hello-world-gpu/hello-world.c +++ b/02-MSA-hello-world-gpu/hello-world.c @@ -24,8 +24,13 @@ int main(int argc, char** argv){ const char *payload = "world!"; + // TODO: Implement the MPI_Send call to send the six characters of "payload" to rank 1 if (rank == 0) { + #ifdef SOLUTION MPI_Send(payload, 6, MPI_CHAR, 1, tag, MPI_COMM_WORLD); + #else + MPI_Send(); + #endif } printf("\n"); diff --git a/02-MSA-hello-world-gpu/hello-world.cu b/02-MSA-hello-world-gpu/hello-world.cu index da1b592e0c32c8165dc99c8d102bc4b3767aa902..8c71020c9251d74547052a39001ae1bd874d9f4d 100644 --- a/02-MSA-hello-world-gpu/hello-world.cu +++ b/02-MSA-hello-world-gpu/hello-world.cu @@ -51,8 +51,13 @@ int main(int argc, char** argv){ CUDA_RT_CALL( cudaPeekAtLastError() ); CUDA_RT_CALL( cudaDeviceSynchronize() ); + // TODO: Implement the MPI_Recv() call to receive the "payload" from rank 1 using directly "d_payload" as the target buffer on the GPU if (rank == 1) { + #ifdef SOLUTION MPI_Recv(d_payload, 6, MPI_CHAR, 0, tag, MPI_COMM_WORLD, &stat); + #else + MPI_Recv(); + #endif } hello<<<1, 1>>>(d_payload);