2
2
* Copyright (c) 2018-2020 The University of Tennessee and The University
3
3
* of Tennessee Research Foundation. All rights
4
4
* reserved.
5
+ * Copyright (c) 2023 High Performance Computing Center Stuttgart,
6
+ * University of Stuttgart. All rights reserved.
5
7
*
6
8
* Simple example usage of SPCs through MPI_T.
7
9
*/
@@ -20,7 +22,6 @@ void message_exchange(int num_messages, int message_size)
20
22
int i , rank ;
21
23
/* Use calloc to initialize data to 0's */
22
24
char * data = (char * ) calloc (message_size , sizeof (char ));
23
- MPI_Status status ;
24
25
25
26
MPI_Comm_rank (MPI_COMM_WORLD , & rank );
26
27
@@ -29,7 +30,7 @@ void message_exchange(int num_messages, int message_size)
29
30
MPI_Send (data , message_size , MPI_BYTE , 1 , 123 , MPI_COMM_WORLD );
30
31
} else if (rank == 1 ) {
31
32
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 );
33
34
}
34
35
35
36
free (data );
@@ -91,19 +92,18 @@ int main(int argc, char **argv)
91
92
MPI_Abort (MPI_COMM_WORLD , -1 );
92
93
}
93
94
94
- int ret ;
95
95
long long value ;
96
96
97
97
MPI_T_pvar_session session ;
98
98
MPI_T_pvar_handle handle ;
99
99
/* 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 );
103
103
104
104
message_exchange (num_messages , message_size );
105
105
106
- ret = MPI_T_pvar_read (session , handle , & value );
106
+ MPI_T_pvar_read (session , handle , & value );
107
107
/* Print the counter values in order by rank */
108
108
for (i = 0 ; i < 2 ; i ++ ) {
109
109
if (i == rank ) {
@@ -113,9 +113,9 @@ int main(int argc, char **argv)
113
113
MPI_Barrier (MPI_COMM_WORLD );
114
114
}
115
115
/* 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 );
119
119
120
120
MPI_T_finalize ();
121
121
MPI_Finalize ();
0 commit comments