Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 23508fe

Browse files
committed
configury: remove the --enable-mpi-profiling option
and directly call the PMPI_* symbols from C and Fortran bindings (back-ported from commit open-mpi/ompi@291a464)
1 parent 4aba238 commit 23508fe

File tree

386 files changed

+1188
-2388
lines changed

Some content is hidden

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

386 files changed

+1188
-2388
lines changed

config/ompi_configure_options.m4

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,6 @@ case "x$enable_mpi_fortran" in
166166
;;
167167
esac
168168

169-
#
170-
# MPI profiling
171-
#
172-
173-
AC_MSG_CHECKING([if want PMPI])
174-
AC_ARG_ENABLE(mpi-profile,
175-
AC_HELP_STRING([--enable-mpi-profile],
176-
[enable MPI profiling (default: enabled)]))
177-
if test "$enable_mpi_profile" != "no"; then
178-
AC_MSG_RESULT([yes])
179-
WANT_MPI_PROFILING=1
180-
MPIF_H_PMPI_W_FUNCS=", PMPI_WTICK, PMPI_WTIME"
181-
else
182-
AC_MSG_RESULT([no])
183-
WANT_MPI_PROFILING=0
184-
MPIF_H_PMPI_W_FUNCS=
185-
fi
186-
AC_SUBST(MPIF_H_PMPI_W_FUNCS)
187-
AM_CONDITIONAL(WANT_MPI_PROFILING, test "$WANT_MPI_PROFILING" = 1)
188-
189-
190169
#
191170
# C++
192171
#

config/ompi_setup_mpi_fortran.m4

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,6 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
374374
OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE
375375
])
376376

377-
AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \
378-
test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS],
379-
[ # If we don't have PMPI, we won't build mpi_f08 at all
380-
AC_MSG_CHECKING([whether PMPI is enabled (needed for mpi_f08)])
381-
AS_IF([test $WANT_MPI_PROFILING -eq 1],
382-
[AC_MSG_RESULT([yes])],
383-
[OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPI_BINDINGS
384-
AC_MSG_RESULT([no (cannot build mpi_f08)])])])
385-
386377
# The overall "_BIND_C" variable will be set to 1 if we have all
387378
# the necessary forms of BIND(C)
388379
OMPI_FORTRAN_HAVE_BIND_C=0
@@ -644,11 +635,10 @@ end type test_mpi_handle],
644635
# these layers need to be built or NOT
645636

646637
AM_CONDITIONAL(BUILD_MPI_FORTRAN_MPIFH_BINDINGS_LAYER,
647-
[( test $WANT_MPI_PROFILING -eq 0 || test $OMPI_PROFILING_COMPILE_SEPARATELY -eq 1 ) && \
638+
[test $OMPI_PROFILING_COMPILE_SEPARATELY -eq 1 && \
648639
test $OMPI_BUILD_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS])
649640
AM_CONDITIONAL(BUILD_PMPI_FORTRAN_MPIFH_BINDINGS_LAYER,
650-
[test $OMPI_BUILD_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS && \
651-
test $WANT_MPI_PROFILING -eq 1])
641+
[test $OMPI_BUILD_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS])
652642
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_MPIFH_BINDINGS,
653643
[test $OMPI_BUILD_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS])
654644

config/ompi_setup_mpi_profiling.m4

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
1616
# reserved.
1717
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
18+
# Copyright (c) 2015 Research Organization for Information Science
19+
# and Technology (RIST). All rights reserved.
1820
# $COPYRIGHT$
1921
#
2022
# Additional copyrights may follow
@@ -39,14 +41,10 @@ AC_DEFUN([OMPI_SETUP_MPI_PROFILING],[
3941
#
4042

4143
AM_CONDITIONAL(BUILD_MPI_BINDINGS_LAYER,
42-
test "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
44+
test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
4345

44-
AM_CONDITIONAL(BUILD_PMPI_BINDINGS_LAYER,
45-
test "$WANT_MPI_PROFILING" = 1)
4646
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY,
4747
test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
48-
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING,
49-
[Whether we want MPI profiling or not])
5048
AC_DEFINE_UNQUOTED(OPAL_HAVE_WEAK_SYMBOLS, $OPAL_C_HAVE_WEAK_SYMBOLS,
5149
[Whether we have weak symbols or not])
5250
])

