Skip to content

Commit

Permalink
coll: use MPI_Aint for count parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhou committed Feb 10, 2021
1 parent 6ec60b5 commit ef2fca3
Show file tree
Hide file tree
Showing 238 changed files with 1,772 additions and 1,597 deletions.
8 changes: 6 additions & 2 deletions maint/local_python/binding_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,12 @@ def push_impl_decl(func, impl_name=None):
impl_name = re.sub(r'^MPIX?_', 'MPIR_', func['name']) + "_impl"
if func['impl_param_list']:
params = ', '.join(func['impl_param_list'])
if func['dir'] == 'coll' and not RE.match(r'MPI_(I|Neighbor)', func['name']):
params = params + ", MPIR_Errflag_t *errflag"
if func['dir'] == 'coll':
# All collective impl function use MPI_Aint counts
params = re.sub(r' int (count|sendcount|recvcount),', r' MPI_Aint \1,', params)
# block collective use an extra errflag
if not RE.match(r'MPI_(I|Neighbor)', func['name']):
params = params + ", MPIR_Errflag_t *errflag"
else:
params="void"

Expand Down
803 changes: 421 additions & 382 deletions src/include/mpir_coll.h

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions src/include/mpir_csel.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ typedef struct {
union {
struct {
const void *sendbuf;
int sendcount;
MPI_Aint sendcount;
MPI_Datatype sendtype;
void *recvbuf;
int recvcount;
MPI_Aint recvcount;
MPI_Datatype recvtype;
} allgather, iallgather, neighbor_allgather, ineighbor_allgather;
struct {
const void *sendbuf;
int sendcount;
MPI_Aint sendcount;
MPI_Datatype sendtype;
void *recvbuf;
const int *recvcounts;
Expand All @@ -82,15 +82,15 @@ typedef struct {
struct {
const void *sendbuf;
void *recvbuf;
int count;
MPI_Aint count;
MPI_Datatype datatype;
MPI_Op op;
} allreduce, iallreduce;
struct {
const void *sendbuf;
int sendcount;
MPI_Aint sendcount;
MPI_Datatype sendtype;
int recvcount;
MPI_Aint recvcount;
void *recvbuf;
MPI_Datatype recvtype;
} alltoall, ialltoall, neighbor_alltoall, ineighbor_alltoall;
Expand Down Expand Up @@ -129,29 +129,29 @@ typedef struct {
} barrier, ibarrier;
struct {
void *buffer;
int count;
MPI_Aint count;
MPI_Datatype datatype;
int root;
} bcast, ibcast;
struct {
const void *sendbuf;
void *recvbuf;
int count;
MPI_Aint count;
MPI_Datatype datatype;
MPI_Op op;
} exscan, iexscan;
struct {
const void *sendbuf;
int sendcount;
MPI_Aint sendcount;
MPI_Datatype sendtype;
int recvcount;
MPI_Aint recvcount;
void *recvbuf;
MPI_Datatype recvtype;
int root;
} gather, igather, scatter, iscatter;
struct {
const void *sendbuf;
int sendcount;
MPI_Aint sendcount;
MPI_Datatype sendtype;
void *recvbuf;
const int *recvcounts;
Expand All @@ -162,7 +162,7 @@ typedef struct {
struct {
const void *sendbuf;
void *recvbuf;
int count;
MPI_Aint count;
MPI_Datatype datatype;
MPI_Op op;
int root;
Expand All @@ -177,14 +177,14 @@ typedef struct {
struct {
const void *sendbuf;
void *recvbuf;
int recvcount;
MPI_Aint recvcount;
MPI_Datatype datatype;
MPI_Op op;
} reduce_scatter_block, ireduce_scatter_block;
struct {
const void *sendbuf;
void *recvbuf;
int count;
MPI_Aint count;
MPI_Datatype datatype;
MPI_Op op;
} scan, iscan;
Expand All @@ -193,7 +193,7 @@ typedef struct {
const int *sendcounts;
const int *displs;
MPI_Datatype sendtype;
int recvcount;
MPI_Aint recvcount;
void *recvbuf;
MPI_Datatype recvtype;
int root;
Expand Down
12 changes: 6 additions & 6 deletions src/mpi/coll/allgather/allgather.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
*/

int MPIR_Allgather_allcomm_auto(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
int recvcount,
MPI_Aint recvcount,
MPI_Datatype recvtype, MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag)
{
Expand Down Expand Up @@ -143,8 +143,8 @@ int MPIR_Allgather_allcomm_auto(const void *sendbuf,
return mpi_errno;
}

int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int MPIR_Allgather_impl(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
Expand Down Expand Up @@ -211,8 +211,8 @@ int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
goto fn_exit;
}

int MPIR_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int MPIR_Allgather(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allgather/allgather_allcomm_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "mpiimpl.h"

int MPIR_Allgather_allcomm_nb(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int MPIR_Allgather_allcomm_nb(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* broadcast.
*/

int MPIR_Allgather_inter_local_gather_remote_bcast(const void *sendbuf, int sendcount,
int MPIR_Allgather_inter_local_gather_remote_bcast(const void *sendbuf, MPI_Aint sendcount,
MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype,
MPI_Aint recvcount, MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int rank, local_size, remote_size, mpi_errno = MPI_SUCCESS, root;
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allgather/allgather_intra_brucks.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* where n is total size of data gathered on each process.
*/
int MPIR_Allgather_intra_brucks(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
int recvcount,
MPI_Aint recvcount,
MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allgather/allgather_intra_recursive_doubling.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
* PVM/MPI 2003).
*/
int MPIR_Allgather_intra_recursive_doubling(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
int recvcount,
MPI_Aint recvcount,
MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allgather/allgather_intra_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
* Myrinet and IBM SP).
*/
int MPIR_Allgather_intra_ring(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
int recvcount,
MPI_Aint recvcount,
MPI_Datatype recvtype, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int comm_size, rank;
Expand Down
6 changes: 3 additions & 3 deletions src/mpi/coll/allgatherv/allgatherv.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
*/

int MPIR_Allgatherv_allcomm_auto(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
const int *recvcounts,
Expand Down Expand Up @@ -136,7 +136,7 @@ int MPIR_Allgatherv_allcomm_auto(const void *sendbuf,
goto fn_exit;
}

int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIR_Allgatherv_impl(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
Expand Down Expand Up @@ -205,7 +205,7 @@ int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendty
goto fn_exit;
}

int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIR_Allgatherv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/coll/allgatherv/allgatherv_allcomm_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "mpiimpl.h"

int MPIR_Allgatherv_allcomm_nb(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIR_Allgatherv_allcomm_nb(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* intracommunicator broadcast.
*/

int MPIR_Allgatherv_inter_remote_gather_local_bcast(const void *sendbuf, int sendcount,
int MPIR_Allgatherv_inter_remote_gather_local_bcast(const void *sendbuf, MPI_Aint sendcount,
MPI_Datatype sendtype, void *recvbuf,
const int *recvcounts, const int
*displs, MPI_Datatype recvtype,
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/coll/allgatherv/allgatherv_intra_brucks.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

int MPIR_Allgatherv_intra_brucks(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
const int *recvcounts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

int MPIR_Allgatherv_intra_recursive_doubling(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
const int *recvcounts,
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/coll/allgatherv/allgatherv_intra_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

int MPIR_Allgatherv_intra_ring(const void *sendbuf,
int sendcount,
MPI_Aint sendcount,
MPI_Datatype sendtype,
void *recvbuf,
const int *recvcounts,
Expand Down
6 changes: 3 additions & 3 deletions src/mpi/coll/allreduce/allreduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[] = {
};


int MPIR_Allreduce_allcomm_auto(const void *sendbuf, void *recvbuf, int count,
int MPIR_Allreduce_allcomm_auto(const void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag)
{
Expand Down Expand Up @@ -159,7 +159,7 @@ int MPIR_Allreduce_allcomm_auto(const void *sendbuf, void *recvbuf, int count,
goto fn_exit;
}

int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, MPI_Aint count, MPI_Datatype datatype,
MPI_Op op, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
Expand Down Expand Up @@ -222,7 +222,7 @@ int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datat
goto fn_exit;
}

int MPIR_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
int MPIR_Allreduce(const void *sendbuf, void *recvbuf, MPI_Aint count, MPI_Datatype datatype,
MPI_Op op, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
Expand Down
5 changes: 3 additions & 2 deletions src/mpi/coll/allreduce/allreduce_allcomm_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

#include "mpiimpl.h"

int MPIR_Allreduce_allcomm_nb(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
int MPIR_Allreduce_allcomm_nb(const void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag)
{
int mpi_errno = MPI_SUCCESS;
MPI_Request req = MPI_REQUEST_NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* group.
*/

int MPIR_Allreduce_inter_reduce_exchange_bcast(const void *sendbuf, void *recvbuf, int
count, MPI_Datatype datatype, MPI_Op op,
int MPIR_Allreduce_inter_reduce_exchange_bcast(const void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
int mpi_errno;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

int MPIR_Allreduce_intra_recursive_doubling(const void *sendbuf,
void *recvbuf,
int count,
MPI_Aint count,
MPI_Datatype datatype,
MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

int MPIR_Allreduce_intra_reduce_scatter_allgather(const void *sendbuf,
void *recvbuf,
int count,
MPI_Aint count,
MPI_Datatype datatype,
MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/coll/allreduce/allreduce_intra_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "mpiimpl.h"

int MPIR_Allreduce_intra_smp(const void *sendbuf, void *recvbuf, int count,
int MPIR_Allreduce_intra_smp(const void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag)
{
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allreduce_group/allreduce_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
MPIR_Assert((cr_) != MPI_UNDEFINED); \
} while (0)

int MPII_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
int MPII_Allreduce_group_intra(void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Group * group_ptr, int tag, MPIR_Errflag_t * errflag)
{
Expand Down Expand Up @@ -337,7 +337,7 @@ int MPII_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
goto fn_exit;
}

int MPII_Allreduce_group(void *sendbuf, void *recvbuf, int count,
int MPII_Allreduce_group(void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Group * group_ptr, int tag, MPIR_Errflag_t * errflag)
{
Expand Down
4 changes: 2 additions & 2 deletions src/mpi/coll/allreduce_group/allreduce_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#ifndef ALLREDUCE_GROUP_H_INCLUDED
#define ALLREDUCE_GROUP_H_INCLUDED

int MPII_Allreduce_group(void *sendbuf, void *recvbuf, int count,
int MPII_Allreduce_group(void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Group * group_ptr, int tag, MPIR_Errflag_t * errflag);
int MPII_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
int MPII_Allreduce_group_intra(void *sendbuf, void *recvbuf, MPI_Aint count,
MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
MPIR_Group * group_ptr, int tag, MPIR_Errflag_t * errflag);

Expand Down
Loading

0 comments on commit ef2fca3

Please sign in to comment.