Skip to content

Commit 6a412af

Browse files
committed
Big count support for datatypes
Utilize the count and disp arrays for type-punning of int and MPI_Count arguments to datatype creation functions. Pack integer or MPI_Count depending on what is needed when packing a datatype. Adjust places where bigcount support for datatpyes was missing. Signed-off-by: Joseph Schuchart <[email protected]>
1 parent ad363d3 commit 6a412af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1295
-1114
lines changed

ompi/datatype/ompi_datatype.h

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "ompi/constants.h"
4141
#include "opal/datatype/opal_convertor.h"
4242
#include "opal/util/output.h"
43+
#include "ompi/util/count_disp_array.h"
4344
#include "mpi.h"
4445

4546
BEGIN_C_DECLS
@@ -124,7 +125,7 @@ OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_init( void );
124125
OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_fini( void );
125126

126127
OMPI_DECLSPEC void ompi_datatype_dump (const ompi_datatype_t* pData);
127-
OMPI_DECLSPEC ompi_datatype_t* ompi_datatype_create( int32_t expectedSize );
128+
OMPI_DECLSPEC ompi_datatype_t* ompi_datatype_create( size_t expectedSize );
128129

129130
static inline int32_t
130131
ompi_datatype_is_committed( const ompi_datatype_t* type )
@@ -151,7 +152,7 @@ ompi_datatype_is_predefined( const ompi_datatype_t* type )
151152
}
152153

153154
static inline int32_t
154-
ompi_datatype_is_contiguous_memory_layout( const ompi_datatype_t* type, int32_t count )
155+
ompi_datatype_is_contiguous_memory_layout( const ompi_datatype_t* type, size_t count )
155156
{
156157
return opal_datatype_is_contiguous_memory_layout(&type->super, count);
157158
}
@@ -189,27 +190,27 @@ ompi_datatype_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, size
189190
OMPI_DECLSPEC int32_t
190191
ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newType );
191192

192-
OMPI_DECLSPEC int32_t ompi_datatype_create_contiguous( int count, const ompi_datatype_t* oldType, ompi_datatype_t** newType );
193-
OMPI_DECLSPEC int32_t ompi_datatype_create_vector( int count, int bLength, int stride,
193+
OMPI_DECLSPEC int32_t ompi_datatype_create_contiguous( size_t count, const ompi_datatype_t* oldType, ompi_datatype_t** newType );
194+
OMPI_DECLSPEC int32_t ompi_datatype_create_vector( size_t count, size_t bLength, ptrdiff_t stride,
194195
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
195-
OMPI_DECLSPEC int32_t ompi_datatype_create_hvector( int count, int bLength, ptrdiff_t stride,
196+
OMPI_DECLSPEC int32_t ompi_datatype_create_hvector( size_t count, size_t bLength, ptrdiff_t stride,
196197
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
197-
OMPI_DECLSPEC int32_t ompi_datatype_create_indexed( int count, const int* pBlockLength, const int* pDisp,
198+
OMPI_DECLSPEC int32_t ompi_datatype_create_indexed( size_t count, const ompi_count_array_t pBlockLength, const ompi_disp_array_t pDisp,
198199
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
199-
OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const ptrdiff_t* pDisp,
200+
OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed( size_t count, const ompi_count_array_t pBlockLength, const ompi_disp_array_t pDisp,
200201
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
201-
OMPI_DECLSPEC int32_t ompi_datatype_create_indexed_block( int count, int bLength, const int* pDisp,
202+
OMPI_DECLSPEC int32_t ompi_datatype_create_indexed_block( size_t count, size_t bLength, const ompi_disp_array_t pDisp,
202203
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
203-
OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const ptrdiff_t* pDisp,
204+
OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed_block( size_t count, size_t bLength, const ompi_disp_array_t pDisp,
204205
const ompi_datatype_t* oldType, ompi_datatype_t** newType );
205-
OMPI_DECLSPEC int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const ptrdiff_t* pDisp,
206+
OMPI_DECLSPEC int32_t ompi_datatype_create_struct( size_t count, const ompi_count_array_t pBlockLength, const ompi_disp_array_t pDisp,
206207
ompi_datatype_t* const* pTypes, ompi_datatype_t** newType );
207-
OMPI_DECLSPEC int32_t ompi_datatype_create_darray( int size, int rank, int ndims, int const* gsize_array,
208-
int const* distrib_array, int const* darg_array,
209-
int const* psize_array, int order, const ompi_datatype_t* oldtype,
208+
OMPI_DECLSPEC int32_t ompi_datatype_create_darray( int size, int rank, int ndims, const ompi_count_array_t gsize_array,
209+
const int* distrib_array, const int* darg_array,
210+
const int* psize_array, int order, const ompi_datatype_t* oldtype,
210211
ompi_datatype_t** newtype);
211-
OMPI_DECLSPEC int32_t ompi_datatype_create_subarray(int ndims, int const* size_array, int const* subsize_array,
212-
int const* start_array, int order,
212+
OMPI_DECLSPEC int32_t ompi_datatype_create_subarray(int ndims, const ompi_count_array_t size_array, const ompi_count_array_t subsize_array,
213+
const ompi_count_array_t start_array, int order,
213214
const ompi_datatype_t* oldtype, ompi_datatype_t** newtype);
214215
static inline int32_t
215216
ompi_datatype_create_resized( const ompi_datatype_t* oldType,
@@ -296,25 +297,26 @@ ompi_datatype_copy_content_same_ddt( const ompi_datatype_t* type, size_t count,
296297
return 0;
297298
}
298299

299-
OMPI_DECLSPEC const ompi_datatype_t* ompi_datatype_match_size( int size, uint16_t datakind, uint16_t datalang );
300+
OMPI_DECLSPEC const ompi_datatype_t* ompi_datatype_match_size( size_t size, uint16_t datakind, uint16_t datalang );
300301

301302
/*
302303
*
303304
*/
304-
OMPI_DECLSPEC int32_t ompi_datatype_sndrcv( const void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
305-
void *rbuf, int32_t rcount, const ompi_datatype_t* rdtype);
305+
OMPI_DECLSPEC int32_t ompi_datatype_sndrcv( const void *sbuf, size_t scount, const ompi_datatype_t* sdtype,
306+
void *rbuf, size_t rcount, const ompi_datatype_t* rdtype);
306307

307308
/*
308309
*
309310
*/
310311
OMPI_DECLSPEC int32_t ompi_datatype_get_args( const ompi_datatype_t* pData, int32_t which,
311-
int32_t * ci, int32_t * i,
312-
int32_t * ca, ptrdiff_t* a,
313-
int32_t * cd, ompi_datatype_t** d, int32_t * type);
312+
size_t * ci, int* i,
313+
size_t * cl, MPI_Count* l,
314+
size_t * ca, ptrdiff_t* a,
315+
size_t * cd, ompi_datatype_t** d, int32_t * type);
314316
OMPI_DECLSPEC int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
315-
int32_t ci, const int32_t ** i,
316-
int32_t ca, const ptrdiff_t* a,
317-
int32_t cd, ompi_datatype_t* const * d,int32_t type);
317+
size_t ci, size_t cl, const ompi_count_array_t *counts,
318+
size_t ca, const ompi_disp_array_t a,
319+
size_t cd, ompi_datatype_t* const * d,int32_t type);
318320
OMPI_DECLSPEC int32_t ompi_datatype_copy_args( const ompi_datatype_t* source_data,
319321
ompi_datatype_t* dest_data );
320322
OMPI_DECLSPEC int32_t ompi_datatype_release_args( ompi_datatype_t* pData );

0 commit comments

Comments
 (0)