Skip to content

Commit

Permalink
Update coll framework for bigcount
Browse files Browse the repository at this point in the history
Update the collective framework and dependent code to use
size_t/ptrdiff_t for counts/displacements when necessary.
Several places include comments with TODO:BIGCOUNT for changes that rely
on updates to other libraries, such as the ompi/opal datatype code.

Co-authored-by: Howard Pritchard <[email protected]>
Signed-off-by: Jake Tronge <[email protected]>
  • Loading branch information
jtronge and hppritcha committed Apr 22, 2024
1 parent 0261a03 commit 7e40475
Show file tree
Hide file tree
Showing 257 changed files with 2,390 additions and 2,010 deletions.
12 changes: 6 additions & 6 deletions ompi/mca/coll/accelerator/coll_accelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,33 @@ int mca_coll_accelerator_module_enable(mca_coll_base_module_t *module,
struct ompi_communicator_t *comm);

int
mca_coll_accelerator_allreduce(const void *sbuf, void *rbuf, int count,
mca_coll_accelerator_allreduce(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module);

int mca_coll_accelerator_reduce(const void *sbuf, void *rbuf, int count,
int mca_coll_accelerator_reduce(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
int root,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module);

int mca_coll_accelerator_exscan(const void *sbuf, void *rbuf, int count,
int mca_coll_accelerator_exscan(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module);

int mca_coll_accelerator_scan(const void *sbuf, void *rbuf, int count,
int mca_coll_accelerator_scan(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module);

int
mca_coll_accelerator_reduce_scatter_block(const void *sbuf, void *rbuf, int rcount,
mca_coll_accelerator_reduce_scatter_block(const void *sbuf, void *rbuf, size_t rcount,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
Expand Down Expand Up @@ -124,7 +124,7 @@ OBJ_CLASS_DECLARATION(mca_coll_accelerator_module_t);
/* Component */

typedef struct mca_coll_accelerator_component_t {
mca_coll_base_component_2_4_0_t super;
mca_coll_base_component_3_0_0_t super;

int priority; /* Priority of this component */
int disable_accelerator_coll; /* Force disable of the accelerator collective component */
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/accelerator/coll_accelerator_allreduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Returns: - MPI_SUCCESS or error code
*/
int
mca_coll_accelerator_allreduce(const void *sbuf, void *rbuf, int count,
mca_coll_accelerator_allreduce(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/accelerator/coll_accelerator_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mca_coll_accelerator_component_t mca_coll_accelerator_component = {
* about the component itself */

.collm_version = {
MCA_COLL_BASE_VERSION_2_4_0,
MCA_COLL_BASE_VERSION_3_0_0,

/* Component name and version */
.mca_component_name = "accelerator",
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/accelerator/coll_accelerator_exscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "ompi/op/op.h"
#include "opal/datatype/opal_convertor.h"

int mca_coll_accelerator_exscan(const void *sbuf, void *rbuf, int count,
int mca_coll_accelerator_exscan(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/accelerator/coll_accelerator_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Returns: - MPI_SUCCESS or error code
*/
int
mca_coll_accelerator_reduce(const void *sbuf, void *rbuf, int count,
mca_coll_accelerator_reduce(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
int root, struct ompi_communicator_t *comm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* up at some point)
*/
int
mca_coll_accelerator_reduce_scatter_block(const void *sbuf, void *rbuf, int rcount,
mca_coll_accelerator_reduce_scatter_block(const void *sbuf, void *rbuf, size_t rcount,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/accelerator/coll_accelerator_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Accepts: - same arguments as MPI_Scan()
* Returns: - MPI_SUCCESS or error code
*/
int mca_coll_accelerator_scan(const void *sbuf, void *rbuf, int count,
int mca_coll_accelerator_scan(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype,
struct ompi_op_t *op,
struct ompi_communicator_t *comm,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/adapt/coll_adapt.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef enum {
*/
typedef struct mca_coll_adapt_component_t {
/* Base coll component */
mca_coll_base_component_2_4_0_t super;
mca_coll_base_component_3_0_0_t super;

/* MCA parameter: Priority of this component */
int adapt_priority;
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/adapt/coll_adapt_bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "coll_adapt.h"
#include "coll_adapt_algorithms.h"

int ompi_coll_adapt_bcast(void *buff, int count, struct ompi_datatype_t *datatype, int root,
int ompi_coll_adapt_bcast(void *buff, size_t count, struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm, mca_coll_base_module_t * module)
{
ompi_request_t *request = NULL;
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/adapt/coll_adapt_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mca_coll_adapt_component_t mca_coll_adapt_component = {
/* First, the mca_component_t struct containing meta
information about the component itself */
.collm_version = {
MCA_COLL_BASE_VERSION_2_4_0,
MCA_COLL_BASE_VERSION_3_0_0,

/* Component name and version */
.mca_component_name = "adapt",
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/adapt/coll_adapt_ibcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int recv_cb(ompi_request_t * req)
return 1;
}

int ompi_coll_adapt_ibcast(void *buff, int count, struct ompi_datatype_t *datatype, int root,
int ompi_coll_adapt_ibcast(void *buff, size_t count, struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
mca_coll_base_module_t * module)
{
Expand All @@ -341,7 +341,7 @@ int ompi_coll_adapt_ibcast(void *buff, int count, struct ompi_datatype_t *dataty
}


int ompi_coll_adapt_ibcast_generic(void *buff, int count, struct ompi_datatype_t *datatype, int root,
int ompi_coll_adapt_ibcast_generic(void *buff, size_t count, struct ompi_datatype_t *datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
mca_coll_base_module_t * module, ompi_coll_tree_t * tree,
size_t seg_size)
Expand All @@ -351,7 +351,7 @@ int ompi_coll_adapt_ibcast_generic(void *buff, int count, struct ompi_datatype_t
int min;

/* Number of datatype in a segment */
int seg_count = count;
size_t seg_count = count;
/* Size of a datatype */
size_t type_size;
/* Real size of a segment */
Expand Down
7 changes: 4 additions & 3 deletions ompi/mca/coll/adapt/coll_adapt_ireduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int recv_cb(ompi_request_t * req)
return 1;
}

int ompi_coll_adapt_ireduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
int ompi_coll_adapt_ireduce(const void *sbuf, void *rbuf, size_t count, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
ompi_request_t ** request, mca_coll_base_module_t * module)
{
Expand Down Expand Up @@ -513,7 +513,7 @@ int ompi_coll_adapt_ireduce(const void *sbuf, void *rbuf, int count, struct ompi
}


int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, size_t count,
struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
mca_coll_base_module_t * module, ompi_coll_tree_t * tree,
Expand All @@ -523,7 +523,8 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
ptrdiff_t extent, lower_bound, segment_increment;
ptrdiff_t true_lower_bound, true_extent, real_seg_size;
size_t typelng;
int seg_count = count, num_segs, rank, recv_count, send_count, err, min;
size_t seg_count = count, recv_count, send_count;
int num_segs, rank, err, min;
/* Used to store the accumuate result, pointer to every segment */
char **accumbuf = NULL;
opal_mutex_t *mutex_op_list;
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/adapt/coll_adapt_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "coll_adapt_algorithms.h"

/* MPI_Reduce and MPI_Ireduce in the ADAPT module only work for commutative operations */
int ompi_coll_adapt_reduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
int ompi_coll_adapt_reduce(const void *sbuf, void *rbuf, size_t count, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, int root, struct ompi_communicator_t *comm,
mca_coll_base_module_t * module)
{
Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/coll/base/coll_base_agree_noft.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

int
ompi_coll_base_agree_noft(void *contrib,
int dt_count,
size_t dt_count,
struct ompi_datatype_t *dt,
struct ompi_op_t *op,
struct ompi_group_t **group, bool update_grp,
Expand All @@ -33,7 +33,7 @@ ompi_coll_base_agree_noft(void *contrib,

int
ompi_coll_base_iagree_noft(void *contrib,
int dt_count,
size_t dt_count,
struct ompi_datatype_t *dt,
struct ompi_op_t *op,
struct ompi_group_t **group, bool update_grp,
Expand Down
28 changes: 14 additions & 14 deletions ompi/mca/coll/base/coll_base_allgather.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
* [4] [4] [4] [4] [4] [4]
* [5] [5] [5] [5] [5] [5]
*/
int ompi_coll_base_allgather_intra_bruck(const void *sbuf, int scount,
int ompi_coll_base_allgather_intra_bruck(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -252,9 +252,9 @@ int ompi_coll_base_allgather_intra_bruck(const void *sbuf, int scount,
* step, and send them appropriate messages.
*/
int
ompi_coll_base_allgather_intra_recursivedoubling(const void *sbuf, int scount,
ompi_coll_base_allgather_intra_recursivedoubling(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -392,9 +392,9 @@ ompi_coll_base_allgather_intra_recursivedoubling(const void *sbuf, int scount,
* [5] [5] [5] [5] [5] [5]
*/

int ompi_coll_base_allgather_intra_sparbit(const void *sbuf, int scount,
int ompi_coll_base_allgather_intra_sparbit(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -495,9 +495,9 @@ int ompi_coll_base_allgather_intra_sparbit(const void *sbuf, int scount,
* No additional memory requirements.
*
*/
int ompi_coll_base_allgather_intra_ring(const void *sbuf, int scount,
int ompi_coll_base_allgather_intra_ring(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -621,9 +621,9 @@ int ompi_coll_base_allgather_intra_ring(const void *sbuf, int scount,
* [5] [5] [5] [5] [5] [5]
*/
int
ompi_coll_base_allgather_intra_neighborexchange(const void *sbuf, int scount,
ompi_coll_base_allgather_intra_neighborexchange(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -735,9 +735,9 @@ ompi_coll_base_allgather_intra_neighborexchange(const void *sbuf, int scount,
}


int ompi_coll_base_allgather_intra_two_procs(const void *sbuf, int scount,
int ompi_coll_base_allgather_intra_two_procs(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void* rbuf, int rcount,
void* rbuf, size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down Expand Up @@ -818,10 +818,10 @@ int ompi_coll_base_allgather_intra_two_procs(const void *sbuf, int scount,
* Returns: - MPI_SUCCESS or error code
*/
int
ompi_coll_base_allgather_intra_basic_linear(const void *sbuf, int scount,
ompi_coll_base_allgather_intra_basic_linear(const void *sbuf, size_t scount,
struct ompi_datatype_t *sdtype,
void *rbuf,
int rcount,
size_t rcount,
struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm,
mca_coll_base_module_t *module)
Expand Down
Loading

0 comments on commit 7e40475

Please sign in to comment.