Skip to content

Commit 37c978f

Browse files
committed
coll/libnbc: correctly handle changed types.
this fixes d816d1c thanks Jeff for the review
1 parent d7b437e commit 37c978f

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

ompi/mca/coll/libnbc/nbc_ialltoall.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +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, datasize;
55-
size_t sndsize;
54+
int rank, p, res, datasize;
55+
size_t a2asize, sndsize;
5656
NBC_Schedule *schedule;
5757
MPI_Aint rcvext, sndext;
5858
#ifdef NBC_CACHE_SCHEDULE
@@ -94,7 +94,7 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype
9494
* total communicated size is smaller than 1<<17 *and* if we don't
9595
* have eager messages (msgsize < 1<<13) */
9696
alg = NBC_A2A_LINEAR;
97-
} else if(a2asize < (1<<12)*p) {
97+
} else if(a2asize < (1<<12)*(unsigned int)p) {
9898
/*alg = NBC_A2A_DISS;*/
9999
alg = NBC_A2A_LINEAR;
100100
} else

ompi/mca/coll/libnbc/nbc_ibcast.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* -*- Mode: C; c-basic-offset:2 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2006 The Trustees of Indiana University and Indiana
4-
* University Research and Technology
5-
* Corporation. All rights reserved.
6-
* Copyright (c) 2006 The Technical University of Chemnitz. All
7-
* rights reserved.
8-
* Copyright (c) 2014 Research Organization for Information Science
3+
* Copyright (c) 2006 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2006 The Technical University of Chemnitz. All
7+
* rights reserved.
8+
* Copyright (c) 2014-2015 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
1010
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1111
* reserved.
@@ -20,7 +20,7 @@ static inline int bcast_sched_binomial(int rank, int p, int root, NBC_Schedule *
2020
static inline int bcast_sched_linear(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count,
2121
MPI_Datatype datatype);
2222
static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count,
23-
MPI_Datatype datatype, int fragsize, int size);
23+
MPI_Datatype datatype, int fragsize, size_t size);
2424

2525
#ifdef NBC_CACHE_SCHEDULE
2626
/* tree comparison function for schedule cache */
@@ -252,7 +252,7 @@ static inline int bcast_sched_linear(int rank, int p, int root, NBC_Schedule *sc
252252
}
253253

254254
/* simple chained MPI_Ibcast */
255-
static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype, int fragsize, int size) {
255+
static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype, int fragsize, size_t size) {
256256
int res, vrank, rpeer, speer, numfrag, fragcount, thiscount;
257257
MPI_Aint ext;
258258
char *buf;

ompi/mca/coll/libnbc/nbc_ibcast_inter.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Corporation. All rights reserved.
66
* Copyright (c) 2006 The Technical University of Chemnitz. All
77
* rights reserved.
8-
* Copyright (c) 2014 Research Organization for Information Science
8+
* Copyright (c) 2014-2015 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
1010
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1111
* reserved.
@@ -19,17 +19,10 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype
1919
struct ompi_communicator_t *comm, ompi_request_t ** request,
2020
struct mca_coll_base_module_2_1_0_t *module) {
2121
int res;
22-
size_t size;
2322
NBC_Schedule *schedule;
2423
NBC_Handle *handle;
2524
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
2625

27-
res = ompi_datatype_type_size(datatype, &size);
28-
if (MPI_SUCCESS != res) {
29-
NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res);
30-
return res;
31-
}
32-
3326
schedule = OBJ_NEW(NBC_Schedule);
3427
if (OPAL_UNLIKELY(NULL == schedule)) {
3528
return OMPI_ERR_OUT_OF_RESOURCE;

ompi/mca/coll/libnbc/nbc_ireduce.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
static inline int red_sched_binomial (int rank, int p, int root, const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
1919
MPI_Op op, void *redbuf, NBC_Schedule *schedule, NBC_Handle *handle);
2020
static inline int red_sched_chain (int rank, int p, int root, const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
21-
MPI_Op op, int ext, int size, NBC_Schedule *schedule, NBC_Handle *handle, int fragsize);
21+
MPI_Op op, int ext, size_t size, NBC_Schedule *schedule, NBC_Handle *handle, int fragsize);
2222

2323
static inline int red_sched_linear (int rank, int rsize, int root, const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
2424
MPI_Op op, NBC_Schedule *schedule, NBC_Handle *handle);
@@ -360,7 +360,7 @@ static inline int red_sched_binomial (int rank, int p, int root, const void *sen
360360

361361
/* chain send ... */
362362
static inline int red_sched_chain (int rank, int p, int root, const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
363-
MPI_Op op, int ext, int size, NBC_Schedule *schedule, NBC_Handle *handle, int fragsize) {
363+
MPI_Op op, int ext, size_t size, NBC_Schedule *schedule, NBC_Handle *handle, int fragsize) {
364364
int res, vrank, rpeer, speer, numfrag, fragcount, thiscount;
365365
long offset;
366366

0 commit comments

Comments
 (0)