diff --git a/swiftmpiproxies.c b/swiftmpiproxies.c index 9d48671ccdd088c0d24944c770394c79155e8acc..5dcecdf10e921ded40c82b6df2d61fb60abc54f7 100644 --- a/swiftmpiproxies.c +++ b/swiftmpiproxies.c @@ -267,8 +267,8 @@ int main(int argc, char *argv[]) { int size = log->size; res = MPI_Isend(&size, 1, MPI_INT, log->otherrank, - basetag + proxy_tag_count, - MPI_COMM_WORLD, &req_send_counts[k]); + basetag + proxy_tag_count, MPI_COMM_WORLD, + &req_send_counts[k]); if (res != MPI_SUCCESS) error("Counts MPI_Isend failed."); /* Start Isend of pcells, filling the data with a pattern for checking @@ -313,8 +313,8 @@ int main(int argc, char *argv[]) { datacheck_fill(1, pcells_size[pid], pcells_in[pid]); res = MPI_Irecv(pcells_in[pid], pcells_size[pid], MPI_BYTE, - log->otherrank, basetag + proxy_tag_cells, - MPI_COMM_WORLD, &req_pcells_in[pid]); + log->otherrank, basetag + proxy_tag_cells, MPI_COMM_WORLD, + &req_pcells_in[pid]); if (res != MPI_SUCCESS) error("Pcell MPI_Irecv failed."); } message("All proxy cell counts have arrived, pcells irecvs are launched"); @@ -338,6 +338,14 @@ int main(int argc, char *argv[]) { /* Check the data received is correct. */ if (!datacheck_test(0, pcells_size[pid], pcells_in[pid])) { message("Received data is not correct"); + + /* Report the tag and source of the request. */ + int expected_tag = + status.MPI_SOURCE * proxy_tag_shift + proxy_tag_cells; + message("sent from rank %d, with tag %d/%d and error code %d", + status.MPI_SOURCE, status.MPI_TAG, expected_tag, + status.MPI_ERROR); + datacheck_fulltest(pcells_size[pid], pcells_in[pid]); if (datacheck_test(1, pcells_size[pid], pcells_in[pid])) { error("Received data is not modified on receive"); @@ -345,8 +353,7 @@ int main(int argc, char *argv[]) { error("Received data is corrupt"); } } else { - if (verbose) - message("Received data is correct"); + if (verbose) message("Received data is correct"); } free(pcells_in[pid]); pcells_in[pid] = NULL; @@ -365,14 +372,13 @@ int main(int argc, char *argv[]) { datacheck_fulltest(log->size, log->data); error("Sent data has been corrupted"); } else { - if (verbose) - message("Sent data is correct"); + if (verbose) message("Sent data is correct"); } free(log->data); log->data = NULL; } - }/* nloop */ + } /* nloop */ /* Shutdown MPI. */ res = MPI_Finalize();