Skip to content

Commit d816d1c

Browse files
committed
coll/libnbc: use PMPI_* and internal ompi_* insted of MPI_*
1 parent c61ef30 commit d816d1c

21 files changed

+111
-106
lines changed

ompi/mca/coll/libnbc/nbc_iallgather.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype
5858
rank = ompi_comm_rank (comm);
5959
p = ompi_comm_size (comm);
6060

61-
res = MPI_Type_extent(recvtype, &rcvext);
61+
res = ompi_datatype_type_extent(recvtype, &rcvext);
6262
if (MPI_SUCCESS != res) {
6363
return res;
6464
}
@@ -175,9 +175,9 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da
175175
NBC_Handle *handle;
176176
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
177177

178-
res = MPI_Type_extent(recvtype, &rcvext);
178+
res = ompi_datatype_type_extent(recvtype, &rcvext);
179179
if (MPI_SUCCESS != res) {
180-
NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);
180+
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)", res);
181181
return res;
182182
}
183183

ompi/mca/coll/libnbc/nbc_iallgatherv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp
4545
rank = ompi_comm_rank (comm);
4646
p = ompi_comm_size (comm);
4747

48-
res = MPI_Type_extent (recvtype, &rcvext);
48+
res = ompi_datatype_type_extent (recvtype, &rcvext);
4949
if (OPAL_UNLIKELY(MPI_SUCCESS != res)) {
50-
NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);
50+
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)", res);
5151
return res;
5252
}
5353

@@ -124,9 +124,9 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D
124124

125125
rsize = ompi_comm_remote_size (comm);
126126

127-
res = MPI_Type_extent(recvtype, &rcvext);
127+
res = ompi_datatype_type_extent(recvtype, &rcvext);
128128
if (OPAL_UNLIKELY(MPI_SUCCESS != res)) {
129-
NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);
129+
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)", res);
130130
return res;
131131
}
132132

ompi/mca/coll/libnbc/nbc_iallreduce.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M
7070

7171
res = ompi_datatype_get_extent(datatype, &lb, &ext);
7272
if (OMPI_SUCCESS != res) {
73-
NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);
73+
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)", res);
7474
return res;
7575
}
7676

7777
res = ompi_datatype_type_size (datatype, &size);
7878
if (OMPI_SUCCESS != res) {
79-
NBC_Error ("MPI Error in MPI_Type_size() (%i)", res);
79+
NBC_Error ("MPI Error in ompi_datatype_type_size() (%i)", res);
8080
return res;
8181
}
8282

@@ -193,7 +193,8 @@ int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int co
193193
struct ompi_communicator_t *comm, ompi_request_t ** request,
194194
struct mca_coll_base_module_2_1_0_t *module)
195195
{
196-
int rank, res, size, rsize;
196+
int rank, res, rsize;
197+
size_t size;
197198
MPI_Aint ext;
198199
NBC_Schedule *schedule;
199200
NBC_Handle *handle;
@@ -202,15 +203,15 @@ int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int co
202203
rank = ompi_comm_rank (comm);
203204
rsize = ompi_comm_remote_size (comm);
204205

205-
res = MPI_Type_extent(datatype, &ext);
206+
res = ompi_datatype_type_extent(datatype, &ext);
206207
if (MPI_SUCCESS != res) {
207-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
208+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
208209
return res;
209210
}
210211

211-
res = MPI_Type_size(datatype, &size);
212+
res = ompi_datatype_type_size(datatype, &size);
212213
if (MPI_SUCCESS != res) {
213-
NBC_Error("MPI Error in MPI_Type_size() (%i)", res);
214+
NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res);
214215
return res;
215216
}
216217

ompi/mca/coll/libnbc/nbc_ialltoall.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype
5151
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
5252
struct mca_coll_base_module_2_1_0_t *module)
5353
{
54-
int rank, p, res, a2asize, sndsize, datasize;
54+
int rank, p, res, a2asize, datasize;
55+
size_t sndsize;
5556
NBC_Schedule *schedule;
5657
MPI_Aint rcvext, sndext;
5758
#ifdef NBC_CACHE_SCHEDULE
@@ -67,21 +68,21 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype
6768
rank = ompi_comm_rank (comm);
6869
p = ompi_comm_size (comm);
6970

70-
res = MPI_Type_extent(sendtype, &sndext);
71+
res = ompi_datatype_type_extent(sendtype, &sndext);
7172
if (MPI_SUCCESS != res) {
72-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
73+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
7374
return res;
7475
}
7576

76-
res = MPI_Type_extent(recvtype, &rcvext);
77+
res = ompi_datatype_type_extent(recvtype, &rcvext);
7778
if (MPI_SUCCESS != res) {
78-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
79+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
7980
return res;
8081
}
8182

82-
res = MPI_Type_size(sendtype, &sndsize);
83+
res = ompi_datatype_type_size(sendtype, &sndsize);
8384
if (MPI_SUCCESS != res) {
84-
NBC_Error("MPI Error in MPI_Type_size() (%i)", res);
85+
NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res);
8586
return res;
8687
}
8788

