Skip to content
Snippets Groups Projects
Commit bf9399d6 authored by Chao Zhan's avatar Chao Zhan
Browse files

fix

parent f7719cf6
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ int main(int argc, char **argv) { ...@@ -42,6 +42,7 @@ int main(int argc, char **argv) {
strncpy(message, "This is not a message!", 32); strncpy(message, "This is not a message!", 32);
MPI_Isend(message, 32, MPI_CHAR, 1, 0, MPI_COMM_WORLD, &request); MPI_Isend(message, 32, MPI_CHAR, 1, 0, MPI_COMM_WORLD, &request);
busy(); busy();
MPI_Wait(&request, &status);
printf("[%s] Message sent: %s\n", processor_name, message); printf("[%s] Message sent: %s\n", processor_name, message);
} else { } else {
MPI_Irecv(message, 32, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &request); MPI_Irecv(message, 32, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &request);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
int main(int argc, char** argv) { int main(int argc, char** argv) {
int rank, num_procs, token; int rank, num_procs, token;
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &num_procs); MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment