From 7363906e4e87f31246a6c7f803c09e619516b9fb Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 29 Jun 2018 16:35:28 +0900 Subject: [PATCH] io/romio321: make grequest extensions internal Signed-off-by: Gilles Gouaillardet --- ompi/include/mpi.h.in | 43 ---------------- ompi/mca/io/romio321/configure.m4 | 2 + ompi/mca/io/romio321/romio/configure.ac | 5 +- .../romio321/romio/include/ompi_grequestx.h | 34 +++++++++++++ ompi/mpi/c/Makefile.am | 7 --- ompi/mpi/c/grequestx_class_allocate.c | 48 ----------------- ompi/mpi/c/grequestx_class_create.c | 51 ------------------- ompi/mpi/c/grequestx_start.c | 50 ------------------ ompi/mpi/c/profile/Makefile.am | 7 --- ompi/request/grequest.h | 16 +++--- ompi/request/grequestx.c | 24 ++++----- ompi/request/grequestx.h | 16 +++--- 12 files changed, 67 insertions(+), 236 deletions(-) create mode 100644 ompi/mca/io/romio321/romio/include/ompi_grequestx.h delete mode 100644 ompi/mpi/c/grequestx_class_allocate.c delete mode 100644 ompi/mpi/c/grequestx_class_create.c delete mode 100644 ompi/mpi/c/grequestx_start.c diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index d7e526e8a9..bfe92288e2 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -139,9 +139,6 @@ /* Whether in include MPI-1 compatibility */ #undef OMPI_ENABLE_MPI1_COMPAT -/* Whether we support Grequest extensions */ -#undef OMPI_ENABLE_GREQUEST_EXTENSIONS - /* Whether we have float _Complex or not */ #undef HAVE_FLOAT__COMPLEX @@ -409,12 +406,6 @@ typedef int (MPI_Grequest_query_function)(void *, MPI_Status *); typedef int (MPI_Grequest_free_function)(void *); typedef int (MPI_Grequest_cancel_function)(void *, int); -#if OMPI_ENABLE_GREQUEST_EXTENSIONS -typedef int (MPIX_Grequest_poll_function)(void *, MPI_Status *); -typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *); -typedef int MPIX_Grequest_class; -#endif /* OMPI_ENABLE_GREQUEST_EXTENSIONS */ - #if !OMPI_OMIT_MPI1_COMPAT_DECLS /* * Removed typedefs. These will be deleted in a future Open MPI release. @@ -1505,23 +1496,6 @@ OMPI_DECLSPEC int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request); -#if OMPI_ENABLE_GREQUEST_EXTENSIONS -OMPI_DECLSPEC int MPIX_Grequest_start(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - void *extra_state, - MPI_Request *request); -OMPI_DECLSPEC int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - MPIX_Grequest_wait_function *wait_fn, - MPIX_Grequest_class *greq_class); -OMPI_DECLSPEC int MPIX_Grequest_class_allocate(MPIX_Grequest_class greq_class, - void *extra_state, - MPI_Request *request); -#endif /* OMPI_ENABLE_GREQUEST_EXTENSIONS */ OMPI_DECLSPEC MPI_Fint MPI_Group_c2f(MPI_Group group); OMPI_DECLSPEC int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); OMPI_DECLSPEC int MPI_Group_difference(MPI_Group group1, MPI_Group group2, @@ -2183,23 +2157,6 @@ OMPI_DECLSPEC int PMPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request); -#if OMPI_ENABLE_GREQUEST_EXTENSIONS -OMPI_DECLSPEC int PMPIX_Grequest_start(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - void *extra_state, - MPI_Request *request); -OMPI_DECLSPEC int PMPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - MPIX_Grequest_wait_function *wait_fn, - MPIX_Grequest_class *greq_class); -OMPI_DECLSPEC int PMPIX_Grequest_class_allocate(MPIX_Grequest_class greq_class, - void *extra_state, - MPI_Request *request); -#endif /* OMPI_ENABLE_GREQUEST_EXTENSIONS */ OMPI_DECLSPEC MPI_Fint PMPI_Group_c2f(MPI_Group group); OMPI_DECLSPEC int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result); OMPI_DECLSPEC int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, diff --git a/ompi/mca/io/romio321/configure.m4 b/ompi/mca/io/romio321/configure.m4 index 2ed89104b1..3e709f7f1c 100644 --- a/ompi/mca/io/romio321/configure.m4 +++ b/ompi/mca/io/romio321/configure.m4 @@ -77,6 +77,8 @@ AC_DEFUN([MCA_ompi_io_romio321_CONFIG],[ [AS_IF([test ! -z $build], [io_romio321_flags="$io_romio321_flags --build=$build"]) AS_IF([test ! -z $host], [io_romio321_flags="$io_romio321_flags --host=$host"]) AS_IF([test ! -z $target], [io_romio321_flags="$io_romio321_flags --target=$target"])]) + AS_IF([test "$enable_grequest_extensions" = "yes"], + [io_romio321_flags="$io_romio321_flags --enable-grequest-extensions"]) io_romio321_flags_define="$io_romio321_flags FROM_OMPI=yes CC='$CC' CFLAGS='$CFLAGS -D__EXTENSIONS__' CPPFLAGS='$CPPFLAGS' FFLAGS='$FFLAGS' LDFLAGS='$LDFLAGS' --$io_romio321_shared-shared --$io_romio321_static-static $io_romio321_flags $io_romio321_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90" AC_DEFINE_UNQUOTED([MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS], ["$io_romio321_flags_define"], [Complete set of command line arguments given to ROMIOs configure script]) diff --git a/ompi/mca/io/romio321/romio/configure.ac b/ompi/mca/io/romio321/romio/configure.ac index 7a893cd01f..6d40359beb 100644 --- a/ompi/mca/io/romio321/romio/configure.ac +++ b/ompi/mca/io/romio321/romio/configure.ac @@ -1515,10 +1515,7 @@ if test $FROM_OMPI = yes ; then [AC_HELP_STRING([--enable-grequest-extensions], [Enable support for Grequest extensions (default: disabled)])]) AS_IF([test "x$enable_grequest_extensions" = "xyes"], - [DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#define HAVE_MPI_GREQUEST_EXTENSIONS 1 - -extern void opal_progress(void); -#define MPIR_Ext_cs_yield_opal_progress"], + [DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#include \"ompi_grequestx.h\""], [DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#undef HAVE_MPI_GREQUEST_EXTENSIONS"]) AC_DEFINE(HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK, 1, [Define if MPI library provides HINDEXED_BLOCK datatype]) diff --git a/ompi/mca/io/romio321/romio/include/ompi_grequestx.h b/ompi/mca/io/romio321/romio/include/ompi_grequestx.h new file mode 100644 index 0000000000..3aae40d8fb --- /dev/null +++ b/ompi/mca/io/romio321/romio/include/ompi_grequestx.h @@ -0,0 +1,34 @@ +#define HAVE_MPI_GREQUEST_EXTENSIONS 1 + +extern void opal_progress(void); + +typedef int (MPIX_Grequest_poll_function)(void *, MPI_Status *); +typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *); +typedef int MPIX_Grequest_class; + +extern int ompi_grequestx_start( + MPI_Grequest_query_function *gquery, + MPI_Grequest_free_function *gfree, + MPI_Grequest_cancel_function *gcancel, + MPIX_Grequest_poll_function *gpoll, + void* gstate, + MPI_Request* request); + +extern int ompi_grequestx_class_create( + MPI_Grequest_query_function *gquery, + MPI_Grequest_free_function *gfree, + MPI_Grequest_cancel_function *gcancel, + MPIX_Grequest_poll_function *gpoll, + MPIX_Grequest_wait_function *gwait, + MPIX_Grequest_class *greq_class); + +extern int ompi_grequestx_class_allocate( + MPIX_Grequest_class greq_class, + void *extra_state, + MPI_Request* request); + +#define MPIR_Ext_cs_yield opal_progress +#define PMPIX_Grequest_class_allocate(greq_class,extra_state,request) ompi_grequestx_class_allocate(greq_class,extra_state,request) +#define PMPIX_Grequest_class_create(query_fn,free_fn,cancel_fn,poll_fn,wait_fn,greq_class) ompi_grequestx_class_create(query_fn,free_fn,cancel_fn,poll_fn,wait_fn,greq_class) +#define PMPIX_Grequest_start(query_fn,free_fn,cancel_fn,poll_fn,extra_state,request) ompi_grequestx_start(query_fn,free_fn,cancel_fn,poll_fn,extra_state,request) + diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 56480d0b31..e12a548388 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -431,13 +431,6 @@ libmpi_c_mpi_la_SOURCES = \ win_unlock_all.c \ win_wait.c -if OMPI_ENABLE_GREQUEST_EXTENSIONS -libmpi_c_mpi_la_SOURCES += \ - grequestx_class_allocate.c \ - grequestx_class_create.c \ - grequestx_start.c -endif - if OMPI_ENABLE_MPI1_COMPAT libmpi_c_mpi_la_SOURCES += \ address.c \ diff --git a/ompi/mpi/c/grequestx_class_allocate.c b/ompi/mpi/c/grequestx_class_allocate.c deleted file mode 100644 index e677cab566..0000000000 --- a/ompi/mpi/c/grequestx_class_allocate.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/request/grequestx.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPIX_Grequest_class_allocate = PMPIX_Grequest_class_allocate -#endif -#define MPIX_Grequest_class_allocate PMPIX_Grequest_class_allocate -#endif - -static const char FUNC_NAME[] = "MPIX_Grequest_class_allocate"; - - -int MPIX_Grequest_class_allocate(MPIX_Grequest_class greq_class, - void *extra_state, - MPI_Request *request) -{ - int rc; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == request) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, - FUNC_NAME); - } - } - - OPAL_CR_ENTER_LIBRARY(); - - rc = ompi_grequestx_class_allocate(greq_class, extra_state, request); - OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); -} - diff --git a/ompi/mpi/c/grequestx_class_create.c b/ompi/mpi/c/grequestx_class_create.c deleted file mode 100644 index 6869db6566..0000000000 --- a/ompi/mpi/c/grequestx_class_create.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/request/grequestx.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPIX_Grequest_class_create = PMPIX_Grequest_class_create -#endif -#define MPIX_Grequest_class_create PMPIX_Grequest_class_create -#endif - -static const char FUNC_NAME[] = "MPIX_Grequest_class_create"; - - -int MPIX_Grequest_class_create(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - MPIX_Grequest_wait_function *wait_fn, - MPIX_Grequest_class *greq_class) -{ - int rc; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == greq_class) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, - FUNC_NAME); - } - } - - OPAL_CR_ENTER_LIBRARY(); - - rc = ompi_grequestx_class_create(query_fn,free_fn,cancel_fn,poll_fn,wait_fn,greq_class); - OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); -} - diff --git a/ompi/mpi/c/grequestx_start.c b/ompi/mpi/c/grequestx_start.c deleted file mode 100644 index 1037b4f974..0000000000 --- a/ompi/mpi/c/grequestx_start.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/request/grequestx.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPIX_Grequest_start = PMPIX_Grequest_start -#endif -#define MPIX_Grequest_start PMPIX_Grequest_start -#endif - -static const char FUNC_NAME[] = "MPIX_Grequest_start"; - - -int MPIX_Grequest_start(MPI_Grequest_query_function *query_fn, - MPI_Grequest_free_function *free_fn, - MPI_Grequest_cancel_function *cancel_fn, - MPIX_Grequest_poll_function *poll_fn, - void *extra_state, MPI_Request *request) -{ - int rc; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == request) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, - FUNC_NAME); - } - } - - OPAL_CR_ENTER_LIBRARY(); - - rc = ompi_grequestx_start(query_fn,free_fn,cancel_fn,poll_fn,extra_state,request); - OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); -} - diff --git a/ompi/mpi/c/profile/Makefile.am b/ompi/mpi/c/profile/Makefile.am index 239e1139bc..698c5c61ab 100644 --- a/ompi/mpi/c/profile/Makefile.am +++ b/ompi/mpi/c/profile/Makefile.am @@ -411,13 +411,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pwin_unlock_all.c \ pwin_wait.c -if OMPI_ENABLE_GREQUEST_EXTENSIONS -nodist_libmpi_c_pmpi_la_SOURCES += \ - pgrequestx_class_allocate.c \ - pgrequestx_class_create.c \ - pgrequestx_start.c -endif - if OMPI_ENABLE_MPI1_COMPAT nodist_libmpi_c_pmpi_la_SOURCES += \ paddress.c \ diff --git a/ompi/request/grequest.h b/ompi/request/grequest.h index e4aa62c649..09dc5cdc0e 100644 --- a/ompi/request/grequest.h +++ b/ompi/request/grequest.h @@ -50,9 +50,11 @@ typedef void (MPI_F_Grequest_cancel_function)(MPI_Aint *extra_state, /** * Fortran type for generalized request query function */ -typedef void (MPIX_F_Grequest_poll_function)(MPI_Aint *extra_state, - MPI_Fint *status, - MPI_Fint *ierr); +typedef int (ompi_grequestx_poll_function)(void *, MPI_Status *); + +typedef void (ompi_f_grequestx_poll_function)(MPI_Aint *extra_state, + MPI_Fint *status, + MPI_Fint *ierr); #endif /** @@ -84,9 +86,9 @@ typedef union { * Union for poll function for use in ompi_grequestx_t */ typedef union { - MPIX_Grequest_poll_function* c_poll; - MPIX_F_Grequest_poll_function* f_poll; -} MPIX_Grequest_poll_fct_t; + ompi_grequestx_poll_function* c_poll; + ompi_f_grequestx_poll_function* f_poll; +} ompi_grequestx_poll_fct_t; #endif /** @@ -98,7 +100,7 @@ struct ompi_grequest_t { MPI_Grequest_free_fct_t greq_free; MPI_Grequest_cancel_fct_t greq_cancel; #if OMPI_ENABLE_GREQUEST_EXTENSIONS - MPIX_Grequest_poll_fct_t greq_poll; + ompi_grequestx_poll_fct_t greq_poll; #endif void *greq_state; bool greq_funcs_are_c; diff --git a/ompi/request/grequestx.c b/ompi/request/grequestx.c index 64e58dd17c..acd688eacf 100644 --- a/ompi/request/grequestx.c +++ b/ompi/request/grequestx.c @@ -60,7 +60,7 @@ int ompi_grequestx_start( MPI_Grequest_query_function *gquery_fn, MPI_Grequest_free_function *gfree_fn, MPI_Grequest_cancel_function *gcancel_fn, - MPIX_Grequest_poll_function *gpoll_fn, + ompi_grequestx_poll_function *gpoll_fn, void* extra_state, ompi_request_t** request) { @@ -90,20 +90,20 @@ int ompi_grequestx_start( } -struct ompi_grequestx_class { +struct grequestx_class { opal_object_t super; MPI_Grequest_query_function *gquery_fn; MPI_Grequest_free_function *gfree_fn; MPI_Grequest_cancel_function *gcancel_fn; - MPIX_Grequest_poll_function *gpoll_fn; - MPIX_Grequest_wait_function *gwait_fn; + ompi_grequestx_poll_function *gpoll_fn; + ompi_grequestx_wait_function *gwait_fn; } ; -typedef struct ompi_grequestx_class ompi_grequestx_class; +typedef struct grequestx_class grequestx_class; static int next_class = 0; -static OBJ_CLASS_INSTANCE(ompi_grequestx_class, opal_object_t, NULL, NULL); +static OBJ_CLASS_INSTANCE(grequestx_class, opal_object_t, NULL, NULL); static opal_pointer_array_t classes; @@ -111,11 +111,11 @@ int ompi_grequestx_class_create( MPI_Grequest_query_function *gquery_fn, MPI_Grequest_free_function *gfree_fn, MPI_Grequest_cancel_function *gcancel_fn, - MPIX_Grequest_poll_function *gpoll_fn, - MPIX_Grequest_wait_function *gwait_fn, - MPIX_Grequest_class *greq_class) + ompi_grequestx_poll_function *gpoll_fn, + ompi_grequestx_wait_function *gwait_fn, + ompi_grequestx_class *greq_class) { - ompi_grequestx_class * class = OBJ_NEW(ompi_grequestx_class); + grequestx_class * class = OBJ_NEW(grequestx_class); class->gquery_fn = gquery_fn; class->gfree_fn = gfree_fn; class->gcancel_fn = gcancel_fn; @@ -132,11 +132,11 @@ int ompi_grequestx_class_create( } int ompi_grequestx_class_allocate( - MPIX_Grequest_class greq_class, + ompi_grequestx_class greq_class, void *extra_state, ompi_request_t **request) { - ompi_grequestx_class *class = opal_pointer_array_get_item(&classes, greq_class); + grequestx_class *class = opal_pointer_array_get_item(&classes, greq_class); ompi_grequestx_start(class->gquery_fn, class->gfree_fn, class->gcancel_fn, class->gpoll_fn, extra_state, request); return OMPI_SUCCESS; diff --git a/ompi/request/grequestx.h b/ompi/request/grequestx.h index 3b91b43d4b..d138a6495a 100644 --- a/ompi/request/grequestx.h +++ b/ompi/request/grequestx.h @@ -25,14 +25,16 @@ BEGIN_C_DECLS +typedef int (ompi_grequestx_wait_function)(int, void **, double, MPI_Status *); +typedef int ompi_grequestx_class; /** - * Start a generalized request (back end for MPIX_GREQUEST_START) + * Start an extended generalized request */ OMPI_DECLSPEC int ompi_grequestx_start( MPI_Grequest_query_function *gquery, MPI_Grequest_free_function *gfree, MPI_Grequest_cancel_function *gcancel, - MPIX_Grequest_poll_function *gpoll, + ompi_grequestx_poll_function *gpoll, void* gstate, ompi_request_t** request); @@ -40,14 +42,14 @@ OMPI_DECLSPEC int ompi_grequestx_class_create( MPI_Grequest_query_function *gquery, MPI_Grequest_free_function *gfree, MPI_Grequest_cancel_function *gcancel, - MPIX_Grequest_poll_function *gpoll, - MPIX_Grequest_wait_function *gwait, - MPIX_Grequest_class *greq_class); + ompi_grequestx_poll_function *gpoll, + ompi_grequestx_wait_function *gwait, + ompi_grequestx_class *greq_class); OMPI_DECLSPEC int ompi_grequestx_class_allocate( - MPIX_Grequest_class greq_class, + ompi_grequestx_class greq_class, void *extra_state, - ompi_request_t **request); + ompi_request_t** request); END_C_DECLS