configure.ac

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -496,14 +496,10 @@ fi
496496
if test "$WANT_WEAK_SYMBOLS" = "0"; then
497497
OPAL_C_HAVE_WEAK_SYMBOLS=0
498498
fi
499-
if test "$WANT_MPI_PROFILING" = "1"; then
500-
if test "$OPAL_C_HAVE_WEAK_SYMBOLS" = "1"; then
501-
OMPI_PROFILING_COMPILE_SEPARATELY=0
502-
else
503-
OMPI_PROFILING_COMPILE_SEPARATELY=1
504-
fi
505-
else
499+
if test "$OPAL_C_HAVE_WEAK_SYMBOLS" = "1"; then
506500
OMPI_PROFILING_COMPILE_SEPARATELY=0
501+
else
502+
OMPI_PROFILING_COMPILE_SEPARATELY=1
507503
fi
508504

509505
# Check if we support the offsetof compiler directive
@@ -549,13 +545,7 @@ m4_ifdef([project_oshmem], [OSHMEM_SETUP_JAVA_BINDINGS])
549545
##################################
550546

551547
# Setup profiling bindings (if we're building the relevant projects).
552-
# Note that opal_wrapper.c has a hard-coded use of the
553-
# OMPI_ENABLE_MPI_PROFILING macro, so we need to define it (to 0) even
554-
# if we're not building the OMPI project.
555-
556-
m4_ifdef([project_ompi], [OMPI_SETUP_MPI_PROFILING],
557-
[AC_DEFINE([OMPI_ENABLE_MPI_PROFILING], [0],
558-
[We are not building OMPI, so no profiling])])
548+
m4_ifdef([project_ompi], [OMPI_SETUP_MPI_PROFILING])
559549
m4_ifdef([project_oshmem], [OSHMEM_SETUP_PROFILING])
560550

561551

ompi/Makefile.am

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1616
# reserved.
1717
# Copyright (c) 2015 Intel, Inc. All rights reserved.
18+
# Copyright (c) 2015 Research Organization for Information Science
19+
# and Technology (RIST). All rights reserved.
1820
# $COPYRIGHT$
1921
#
2022
# Additional copyrights may follow
@@ -29,11 +31,7 @@ c_mpi_lib = mpi/c/libmpi_c_mpi.la mpi/tool/libmpi_mpit.la
2931
else
3032
c_mpi_lib =
3133
endif
32-
if BUILD_PMPI_BINDINGS_LAYER
3334
c_pmpi_lib = mpi/c/profile/libmpi_c_pmpi.la mpi/tool/profile/libmpi_pmpit.la
34-
else
35-
c_pmpi_lib =
36-
endif
3735

3836
# See if we have Fortran mpif.h MPI bindings
3937

ompi/mpi/c/errhandler_create.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@
3232
#define MPI_Errhandler_create PMPI_Errhandler_create
3333
#endif
3434

35-
#if OMPI_ENABLE_MPI_PROFILING
36-
#define MPI_Comm_create_errhandler PMPI_Comm_create_errhandler
37-
#endif
38-
3935
int MPI_Errhandler_create(MPI_Handler_function *function,
4036
MPI_Errhandler *errhandler)
4137
{
4238

4339
/* This is a deprecated -- just turn around and call the real
4440
function */
4541

46-
return MPI_Comm_create_errhandler(function, errhandler);
42+
return PMPI_Comm_create_errhandler(function, errhandler);
4743
}

ompi/mpi/c/errhandler_get.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#define MPI_Errhandler_get PMPI_Errhandler_get
3535
#endif
3636

37-
#if OMPI_ENABLE_MPI_PROFILING
38-
#define MPI_Comm_get_errhandler PMPI_Comm_get_errhandler
39-
#endif
40-
4137
static const char FUNC_NAME[] = "MPI_Errhandler_get";
4238

4339

@@ -54,5 +50,5 @@ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
5450
/* This is a deprecated -- just turn around and call the real
5551
function */
5652

57-
return MPI_Comm_get_errhandler(comm, errhandler);
53+
return PMPI_Comm_get_errhandler(comm, errhandler);
5854
}

ompi/mpi/c/errhandler_set.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#define MPI_Errhandler_set PMPI_Errhandler_set
3535
#endif
3636

37-
#if OMPI_ENABLE_MPI_PROFILING
38-
#define MPI_Comm_set_errhandler PMPI_Comm_set_errhandler
39-
#endif
40-
4137
static const char FUNC_NAME[] = "MPI_Errhandler_set";
4238

4339

@@ -54,5 +50,5 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
5450
/* This is a deprecated -- just turn around and call the real
5551
function */
5652

57-
return MPI_Comm_set_errhandler(comm, errhandler);
53+
return PMPI_Comm_set_errhandler(comm, errhandler);
5854
}

ompi/mpi/c/profile/Makefile.am

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ AM_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=1
3838
# Further, this build HAS to go through if profiling is required.
3939
#
4040

