-
- /* Send unexpected message which hopefully MPI_Probe() is
- already waiting for at the remote process */
- mpi_errno = MPI_Send (buf, msg_size, MPI_BYTE,
- status.MPI_SOURCE, status.MPI_TAG, MPI_COMM_WORLD);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
- }
- }
- else
- {
- int incoming_msg_size;
-
- /* Send synchronization message */
- mpi_errno = MPI_Send(NULL, 0, MPI_BYTE, 0, tag, MPI_COMM_WORLD);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
-
- /* Perform probe, hopefully before the master process can
- send its reply */
- mpi_errno = MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG,
- MPI_COMM_WORLD, &status);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
- mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
- if (status.MPI_SOURCE != 0 && errs++ < 10)
- {
- printf("ERROR: unexpected message source from MPI_Probe(): p=%d, expected=0, actual=%d, count=%d\n",
- p_rank, status.MPI_SOURCE, msg_cnt);
- }
- if (status.MPI_TAG != tag && errs++ < 10)
- {
- printf("ERROR: unexpected message tag from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
- p_rank, tag, status.MPI_TAG, msg_cnt);
- }
- if (incoming_msg_size != msg_size && errs++ < 10)
- {
- printf("ERROR: unexpected message size from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
- p_rank, msg_size, incoming_msg_size, msg_cnt);
- }
-
- /* Receive the probed message from the master process */
- mpi_errno = MPI_Recv(buf, msg_size, MPI_BYTE, 0, tag,
- MPI_COMM_WORLD, &status);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
- mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
- if (mpi_errno != MPI_SUCCESS && errs++ < 10)
- {
- MTestPrintError(mpi_errno);
- }
- if (status.MPI_SOURCE != 0 && errs++ < 10)
- {
- printf("ERROR: unexpected message source from MPI_Recv(): p=%d, expected=0, actual=%d, count=%d\n",
- p_rank, status.MPI_SOURCE, msg_cnt);
- }
- if (status.MPI_TAG != tag && errs++ < 10)
- {
- printf("ERROR: unexpected message tag from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
- p_rank, tag, status.MPI_TAG, msg_cnt);
- }
- if (incoming_msg_size != msg_size && errs++ < 10)
- {
- printf("ERROR: unexpected message size from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
- p_rank, msg_size, incoming_msg_size, msg_cnt);
- }
- }
- }
+
+ /* Send unexpected message which hopefully MPI_Probe() is
+ * already waiting for at the remote process */
+ mpi_errno = MPI_Send(buf, msg_size, MPI_BYTE,
+ status.MPI_SOURCE, status.MPI_TAG, MPI_COMM_WORLD);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+ }
+ }
+ else {
+ int incoming_msg_size;
+
+ /* Send synchronization message */
+ mpi_errno = MPI_Send(NULL, 0, MPI_BYTE, 0, tag, MPI_COMM_WORLD);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+
+ /* Perform probe, hopefully before the master process can
+ * send its reply */
+ mpi_errno = MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+ mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+ if (status.MPI_SOURCE != 0 && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message source from MPI_Probe(): p=%d, expected=0, actual=%d, count=%d\n",
+ p_rank, status.MPI_SOURCE, msg_cnt);
+ }
+ if (status.MPI_TAG != tag && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message tag from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
+ p_rank, tag, status.MPI_TAG, msg_cnt);
+ }
+ if (incoming_msg_size != msg_size && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message size from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
+ p_rank, msg_size, incoming_msg_size, msg_cnt);
+ }
+
+ /* Receive the probed message from the master process */
+ mpi_errno = MPI_Recv(buf, msg_size, MPI_BYTE, 0, tag, MPI_COMM_WORLD, &status);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+ mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
+ if (mpi_errno != MPI_SUCCESS && errs++ < 10) {
+ MTestPrintError(mpi_errno);
+ }
+ if (status.MPI_SOURCE != 0 && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message source from MPI_Recv(): p=%d, expected=0, actual=%d, count=%d\n",
+ p_rank, status.MPI_SOURCE, msg_cnt);
+ }
+ if (status.MPI_TAG != tag && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message tag from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
+ p_rank, tag, status.MPI_TAG, msg_cnt);
+ }
+ if (incoming_msg_size != msg_size && errs++ < 10) {
+ printf
+ ("ERROR: unexpected message size from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
+ p_rank, msg_size, incoming_msg_size, msg_cnt);
+ }
+ }
+ }