Skip to content

Commit 4008ac8

Browse files
committed
Add --enable-bigcount configure switch
Signed-off-by: Jake Tronge <jtronge@lanl.gov>
1 parent 851b513 commit 4008ac8

File tree

5 files changed

+101
-15
lines changed

5 files changed

+101
-15
lines changed

config/ompi_configure_options.m4

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ else
244244
fi
245245
AM_CONDITIONAL(OMPI_OMPIO_SUPPORT, test "$ompi_want_ompio" = "1")
246246

247+
AC_MSG_CHECKING([if want bigcount support])
248+
AC_ARG_ENABLE([bigcount],
249+
[AS_HELP_STRING([--enable-bigcount],
250+
[Enable the bigcount API])])
251+
if test "$enable_bigcount" = "yes" ; then
252+
AC_MSG_RESULT([yes])
253+
ompi_enable_bigcount=1
254+
else
255+
AC_MSG_RESULT([no])
256+
ompi_enable_bigcount=0
257+
fi
258+
AC_DEFINE_UNQUOTED([OMPI_BIGCOUNT],[$ompi_enable_bigcount],
259+
[Whether we want to compile bigcount API support])
260+
247261
# If the binding source files don't exist, then we need Python to generate them
248262
AM_PATH_PYTHON([3.6],,[:])
249263
binding_file="${srcdir}/ompi/mpi/c/ompi_send.c"