@@ -120,9 +121,9 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype
120121
if(NBC_Type_intrinsic(sendtype)) {
121122
datasize = sndext * sendcount;
122123
} else {
123-
res = MPI_Pack_size (sendcount, sendtype, comm, &datasize);
124+
res = PMPI_Pack_size (sendcount, sendtype, comm, &datasize);
124125
if (MPI_SUCCESS != res) {
125-
NBC_Error("MPI Error in MPI_Pack_size() (%i)", res);
126+
NBC_Error("MPI Error in PMPI_Pack_size() (%i)", res);
126127
NBC_Return_handle (handle);
127128
return res;
128129
}
@@ -156,20 +157,20 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype
156157
int pos=0;
157158

158159
/* non-contiguous - pack */
159-
res = MPI_Pack ((char *) sendbuf + rank * sendcount * sndext, (p - rank) * sendcount, sendtype, handle->tmpbuf,
160+
res = PMPI_Pack ((char *) sendbuf + rank * sendcount * sndext, (p - rank) * sendcount, sendtype, handle->tmpbuf,
160161
(p - rank) * datasize, &pos, comm);
161162
if (OPAL_UNLIKELY(MPI_SUCCESS != res)) {
162-
NBC_Error("MPI Error in MPI_Pack() (%i)", res);
163+
NBC_Error("MPI Error in PMPI_Pack() (%i)", res);
163164
NBC_Return_handle (handle);
164165
return res;
165166
}
166167

167168
if (rank != 0) {
168169
pos = 0;
169-
res = MPI_Pack(sendbuf, rank * sendcount, sendtype, (char *) handle->tmpbuf + datasize * (p - rank),
170+
res = PMPI_Pack(sendbuf, rank * sendcount, sendtype, (char *) handle->tmpbuf + datasize * (p - rank),
170171
rank * datasize, &pos, comm);
171172
if (OPAL_UNLIKELY(MPI_SUCCESS != res)) {
172-
NBC_Error("MPI Error in MPI_Pack() (%i)", res);
173+
NBC_Error("MPI Error in PMPI_Pack() (%i)", res);
173174
NBC_Return_handle (handle);
174175
return res;
175176
}
@@ -277,15 +278,15 @@ int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Da
277278

278279
rsize = ompi_comm_remote_size (comm);
279280

280-
res = MPI_Type_extent (sendtype, &sndext);
281+
res = ompi_datatype_type_extent (sendtype, &sndext);
281282
if (MPI_SUCCESS != res) {
282-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
283+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
283284
return res;
284285
}
285286

286-
res = MPI_Type_extent (recvtype, &rcvext);
287+
res = ompi_datatype_type_extent (recvtype, &rcvext);
287288
if (MPI_SUCCESS != res) {
288-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
289+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
289290
return res;
290291
}
291292

@@ -414,9 +415,9 @@ static inline int a2a_sched_diss(int rank, int p, MPI_Aint sndext, MPI_Aint rcve
414415
if(NBC_Type_intrinsic(sendtype)) {
415416
datasize = sndext*sendcount;
416417
} else {
417-
res = MPI_Pack_size(sendcount, sendtype, comm, &datasize);
418+
res = PMPI_Pack_size(sendcount, sendtype, comm, &datasize);
418419
if (MPI_SUCCESS != res) {
419-
NBC_Error("MPI Error in MPI_Pack_size() (%i)", res);
420+
NBC_Error("MPI Error in PMPI_Pack_size() (%i)", res);
420421
return res;
421422
}
422423
}

ompi/mca/coll/libnbc/nbc_ialltoallv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
3737
rank = ompi_comm_rank (comm);
3838
p = ompi_comm_size (comm);
3939

40-
res = MPI_Type_extent (sendtype, &sndext);
40+
res = ompi_datatype_type_extent (sendtype, &sndext);
4141
if (MPI_SUCCESS != res) {
42-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
42+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
4343
return res;
4444
}
4545

46-
res = MPI_Type_extent (recvtype, &rcvext);
46+
res = ompi_datatype_type_extent (recvtype, &rcvext);
4747
if (MPI_SUCCESS != res) {
48-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
48+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
4949
return res;
5050
}
5151

@@ -128,15 +128,15 @@ int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcount
128128
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
129129

130130

131-
res = MPI_Type_extent(sendtype, &sndext);
131+
res = ompi_datatype_type_extent(sendtype, &sndext);
132132
if (MPI_SUCCESS != res) {
133-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
133+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
134134
return res;
135135
}
136136

137-
res = MPI_Type_extent(recvtype, &rcvext);
137+
res = ompi_datatype_type_extent(recvtype, &rcvext);
138138
if (MPI_SUCCESS != res) {
139-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
139+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
140140
return res;
141141
}
142142

ompi/mca/coll/libnbc/nbc_ibcast.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int
4444
struct ompi_communicator_t *comm, ompi_request_t ** request,
4545
struct mca_coll_base_module_2_1_0_t *module)
4646
{
47-
int rank, p, res, size, segsize;
47+
int rank, p, res, segsize;
48+
size_t size;
4849
NBC_Schedule *schedule;
4950
#ifdef NBC_CACHE_SCHEDULE
5051
NBC_Bcast_args *args, *found, search;
@@ -56,9 +57,9 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int
5657
rank = ompi_comm_rank (comm);
5758
p = ompi_comm_size (comm);
5859

59-
res = MPI_Type_size(datatype, &size);
60+
res = ompi_datatype_type_size(datatype, &size);
6061
if (MPI_SUCCESS != res) {
61-
NBC_Error("MPI Error in MPI_Type_size() (%i)", res);
62+
NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res);
6263
return res;
6364
}
6465

@@ -259,9 +260,9 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch
259260
RANK2VRANK(rank, vrank, root);
260261
VRANK2RANK(rpeer, vrank-1, root);
261262
VRANK2RANK(speer, vrank+1, root);
262-
res = MPI_Type_extent(datatype, &ext);
263+
res = ompi_datatype_type_extent(datatype, &ext);
263264
if (MPI_SUCCESS != res) {
264-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
265+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
265266
return res;
266267
}
267268

ompi/mca/coll/libnbc/nbc_ibcast_inter.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root,
1919
struct ompi_communicator_t *comm, ompi_request_t ** request,
2020
struct mca_coll_base_module_2_1_0_t *module) {
21-
int res, size;
21+
int res;
22+
size_t size;
2223
NBC_Schedule *schedule;
2324
NBC_Handle *handle;
2425
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
2526

26-
res = MPI_Type_size(datatype, &size);
27+
res = ompi_datatype_type_size(datatype, &size);
2728
if (MPI_SUCCESS != res) {
28-
NBC_Error("MPI Error in MPI_Type_size() (%i)", res);
29+
NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res);
2930
return res;
3031
}
3132

ompi/mca/coll/libnbc/nbc_iexscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_
5959
rank = ompi_comm_rank (comm);
6060
p = ompi_comm_size (comm);
6161

62-
res = MPI_Type_extent(datatype, &ext);
62+
res = ompi_datatype_type_extent(datatype, &ext);
6363
if (MPI_SUCCESS != res) {
64-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
64+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
6565
return res;
6666
}
6767

ompi/mca/coll/libnbc/nbc_igather.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se
5656
p = ompi_comm_size (comm);
5757

5858
if (rank == root) {
59-
res = MPI_Type_extent (recvtype, &rcvext);
59+
res = ompi_datatype_type_extent (recvtype, &rcvext);
6060
if (MPI_SUCCESS != res) {
61-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
61+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
6262
return res;
6363
}
6464
}
@@ -187,9 +187,9 @@ int ompi_coll_libnbc_igather_inter (const void* sendbuf, int sendcount, MPI_Data
187187
rsize = ompi_comm_remote_size (comm);
188188

189189
if (root == MPI_ROOT) {
190-
res = MPI_Type_extent(recvtype, &rcvext);
190+
res = ompi_datatype_type_extent(recvtype, &rcvext);
191191
if (MPI_SUCCESS != res) {
192-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
192+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
193193
return res;
194194
}
195195
}

ompi/mca/coll/libnbc/nbc_igatherv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s
4040
p = ompi_comm_size (comm);
4141

4242
if (rank == root) {
43-
res = MPI_Type_extent(recvtype, &rcvext);
43+
res = ompi_datatype_type_extent(recvtype, &rcvext);
4444
if (MPI_SUCCESS != res) {
45-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
45+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
4646
return res;
4747
}
4848
}
@@ -121,9 +121,9 @@ int ompi_coll_libnbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Dat
121121
rsize = ompi_comm_size (comm);
122122

123123
if (MPI_ROOT == root) {
124-
res = MPI_Type_extent(recvtype, &rcvext);
124+
res = ompi_datatype_type_extent(recvtype, &rcvext);
125125
if (MPI_SUCCESS != res) {
126-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
126+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
127127
return res;
128128
}
129129
}

ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datat
4848
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
4949
NBC_Schedule *schedule;
5050

51-
res = MPI_Type_extent (rtype, &rcvext);
51+
res = ompi_datatype_type_extent (rtype, &rcvext);
5252
if (MPI_SUCCESS != res) {
53-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
53+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
5454
return res;
5555
}
5656

ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data
4949
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
5050
NBC_Schedule *schedule;
5151

52-
res = MPI_Type_extent(rtype, &rcvext);
52+
res = ompi_datatype_type_extent(rtype, &rcvext);
5353
if (MPI_SUCCESS != res) {
54-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
54+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
5555
return res;
5656
}
5757

ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty
4545
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
4646
NBC_Schedule *schedule;
4747

48-
res = MPI_Type_extent(stype, &sndext);
48+
res = ompi_datatype_type_extent(stype, &sndext);
4949
if (MPI_SUCCESS != res) {
50-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
50+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
5151
return res;
5252
}
5353

54-
res = MPI_Type_extent(rtype, &rcvext);
54+
res = ompi_datatype_type_extent(rtype, &rcvext);
5555
if (MPI_SUCCESS != res) {
56-
NBC_Error("MPI Error in MPI_Type_extent() (%i)", res);
56+
NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res);
5757
return res;
5858
}
5959

0 commit comments

Comments
 (0)