Merge pull request #5337 from ggouaillardet/topic/generalized_requests
ompi/requests: implement generalized request extensions
Этот коммит содержится в:
Коммит
e609cf7bc3
22
.gitignore
поставляемый
22
.gitignore
поставляемый
@ -170,17 +170,17 @@ ompi/mca/coll/sm/coll-sm-version.h*
|
||||
|
||||
ompi/mca/crcp/ompi_crcp.7
|
||||
|
||||
ompi/mca/io/romio314/romio/adio/include/romioconf.h
|
||||
ompi/mca/io/romio314/romio/include/mpio.h
|
||||
ompi/mca/io/romio314/romio/localdefs
|
||||
ompi/mca/io/romio314/romio/test/fcoll_test.f
|
||||
ompi/mca/io/romio314/romio/test/fmisc.f
|
||||
ompi/mca/io/romio314/romio/test/fperf.f
|
||||
ompi/mca/io/romio314/romio/test/large_file.c
|
||||
ompi/mca/io/romio314/romio/test/misc.c
|
||||
ompi/mca/io/romio314/romio/test/pfcoll_test.f
|
||||
ompi/mca/io/romio314/romio/test/runtests
|
||||
ompi/mca/io/romio314/romio/util/romioinstall
|
||||
ompi/mca/io/romio321/romio/adio/include/romioconf.h
|
||||
ompi/mca/io/romio321/romio/include/mpio.h
|
||||
ompi/mca/io/romio321/romio/localdefs
|
||||
ompi/mca/io/romio321/romio/test/fcoll_test.f
|
||||
ompi/mca/io/romio321/romio/test/fmisc.f
|
||||
ompi/mca/io/romio321/romio/test/fperf.f
|
||||
ompi/mca/io/romio321/romio/test/large_file.c
|
||||
ompi/mca/io/romio321/romio/test/misc.c
|
||||
ompi/mca/io/romio321/romio/test/pfcoll_test.f
|
||||
ompi/mca/io/romio321/romio/test/runtests
|
||||
ompi/mca/io/romio321/romio/util/romioinstall
|
||||
ompi/mca/io/romio321/romio/test/syshints.c
|
||||
|
||||
ompi/mca/osc/monitoring/osc_monitoring_template_gen.h
|
||||
|
@ -17,7 +17,7 @@ dnl Copyright (c) 2009-2018 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
dnl Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl
|
||||
dnl $COPYRIGHT$
|
||||
@ -212,6 +212,21 @@ AC_DEFINE_UNQUOTED([OMPI_ENABLE_MPI1_COMPAT], [$ompi_mpi1_support], [whether we
|
||||
AC_SUBST([OMPI_ENABLE_MPI1_COMPAT], [$ompi_mpi1_support])
|
||||
AM_CONDITIONAL([OMPI_ENABLE_MPI1_COMPAT],[test $ompi_mpi1_support = 1])
|
||||
|
||||
AC_ARG_ENABLE([grequest-extensions],
|
||||
[AC_HELP_STRING([--enable-grequest-extensions],
|
||||
[Enable support for Grequest extensions (default: disabled)])])
|
||||
|
||||
if test "x$enable_grequest_extensions" = "xyes" ; then
|
||||
ompi_grequest_extensions=1
|
||||
else
|
||||
ompi_grequest_extensions=0
|
||||
fi
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED([OMPI_ENABLE_GREQUEST_EXTENSIONS], [$ompi_grequest_extensions], [whether we support Grequest extensions])
|
||||
AC_SUBST([OMPI_ENABLE_GREQUEST_EXTENSIONS], [$ompi_grequest_extensions])
|
||||
AM_CONDITIONAL([OMPI_ENABLE_GREQUEST_EXTENSIONS],[test $ompi_grequest_extensions = 1])
|
||||
|
||||
#
|
||||
# Do we want to disable MPI parameter checking at run-time?
|
||||
#
|
||||
|
@ -17,7 +17,7 @@
|
||||
* reserved.
|
||||
* Copyright (c) 2011-2013 INRIA. All rights reserved.
|
||||
* Copyright (c) 2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2017 IBM Corporation. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -139,6 +139,9 @@
|
||||
/* 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
|
||||
|
||||
@ -406,6 +409,12 @@ 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.
|
||||
@ -1496,6 +1505,23 @@ 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,
|
||||
@ -2157,6 +2183,23 @@ 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,
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -1,36 +0,0 @@
|
||||
commit ae17908f35ee614071ec68eb4643286f7b707e86
|
||||
Author: Nathan Hjelm <hjelmn@lanl.gov>
|
||||
Date: Tue May 1 15:11:34 2018 -0600
|
||||
|
||||
io/romio314: fix two more MPI-3 compliance issues
|
||||
|
||||
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
|
||||
|
||||
diff --git a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c
|
||||
index 718205b..e9f3116 100644
|
||||
--- a/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c
|
||||
+++ b/ompi/mca/io/romio314/romio/adio/common/cb_config_list.c
|
||||
@@ -135,8 +135,8 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm,
|
||||
|
||||
if (ADIOI_cb_config_list_keyval == MPI_KEYVAL_INVALID) {
|
||||
/* cleaned up by ADIOI_End_call */
|
||||
- MPI_Comm_create_keyval((MPI_Copy_function *) ADIOI_cb_copy_name_array,
|
||||
- (MPI_Delete_function *) ADIOI_cb_delete_name_array,
|
||||
+ MPI_Comm_create_keyval((MPI_Comm_copy_attr_function *) ADIOI_cb_copy_name_array,
|
||||
+ (MPI_Comm_delete_attr_function *) ADIOI_cb_delete_name_array,
|
||||
&ADIOI_cb_config_list_keyval, NULL);
|
||||
}
|
||||
else {
|
||||
diff --git a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h b/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h
|
||||
index a73561a..ff13723 100644
|
||||
--- a/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h
|
||||
+++ b/ompi/mca/io/romio314/romio/mpi-io/mpioimpl.h
|
||||
@@ -58,7 +58,7 @@ struct MPIR_Info {
|
||||
|
||||
#define MPIR_INFO_COOKIE 5835657
|
||||
|
||||
-MPI_Delete_function ADIOI_End_call;
|
||||
+MPI_Comm_delete_attr_function ADIOI_End_call;
|
||||
|
||||
/* common initialization routine */
|
||||
void MPIR_MPIOInit(int * error_code);
|
@ -577,6 +577,7 @@ static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *nbc_req, int *error_code)
|
||||
ADIO_File fd = vars->fd;
|
||||
MPI_Datatype datatype = vars->datatype;
|
||||
int nprocs = vars->nprocs;
|
||||
MPI_Aint lb;
|
||||
ADIOI_Access *others_req = vars->others_req;
|
||||
|
||||
/* Read in sizes of no more than coll_bufsize, an info parameter.
|
||||
@ -674,7 +675,7 @@ static void ADIOI_Iread_and_exch(ADIOI_NBC_Request *nbc_req, int *error_code)
|
||||
if (!vars->buftype_is_contig) {
|
||||
vars->flat_buf = ADIOI_Flatten_and_find(datatype);
|
||||
}
|
||||
MPI_Type_extent(datatype, &vars->buftype_extent);
|
||||
MPI_Type_get_extent(datatype, &lb, &vars->buftype_extent);
|
||||
|
||||
vars->done = 0;
|
||||
vars->off = st_loc;
|
||||
@ -792,7 +793,7 @@ static void ADIOI_Iread_and_exch_l1_begin(ADIOI_NBC_Request *nbc_req,
|
||||
if (req_off < real_off + real_size) {
|
||||
count[i]++;
|
||||
ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)read_buf) + req_off - real_off) == (ADIO_Offset)(MPIU_Upint)(read_buf + req_off - real_off));
|
||||
MPI_Address(read_buf + req_off - real_off,
|
||||
MPI_Get_address(read_buf + req_off - real_off,
|
||||
&(others_req[i].mem_ptrs[j]));
|
||||
ADIOI_Assert((real_off + real_size - req_off) == (int)(real_off + real_size - req_off));
|
||||
send_size[i] += (int)(ADIOI_MIN(real_off + real_size - req_off,
|
||||
|
@ -626,6 +626,7 @@ static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *nbc_req, int *error_code)
|
||||
MPI_Datatype datatype = vars->datatype;
|
||||
int nprocs = vars->nprocs;
|
||||
ADIOI_Access *others_req = vars->others_req;
|
||||
MPI_Aint lb;
|
||||
|
||||
/* Send data to appropriate processes and write in sizes of no more
|
||||
than coll_bufsize.
|
||||
@ -722,7 +723,7 @@ static void ADIOI_Iexch_and_write(ADIOI_NBC_Request *nbc_req, int *error_code)
|
||||
if (!vars->buftype_is_contig) {
|
||||
vars->flat_buf = ADIOI_Flatten_and_find(datatype);
|
||||
}
|
||||
MPI_Type_extent(datatype, &vars->buftype_extent);
|
||||
MPI_Type_get_extent(datatype, &lb, &vars->buftype_extent);
|
||||
|
||||
|
||||
/* I need to check if there are any outstanding nonblocking writes to
|
||||
@ -823,8 +824,8 @@ static void ADIOI_Iexch_and_write_l1_begin(ADIOI_NBC_Request *nbc_req,
|
||||
if (req_off < off + size) {
|
||||
count[i]++;
|
||||
ADIOI_Assert((((ADIO_Offset)(MPIU_Upint)write_buf)+req_off-off) == (ADIO_Offset)(MPIU_Upint)(write_buf+req_off-off));
|
||||
MPI_Address(write_buf + req_off - off,
|
||||
&(others_req[i].mem_ptrs[j]));
|
||||
MPI_Get_address(write_buf + req_off - off,
|
||||
&(others_req[i].mem_ptrs[j]));
|
||||
ADIOI_Assert((off + size - req_off) == (int)(off + size - req_off));
|
||||
recv_size[i] += (int)(ADIOI_MIN(off + size - req_off,
|
||||
(unsigned)req_len));
|
||||
|
@ -1511,7 +1511,16 @@ if test $FROM_OMPI = yes ; then
|
||||
# Open MPI: see comments in mpi-io/mpioprof.h
|
||||
AC_DEFINE(MPIO_BUILD_PROFILING, 1, [hack to make ROMIO build without profiling])
|
||||
DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
|
||||
DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#undef HAVE_MPI_GREQUEST_EXTENSIONS"
|
||||
AC_ARG_ENABLE([grequest-extensions],
|
||||
[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="#undef HAVE_MPI_GREQUEST_EXTENSIONS"])
|
||||
|
||||
AC_DEFINE(HAVE_DECL_MPI_COMBINER_HINDEXED_BLOCK, 1, [Define if MPI library provides HINDEXED_BLOCK datatype])
|
||||
AC_DEFINE(HAVE_MPIIO_CONST, 1, Set if MPI-IO prototypes use const qualifier)
|
||||
elif test $FROM_LAM = yes ; then
|
||||
|
@ -15,7 +15,7 @@
|
||||
# Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||
# Copyright (c) 2013-2018 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
# Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -431,6 +431,13 @@ 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 \
|
||||
|
48
ompi/mpi/c/grequestx_class_allocate.c
Обычный файл
48
ompi/mpi/c/grequestx_class_allocate.c
Обычный файл
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 <stdio.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
51
ompi/mpi/c/grequestx_class_create.c
Обычный файл
51
ompi/mpi/c/grequestx_class_create.c
Обычный файл
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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 <stdio.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
50
ompi/mpi/c/grequestx_start.c
Обычный файл
50
ompi/mpi/c/grequestx_start.c
Обычный файл
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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 <stdio.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
# Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
# Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -411,6 +411,13 @@ 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 \
|
||||
|
@ -11,6 +11,8 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2016 IBM Corporation. All rights reserved.
|
||||
# Copyright (c) 2018 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -26,8 +28,18 @@ headers += \
|
||||
request/request.h \
|
||||
request/request_dbg.h
|
||||
|
||||
if OMPI_ENABLE_GREQUEST_EXTENSIONS
|
||||
headers += \
|
||||
request/grequestx.h
|
||||
endif
|
||||
|
||||
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
|
||||
request/grequest.c \
|
||||
request/request.c \
|
||||
request/req_test.c \
|
||||
request/req_wait.c
|
||||
|
||||
if OMPI_ENABLE_GREQUEST_EXTENSIONS
|
||||
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
|
||||
request/grequestx.c
|
||||
endif
|
||||
|
@ -10,6 +10,8 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -44,6 +46,15 @@ typedef void (MPI_F_Grequest_cancel_function)(MPI_Aint *extra_state,
|
||||
ompi_fortran_logical_t *complete,
|
||||
MPI_Fint *ierr);
|
||||
|
||||
#if OMPI_ENABLE_GREQUEST_EXTENSIONS
|
||||
/**
|
||||
* Fortran type for generalized request query function
|
||||
*/
|
||||
typedef void (MPIX_F_Grequest_poll_function)(MPI_Aint *extra_state,
|
||||
MPI_Fint *status,
|
||||
MPI_Fint *ierr);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Union for query function for use in ompi_grequest_t
|
||||
*/
|
||||
@ -68,6 +79,16 @@ typedef union {
|
||||
MPI_F_Grequest_cancel_function* f_cancel;
|
||||
} MPI_Grequest_cancel_fct_t;
|
||||
|
||||
#if OMPI_ENABLE_GREQUEST_EXTENSIONS
|
||||
/**
|
||||
* 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;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Main structure for MPI generalized requests
|
||||
*/
|
||||
@ -76,6 +97,9 @@ struct ompi_grequest_t {
|
||||
MPI_Grequest_query_fct_t greq_query;
|
||||
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;
|
||||
#endif
|
||||
void *greq_state;
|
||||
bool greq_funcs_are_c;
|
||||
};
|
||||
|
143
ompi/request/grequestx.c
Обычный файл
143
ompi/request/grequestx.c
Обычный файл
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2016 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* 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 "ompi/communicator/communicator.h"
|
||||
#include "ompi/request/grequest.h"
|
||||
#include "ompi/mpi/fortran/base/fint_2_int.h"
|
||||
#include "ompi/request/grequestx.h"
|
||||
|
||||
static bool requests_initialized = false;
|
||||
static opal_list_t requests;
|
||||
static int32_t active_requests = 0;
|
||||
static bool in_progress = false;
|
||||
static opal_mutex_t lock;
|
||||
|
||||
static int grequestx_progress(void) {
|
||||
ompi_grequest_t *request, *next;
|
||||
|
||||
OPAL_THREAD_LOCK(&lock);
|
||||
if (!in_progress) {
|
||||
in_progress = true;
|
||||
|
||||
OPAL_LIST_FOREACH_SAFE(request, next, &requests, ompi_grequest_t) {
|
||||
MPI_Status status;
|
||||
OPAL_THREAD_UNLOCK(&lock);
|
||||
request->greq_poll.c_poll(request->greq_state, &status);
|
||||
if (REQUEST_COMPLETE(&request->greq_base)) {
|
||||
OPAL_THREAD_LOCK(&lock);
|
||||
opal_list_remove_item(&requests, &request->greq_base.super.super);
|
||||
OPAL_THREAD_UNLOCK(&lock);
|
||||
}
|
||||
OPAL_THREAD_LOCK(&lock);
|
||||
}
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&lock);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
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,
|
||||
void* extra_state,
|
||||
ompi_request_t** request)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = ompi_grequest_start(gquery_fn, gfree_fn, gcancel_fn, extra_state, request);
|
||||
if (OMPI_SUCCESS != rc) {
|
||||
return rc;
|
||||
}
|
||||
((ompi_grequest_t *)*request)->greq_poll.c_poll = gpoll_fn;
|
||||
|
||||
if (!requests_initialized) {
|
||||
OBJ_CONSTRUCT(&requests, opal_list_t);
|
||||
OBJ_CONSTRUCT(&lock, opal_mutex_t);
|
||||
requests_initialized = true;
|
||||
}
|
||||
|
||||
OPAL_THREAD_LOCK(&lock);
|
||||
opal_list_append(&requests, &((*request)->super.super));
|
||||
OPAL_THREAD_UNLOCK(&lock);
|
||||
int32_t tmp = OPAL_THREAD_ADD_FETCH32(&active_requests, 1);
|
||||
if (1 == tmp) {
|
||||
opal_progress_register(grequestx_progress);
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
struct ompi_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;
|
||||
} ;
|
||||
|
||||
typedef struct ompi_grequestx_class ompi_grequestx_class;
|
||||
|
||||
static int next_class = 0;
|
||||
|
||||
static OBJ_CLASS_INSTANCE(ompi_grequestx_class, opal_object_t, NULL, NULL);
|
||||
|
||||
static opal_pointer_array_t classes;
|
||||
|
||||
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_class * class = OBJ_NEW(ompi_grequestx_class);
|
||||
class->gquery_fn = gquery_fn;
|
||||
class->gfree_fn = gfree_fn;
|
||||
class->gcancel_fn = gcancel_fn;
|
||||
class->gpoll_fn = gpoll_fn;
|
||||
class->gwait_fn = gwait_fn;
|
||||
|
||||
if (0 == next_class) {
|
||||
OBJ_CONSTRUCT(&classes, opal_pointer_array_t);
|
||||
}
|
||||
opal_pointer_array_add(&classes, class);
|
||||
next_class ++;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int ompi_grequestx_class_allocate(
|
||||
MPIX_Grequest_class greq_class,
|
||||
void *extra_state,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
ompi_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;
|
||||
}
|
54
ompi/request/grequestx.h
Обычный файл
54
ompi/request/grequestx.h
Обычный файл
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OMPI_GEN_REQUESTX_H
|
||||
#define OMPI_GEN_REQUESTX_H
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/request/grequest.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* Start a generalized request (back end for MPIX_GREQUEST_START)
|
||||
*/
|
||||
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,
|
||||
void* gstate,
|
||||
ompi_request_t** request);
|
||||
|
||||
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_DECLSPEC int ompi_grequestx_class_allocate(
|
||||
MPIX_Grequest_class greq_class,
|
||||
void *extra_state,
|
||||
ompi_request_t **request);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче
Block a user