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 );
@@ -91,19 +92,18 @@ int main(int argc, char **argv)
9192 MPI_Abort (MPI_COMM_WORLD , -1 );
9293 }
9394
94- int ret ;
9595 long long value ;
9696
9797 MPI_T_pvar_session session ;
9898 MPI_T_pvar_handle handle ;
9999 /* Create the MPI_T sessions/handles for the counters and start the counters */
100- ret = MPI_T_pvar_session_create (& session );
101- ret = MPI_T_pvar_handle_alloc (session , index , NULL , & handle , & count );
102- ret = MPI_T_pvar_start (session , handle );
100+ MPI_T_pvar_session_create (& session );
101+ MPI_T_pvar_handle_alloc (session , index , NULL , & handle , & count );
102+ MPI_T_pvar_start (session , handle );
103103
104104 message_exchange (num_messages , message_size );
105105
106- ret = MPI_T_pvar_read (session , handle , & value );
106+ MPI_T_pvar_read (session , handle , & value );
107107 /* Print the counter values in order by rank */
108108 for (i = 0 ; i < 2 ; i ++ ) {
109109 if (i == rank ) {
@@ -113,9 +113,9 @@ int main(int argc, char **argv)
113113 MPI_Barrier (MPI_COMM_WORLD );
114114 }
115115 /* Stop the MPI_T session, free the handle, and then free the session */
116- ret = MPI_T_pvar_stop (session , handle );
117- ret = MPI_T_pvar_handle_free (session , & handle );
118- ret = MPI_T_pvar_session_free (& session );
116+ MPI_T_pvar_stop (session , handle );
117+ MPI_T_pvar_handle_free (session , & handle );
118+ MPI_T_pvar_session_free (& session );
119119
120120 MPI_T_finalize ();
121121 MPI_Finalize ();
0 commit comments