Skip to content

Commit adaa7f6

Browse files
committed
some fixes to get further with mpi4py
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent d0526d1 commit adaa7f6

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

ompi/include/mpi.h.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ typedef struct ompi_f08_status_public_t ompi_f08_status_public_t;
499499
typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, void *);
500500
typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype,
501501
int, void *, MPI_Offset, void *);
502+
typedef int (MPI_Datarep_conversion_function_c)(void *, MPI_Datatype,
503+
MPI_Count, void *, MPI_Offset, void *);
502504
typedef void (MPI_Comm_errhandler_function)(MPI_Comm *, int *, ...);
503505
typedef void (MPI_Session_errhandler_function) (MPI_Session *, int *, ...);
504506

@@ -509,6 +511,7 @@ typedef void (MPI_Session_errhandler_function) (MPI_Session *, int *, ...);
509511
typedef void (ompi_file_errhandler_function)(MPI_File *, int *, ...);
510512
typedef void (MPI_Win_errhandler_function)(MPI_Win *, int *, ...);
511513
typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *);
514+
typedef void (MPI_User_function_c)(void *, void *, MPI_Count *, MPI_Datatype *);
512515
typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *,
513516
void *, void *, int *);
514517
typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *);
@@ -994,6 +997,7 @@ enum {
994997
must be able to be present, and therefore has to be in this
995998
conditional block in mpi.h. */
996999
#define MPI_CONVERSION_FN_NULL ((MPI_Datarep_conversion_function*) 0)
1000+
#define MPI_CONVERSION_FN_NULL_C ((MPI_Datarep_conversion_function_c*) 0)
9971001
#endif
9981002

9991003
OMPI_DECLSPEC int OMPI_C_MPI_TYPE_NULL_DELETE_FN( MPI_Datatype datatype,
@@ -1896,6 +1900,8 @@ OMPI_DECLSPEC int MPI_Group_union(MPI_Group group1, MPI_Group group2,
18961900
MPI_Group *newgroup);
18971901
OMPI_DECLSPEC int MPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest,
18981902
int tag, MPI_Comm comm, MPI_Request *request);
1903+
OMPI_DECLSPEC int MPI_Ibsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
1904+
int tag, MPI_Comm comm, MPI_Request *request);
18991905
OMPI_DECLSPEC int MPI_Improbe(int source, int tag, MPI_Comm comm,
19001906
int *flag, MPI_Message *message,
19011907
MPI_Status *status);
@@ -2403,6 +2409,9 @@ OMPI_DECLSPEC int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers,
24032409
OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers,
24042410
int *num_addresses, int *num_datatypes,
24052411
int *combiner);
2412+
OMPI_DECLSPEC int MPI_Type_get_envelope_c(MPI_Datatype type, MPI_Count *num_integers,
2413+
MPI_Count *num_addresses, MPI_Count *num_large_counts,
2414+
MPI_Count *num_datatypes, int *combiner);
24062415
OMPI_DECLSPEC int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb,
24072416
MPI_Aint *extent);
24082417
OMPI_DECLSPEC int MPI_Type_get_extent_x(MPI_Datatype type, MPI_Count *lb,
@@ -3011,6 +3020,8 @@ OMPI_DECLSPEC int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
30113020
MPI_Group *newgroup);
30123021
OMPI_DECLSPEC int PMPI_Ibsend(const void *buf, int count, MPI_Datatype datatype, int dest,
30133022
int tag, MPI_Comm comm, MPI_Request *request);
3023+
OMPI_DECLSPEC int PMPI_Ibsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
3024+
int tag, MPI_Comm comm, MPI_Request *request);
30143025
OMPI_DECLSPEC int PMPI_Improbe(int source, int tag, MPI_Comm comm,
30153026
int *flag, MPI_Message *message,
30163027
MPI_Status *status);
@@ -3518,6 +3529,9 @@ OMPI_DECLSPEC int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers,
35183529
OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers,
35193530
int *num_addresses, int *num_datatypes,
35203531
int *combiner);
3532+
OMPI_DECLSPEC int PMPI_Type_get_envelope_c(MPI_Datatype type, MPI_Count *num_integers,
3533+
MPI_Count *num_addresses, MPI_Count *num_large_counts,
3534+
MPI_Count *num_datatypes, int *combiner);
35213535
OMPI_DECLSPEC int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb,
35223536
MPI_Aint *extent);
35233537
OMPI_DECLSPEC int PMPI_Type_get_extent_x(MPI_Datatype type, MPI_Count *lb,

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ def parameter(self, enable_count=False, **kwargs):
199199
else:
200200
return f'int {self.name}[]'
201201

202+
@Type.add_type('COUNT_OUT')
203+
class TypeCountOut(Type):
204+
205+
@property
206+
def is_count(self):
207+
return True
208+
209+
def type_text(self, enable_count=False):
210+
return 'MPI_Count *' if enable_count else 'int *'
202211

203212
@Type.add_type('INT_ARRAY')
204213
class TypeIntArray(Type):

ompi/mpi/bindings/ompi_bindings/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ def abi_internal_name(extname):
128128

129129
def prototype_has_bigcount(prototype):
130130
"""Should this prototype have a bigcount version?"""
131-
return any(param.type_name in ('COUNT', 'COUNT_ARRAY', 'DISP', 'DISP_ARRAY')
131+
return any(param.type_name in ('COUNT', 'COUNT_ARRAY', 'DISP', 'DISP_ARRAY', 'COUNT_OUT')
132132
for param in prototype.params)

ompi/mpi/c/get_elements.c.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
#include "ompi/datatype/ompi_datatype.h"
3333
#include "ompi/memchecker.h"
3434

35-
/* TODO: Does this need a bigcount variant? */
36-
37-
PROTOTYPE ERROR_CLASS get_elements(STATUS status, DATATYPE datatype, INT_OUT count)
35+
PROTOTYPE ERROR_CLASS Get_elements(STATUS status, DATATYPE datatype, COUNT_OUT count)
3836
{
3937
size_t internal_count;
4038
int ret;

ompi/mpi/c/irsend.c.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#include "ompi/memchecker.h"
3535
#include "ompi/runtime/ompi_spc.h"
3636

37-
PROTOTYPE ERROR_CLASS irsend(BUFFER buf, COUNT count, DATATYPE type, INT dest,
38-
INT tag, COMM comm, REQUEST_INOUT request)
37+
PROTOTYPE ERROR_CLASS Irsend(BUFFER buf, COUNT count, DATATYPE type, INT dest,
38+
INT tag, COMM comm, REQUEST_INOUT request)
3939
{
4040
int rc;
4141

0 commit comments

Comments
 (0)