Skip to content

Commit cfeb605

Browse files
committed
Use MPI_STATUS_IGNORE for MPI_Recv as status was not checked afterwards
Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
1 parent aabb3b3 commit cfeb605

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/spc_example.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2018-2020 The University of Tennessee and The University
33
* of Tennessee Research Foundation. All rights
44
* reserved.
5+
* Copyright (c) 2023 High Performance Computing Center Stuttgart,
6+
* University of Stuttgart. All rights reserved.
57
*
68
* Simple example usage of SPCs through MPI_T.
79
*/
@@ -20,7 +22,6 @@ void message_exchange(int num_messages, int message_size)
2022
int i, rank;
2123
/* Use calloc to initialize data to 0's */
2224
char *data = (char *) calloc(message_size, sizeof(char));
23-
MPI_Status status;
2425

2526
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
2627

@@ -29,7 +30,7 @@ void message_exchange(int num_messages, int message_size)
2930
MPI_Send(data, message_size, MPI_BYTE, 1, 123, MPI_COMM_WORLD);
3031
} else if (rank == 1) {
3132
for (i = 0; i < num_messages; i++)
32-
MPI_Recv(data, message_size, MPI_BYTE, 0, 123, MPI_COMM_WORLD, &status);
33+
MPI_Recv(data, message_size, MPI_BYTE, 0, 123, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
3334
}
3435

3536
free(data);

0 commit comments

Comments
 (0)