41-
noinst_LTLIBRARIES =
42-
if BUILD_PMPI_BINDINGS_LAYER
43-
noinst_LTLIBRARIES += libmpi_c_pmpi.la
44-
endif
41+
noinst_LTLIBRARIES = libmpi_c_pmpi.la
4542

4643
nodist_libmpi_c_pmpi_la_SOURCES = \
4744
pabort.c \

ompi/mpi/c/sendrecv_replace.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@
3838
#define MPI_Sendrecv_replace PMPI_Sendrecv_replace
3939
#endif
4040

41-
#if OMPI_ENABLE_MPI_PROFILING
42-
#define MPI_Alloc_mem PMPI_Alloc_mem
43-
#define MPI_Free_mem PMPI_Free_mem
44-
#define MPI_Sendrecv PMPI_Sendrecv
45-
#endif
46-
4741
static const char FUNC_NAME[] = "MPI_Sendrecv_replace";
4842

4943

@@ -81,7 +75,7 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
8175

8276
/* simple case */
8377
if ( source == MPI_PROC_NULL || dest == MPI_PROC_NULL || count == 0 ) {
84-
rc = MPI_Sendrecv(buf,count,datatype,dest,sendtag,buf,count,datatype,source,recvtag,comm,status);
78+
rc = PMPI_Sendrecv(buf,count,datatype,dest,sendtag,buf,count,datatype,source,recvtag,comm,status);
8579

8680
return rc;
8781
} else {
@@ -106,7 +100,7 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
106100
/* setup a buffer for recv */
107101
opal_convertor_get_packed_size( &convertor, &packed_size );
108102
if( packed_size > sizeof(recv_data) ) {
109-
rc = MPI_Alloc_mem(packed_size, MPI_INFO_NULL, &iov.iov_base);
103+
rc = PMPI_Alloc_mem(packed_size, MPI_INFO_NULL, &iov.iov_base);
110104
if(OMPI_SUCCESS != rc) {
111105
OMPI_ERRHANDLER_RETURN(OMPI_ERR_OUT_OF_RESOURCE, comm, MPI_ERR_BUFFER, FUNC_NAME);
112106
}
@@ -115,11 +109,11 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
115109
}
116110

117111
/* recv into temporary buffer */
118-
rc = MPI_Sendrecv( buf, count, datatype, dest, sendtag, iov.iov_base, packed_size,
112+
rc = PMPI_Sendrecv( buf, count, datatype, dest, sendtag, iov.iov_base, packed_size,
119113
MPI_BYTE, source, recvtag, comm, &recv_status );
120114
if (rc != MPI_SUCCESS) {
121115
if(packed_size > sizeof(recv_data))
122-
MPI_Free_mem(iov.iov_base);
116+
PMPI_Free_mem(iov.iov_base);
123117
OBJ_DESTRUCT(&convertor);
124118
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
125119
}
@@ -137,7 +131,7 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
137131

138132
/* release resources */
139133
if(packed_size > sizeof(recv_data)) {
140-
MPI_Free_mem(iov.iov_base);
134+
PMPI_Free_mem(iov.iov_base);
141135
}
142136
OBJ_DESTRUCT(&convertor);
143137

ompi/mpi/c/type_hindexed.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#define MPI_Type_hindexed PMPI_Type_hindexed
3535
#endif
3636

37-
#if OMPI_ENABLE_MPI_PROFILING
38-
#define MPI_Type_create_hindexed PMPI_Type_create_hindexed
39-
#endif
40-
4137
static const char FUNC_NAME[] = "MPI_Type_hindexed";
4238

4339

@@ -75,7 +71,7 @@ int MPI_Type_hindexed(int count,
7571
}
7672
}
7773

78-
return MPI_Type_create_hindexed(count,
74+
return PMPI_Type_create_hindexed(count,
7975
array_of_blocklengths,
8076
array_of_displacements,
8177
oldtype,

ompi/mpi/c/type_hvector.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#define MPI_Type_hvector PMPI_Type_hvector
3535
#endif
3636

37-
#if OMPI_ENABLE_MPI_PROFILING
38-
#define MPI_Type_create_hvector PMPI_Type_create_hvector
39-
#endif
40-
4137
static const char FUNC_NAME[] = "MPI_Type_hvector";
4238

4339

@@ -66,7 +62,7 @@ int MPI_Type_hvector(int count,
6662
}
6763
}
6864

69-
return MPI_Type_create_hvector(count,
65+
return PMPI_Type_create_hvector(count,
7066
blocklength,
7167
stride,
7268
oldtype,

ompi/mpi/c/type_struct.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@
3030
#define MPI_Type_struct PMPI_Type_struct
3131
#endif
3232

33-
#if OMPI_ENABLE_MPI_PROFILING
34-
#define MPI_Type_create_struct PMPI_Type_create_struct
35-
#endif
36-
3733
int MPI_Type_struct(int count,
3834
int array_of_blocklengths[],
3935
MPI_Aint array_of_displacements[],
4036
MPI_Datatype array_of_types[],
4137
MPI_Datatype *newtype)
4238
{
4339
/* the param check will be done if necessary on the MPI_Type_create_struct */
44-
return MPI_Type_create_struct(count,
40+
return PMPI_Type_create_struct(count,
4541
array_of_blocklengths,
4642
array_of_displacements,
4743
array_of_types,

ompi/mpi/fortran/mpif-h/abort_f.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ OMPI_GENERATE_F77_BINDINGS(MPI_ABORT,
6666
#define ompi_abort_f pompi_abort_f
6767
#endif
6868

69-
#if OMPI_ENABLE_MPI_PROFILING
70-
#define MPI_Abort PMPI_Abort
71-
#endif
7269

7370

7471
void ompi_abort_f(MPI_Fint *comm, MPI_Fint *errorcode, MPI_Fint *ierr)
7572
{
7673
int ierr_c;
77-
MPI_Comm c_comm = MPI_Comm_f2c(*comm);
74+
MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
7875

79-
ierr_c = MPI_Abort(c_comm, OMPI_FINT_2_INT(*errorcode));
76+
ierr_c = PMPI_Abort(c_comm, OMPI_FINT_2_INT(*errorcode));
8077
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
8178
}

ompi/mpi/fortran/mpif-h/accumulate_f.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ACCUMULATE,
6868
#define ompi_accumulate_f pompi_accumulate_f
6969
#endif
7070

71-
#if OMPI_ENABLE_MPI_PROFILING
72-
#define MPI_Accumulate PMPI_Accumulate
73-
#endif
7471

7572
void ompi_accumulate_f(char *origin_addr, MPI_Fint *origin_count,
7673
MPI_Fint *origin_datatype, MPI_Fint *target_rank,
@@ -80,18 +77,18 @@ void ompi_accumulate_f(char *origin_addr, MPI_Fint *origin_count,
8077
{
8178
int ierr_c;
8279

83-
MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype);
84-
MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype);
85-
MPI_Win c_win = MPI_Win_f2c(*win);
86-
MPI_Op c_op = MPI_Op_f2c(*op);
80+
MPI_Datatype c_origin_datatype = PMPI_Type_f2c(*origin_datatype);
81+
MPI_Datatype c_target_datatype = PMPI_Type_f2c(*target_datatype);
82+
MPI_Win c_win = PMPI_Win_f2c(*win);
83+
MPI_Op c_op = PMPI_Op_f2c(*op);
8784

88-
ierr_c = MPI_Accumulate(OMPI_F2C_BOTTOM(origin_addr),
89-
OMPI_FINT_2_INT(*origin_count),
90-
c_origin_datatype,
91-
OMPI_FINT_2_INT(*target_rank),
92-
*target_disp,
93-
OMPI_FINT_2_INT(*target_count),
94-
c_target_datatype, c_op, c_win);
85+
ierr_c = PMPI_Accumulate(OMPI_F2C_BOTTOM(origin_addr),
86+
OMPI_FINT_2_INT(*origin_count),
87+
c_origin_datatype,
88+
OMPI_FINT_2_INT(*target_rank),
89+
*target_disp,
90+
OMPI_FINT_2_INT(*target_count),
91+
c_target_datatype, c_op, c_win);
9592

9693
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
9794
}

ompi/mpi/fortran/mpif-h/add_error_class_f.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_ADD_ERROR_CLASS,
6666
#define ompi_add_error_class_f pompi_add_error_class_f
6767
#endif
6868

69-
#if OMPI_ENABLE_MPI_PROFILING
70-
#define MPI_Add_error_class PMPI_Add_error_class
71-
#endif
7269

7370
void ompi_add_error_class_f(MPI_Fint *errorclass, MPI_Fint *ierr)
7471
{
7572
int ierr_c;
7673
OMPI_SINGLE_NAME_DECL(errorclass);
7774

78-
ierr_c = MPI_Add_error_class(OMPI_SINGLE_NAME_CONVERT(errorclass));
75+
ierr_c = PMPI_Add_error_class(OMPI_SINGLE_NAME_CONVERT(errorclass));
7976
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
8077

8178
if (MPI_SUCCESS == ierr_c) {

0 commit comments

Comments
 (0)