This source file includes following definitions.
- ADIOI_Datatype_iscontig
- ADIOI_Datatype_iscontig
- ADIOI_Datatype_iscontig
- ADIOI_Datatype_iscontig
1
2
3
4
5
6
7 #include "adio.h"
8
9
10
11
12 #if defined(MPICH)
13
14 void MPIR_Datatype_iscontig(MPI_Datatype datatype, int *flag);
15
16 void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag)
17 {
18 MPIR_Datatype_iscontig(datatype, flag);
19
20
21
22 if (*flag) {
23 MPI_Aint true_extent, true_lb;
24
25 MPI_Type_get_true_extent(datatype, &true_lb, &true_extent);
26
27 if (true_lb > 0)
28 *flag = 0;
29 }
30 }
31
32 #elif (defined(MPIHP) && defined(HAVE_MPI_INFO))
33
34
35 int hpmp_dtiscontig(MPI_Datatype datatype);
36
37 void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag)
38 {
39 *flag = hpmp_dtiscontig(datatype);
40 }
41
42 #elif (defined(MPISGI) && !defined(NO_MPI_SGI_type_is_contig))
43
44 int MPI_SGI_type_is_contig(MPI_Datatype datatype);
45
46 void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag)
47 {
48 MPI_Aint displacement;
49 MPI_Type_lb(datatype, &distplacement);
50
51
52
53
54
55 *flag = MPI_SGI_type_is_contig(datatype) && (displacement == 0);
56 }
57
58 #elif defined(OMPI_BUILDING) && OMPI_BUILDING
59
60
61
62
63 #else
64
65 void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag)
66 {
67 int nints, nadds, ntypes, combiner;
68 int *ints, ni, na, nt, cb;
69 MPI_Aint *adds;
70 MPI_Datatype *types;
71
72 MPI_Type_get_envelope(datatype, &nints, &nadds, &ntypes, &combiner);
73
74 switch (combiner) {
75 case MPI_COMBINER_NAMED:
76 *flag = 1;
77 break;
78 case MPI_COMBINER_CONTIGUOUS:
79 ints = (int *) ADIOI_Malloc((nints+1)*sizeof(int));
80 adds = (MPI_Aint *) ADIOI_Malloc((nadds+1)*sizeof(MPI_Aint));
81 types = (MPI_Datatype *) ADIOI_Malloc((ntypes+1)*sizeof(MPI_Datatype));
82 MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints,
83 adds, types);
84 ADIOI_Datatype_iscontig(types[0], flag);
85
86 #ifndef MPISGI
87
88
89 MPI_Type_get_envelope(types[0], &ni, &na, &nt, &cb);
90 if (cb != MPI_COMBINER_NAMED) MPI_Type_free(types);
91 #endif
92
93 ADIOI_Free(ints);
94 ADIOI_Free(adds);
95 ADIOI_Free(types);
96 break;
97 default:
98 *flag = 0;
99 break;
100 }
101
102
103
104 }
105 #endif