ompi/include/mpi.h.in

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,10 @@ OMPI_DECLSPEC int MPI_Alloc_mem(MPI_Aint size, MPI_Info info,
14181418
void *baseptr);
14191419
OMPI_DECLSPEC int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
14201420
MPI_Op op, MPI_Comm comm);
1421+
#ifdef OMPI_BIGCOUNT
14211422
OMPI_DECLSPEC int MPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype,
14221423
MPI_Op op, MPI_Comm comm);
1424+
#endif
14231425
OMPI_DECLSPEC int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
14241426
MPI_Op op, MPI_Comm comm, MPI_Request *request);
14251427
OMPI_DECLSPEC int MPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -1436,9 +1438,11 @@ OMPI_DECLSPEC int MPI_Alltoall_init(const void *sendbuf, int sendcount, MPI_Dat
14361438
OMPI_DECLSPEC int MPI_Alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype,
14371439
void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype,
14381440
MPI_Comm comm);
1441+
#ifdef OMPI_BIGCOUNT
14391442
OMPI_DECLSPEC int MPI_Alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
14401443
void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype,
14411444
MPI_Comm comm);
1445+
#endif
14421446
OMPI_DECLSPEC int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype,
14431447
void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype,
14441448
MPI_Comm comm, MPI_Request *request);
@@ -1448,9 +1452,11 @@ OMPI_DECLSPEC int MPI_Alltoallv_init(const void *sendbuf, const int sendcounts[
14481452
OMPI_DECLSPEC int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
14491453
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
14501454
MPI_Comm comm);
1455+
#ifdef OMPI_BIGCOUNT
14511456
OMPI_DECLSPEC int MPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[],
14521457
void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[],
14531458
MPI_Comm comm);
1459+
#endif
14541460
OMPI_DECLSPEC int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
14551461
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
14561462
MPI_Comm comm, MPI_Request *request);
@@ -1781,14 +1787,18 @@ OMPI_DECLSPEC int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
17811787
MPI_Status *status);
17821788
OMPI_DECLSPEC int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
17831789
int tag, MPI_Comm comm, MPI_Request *request);
1790+
#ifdef OMPI_BIGCOUNT
17841791
OMPI_DECLSPEC int MPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
17851792
int tag, MPI_Comm comm, MPI_Request *request);
1793+
#endif
17861794
OMPI_DECLSPEC int MPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest,
17871795
int tag, MPI_Comm comm, MPI_Request *request);
17881796
OMPI_DECLSPEC int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
17891797
int tag, MPI_Comm comm, MPI_Request *request);
1798+
#ifdef OMPI_BIGCOUNT
17901799
OMPI_DECLSPEC int MPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
17911800
int tag, MPI_Comm comm, MPI_Request *request);
1801+
#endif
17921802
OMPI_DECLSPEC int MPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
17931803
int dest, int sendtag, void *recvbuf, int recvcount,
17941804
MPI_Datatype recvtype, int source, int recvtag,
@@ -1893,8 +1903,10 @@ OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, in
18931903
int tag, MPI_Comm comm, MPI_Request *request);
18941904
OMPI_DECLSPEC int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source,
18951905
int tag, MPI_Comm comm, MPI_Status *status);
1906+
#ifdef OMPI_BIGCOUNT
18961907
OMPI_DECLSPEC int MPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
18971908
int tag, MPI_Comm comm, MPI_Status *status);
1909+
#endif
18981910
OMPI_DECLSPEC int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
18991911
MPI_Op op, int root, MPI_Comm comm);
19001912
OMPI_DECLSPEC int MPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -1943,8 +1955,10 @@ OMPI_DECLSPEC int MPI_Rsend_init(const void *buf, int count, MPI_Datatype datat
19431955
MPI_Request *request);
19441956
OMPI_DECLSPEC int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
19451957
MPI_Op op, MPI_Comm comm);
1958+
#ifdef OMPI_BIGCOUNT
19461959
OMPI_DECLSPEC int MPI_Scan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype,
19471960
MPI_Op op, MPI_Comm comm);
1961+
#endif
19481962
OMPI_DECLSPEC int MPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
19491963
MPI_Op op, MPI_Comm comm, MPI_Request *request);
19501964
OMPI_DECLSPEC int MPI_Scan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -1972,8 +1986,10 @@ OMPI_DECLSPEC int MPI_Send_init(const void *buf, int count, MPI_Datatype dataty
19721986
MPI_Request *request);
19731987
OMPI_DECLSPEC int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
19741988
int tag, MPI_Comm comm);
1989+
#ifdef OMPI_BIGCOUNT
19751990
OMPI_DECLSPEC int MPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
19761991
int tag, MPI_Comm comm);
1992+
#endif
19771993
OMPI_DECLSPEC int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
19781994
int dest, int sendtag, void *recvbuf, int recvcount,
19791995
MPI_Datatype recvtype, int source, int recvtag,
@@ -2170,9 +2186,11 @@ OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode);
21702186
OMPI_DECLSPEC int PMPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
21712187
int target_rank, MPI_Aint target_disp, int target_count,
21722188
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
2189+
#ifdef OMPI_BIGCOUNT
21732190
OMPI_DECLSPEC int PMPI_Accumulate_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
21742191
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
21752192
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
2193+
#endif
21762194
OMPI_DECLSPEC int PMPI_Add_error_class(int *errorclass);
21772195
OMPI_DECLSPEC int PMPI_Add_error_code(int errorclass, int *errorcode);
21782196
OMPI_DECLSPEC int PMPI_Add_error_string(int errorcode, const char *string);
@@ -2198,8 +2216,10 @@ OMPI_DECLSPEC int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info,
21982216
void *baseptr);
21992217
OMPI_DECLSPEC int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
22002218
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
2219+
#ifdef OMPI_BIGCOUNT
22012220
OMPI_DECLSPEC int PMPI_Allreduce_c(const void *sendbuf, void *recvbuf, MPI_Count count,
22022221
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
2222+
#endif
22032223
OMPI_DECLSPEC int PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
22042224
MPI_Op op, MPI_Comm comm, MPI_Request *request);
22052225
OMPI_DECLSPEC int PMPI_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -2216,9 +2236,11 @@ OMPI_DECLSPEC int PMPI_Alltoall_init(const void *sendbuf, int sendcount, MPI_Da
22162236
OMPI_DECLSPEC int PMPI_Alltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype,
22172237
void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype,
22182238
MPI_Comm comm);
2239+
#ifdef OMPI_BIGCOUNT
22192240
OMPI_DECLSPEC int PMPI_Alltoallv_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
22202241
void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], MPI_Datatype recvtype,
22212242
MPI_Comm comm);
2243+
#endif
22222244
OMPI_DECLSPEC int PMPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype,
22232245
void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype,
22242246
MPI_Comm comm, MPI_Request *request);
@@ -2228,9 +2250,11 @@ OMPI_DECLSPEC int PMPI_Alltoallv_init(const void *sendbuf, const int sendcounts
22282250
OMPI_DECLSPEC int PMPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
22292251
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
22302252
MPI_Comm comm);
2253+
#ifdef OMPI_BIGCOUNT
22312254
OMPI_DECLSPEC int PMPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[],
22322255
void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[],
22332256
MPI_Comm comm);
2257+
#endif
22342258
OMPI_DECLSPEC int PMPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
22352259
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
22362260
MPI_Comm comm, MPI_Request *request);
@@ -2563,14 +2587,18 @@ OMPI_DECLSPEC int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag,
25632587
MPI_Status *status);
25642588
OMPI_DECLSPEC int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
25652589
int tag, MPI_Comm comm, MPI_Request *request);
2590+
#ifdef OMPI_BIGCOUNT
25662591
OMPI_DECLSPEC int PMPI_Irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
25672592
int tag, MPI_Comm comm, MPI_Request *request);
2593+
#endif
25682594
OMPI_DECLSPEC int PMPI_Irsend(const void *buf, int count, MPI_Datatype datatype, int dest,
25692595
int tag, MPI_Comm comm, MPI_Request *request);
25702596
OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
25712597
int tag, MPI_Comm comm, MPI_Request *request);
2598+
#ifdef OMPI_BIGCOUNT
25722599
OMPI_DECLSPEC int PMPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
25732600
int tag, MPI_Comm comm, MPI_Request *request);
2601+
#endif
25742602
OMPI_DECLSPEC int PMPI_Isendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
25752603
int dest, int sendtag, void *recvbuf, int recvcount,
25762604
MPI_Datatype recvtype, int source, int recvtag,
@@ -2675,8 +2703,10 @@ OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, i
26752703
int tag, MPI_Comm comm, MPI_Request *request);
26762704
OMPI_DECLSPEC int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source,
26772705
int tag, MPI_Comm comm, MPI_Status *status);
2706+
#ifdef OMPI_BIGCOUNT
26782707
OMPI_DECLSPEC int PMPI_Recv_c(void *buf, MPI_Count count, MPI_Datatype datatype, int source,
26792708
int tag, MPI_Comm comm, MPI_Status *status);
2709+
#endif
26802710
OMPI_DECLSPEC int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
26812711
MPI_Op op, int root, MPI_Comm comm);
26822712
OMPI_DECLSPEC int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -2725,8 +2755,10 @@ OMPI_DECLSPEC int PMPI_Rsend_init(const void *buf, int count, MPI_Datatype data
27252755
MPI_Request *request);
27262756
OMPI_DECLSPEC int PMPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
27272757
MPI_Op op, MPI_Comm comm);
2758+
#ifdef OMPI_BIGCOUNT
27282759
OMPI_DECLSPEC int PMPI_Scan_c(const void *sendbuf, void *recvbuf, MPI_Count count, MPI_Datatype datatype,
27292760
MPI_Op op, MPI_Comm comm);
2761+
#endif
27302762
OMPI_DECLSPEC int PMPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
27312763
MPI_Op op, MPI_Comm comm, MPI_Request *request);
27322764
OMPI_DECLSPEC int PMPI_Scan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
@@ -2754,8 +2786,10 @@ OMPI_DECLSPEC int PMPI_Send_init(const void *buf, int count, MPI_Datatype datat
27542786
MPI_Request *request);
27552787
OMPI_DECLSPEC int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
27562788
int tag, MPI_Comm comm);
2789+
#ifdef OMPI_BIGCOUNT
27572790
OMPI_DECLSPEC int PMPI_Send_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest,
27582791
int tag, MPI_Comm comm);
2792+
#endif
27592793
OMPI_DECLSPEC int PMPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
27602794
int dest, int sendtag, void *recvbuf, int recvcount,
27612795
MPI_Datatype recvtype, int source, int recvtag,

