To keep it simple, sending up is sending to rank+1 and sending down is sending to rank-1
The code is sending arrays from one node to another back and forth between them. Here is the code:
MPI_Request req1, req2;
MPI_Status s1, s2;
if (procid+1 != nproc) {
// send up
MPI_Isend(prior_hot_plate[my_num_rows-2], TOTAL_COLS, MPI_FLOAT, procid+1, k, MPI_COMM_WORLD, &req1);
++k;
fprintf(stderr, "%d made it through Isend up\n", procid);
}
if (procid-1 != -1) {
// send down
MPI_Isend(prior_hot_plate[1], TOTAL_COLS, MPI_FLOAT, procid-1, k, MPI_COMM_WORLD, &req2);
++k;
fprintf(stderr, "%d made it past Isend down\n", procid);
}
if (procid+1 != nproc) {
// recv up
//MPI_Wait(&req1, &s1);
//fprintf(stderr, "%d finished wait\n", procid);
MPI_Recv(prior_hot_plate[my_num_rows-1], TOTAL_COLS, MPI_FLOAT, procid+1, k, MPI_COMM_WORLD, &s1);
++k;
fprintf(stderr, "%d finished receiving\n", procid);
}
if (procid-1 != -1) {
// recv down
//MPI_Wait(&req2, &s2);
//fprintf(stderr, "%d finished wait\n", procid);
MPI_Recv(prior_hot_plate[0], TOTAL_COLS, MPI_FLOAT, procid-1, k, MPI_COMM_WORLD, &s2);
++k;
fprintf(stderr, "%d finished receiving\n", procid);
}
Each of the nodes make it past the Isend calls no problem, but then all of them hang on the calls to Recv. Does anyone see something wrong with this? What am I missing?
Thanks