forked from ESMCI/mpi-serial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetcount.c
44 lines (31 loc) · 881 Bytes
/
getcount.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* getcount.c
*
* 07/2007 JCY
* Functions for count information regarding MPI_Status
*/
#include "type.h"
#include "mpiP.h"
int FC_FUNC( mpi_get_count , MPI_GET_COUNT )
(int *status, int *datatype, int *count, int *ierr)
{
*ierr = MPI_Get_count((MPI_Status *)status, *datatype, count);
return(MPI_SUCCESS);
}
int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count)
{
*count = status->get_count;
return(MPI_SUCCESS);
}
/********/
int FC_FUNC( mpi_get_elements , MPI_GET_ELEMENTS )
(MPI_Status *status, int *datatype, int *count, int *ierr)
{
*ierr = MPI_Get_elements(status, *datatype, count);
return(MPI_SUCCESS);
}
int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count)
{
Datatype dt_ptr = *(Datatype*)mpi_handle_to_datatype(datatype);
*count = status->get_count * dt_ptr->count;
return(MPI_SUCCESS);
}