ompi/mpi/bindings/ompi_bindings/c.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ def validate_body(body):
357357
raise util.BindingError('Mismatched brackets found in template')
358358

359359

360+
# Values to replace in function bodies per-function (empty for now).
361+
FUNCTION_BODY_REPLACEMENTS = {}
362+
363+
360364
class SourceTemplate:
361365
"""Source template for a single API function."""
362366

@@ -414,6 +418,9 @@ def print_body(self, func_name, out):
414418
for line in self.body:
415419
# FUNC_NAME is used for error messages
416420
line = line.replace('FUNC_NAME', f'"{func_name}"')
421+
if func_name in FUNCTION_BODY_REPLACEMENTS:
422+
for key, value in FUNCTION_BODY_REPLACEMENTS[func_name]:
423+
line = line.replace(key, value)
417424
out.dump(line)
418425

419426

@@ -435,10 +442,12 @@ def ompi_abi(base_name, template, out):
435442
template.print_body(func_name=base_name, out=out)
436443
# Check if we need to generate the bigcount interface
437444
if template.prototype.need_bigcount:
445+
out.dump('#if OMPI_BIGCOUNT')
438446
base_name_c = f'{base_name}_c'
439447
print_profiling_header(base_name_c, out)
440448
out.dump(template.prototype.signature('ompi', base_name_c, enable_count=True))
441449
template.print_body(func_name=base_name_c, out=out)
450+
out.dump('#endif /* OMPI_BIGCOUNT */')
442451

443452

444453
ABI_INTERNAL_HEADER = 'ompi/mpi/c/abi.h'

ompi/mpi/bindings/ompi_bindings/fortran.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ def generate_code(args, out):
315315
print_binding(prototype, args.lang, out, ts=args.ts)
316316
if util.fortran_prototype_has_bigcount(prototype):
317317
out.dump()
318+
out.dump('#if OMPI_BIGCOUNT')
318319
print_binding(prototype, args.lang, bigcount=True, out=out, ts=args.ts)
320+
out.dump('#endif /* OMPI_BIGCOUNT */')
319321

320322

321323
def generate_interface(args, out):
@@ -330,5 +332,7 @@ def generate_interface(args, out):
330332
if util.fortran_prototype_has_bigcount(prototype):
331333
out.dump()
332334
binding_c = FortranBinding(prototype, out=out, bigcount=True, ts=args.ts)
335+
out.dump('#if OMPI_BIGCOUNT')
333336
binding_c.print_interface()
337+
out.dump('#endif /* OMPI_BIGCOUNT */')
334338
out.dump(f'end interface {ext_name}')

0 commit comments

Comments
 (0)