Skip to content
Snippets Groups Projects
Commit 72a17124 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Also report the tag and source of the failed receive

parent 47807adb
Branches
Tags
No related merge requests found
...@@ -267,8 +267,8 @@ int main(int argc, char *argv[]) { ...@@ -267,8 +267,8 @@ int main(int argc, char *argv[]) {
int size = log->size; int size = log->size;
res = MPI_Isend(&size, 1, MPI_INT, log->otherrank, res = MPI_Isend(&size, 1, MPI_INT, log->otherrank,
basetag + proxy_tag_count, basetag + proxy_tag_count, MPI_COMM_WORLD,
MPI_COMM_WORLD, &req_send_counts[k]); &req_send_counts[k]);
if (res != MPI_SUCCESS) error("Counts MPI_Isend failed."); if (res != MPI_SUCCESS) error("Counts MPI_Isend failed.");
/* Start Isend of pcells, filling the data with a pattern for checking /* Start Isend of pcells, filling the data with a pattern for checking
...@@ -313,8 +313,8 @@ int main(int argc, char *argv[]) { ...@@ -313,8 +313,8 @@ int main(int argc, char *argv[]) {
datacheck_fill(1, pcells_size[pid], pcells_in[pid]); datacheck_fill(1, pcells_size[pid], pcells_in[pid]);
res = MPI_Irecv(pcells_in[pid], pcells_size[pid], MPI_BYTE, res = MPI_Irecv(pcells_in[pid], pcells_size[pid], MPI_BYTE,
log->otherrank, basetag + proxy_tag_cells, log->otherrank, basetag + proxy_tag_cells, MPI_COMM_WORLD,
MPI_COMM_WORLD, &req_pcells_in[pid]); &req_pcells_in[pid]);
if (res != MPI_SUCCESS) error("Pcell MPI_Irecv failed."); if (res != MPI_SUCCESS) error("Pcell MPI_Irecv failed.");
} }
message("All proxy cell counts have arrived, pcells irecvs are launched"); message("All proxy cell counts have arrived, pcells irecvs are launched");
...@@ -338,6 +338,14 @@ int main(int argc, char *argv[]) { ...@@ -338,6 +338,14 @@ int main(int argc, char *argv[]) {
/* Check the data received is correct. */ /* Check the data received is correct. */
if (!datacheck_test(0, pcells_size[pid], pcells_in[pid])) { if (!datacheck_test(0, pcells_size[pid], pcells_in[pid])) {
message("Received data is not correct"); 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]); datacheck_fulltest(pcells_size[pid], pcells_in[pid]);
if (datacheck_test(1, pcells_size[pid], pcells_in[pid])) { if (datacheck_test(1, pcells_size[pid], pcells_in[pid])) {
error("Received data is not modified on receive"); error("Received data is not modified on receive");
...@@ -345,8 +353,7 @@ int main(int argc, char *argv[]) { ...@@ -345,8 +353,7 @@ int main(int argc, char *argv[]) {
error("Received data is corrupt"); error("Received data is corrupt");
} }
} else { } else {
if (verbose) if (verbose) message("Received data is correct");
message("Received data is correct");
} }
free(pcells_in[pid]); free(pcells_in[pid]);
pcells_in[pid] = NULL; pcells_in[pid] = NULL;
...@@ -365,14 +372,13 @@ int main(int argc, char *argv[]) { ...@@ -365,14 +372,13 @@ int main(int argc, char *argv[]) {
datacheck_fulltest(log->size, log->data); datacheck_fulltest(log->size, log->data);
error("Sent data has been corrupted"); error("Sent data has been corrupted");
} else { } else {
if (verbose) if (verbose) message("Sent data is correct");
message("Sent data is correct");
} }
free(log->data); free(log->data);
log->data = NULL; log->data = NULL;
} }
}/* nloop */ } /* nloop */
/* Shutdown MPI. */ /* Shutdown MPI. */
res = MPI_Finalize(); res = MPI_Finalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment