diff --git a/.mailmap b/.mailmap index 5df8b7c4481..725879d932e 100644 --- a/.mailmap +++ b/.mailmap @@ -119,3 +119,5 @@ Nick Papior Nick Papior Wei-keng Liao + +Matthew G. F. Dosanjh diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 2c935d1df4a..099b08023d0 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -9,10 +9,10 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2007-2021 Cisco Systems, Inc. All rights reserved * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved. - * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved. * Copyright (c) 2012-2018 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2013 INRIA. All rights reserved. @@ -24,6 +24,7 @@ * Copyright (c) 2021 Google, LLC. All rights reserved. * Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights * reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -1768,8 +1769,19 @@ OMPI_DECLSPEC int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatyp void *outbuf, int outsize, int *position, MPI_Comm comm); OMPI_DECLSPEC int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size); +OMPI_DECLSPEC int MPI_Parrived(MPI_Request request, MPI_Count partition, int *flag); OMPI_DECLSPEC int MPI_Pcontrol(const int level, ...); +OMPI_DECLSPEC int MPI_Pready(int partitions, MPI_Request request); +OMPI_DECLSPEC int MPI_Pready_range(int partition_low, int partition_high, + MPI_Request request); +OMPI_DECLSPEC int MPI_Pready_list(int length, int partition_list[], MPI_Request request); +OMPI_DECLSPEC int MPI_Precv_init(void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status); +OMPI_DECLSPEC int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); OMPI_DECLSPEC int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_name); OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, @@ -2420,6 +2432,17 @@ OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int tag, MPI_Comm comm, MPI_Request *request); OMPI_DECLSPEC int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Precv_init(void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count, + MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, + MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int PMPI_Pready(int partitions, MPI_Request request); +OMPI_DECLSPEC int PMPI_Pready_range(int partition_low, int partition_high, + MPI_Request request); +OMPI_DECLSPEC int PMPI_Pready_list(int length, int partition_list[], MPI_Request request); +OMPI_DECLSPEC int PMPI_Parrived(MPI_Request request, MPI_Count partition, int *flag); OMPI_DECLSPEC int PMPI_Is_thread_main(int *flag); OMPI_DECLSPEC int PMPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name); OMPI_DECLSPEC MPI_Fint PMPI_Message_c2f(MPI_Message message); diff --git a/ompi/mca/part/Makefile.am b/ompi/mca/part/Makefile.am new file mode 100644 index 00000000000..3eab15c827d --- /dev/null +++ b/ompi/mca/part/Makefile.am @@ -0,0 +1,39 @@ +# +# 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) 2010-2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# main library setup +noinst_LTLIBRARIES = libmca_part.la +libmca_part_la_SOURCES = + +# local files +headers = part.h +libmca_part_la_SOURCES += $(headers) $(nodist_headers) + +# Conditionally install the header files +if WANT_INSTALL_HEADERS +ompidir = $(ompiincludedir)/$(subdir) +nobase_ompi_HEADERS = $(headers) +nobase_nodist_ompi_HEADERS = $(nodist_headers) +endif + +include base/Makefile.am + +distclean-local: + rm -f base/static-components.h diff --git a/ompi/mca/part/base/Makefile.am b/ompi/mca/part/base/Makefile.am new file mode 100644 index 00000000000..05a7aba9783 --- /dev/null +++ b/ompi/mca/part/base/Makefile.am @@ -0,0 +1,21 @@ +# +# Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +headers += \ + base/base.h \ + base/part_base_prequest.h \ + base/part_base_precvreq.h \ + base/part_base_psendreq.h + +libmca_part_la_SOURCES += \ + base/part_base_frame.c \ + base/part_base_precvreq.c \ + base/part_base_prequest.c \ + base/part_base_select.c \ + base/part_base_psendreq.c diff --git a/ompi/mca/part/base/base.h b/ompi/mca/part/base/base.h new file mode 100644 index 00000000000..a65b2aba51c --- /dev/null +++ b/ompi/mca/part/base/base.h @@ -0,0 +1,71 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 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) 2013 Los Alamos National Security, LLC. All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef MCA_PART_BASE_H +#define MCA_PART_BASE_H + +#include "ompi_config.h" + +#include "ompi/mca/mca.h" +#include "opal/mca/base/mca_base_framework.h" +#include "opal/class/opal_list.h" +#include "opal/class/opal_pointer_array.h" + +#include "ompi/mca/part/part.h" + +/* + * Global functions for PART + */ + +BEGIN_C_DECLS + +/* + * This is the base priority for a PART wrapper component + * If there exists more than one then it is undefined + * which one is picked. + */ +#define PART_SELECT_WRAPPER_PRIORITY -128 + +/* + * MCA framework + */ +OMPI_DECLSPEC extern mca_base_framework_t ompi_part_base_framework; + +/* + * Select an available component. + */ +OMPI_DECLSPEC int mca_part_base_select(bool enable_progress_threads, + bool enable_mpi_threads); + +OMPI_DECLSPEC int mca_part_base_progress(void); + +OMPI_DECLSPEC int mca_part_base_finalize(void); + +/* + * Globals + */ +OMPI_DECLSPEC extern mca_part_base_component_t mca_part_base_selected_component; +OMPI_DECLSPEC extern mca_part_base_module_t mca_part; +OMPI_DECLSPEC extern opal_pointer_array_t mca_part_base_part; + +END_C_DECLS + +#endif /* MCA_PART_BASE_H */ diff --git a/ompi/mca/part/base/part_base_frame.c b/ompi/mca/part/base/part_base_frame.c new file mode 100644 index 00000000000..f9da3548456 --- /dev/null +++ b/ompi/mca/part/base/part_base_frame.c @@ -0,0 +1,148 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2007 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) 2009 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 IBM Corporation. All rights reserved. + * Copyright (c) 2020 Intel, Inc. All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +#include "ompi_config.h" +#include + +#include +#ifdef HAVE_UNISTD_H +#include +#endif /* HAVE_UNIST_H */ +#include "ompi/mca/mca.h" +#include "opal/util/output.h" +#include "opal/mca/base/base.h" + + +#include "ompi/constants.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/base.h" +#include "ompi/mca/part/base/part_base_prequest.h" + +/* + * The following file was created by configure. It contains extern + * statements and the definition of an array of pointers to each + * component's public mca_base_component_t struct. + */ + +#include "ompi/mca/part/base/static-components.h" + +/* + * This function allows modules to not declare a progress function, + * by defaulting to doing nothing. + */ +int mca_part_base_progress(void) +{ + return OMPI_SUCCESS; +} + +#define xstringify(part) #part +#define stringify(part) xstringify(part) + +/* + * Global variables + */ +mca_part_base_module_t mca_part = { + .part_progress = mca_part_base_progress /* part_progress */ +}; + +mca_part_base_component_t mca_part_base_selected_component = {{0}}; +opal_pointer_array_t mca_part_base_part = {{0}}; + +static int mca_part_base_register(mca_base_register_flag_t flags) +{ + return OMPI_SUCCESS; +} + +int mca_part_base_finalize(void) { + if (NULL != mca_part_base_selected_component.partm_finalize) { + return mca_part_base_selected_component.partm_finalize(); + } + return OMPI_SUCCESS; +} + + +static int mca_part_base_close(void) +{ + int i, j; + + /* unregister the progress function */ + if( NULL != mca_part.part_progress ) { + opal_progress_unregister(mca_part.part_progress); + } + + /* reset the progress function to do nothing */ + mca_part.part_progress = mca_part_base_progress; + + /* Free all the strings in the array of components */ + j = opal_pointer_array_get_size(&mca_part_base_part); + for (i = 0; i < j; ++i) { + char *str; + str = (char*) opal_pointer_array_get_item(&mca_part_base_part, i); + free(str); + } + OBJ_DESTRUCT(&mca_part_base_part); + + OBJ_DESTRUCT(&mca_part_base_psend_requests); + OBJ_DESTRUCT(&mca_part_base_precv_requests); + + /* Close all remaining available components */ + return mca_base_framework_components_close(&ompi_part_base_framework, NULL); +} + +/** + * Function for finding and opening either all MCA components, or the one + * that was specifically requested via a MCA parameter. + */ +static int mca_part_base_open(mca_base_open_flag_t flags) +{ + OBJ_CONSTRUCT(&mca_part_base_part, opal_pointer_array_t); + + + OBJ_CONSTRUCT(&mca_part_base_psend_requests, opal_free_list_t); + OBJ_CONSTRUCT(&mca_part_base_precv_requests, opal_free_list_t); + /* Open up all available components */ + + if (OPAL_SUCCESS != + mca_base_framework_components_open(&ompi_part_base_framework, flags)) { + return OMPI_ERROR; + } + + /* Set a sentinel in case we don't select any components (e.g., + ompi_info) */ + + mca_part_base_selected_component.partm_finalize = NULL; + + /* Currently this uses a default with no selection criteria as there is only 1 module. */ + opal_pointer_array_add(&mca_part_base_part, strdup("persist")); + + return OMPI_SUCCESS; +} + +MCA_BASE_FRAMEWORK_DECLARE(ompi, part, "OMPI PART", mca_part_base_register, + mca_part_base_open, mca_part_base_close, + mca_part_base_static_components, 0); diff --git a/ompi/mca/part/base/part_base_precvreq.c b/ompi/mca/part/base/part_base_precvreq.c new file mode 100644 index 00000000000..ae50422bbc8 --- /dev/null +++ b/ompi/mca/part/base/part_base_precvreq.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2007 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) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +#include "ompi_config.h" +#include "ompi/types.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/part_base_precvreq.h" + + +static void mca_part_base_precv_request_construct(mca_part_base_precv_request_t* request) +{ + OBJ_CONSTRUCT(&request->req_base.req_convertor, opal_convertor_t); +} + + +/* For each request the convertor get cleaned after each message + * (in the base _FINI macro). Therefore, as the convertor is a static object + * we don't have to call OBJ_DESTRUCT here. + */ + +OBJ_CLASS_INSTANCE( + mca_part_base_precv_request_t, + mca_part_base_prequest_t, + mca_part_base_precv_request_construct, + 0 +); + + diff --git a/ompi/mca/part/base/part_base_precvreq.h b/ompi/mca/part/base/part_base_precvreq.h new file mode 100644 index 00000000000..64836757e0d --- /dev/null +++ b/ompi/mca/part/base/part_base_precvreq.h @@ -0,0 +1,50 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * 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 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + */ +#ifndef MCA_PART_BASE_PRECV_REQUEST_H +#define MCA_PART_BASE_PRECV_REQUEST_H + +#include "ompi_config.h" +#include "ompi/mca/part/base/part_base_prequest.h" +#include "opal/datatype/opal_convertor.h" +#include "ompi/peruse/peruse-internal.h" + +BEGIN_C_DECLS + +/** + * Base type for receive requests. + */ +struct mca_part_base_precv_request_t { + mca_part_base_prequest_t req_base; /**< base request */ + size_t parts; /**< number of partitions */ +}; +typedef struct mca_part_base_precv_request_t mca_part_base_precv_request_t; + +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_part_base_precv_request_t); + +END_C_DECLS + +#endif + diff --git a/ompi/mca/part/base/part_base_prequest.c b/ompi/mca/part/base/part_base_prequest.c new file mode 100644 index 00000000000..e96fe059b0d --- /dev/null +++ b/ompi/mca/part/base/part_base_prequest.c @@ -0,0 +1,45 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2015 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2007 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) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/part_base_prequest.h" + +/** + * If you wonder why these 2 freelists are declared here read the comment + * in the part_base_request.h file. + */ +opal_free_list_t mca_part_base_psend_requests = {{{0}}}; +opal_free_list_t mca_part_base_precv_requests = {{{0}}}; + +static void mca_part_base_prequest_construct(mca_part_base_prequest_t* req) +{ + req->req_ompi.req_type = OMPI_REQUEST_PART; +} + +OBJ_CLASS_INSTANCE( + mca_part_base_prequest_t, + ompi_request_t, + mca_part_base_prequest_construct, + NULL +); + diff --git a/ompi/mca/part/base/part_base_prequest.h b/ompi/mca/part/base/part_base_prequest.h new file mode 100644 index 00000000000..274102471b2 --- /dev/null +++ b/ompi/mca/part/base/part_base_prequest.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * 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-2008 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) 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + */ +#ifndef MCA_PART_BASE_REQUEST_H +#define MCA_PART_BASE_REQUEST_H + +#include "ompi_config.h" +#include "opal/class/opal_free_list.h" +#include "ompi/communicator/communicator.h" +#include "ompi/request/request.h" +#include "opal/datatype/opal_convertor.h" +BEGIN_C_DECLS + +/** + * External list for the partitioned requests. + */ +OMPI_DECLSPEC extern opal_free_list_t mca_part_base_psend_requests; +OMPI_DECLSPEC extern opal_free_list_t mca_part_base_precv_requests; + +typedef enum { + MCA_PART_REQUEST_NULL, + MCA_PART_REQUEST_PSEND, + MCA_PART_REQUEST_PRECV +} mca_part_base_request_type_t; + + +/** + * Base type for Partitoned P2P requests + */ +struct mca_part_base_prequest_t { + + ompi_request_t req_ompi; /**< base request */ + volatile int32_t req_part_complete; /**< flag indicating if the pt-2-pt layer is done with this request */ + volatile int32_t req_free_called; /**< flag indicating if the user has freed this request */ + mca_part_base_request_type_t req_type; /**< MPI request type - used for test */ + struct ompi_communicator_t *req_comm; /**< communicator pointer */ + struct ompi_datatype_t *req_datatype; /**< pointer to data type */ + opal_convertor_t req_convertor; /**< always need the convertor */ + + void *req_addr; /**< pointer to application buffer */ + size_t req_parts; /**< number of partitions */ + size_t req_count; /**< count of user datatype elements */ + int32_t req_peer; /**< peer process - rank w/in this communicator */ + int32_t req_tag; /**< user defined tag */ + struct ompi_proc_t* req_proc; /**< peer process */ +}; +typedef struct mca_part_base_prequest_t mca_part_base_prequest_t; + +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_part_base_prequest_t); + +END_C_DECLS + +#endif + diff --git a/ompi/mca/part/base/part_base_psendreq.c b/ompi/mca/part/base/part_base_psendreq.c new file mode 100644 index 00000000000..768388c179e --- /dev/null +++ b/ompi/mca/part/base/part_base_psendreq.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2007 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) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +#include "ompi_config.h" +#include +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/part_base_psendreq.h" + +static void mca_part_base_psend_request_construct(mca_part_base_psend_request_t* request) +{ + /* no need to reinit for every send -- never changes */ + OBJ_CONSTRUCT(&request->req_base.req_convertor, opal_convertor_t); +} + +OBJ_CLASS_INSTANCE( + mca_part_base_psend_request_t, + mca_part_base_prequest_t, + mca_part_base_psend_request_construct, + 0 +); + diff --git a/ompi/mca/part/base/part_base_psendreq.h b/ompi/mca/part/base/part_base_psendreq.h new file mode 100644 index 00000000000..ee7121d2554 --- /dev/null +++ b/ompi/mca/part/base/part_base_psendreq.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * 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 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2016 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2017 Intel, Inc. All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + */ +#ifndef MCA_PART_BASE_PSEND_REQUEST_H +#define MCA_PART_BASE_PSEND_REQUEST_H + +#include "ompi_config.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/part_base_prequest.h" +#include "opal/datatype/opal_convertor.h" +#include "ompi/peruse/peruse-internal.h" + +BEGIN_C_DECLS + +/** + * Base type for send requests + */ +struct mca_part_base_psend_request_t { + mca_part_base_prequest_t req_base; /**< base request type - common data structure for use by wait/test */ + const void *req_addr; /**< pointer to send buffer - may not be application buffer */ + size_t req_bytes_packed; /**< packed size of a message given the datatype and count */ +}; +typedef struct mca_part_base_psend_request_t mca_part_base_psend_request_t; + +OMPI_DECLSPEC OBJ_CLASS_DECLARATION( mca_part_base_psend_request_t ); + +END_C_DECLS + +#endif diff --git a/ompi/mca/part/base/part_base_select.c b/ompi/mca/part/base/part_base_select.c new file mode 100644 index 00000000000..b7390a737aa --- /dev/null +++ b/ompi/mca/part/base/part_base_select.c @@ -0,0 +1,233 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 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) 2012 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2013-2014 Intel, Inc. All rights reserved + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include + +#include "opal/class/opal_list.h" +#include "opal/util/output.h" +#include "opal/util/show_help.h" +#include "opal/runtime/opal_progress.h" +#include "ompi/mca/mca.h" +#include "opal/mca/base/base.h" +#include "opal/runtime/opal.h" +#include "opal/mca/pmix/pmix-internal.h" + +#include "ompi/constants.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/base.h" +#include "ompi/proc/proc.h" + +typedef struct opened_component_t { + opal_list_item_t super; + mca_part_base_component_t *om_component; +} opened_component_t; + +static bool modex_reqd=false; + +/** + * Function for selecting one component from all those that are + * available. + * + * Call the init function on all available components and get their + * priorities. Select the component with the highest priority. All + * other components will be closed and unloaded. The selected component + * will have all of its function pointers saved and returned to the + * caller. + */ +int mca_part_base_select(bool enable_progress_threads, + bool enable_mpi_threads) +{ + int i, priority = 0, best_priority = 0, num_part = 0; + opal_list_item_t *item = NULL; + mca_base_component_list_item_t *cli = NULL; + mca_part_base_component_t *component = NULL, *best_component = NULL; + mca_part_base_module_t *module = NULL, *best_module = NULL; + opal_list_t opened; + opened_component_t *om = NULL; + bool found_part; + + /* Traverse the list of available components; call their init + functions. */ + + best_priority = -1; + best_component = NULL; + module = NULL; + OBJ_CONSTRUCT(&opened, opal_list_t); + OPAL_LIST_FOREACH(cli, &ompi_part_base_framework.framework_components, mca_base_component_list_item_t) { + component = (mca_part_base_component_t *) cli->cli_component; + + /* if there is an include list - item must be in the list to be included */ + found_part = false; + for( i = 0; i < opal_pointer_array_get_size(&mca_part_base_part); i++) { + char * tmp_val = NULL; + tmp_val = (char *) opal_pointer_array_get_item(&mca_part_base_part, i); + if( NULL == tmp_val) { + continue; + } + + if(0 == strncmp(component->partm_version.mca_component_name, + tmp_val, strlen(component->partm_version.mca_component_name)) ) { + found_part = true; + break; + } + } + + if(!found_part && opal_pointer_array_get_size(&mca_part_base_part)) { + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: component %s not in the include list", + component->partm_version.mca_component_name ); + + continue; + } + + /* if there is no init function - ignore it */ + if (NULL == component->partm_init) { + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: no init function; ignoring component %s", + component->partm_version.mca_component_name ); + continue; + } + + /* this is a part that could be considered */ + num_part++; + + /* Init component to get its priority */ + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: initializing %s component %s", + component->partm_version.mca_type_name, + component->partm_version.mca_component_name ); + priority = best_priority; + module = component->partm_init(&priority, enable_progress_threads, + enable_mpi_threads); + if (NULL == module) { + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: init returned failure for component %s", + component->partm_version.mca_component_name ); + continue; + } + + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: init returned priority %d", priority ); + if (priority > best_priority) { + best_priority = priority; + best_component = component; + best_module = module; + } + + om = (opened_component_t*)malloc(sizeof(opened_component_t)); + if (NULL == om) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + OBJ_CONSTRUCT(om, opal_list_item_t); + om->om_component = component; + opal_list_append(&opened, (opal_list_item_t*) om); + } + + /* Finished querying all components. Check for the bozo case. */ + + if( NULL == best_component ) { + opal_show_help("help-mca-base.txt", "find-available:none found", + true, "part", + opal_process_info.nodename, + "part"); + for( i = 0; i < opal_pointer_array_get_size(&mca_part_base_part); i++) { + char * tmp_val = NULL; + tmp_val = (char *) opal_pointer_array_get_item(&mca_part_base_part, i); + if( NULL == tmp_val) { + continue; + } + ompi_rte_abort(1, "PART %s cannot be selected", tmp_val); + } + if(0 == i) { + ompi_rte_abort(2, "No part component available. This shouldn't happen."); + } + } + + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "selected %s best priority %d\n", + best_component->partm_version.mca_component_name, best_priority); + + /* if more than one PART could be considered, then we still need the + * modex since we cannot know which one will be selected on all procs + */ + if (1 < num_part) { + modex_reqd = true; + } + + /* Finalize all non-selected components */ + + for (item = opal_list_remove_first(&opened); + NULL != item; + item = opal_list_remove_first(&opened)) { + om = (opened_component_t *) item; + + if (om->om_component != best_component + ) { + /* Finalize */ + + if (NULL != om->om_component->partm_finalize) { + + /* Blatently ignore the return code (what would we do to + recover, anyway? This component is going away, so errors + don't matter anymore) */ + + om->om_component->partm_finalize(); + opal_output_verbose(10, ompi_part_base_framework.framework_output, + "select: component %s not selected / finalized", + om->om_component->partm_version.mca_component_name); + } + } + OBJ_DESTRUCT( om ); + free(om); + } + OBJ_DESTRUCT( &opened ); + + /* Save the winner */ + + mca_part_base_selected_component = *best_component; + mca_part = *best_module; + opal_output_verbose( 10, ompi_part_base_framework.framework_output, + "select: component %s selected", + mca_part_base_selected_component.partm_version.mca_component_name ); + + /* This base function closes, unloads, and removes from the + available list all unselected components. The available list will + contain only the selected component. */ + + mca_base_components_close(ompi_part_base_framework.framework_output, + &ompi_part_base_framework.framework_components, + (mca_base_component_t *) best_component); + + /* register the winner's callback */ + if( NULL != mca_part.part_progress ) { + opal_progress_register(mca_part.part_progress); + } + + /* All done */ + + return OMPI_SUCCESS; +} + diff --git a/ompi/mca/part/configure.m4 b/ompi/mca/part/configure.m4 new file mode 100644 index 00000000000..88475c5e445 --- /dev/null +++ b/ompi/mca/part/configure.m4 @@ -0,0 +1,18 @@ +# -*- shell-script -*- +# +# Copyright (c) 2013-2020 Sandia National Laboratories. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +AC_DEFUN([MCA_ompi_part_CONFIG],[ + # configure all the components + MCA_CONFIGURE_FRAMEWORK($1, $2, 1) + + # this is a direct callable component, so set that up. + MCA_SETUP_DIRECT_CALL($1, $2) +]) diff --git a/ompi/mca/part/part.h b/ompi/mca/part/part.h new file mode 100644 index 00000000000..aa3977bc84c --- /dev/null +++ b/ompi/mca/part/part.h @@ -0,0 +1,249 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + * + * Partitioned Communication (PART) + * + * An MCA component type that provides the partitioned interface functionality + * required by the MPI-4 specification. Part is designed to act as intermediary + * between the MPI layer and another transfer layer. This differs from other + * components, such as PML, by allowing the component to leverage the underlying + * transfer mechanism to be another MPI layer, such as the osc component/the + * RMA interface. + * + * ------------------------------------ + * | MPI | + * ------------------------------------ + * | PART | + * ------------------------------------ + * | OSC (RDMA) | + * ------------------------------------ + * + * The initial implementation is currently leveraging the RMA interface, + * with the intent to remove the MPI layer and directly call the osc component. + * Other transport mechanisms could be used in future implementation (such as + * the MTL and BTL components). + * + * This component and it's initial module are under development and have + * extra restrictions on use than described in the MPI-4 specification. + * Currently, MPI_Psend_init and MPI_Precv_init are both blocking in the RMA + * component which requires careful use to avoid deadlocks. This will + * be addressed in future updates. + */ + +#ifndef MCA_PART_H +#define MCA_PART_H + +#include "ompi_config.h" +#include "ompi/mca/mca.h" +#include "mpi.h" /* needed for MPI_ANY_TAG */ +#include "ompi/request/request.h" + +BEGIN_C_DECLS + +struct ompi_proc_t; + +/** + * MCA->PART Called by MCA framework to initialize the component. + * + * @param priority (OUT) Relative priority or ranking used by MCA to + * selected a component. + * + * @param enable_progress_threads (IN) Whether this component is + * allowed to run a hidden/progress thread or not. + * + * @param enable_mpi_threads (IN) Whether support for multiple MPI + * threads is enabled or not (i.e., MPI_THREAD_MULTIPLE), which + * indicates whether multiple threads may invoke this component + * simultaneously or not. + */ +typedef struct mca_part_base_module_1_0_1_t * (*mca_part_base_component_init_fn_t)( + int *priority, + bool enable_progress_threads, + bool enable_mpi_threads); + +typedef int (*mca_part_base_component_finalize_fn_t)(void); + +/** + * PART component version and interface functions. + */ + +struct mca_part_base_component_4_0_0_t { + mca_base_component_t partm_version; + mca_base_component_data_t partm_data; + mca_part_base_component_init_fn_t partm_init; + mca_part_base_component_finalize_fn_t partm_finalize; +}; +typedef struct mca_part_base_component_4_0_0_t mca_part_base_component_4_0_0_t; +typedef mca_part_base_component_4_0_0_t mca_part_base_component_t; + + +/** + * MCA management functions. + */ + + +/** + * For non-threaded case, provides MCA the opportunity to + * progress outstanding requests on all btls. + * + * * @return Count of "completions", a metric of + * how many items where completed in the call + * to progress. +*/ +typedef int (*mca_part_base_module_progress_fn_t)(void); + +/** + * MPI Interface Functions + */ + +/** + * Initialize a partitioned receive request. + * + * @param buf (IN) User buffer. + * @param parts (IN) Number of partitions. + * @param count (IN) Number of elements of the specified datatype. + * @param datatype (IN) User defined datatype. + * @param src (IN) Source rank w/in communicator. + * @param tag (IN) User defined tag. + * @param comm (IN) Communicator. + * @param request (OUT) Request handle. + * @return OMPI_SUCCESS or failure status. + */ + +typedef int (*mca_part_base_module_precv_init_fn_t)( + void *buf, + size_t parts, + size_t count, + struct ompi_datatype_t *datatype, + int src, + int tag, + struct ompi_communicator_t* comm, + struct ompi_info_t * info, + struct ompi_request_t **request +); + +/** + * Initialize a partitioned send request. + * + * @param buf (IN) User buffer. + * @param parts (IN) Number of partitions. + * @param count (IN) Number of elements of the specified datatype. + * @param datatype (IN) User defined datatype. + * @param dst (IN) Peer rank w/in communicator. + * @param tag (IN) User defined tag. + * @param mode (IN) Send mode (STANDARD,BUFFERED,SYNCHRONOUS,READY) + * @param comm (IN) Communicator. + * @param request (OUT) Request handle. + * @return OMPI_SUCCESS or failure status. + */ +typedef int (*mca_part_base_module_psend_init_fn_t)( + const void *buf, + size_t parts, + size_t count, + struct ompi_datatype_t *datatype, + int dst, + int tag, + struct ompi_communicator_t* comm, + struct ompi_info_t * info, + struct ompi_request_t **request +); + +/** + * Initiate one or more partitioned requests. + * + * @param count (IN) Number of requests + * @param requests (IN/OUT) Array of persistent requests + * @return OMPI_SUCCESS or failure status. + */ +typedef ompi_request_start_fn_t mca_part_base_module_start_fn_t; + +/** + * Mark a range of partitions ready in a partitioned send request. + * + * @param min_part Minimum partition to mark ready for transfer. + * @param max_part Maximum partition to mark ready for transfer. + * @param request (IN/OUT) Request + * @return OMPI_SUCCESS or failure status. + * + */ +typedef int (*mca_part_base_module_pready_fn_t)( + size_t min_part, + size_t max_part, + struct ompi_request_t* request +); + +/** + * Check a range of partitions in a partitioned receive request. + * + * @param min_part Minimum partition to check. + * @param max_part Maximum partition to check. + * @param flag Flag for completion of entire range. + * @param request (IN/OUT) Request + * @return OMPI_SUCCESS or failure status. + * + */ +typedef int (*mca_part_base_module_parrived_fn_t)( + size_t min_part, + size_t max_part, + int* flag, + struct ompi_request_t* request +); + +/** + * PART instance. + */ + +struct mca_part_base_module_1_0_1_t { + + /* downcalls from MCA to PART */ + mca_part_base_module_progress_fn_t part_progress; + + /* downcalls from MPI to PART */ + mca_part_base_module_precv_init_fn_t part_precv_init; + mca_part_base_module_psend_init_fn_t part_psend_init; + mca_part_base_module_start_fn_t part_start; + mca_part_base_module_pready_fn_t part_pready; + mca_part_base_module_parrived_fn_t part_parrived; + /* diagnostics */ + + /* FT Event */ + + /* maximum constant sizes */ +}; +typedef struct mca_part_base_module_1_0_1_t mca_part_base_module_1_0_1_t; +typedef mca_part_base_module_1_0_1_t mca_part_base_module_t; + +/* + * Macro for use in components that are of type part + */ +#define MCA_PART_BASE_VERSION_2_0_0 \ + OMPI_MCA_BASE_VERSION_2_1_0("part", 4, 0, 0) + +OMPI_DECLSPEC extern mca_part_base_module_t mca_part; + +END_C_DECLS +#endif /* MCA_PART_H */ diff --git a/ompi/mca/part/persist/Makefile.am b/ompi/mca/part/persist/Makefile.am new file mode 100644 index 00000000000..fab2975e92b --- /dev/null +++ b/ompi/mca/part/persist/Makefile.am @@ -0,0 +1,53 @@ +# +# Copyright (c) 2004-2006 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# Make the output library in this directory, and name it either +# mca__.la (for DSO builds) or libmca__.la +# (for static builds). + +EXTRA_DIST = post_configure.sh + +if MCA_BUILD_ompi_part_persist_DSO +component_noinst = +component_install = mca_part_persist.la +else +component_noinst = libmca_part_persist.la +component_install = +endif + +local_sources = \ + part_persist.c \ + part_persist.h \ + part_persist_component.c \ + part_persist_component.h \ + part_persist_recvreq.h \ + part_persist_recvreq.c \ + part_persist_request.h \ + part_persist_request.c \ + part_persist_sendreq.h \ + part_persist_sendreq.c + +mcacomponentdir = $(ompilibdir) +mcacomponent_LTLIBRARIES = $(component_install) +mca_part_persist_la_SOURCES = $(local_sources) +mca_part_persist_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \ + $(part_persist_LIBS) +mca_part_persist_la_LDFLAGS = -module -avoid-version $(part_persist_LDFLAGS) + +noinst_LTLIBRARIES = $(component_noinst) +libmca_part_persist_la_SOURCES = $(local_sources) +libmca_part_persist_la_LIBADD = $(part_persist_LIBS) +libmca_part_persist_la_LDFLAGS = -module -avoid-version $(part_persist_LDFLAGS) + diff --git a/ompi/mca/part/persist/part_persist.c b/ompi/mca/part/persist/part_persist.c new file mode 100644 index 00000000000..b90a180a601 --- /dev/null +++ b/ompi/mca/part/persist/part_persist.c @@ -0,0 +1,47 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2011-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/communicator/communicator.h" +#include "ompi/mca/part/base/part_base_prequest.h" +#include "ompi/mca/part/base/base.h" + +#include "ompi/mca/part/persist/part_persist.h" +#include "ompi/mca/part/persist/part_persist_sendreq.h" +#include "ompi/mca/part/persist/part_persist_recvreq.h" + +ompi_part_persist_t ompi_part_persist = { + .super = { + .part_progress = mca_part_persist_progress, + .part_precv_init = mca_part_persist_precv_init, + .part_psend_init = mca_part_persist_psend_init, + .part_start = mca_part_persist_start, + .part_pready = mca_part_persist_pready, + .part_parrived = mca_part_persist_parrived, + } +}; + + +OBJ_CLASS_INSTANCE(mca_part_persist_list_t, + opal_list_item_t, + NULL, + NULL); + diff --git a/ompi/mca/part/persist/part_persist.h b/ompi/mca/part/persist/part_persist.h new file mode 100644 index 00000000000..939aae99696 --- /dev/null +++ b/ompi/mca/part/persist/part_persist.h @@ -0,0 +1,599 @@ +/* + * Copyright (c) 2004-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 Intel, Inc. All rights reserved + * Copyright (c) 2019-2021 The University of Tennessee at Chattanooga and The University + * of Tennessee Research Foundation. All rights reserved. + * Copyright (c) 2019-2021 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 University of Alabama at Birmingham. All rights reserved. + * Copyright (c) 2021 Tennessee Technological University. All rights reserved. + * Copyright (c) 2021 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PART_PERSIST_H +#define PART_PERSIST_H + +#ifdef HAVE_ALLOCA_H +#include +#endif + +#include + +#include "ompi_config.h" +#include "ompi/request/request.h" +#include "ompi/mca/part/part.h" +#include "ompi/mca/part/base/base.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/communicator/communicator.h" +#include "ompi/request/request.h" +#include "opal/sys/atomic.h" + +#include "ompi/mca/part/persist/part_persist_request.h" +#include "ompi/mca/part/base/part_base_precvreq.h" +#include "ompi/mca/part/persist/part_persist_recvreq.h" +#include "ompi/mca/part/persist/part_persist_sendreq.h" +#include "ompi/message/message.h" +#include "ompi/mca/pml/pml.h" +BEGIN_C_DECLS + +typedef struct mca_part_persist_list_t { + opal_list_item_t super; + mca_part_persist_request_t *item; +} mca_part_persist_list_t; + +OPAL_DECLSPEC OBJ_CLASS_DECLARATION(mca_part_persist_list_t); + + +struct ompi_part_persist_t { + mca_part_base_module_t super; + int free_list_num; + int free_list_max; + int free_list_inc; + opal_list_t *progress_list; + + int32_t next_send_tag; /**< This is a counter for send tags for the actual data transfer. */ + int32_t next_recv_tag; + ompi_communicator_t *part_comm; /* This approach requires a separate tag space, so we need a dedicated communicator. */ + ompi_request_t *part_comm_req; + int32_t part_comm_ready; + ompi_communicator_t *part_comm_setup; /* We create a second communicator to send set-up messages (rational: these + messages go in the opposite direction of normal messages, need to use MPI_ANY_SOURCE + to support different communicators, and thus need to have a unique tag. Because tags + are controled by the sender in this model, we cannot assume that the tag will be + unused in part_comm. */ + ompi_request_t *part_comm_sreq; + int32_t part_comm_sready; + int32_t init_comms; + int32_t init_world; + int32_t my_world_rank; /* Because the back end communicators use a world rank, we need to communicate ours + to set up the requests. */ + opal_atomic_int32_t block_entry; + opal_mutex_t lock; +}; +typedef struct ompi_part_persist_t ompi_part_persist_t; +extern ompi_part_persist_t ompi_part_persist; + + +/** + * This is a helper function that frees a request. This requires ompi_part_persist.lock be held before calling. + */ +__opal_attribute_always_inline__ static inline int +mca_part_persist_free_req(struct mca_part_persist_request_t* req) +{ + int err = OMPI_SUCCESS; + size_t i; + opal_list_remove_item(ompi_part_persist.progress_list, (opal_list_item_t*)req->progress_elem); + OBJ_RELEASE(req->progress_elem); + + for(i = 0; i < req->real_parts; i++) { + ompi_request_free(&(req->persist_reqs[i])); + } + free(req->persist_reqs); + free(req->flags); + + if( MCA_PART_PERSIST_REQUEST_PRECV == req->req_type ) { + MCA_PART_PERSIST_PRECV_REQUEST_RETURN(req); + } else { + MCA_PART_PERSIST_PSEND_REQUEST_RETURN(req); + } + return err; +} + + +__opal_attribute_always_inline__ static inline void mca_part_persist_init_lists(void) +{ + opal_free_list_init (&mca_part_base_precv_requests, + sizeof(mca_part_persist_precv_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_part_persist_precv_request_t), + 0,opal_cache_line_size, + ompi_part_persist.free_list_num, + ompi_part_persist.free_list_max, + ompi_part_persist.free_list_inc, + NULL, 0, NULL, NULL, NULL); + opal_free_list_init (&mca_part_base_psend_requests, + sizeof(mca_part_persist_psend_request_t), + opal_cache_line_size, + OBJ_CLASS(mca_part_persist_psend_request_t), + 0,opal_cache_line_size, + ompi_part_persist.free_list_num, + ompi_part_persist.free_list_max, + ompi_part_persist.free_list_inc, + NULL, 0, NULL, NULL, NULL); + ompi_part_persist.progress_list = OBJ_NEW(opal_list_t); +} + +__opal_attribute_always_inline__ static inline void +mca_part_persist_complete(struct mca_part_persist_request_t* request) +{ + if(MCA_PART_PERSIST_REQUEST_PRECV == request->req_type) { + request->req_ompi.req_status.MPI_SOURCE = request->req_peer; + } else { + request->req_ompi.req_status.MPI_SOURCE = request->req_comm->c_my_rank; + } + request->req_ompi.req_complete_cb = NULL; + request->req_ompi.req_status.MPI_TAG = request->req_tag; + request->req_ompi.req_status._ucount = request->req_bytes; + request->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; + request->req_part_complete = true; + ompi_request_complete(&(request->req_ompi), true ); +} + +/** + * mca_part_persist_progress is the progress function that will be registered. It handles + * both send and recv request testing and completion. It also handles freeing requests, + * after MPI_Free is called and the requests have become inactive. + */ +__opal_attribute_always_inline__ static inline int +mca_part_persist_progress(void) +{ + mca_part_persist_list_t *current; + int err; + size_t i; + + /* prevent re-entry, */ + int block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), 1); + if(1 < block_entry) + { + block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1); + return OMPI_SUCCESS; + } + + OPAL_THREAD_LOCK(&ompi_part_persist.lock); + + mca_part_persist_request_t* to_delete = NULL; + + /* Don't do anything till a function in the module is called. */ + if(-1 == ompi_part_persist.init_world) + { + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1); + return OMPI_SUCCESS; + } + + /* Can't do anything if we don't have world */ + if(0 == ompi_part_persist.init_world) { + ompi_part_persist.my_world_rank = ompi_comm_rank(&ompi_mpi_comm_world.comm); + err = ompi_comm_idup(&ompi_mpi_comm_world.comm, &ompi_part_persist.part_comm, &ompi_part_persist.part_comm_req); + if(err != OMPI_SUCCESS) { + exit(-1); + } + ompi_part_persist.part_comm_ready = 0; + err = ompi_comm_idup(&ompi_mpi_comm_world.comm, &ompi_part_persist.part_comm_setup, &ompi_part_persist.part_comm_sreq); + if(err != OMPI_SUCCESS) { + exit(-1); + } + ompi_part_persist.part_comm_sready = 0; + ompi_part_persist.init_world = 1; + + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1); + return OMPI_SUCCESS; + } + + /* Check to see if Comms are setup */ + if(0 == ompi_part_persist.init_comms) { + if(0 == ompi_part_persist.part_comm_ready) { + ompi_request_test(&ompi_part_persist.part_comm_req, &ompi_part_persist.part_comm_ready, MPI_STATUS_IGNORE); + } + if(0 == ompi_part_persist.part_comm_sready) { + ompi_request_test(&ompi_part_persist.part_comm_sreq, &ompi_part_persist.part_comm_sready, MPI_STATUS_IGNORE); + } + if(0 != ompi_part_persist.part_comm_ready && 0 != ompi_part_persist.part_comm_sready) { + ompi_part_persist.init_comms = 1; + } + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1); + return OMPI_SUCCESS; + } + + OPAL_LIST_FOREACH(current, ompi_part_persist.progress_list, mca_part_persist_list_t) { + mca_part_persist_request_t *req = (mca_part_persist_request_t *) current->item; + + /* Check to see if request is initilaized */ + if(false == req->initialized) { + int done = 0; + + if(true == req->flag_post_setup_recv) { + err = MCA_PML_CALL(irecv(&(req->setup_info[1]), sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, OMPI_ANY_SOURCE, req->my_recv_tag, ompi_part_persist.part_comm_setup, &req->setup_req[1])); + req->flag_post_setup_recv = false; + } + + ompi_request_test(&(req->setup_req[1]), &done, MPI_STATUS_IGNORE); + + if(done) { + size_t dt_size_; + int32_t dt_size; + + req->initialized = true; + + if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) { + /* parse message */ + req->world_peer = req->setup_info[1].world_rank; + + err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + dt_size = (dt_size_ > (size_t) INT_MAX) ? MPI_UNDEFINED : (int) dt_size_; + int32_t bytes = req->real_count * dt_size; + + /* Set up persistant sends */ + req->persist_reqs = (ompi_request_t**) malloc(sizeof(ompi_request_t*)*(req->real_parts)); + for(i = 0; i < req->real_parts; i++) { + void *buf = ((void*) (((char*)req->req_addr) + (bytes * i))); + err = MCA_PML_CALL(isend_init(buf, req->real_count, req->req_datatype, req->world_peer, req->my_send_tag+i, MCA_PML_BASE_SEND_STANDARD, ompi_part_persist.part_comm, &(req->persist_reqs[i]))); + } + } else { + /* parse message */ + req->world_peer = req->setup_info[1].world_rank; + req->my_send_tag = req->setup_info[1].start_tag; + req->my_recv_tag = req->setup_info[1].setup_tag; + req->real_parts = req->setup_info[1].num_parts; + req->real_count = req->setup_info[1].count; + + err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + dt_size = (dt_size_ > (size_t) INT_MAX) ? MPI_UNDEFINED : (int) dt_size_; + int32_t bytes = req->real_count * dt_size; + + /* Set up persistant sends */ + req->persist_reqs = (ompi_request_t**) malloc(sizeof(ompi_request_t*)*(req->real_parts)); + req->flags = (int*) calloc(req->real_parts,sizeof(int)); + for(i = 0; i < req->real_parts; i++) { + void *buf = ((void*) (((char*)req->req_addr) + (bytes * i))); + err = MCA_PML_CALL(irecv_init(buf, req->real_count, req->req_datatype, req->world_peer, req->my_send_tag+i, ompi_part_persist.part_comm, &(req->persist_reqs[i]))); + } + err = req->persist_reqs[0]->req_start(req->real_parts, (&(req->persist_reqs[0]))); + + /* Send back a message */ + req->setup_info[0].world_rank = ompi_part_persist.my_world_rank; + err = MCA_PML_CALL(isend(&(req->setup_info[0]), sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, req->world_peer, req->my_recv_tag, MCA_PML_BASE_SEND_STANDARD, ompi_part_persist.part_comm_setup, &req->setup_req[0])); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + } + } + } else { + if(false == req->req_part_complete && REQUEST_COMPLETED != req->req_ompi.req_complete && OMPI_REQUEST_ACTIVE == req->req_ompi.req_state) { + for(i = 0; i < req->real_parts; i++) { + + /* Check to see if partition is queued for being started. Only applicable to sends. */ + if(-2 == req->flags[i]) { + err = req->persist_reqs[i]->req_start(1, (&(req->persist_reqs[i]))); + req->flags[i] = 0; + } + + if(0 == req->flags[i]) + { + ompi_request_test(&(req->persist_reqs[i]), &(req->flags[i]), MPI_STATUS_IGNORE); + if(0 != req->flags[i]) req->done_count++; + } + } + + /* Check for completion and complete the requests */ + if(req->done_count == req->real_parts) + { + req->first_send = false; + mca_part_persist_complete(req); + } + } + + if(true == req->req_free_called && true == req->req_part_complete && REQUEST_COMPLETED == req->req_ompi.req_complete && OMPI_REQUEST_INACTIVE == req->req_ompi.req_state) { + to_delete = req; + } + } + + } + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1); + if(to_delete) { + err = mca_part_persist_free_req(to_delete); + if (OMPI_SUCCESS != err) { + return OMPI_ERROR; + } + } + + return OMPI_SUCCESS; +} + +__opal_attribute_always_inline__ static inline int +mca_part_persist_precv_init(void *buf, + size_t parts, + size_t count, + ompi_datatype_t * datatype, + int src, + int tag, + struct ompi_communicator_t *comm, + struct ompi_info_t * info, + struct ompi_request_t **request) +{ + int err = OMPI_SUCCESS; + size_t dt_size_; + int dt_size; + mca_part_persist_list_t* new_progress_elem = NULL; + + mca_part_persist_precv_request_t *recvreq; + + /* if module hasn't been called before, flag module to init. */ + if(-1 == ompi_part_persist.init_world) + { + ompi_part_persist.init_world = 0; + } + + /* Allocate a new request */ + MCA_PART_PERSIST_PRECV_REQUEST_ALLOC(recvreq); + if (OPAL_UNLIKELY(NULL == recvreq)) return OMPI_ERR_OUT_OF_RESOURCE; + + MCA_PART_PERSIST_PRECV_REQUEST_INIT(recvreq, ompi_proc, comm, tag, src, + datatype, buf, parts, count, flags); + + mca_part_persist_request_t *req = (mca_part_persist_request_t *) recvreq; + + /* Set lazy initializion flags */ + req->initialized = false; + req->first_send = true; + req->flag_post_setup_recv = false; + req->flags = NULL; + /* Non-blocking recive on setup info */ + err = MCA_PML_CALL(irecv(&req->setup_info[1], sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, src, tag, comm, &req->setup_req[1])); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + + /* Compute total number of bytes */ + err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + dt_size = (dt_size_ > (size_t) INT_MAX) ? MPI_UNDEFINED : (int) dt_size_; + req->req_bytes = parts * count * dt_size; + + + /* Set ompi request initial values */ + req->req_ompi.req_persistent = true; + req->req_part_complete = true; + req->req_ompi.req_complete = REQUEST_COMPLETED; + req->req_ompi.req_state = OMPI_REQUEST_INACTIVE; + + /* Add element to progress engine */ + new_progress_elem = OBJ_NEW(mca_part_persist_list_t); + new_progress_elem->item = req; + req->progress_elem = new_progress_elem; + OPAL_THREAD_LOCK(&ompi_part_persist.lock); + opal_list_append(ompi_part_persist.progress_list, (opal_list_item_t*)new_progress_elem); + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + + /* set return values */ + *request = (ompi_request_t*) recvreq; + return err; +} + +__opal_attribute_always_inline__ static inline int +mca_part_persist_psend_init(const void* buf, + size_t parts, + size_t count, + ompi_datatype_t* datatype, + int dst, + int tag, + ompi_communicator_t* comm, + struct ompi_info_t * info, + ompi_request_t** request) +{ + int err = OMPI_SUCCESS; + size_t dt_size_; + int dt_size; + mca_part_persist_list_t* new_progress_elem = NULL; + mca_part_persist_psend_request_t *sendreq; + + /* if module hasn't been called before, flag module to init. */ + if(-1 == ompi_part_persist.init_world) + { + ompi_part_persist.init_world = 0; + } + + /* Create new request object */ + MCA_PART_PERSIST_PSEND_REQUEST_ALLOC(sendreq, comm, dst, ompi_proc); + if (OPAL_UNLIKELY(NULL == sendreq)) return OMPI_ERR_OUT_OF_RESOURCE; + MCA_PART_PERSIST_PSEND_REQUEST_INIT(sendreq, ompi_proc, comm, tag, dst, + datatype, buf, parts, count, flags); + mca_part_persist_request_t *req = (mca_part_persist_request_t *) sendreq; + + /* Set lazy initialization variables */ + req->initialized = false; + req->first_send = true; + + + /* Determine total bytes to send. */ + err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + dt_size = (dt_size_ > (size_t) INT_MAX) ? MPI_UNDEFINED : (int) dt_size_; + req->req_bytes = parts * count * dt_size; + + + + /* non-blocking send set-up data */ + req->setup_info[0].world_rank = ompi_comm_rank(&ompi_mpi_comm_world.comm); + req->setup_info[0].start_tag = ompi_part_persist.next_send_tag; ompi_part_persist.next_send_tag += parts; + req->my_send_tag = req->setup_info[0].start_tag; + req->setup_info[0].setup_tag = ompi_part_persist.next_recv_tag; ompi_part_persist.next_recv_tag++; + req->my_recv_tag = req->setup_info[0].setup_tag; + req->setup_info[0].num_parts = parts; + req->real_parts = parts; + req->setup_info[0].count = count; + req->real_count = count; + + + req->flags = (int*) calloc(req->real_parts, sizeof(int)); + + err = MCA_PML_CALL(isend(&(req->setup_info[0]), sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, dst, tag, MCA_PML_BASE_SEND_STANDARD, comm, &req->setup_req[0])); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + + /* Non-blocking recive on setup info */ + if(1 == ompi_part_persist.init_comms) { + err = MCA_PML_CALL(irecv(&(req->setup_info[1]), sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, MPI_ANY_SOURCE, req->my_recv_tag, ompi_part_persist.part_comm_setup, &req->setup_req[1])); + if(OMPI_SUCCESS != err) return OMPI_ERROR; + req->flag_post_setup_recv = false; + } else { + req->flag_post_setup_recv = true; + } + + /* Initilaize completion variables */ + sendreq->req_base.req_ompi.req_persistent = true; + req->req_part_complete = true; + req->req_ompi.req_complete = REQUEST_COMPLETED; + req->req_ompi.req_state = OMPI_REQUEST_INACTIVE; + + /* add element to progress queue */ + new_progress_elem = OBJ_NEW(mca_part_persist_list_t); + new_progress_elem->item = req; + req->progress_elem = new_progress_elem; + OPAL_THREAD_LOCK(&ompi_part_persist.lock); + opal_list_append(ompi_part_persist.progress_list, (opal_list_item_t*)new_progress_elem); + OPAL_THREAD_UNLOCK(&ompi_part_persist.lock); + + /* Set return values */ + *request = (ompi_request_t*) sendreq; + return err; +} + +__opal_attribute_always_inline__ static inline int +mca_part_persist_start(size_t count, ompi_request_t** requests) +{ + int err = OMPI_SUCCESS; + size_t _count = count; + size_t i; + + for(i = 0; i < _count && OMPI_SUCCESS == err; i++) { + mca_part_persist_request_t *req = (mca_part_persist_request_t *)(requests[i]); + /* First use is a special case, to support lazy initialization */ + if(false == req->first_send) + { + if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) { + req->done_count = 0; + memset((void*)req->flags,0,sizeof(int32_t)*req->real_parts); + } else { + req->done_count = 0; + err = req->persist_reqs[0]->req_start(req->real_parts, req->persist_reqs); + memset((void*)req->flags,0,sizeof(int32_t)*req->real_parts); + } + } else { + if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) { + req->done_count = 0; + for(i = 0; i < req->real_parts && OMPI_SUCCESS == err; i++) { + req->flags[i] = -1; + } + } else { + req->done_count = 0; + } + } + req->req_ompi.req_state = OMPI_REQUEST_ACTIVE; + req->req_ompi.req_status.MPI_TAG = MPI_ANY_TAG; + req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; + req->req_ompi.req_status._cancelled = 0; + req->req_part_complete = false; + req->req_ompi.req_complete = false; + OPAL_ATOMIC_SWAP_PTR(&req->req_ompi.req_complete, REQUEST_PENDING); + } + + return err; +} + +__opal_attribute_always_inline__ static inline int +mca_part_persist_pready(size_t min_part, + size_t max_part, + ompi_request_t* request) +{ + int err = OMPI_SUCCESS; + size_t i; + + mca_part_persist_request_t *req = (mca_part_persist_request_t *)(request); + if(true == req->initialized) + { + err = req->persist_reqs[min_part]->req_start(max_part-min_part+1, (&(req->persist_reqs[min_part]))); + for(i = min_part; i <= max_part && OMPI_SUCCESS == err; i++) { + req->flags[i] = 0; /* Mark partion as ready for testing */ + } + } + else + { + for(i = min_part; i <= max_part && OMPI_SUCCESS == err; i++) { + req->flags[i] = -2; /* Mark partition as queued */ + } + } + return err; +} + +__opal_attribute_always_inline__ static inline int +mca_part_persist_parrived(size_t min_part, + size_t max_part, + int* flag, + ompi_request_t* request) +{ + int err = OMPI_SUCCESS; + size_t i; + int _flag = false; + mca_part_persist_request_t *req = (mca_part_persist_request_t *)request; + + if(0 != req->flags) { + _flag = 1; + if(req->req_parts == req->real_parts) { + for(i = min_part; i <= max_part; i++) { + _flag = _flag && req->flags[i]; + } + } else { + float convert = ((float)req->real_parts) / ((float)req->req_parts); + size_t _min = floor(convert * min_part); + size_t _max = ceil(convert * max_part); + for(i = _min; i <= _max; i++) { + _flag = _flag && req->flags[i]; + } + } + } + *flag = _flag; + return err; +} + + +/** + * mca_part_persist_free marks an entry as free called and sets the request to + * MPI_REQUEST_NULL. Note: requests get freed in the progress engine. + */ +__opal_attribute_always_inline__ static inline int +mca_part_persist_free(ompi_request_t** request) +{ + mca_part_persist_request_t* req = *(mca_part_persist_request_t**)request; + + if(true == req->req_free_called) return OMPI_ERROR; + req->req_free_called = true; + + *request = MPI_REQUEST_NULL; + return OMPI_SUCCESS; +} + +END_C_DECLS + +#endif /* PART_PERSIST_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/part/persist/part_persist_component.c b/ompi/mca/part/persist/part_persist_component.c new file mode 100644 index 00000000000..919284476b9 --- /dev/null +++ b/ompi/mca/part/persist/part_persist_component.c @@ -0,0 +1,139 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013-2021 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mca/part/persist/part_persist.h" + +#include "ompi/mca/part/persist/part_persist_sendreq.h" +#include "ompi/mca/part/persist/part_persist_recvreq.h" +#include "ompi/mca/part/persist/part_persist_component.h" + +static int mca_part_persist_component_register(void); +static int mca_part_persist_component_open(void); +static int mca_part_persist_component_close(void); +static mca_part_base_module_t* mca_part_persist_component_init( int* priority, + bool enable_progress_threads, bool enable_mpi_threads); +static int mca_part_persist_component_fini(void); + +mca_part_base_component_4_0_0_t mca_part_persist_component = { + /* First, the mca_base_component_t struct containing meta + * information about the component itself */ + + .partm_version = { + MCA_PART_BASE_VERSION_2_0_0, + + .mca_component_name = "persist", + MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, + OMPI_RELEASE_VERSION), + .mca_open_component = mca_part_persist_component_open, + .mca_close_component = mca_part_persist_component_close, + .mca_register_component_params = mca_part_persist_component_register, + }, + .partm_data = { + /* This component is not checkpoint ready */ + MCA_BASE_METADATA_PARAM_NONE + }, + + .partm_init = mca_part_persist_component_init, + .partm_finalize = mca_part_persist_component_fini, +}; + +static int +mca_part_persist_component_register(void) +{ + ompi_part_persist.free_list_num = 4; + (void) mca_base_component_var_register(&mca_part_persist_component.partm_version, "free_list_num", + "Initial size of request free lists", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &ompi_part_persist.free_list_num); + + ompi_part_persist.free_list_max = -1; + (void) mca_base_component_var_register(&mca_part_persist_component.partm_version, "free_list_max", + "Maximum size of request free lists", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &ompi_part_persist.free_list_max); + + ompi_part_persist.free_list_inc = 64; + (void) mca_base_component_var_register(&mca_part_persist_component.partm_version, "free_list_inc", + "Number of elements to add when growing request free lists", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &ompi_part_persist.free_list_inc); + + + return OPAL_SUCCESS; +} + +static int +mca_part_persist_component_open(void) +{ + OBJ_CONSTRUCT(&ompi_part_persist.lock, opal_mutex_t); + + ompi_part_persist.next_send_tag = 0; /**< This is a counter for send tags for the actual data transfer. */ + ompi_part_persist.next_recv_tag = 0; + + mca_part_persist_init_lists(); + + ompi_part_persist.init_comms = 0; + ompi_part_persist.init_world = -1; + + ompi_part_persist.part_comm_ready = 0; + ompi_part_persist.part_comm_ready = 0; + + ompi_part_persist.block_entry = 0; + return OMPI_SUCCESS; +} + + +static int +mca_part_persist_component_close(void) +{ + OBJ_DESTRUCT(&ompi_part_persist.lock); + return OMPI_SUCCESS; +} + + +static mca_part_base_module_t* +mca_part_persist_component_init(int* priority, + bool enable_progress_threads, + bool enable_mpi_threads) +{ + *priority = 1; + + opal_output_verbose( 10, 0, + "in persist part priority is %d\n", *priority); + + return &ompi_part_persist.super; +} + + +static int +mca_part_persist_component_fini(void) +{ + return OMPI_SUCCESS; +} + diff --git a/ompi/mca/part/persist/part_persist_component.h b/ompi/mca/part/persist/part_persist_component.h new file mode 100644 index 00000000000..c25def5d78b --- /dev/null +++ b/ompi/mca/part/persist/part_persist_component.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 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) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + */ + +#ifndef MCA_PART_RMA_COMPONENT_H +#define MCA_PART_RMA_COMPONENT_H + +BEGIN_C_DECLS + +/* + * PART module functions. + */ +OMPI_MODULE_DECLSPEC extern mca_part_base_component_4_0_0_t mca_part_rma_component; + +END_C_DECLS + +#endif diff --git a/ompi/mca/part/persist/part_persist_recvreq.c b/ompi/mca/part/persist/part_persist_recvreq.c new file mode 100644 index 00000000000..f66bf96a78f --- /dev/null +++ b/ompi/mca/part/persist/part_persist_recvreq.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mca/part/persist/part_persist.h" +#include "ompi/mca/part/persist/part_persist_recvreq.h" + + +static void +mca_part_persist_precv_request_construct(mca_part_persist_precv_request_t* recvreq) +{ + recvreq->req_base.req_ompi.req_start = mca_part_persist_start; + recvreq->req_base.req_ompi.req_free = mca_part_persist_free; + recvreq->req_base.req_ompi.req_cancel = NULL; + recvreq->req_base.req_ompi.req_persistent = true; + OBJ_CONSTRUCT( &(recvreq->req_base.req_convertor), opal_convertor_t ); +} + + +OBJ_CLASS_INSTANCE(mca_part_persist_precv_request_t, + mca_part_persist_request_t, + mca_part_persist_precv_request_construct, + NULL); + diff --git a/ompi/mca/part/persist/part_persist_recvreq.h b/ompi/mca/part/persist/part_persist_recvreq.h new file mode 100644 index 00000000000..f1d70e1bc8b --- /dev/null +++ b/ompi/mca/part/persist/part_persist_recvreq.h @@ -0,0 +1,103 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2013 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2012-2021 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2017 Intel, Inc. All rights reserved + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PART_PERSIST_RECVREQ_H +#define PART_PERSIST_RECVREQ_H + +#include "ompi/mca/part/persist/part_persist_request.h" +#include "ompi/mca/part/base/part_base_precvreq.h" + +struct mca_part_persist_precv_request_t { + mca_part_persist_request_t req_base; +}; +typedef struct mca_part_persist_precv_request_t mca_part_persist_precv_request_t; +OBJ_CLASS_DECLARATION(mca_part_persist_precv_request_t); + +/** + * Allocate a recv request from the modules free list. + * + * @param rc (OUT) OMPI_SUCCESS or error status on failure. + * @return Receive request. + */ +#define MCA_PART_PERSIST_PRECV_REQUEST_ALLOC(precvreq) \ +do { \ + precvreq = (mca_part_persist_precv_request_t*) \ + opal_free_list_get (&mca_part_base_precv_requests); \ + precvreq->req_base.req_type = MCA_PART_PERSIST_REQUEST_PRECV; \ + } while (0) + +/** + * Initialize a receive request with call parameters. + * + * @param request (IN) Receive request. + * @param addr (IN) User buffer. + * @param count (IN) Number of elements of indicated datatype. + * @param datatype (IN) User defined datatype. + * @param src (IN) Source rank w/in the communicator. + * @param comm (IN) Communicator. + * @param persistent (IN) Is this a ersistent request. + */ +#define MCA_PART_PERSIST_PRECV_REQUEST_INIT( request, \ + ompi_proc, \ + comm, \ + tag, \ + src, \ + datatype, \ + addr, \ + parts, \ + count, \ + flags ) \ +do { \ + OBJ_RETAIN(comm); \ + OMPI_DATATYPE_RETAIN(datatype); \ + (request)->req_base.req_comm = comm; \ + (request)->req_base.req_datatype = datatype; \ + (request)->req_base.req_ompi.req_mpi_object.comm = comm; \ + (request)->req_base.req_ompi.req_status.MPI_SOURCE = src; \ + (request)->req_base.req_ompi.req_status.MPI_TAG = tag; \ + (request)->req_base.req_part_complete = true; \ + (request)->req_base.req_ompi.req_status._ucount = count; \ + (request)->req_base.req_free_called = false; \ + (request)->req_base.req_addr = addr; /**< pointer to application buffer */\ + (request)->req_base.req_parts = parts; /**< number of partitions */\ + (request)->req_base.req_count = count; /**< count of user datatype elements */\ + (request)->req_base.req_peer = src; /**< peer process - rank w/in this communicator */\ + (request)->req_base.req_tag = tag; \ +} while(0) + +/** + * Free the PART receive request + */ +#define MCA_PART_PERSIST_PRECV_REQUEST_RETURN(recvreq) \ +{ \ + OBJ_RELEASE((recvreq)->req_comm); \ + OMPI_DATATYPE_RELEASE((recvreq)->req_datatype); \ + OMPI_REQUEST_FINI(&(recvreq)->req_ompi); \ + opal_convertor_cleanup( &((recvreq)->req_convertor) ); \ + opal_free_list_return ( &mca_part_base_precv_requests, \ + (opal_free_list_item_t*)(recvreq)); \ +} + +#endif + + diff --git a/ompi/mca/part/persist/part_persist_request.c b/ompi/mca/part/persist/part_persist_request.c new file mode 100644 index 00000000000..56362f35656 --- /dev/null +++ b/ompi/mca/part/persist/part_persist_request.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mca/part/persist/part_persist.h" +#include "ompi/mca/part/persist/part_persist_request.h" + + +static void mca_part_persist_request_construct( mca_part_persist_request_t* req) { + OBJ_CONSTRUCT(&req->req_convertor, opal_convertor_t); + req->req_ompi.req_type = OMPI_REQUEST_PART; +} + +static void mca_part_persist_request_destruct( mca_part_persist_request_t* req) { + OBJ_DESTRUCT(&req->req_convertor); +} + +OBJ_CLASS_INSTANCE(mca_part_persist_request_t, + ompi_request_t, + mca_part_persist_request_construct, + mca_part_persist_request_destruct); diff --git a/ompi/mca/part/persist/part_persist_request.h b/ompi/mca/part/persist/part_persist_request.h new file mode 100644 index 00000000000..368e4ab84e2 --- /dev/null +++ b/ompi/mca/part/persist/part_persist_request.h @@ -0,0 +1,103 @@ +/* + * 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2017 Intel, Inc. All rights reserved + * Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PART_PERSIST_REQUEST_H +#define PART_PERSIST_REQUEST_H + +#include "ompi/mca/part/base/part_base_psendreq.h" +#include "ompi/mca/part/part.h" +#include "opal/sys/atomic.h" +/** + * Type of request. + */ +typedef enum { + MCA_PART_PERSIST_REQUEST_PSEND, + MCA_PART_PERSIST_REQUEST_PRECV, + MCA_PART_PERSIST_REQUEST_NULL +} mca_part_persist_request_type_t; + +struct mca_part_persist_list_t; + +struct ompi_mca_persist_setup_t { + int world_rank; + int start_tag; + int setup_tag; + size_t num_parts; + size_t count; +}; + + +/** + * Base type for PART PERSIST requests + */ +struct mca_part_persist_request_t { + +/* START: These fields have to match the definition of the mca_part_persist_request_t */ + ompi_request_t req_ompi; /**< base request */ + volatile int32_t req_part_complete; /**< flag indicating if the pt-2-pt layer is done with this request */ + volatile int32_t req_free_called; /**< flag indicating if the user has freed this request */ + mca_part_persist_request_type_t req_type; /**< MPI request type - used for test */ + struct ompi_communicator_t *req_comm; /**< communicator pointer */ + struct ompi_datatype_t *req_datatype; /**< pointer to data type */ + opal_convertor_t req_convertor; /**< always need the convertor */ + + const void *req_addr; /**< pointer to application buffer */ + size_t req_parts; /**< number of partitions */ + size_t req_count; /**< count of user datatype elements */ + int32_t req_peer; /**< peer process - rank w/in this communicator */ + int32_t req_tag; /**< user defined tag */ + struct ompi_proc_t* req_proc; /**< peer process */ + +/* END: These fields have to match the definition of the mca_part_persist_request_t */ + + size_t req_bytes; /**< bytes for completion status */ + + size_t real_parts; /**< internal number of partitions */ + size_t real_count; + size_t part_size; + + ompi_request_t** persist_reqs; /**< requests for persistant sends/recvs */ + ompi_request_t* setup_req [2]; /**< Request structure for setup messages */ + + + int32_t req_partitions_send; /**< Send side number of partitions */ + int32_t req_partitions_recv; /**< Recv side number of partitions */ + + int32_t my_send_tag; /**< This is a counter for send tags for the actual data transfer. */ + int32_t my_recv_tag; /**< This is a counter for recive tags, for incoming setup messages. */ + + int32_t world_peer; /**< peer's rank in MPI_COMM_WORLD */ + + int32_t initialized; /**< flag for initialized state */ + int32_t first_send; /**< flag for whether the first send has happend */ + int32_t flag_post_setup_recv; + size_t done_count; /**< counter for the number of partitions marked ready */ + + int32_t *flags; /**< array of flags to determine whether a partition has arrived */ + + struct ompi_mca_persist_setup_t setup_info[2]; /**< Setup info to send durring initialization. */ + + struct mca_part_persist_list_t* progress_elem; /**< pointer to progress list element for removal durring free. */ + +}; +typedef struct mca_part_persist_request_t mca_part_persist_request_t; +OBJ_CLASS_DECLARATION(mca_part_persist_request_t); + +#endif diff --git a/ompi/mca/part/persist/part_persist_sendreq.c b/ompi/mca/part/persist/part_persist_sendreq.c new file mode 100644 index 00000000000..b4526bd16e3 --- /dev/null +++ b/ompi/mca/part/persist/part_persist_sendreq.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mca/part/persist/part_persist.h" +#include "ompi/mca/part/persist/part_persist_sendreq.h" + + +static void mca_part_persist_psend_request_construct(mca_part_persist_psend_request_t* sendreq) +{ + /* no need to reinit for every send -- never changes */ + sendreq->req_base.req_ompi.req_start = mca_part_persist_start; + sendreq->req_base.req_ompi.req_free = mca_part_persist_free; + sendreq->req_base.req_ompi.req_persistent = true; + sendreq->req_base.req_ompi.req_cancel = NULL; +} + +OBJ_CLASS_INSTANCE(mca_part_persist_psend_request_t, + mca_part_persist_request_t, + mca_part_persist_psend_request_construct, + NULL); + diff --git a/ompi/mca/part/persist/part_persist_sendreq.h b/ompi/mca/part/persist/part_persist_sendreq.h new file mode 100644 index 00000000000..9a7be5af8ac --- /dev/null +++ b/ompi/mca/part/persist/part_persist_sendreq.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2013 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-2006 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 Intel, Inc. All rights reserved + * Copyright (c) 2020-2021 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PART_PERSIST_PSENDREQ_H +#define PART_PERSIST_PSENDREQ_H + +#include "ompi/mca/part/persist/part_persist_request.h" +#include "ompi/mca/part/base/part_base_psendreq.h" +#include "ompi/mca/part/part.h" +#include "opal/prefetch.h" + +struct mca_part_persist_psend_request_t { + mca_part_persist_request_t req_base; +}; +typedef struct mca_part_persist_psend_request_t mca_part_persist_psend_request_t; +OBJ_CLASS_DECLARATION(mca_part_persist_psend_request_t); + + +#define MCA_PART_PERSIST_PSEND_REQUEST_ALLOC(sendreq, comm, dst, \ + ompi_proc) \ +do { \ + sendreq = (mca_part_persist_psend_request_t*) \ + opal_free_list_wait (&mca_part_base_psend_requests); \ + sendreq->req_base.req_type = MCA_PART_PERSIST_REQUEST_PSEND; \ +} while(0) + +#define MCA_PART_PERSIST_PSEND_REQUEST_INIT( req_send, \ + ompi_proc, \ + comm, \ + tag, \ + dst, \ + datatype, \ + buf, \ + parts, \ + count, \ + flags ) \ + do { \ + OMPI_REQUEST_INIT(&(sendreq->req_base.req_ompi), \ + false); \ + OBJ_RETAIN(comm); \ + OMPI_DATATYPE_RETAIN(datatype); \ + (req_send)->req_base.req_comm = comm; \ + (req_send)->req_base.req_datatype = datatype; \ + (req_send)->req_base.req_ompi.req_mpi_object.comm = comm; \ + (req_send)->req_base.req_ompi.req_status.MPI_SOURCE = \ + comm->c_my_rank; \ + (req_send)->req_base.req_ompi.req_status.MPI_TAG = tag; \ + (req_send)->req_base.req_part_complete = true; \ + (req_send)->req_base.req_ompi.req_status._ucount = count; \ + (req_send)->req_base.req_free_called = false; \ + (req_send)->req_base.req_addr = buf; /**< pointer to application buffer */\ + (req_send)->req_base.req_parts = parts; /**< number of partitions */\ + (req_send)->req_base.req_count = count; /**< count of user datatype elements */\ + (req_send)->req_base.req_peer = dst; /**< peer process - rank w/in this communicator */\ + (req_send)->req_base.req_tag = tag; /**< user defined tag */\ + } while(0) + +/* + * Release resources associated with a request + */ +#define MCA_PART_PERSIST_PSEND_REQUEST_RETURN(sendreq) \ + { \ + /* Let the base handle the reference counts */ \ + OMPI_DATATYPE_RETAIN(sendreq->req_datatype); \ + OBJ_RELEASE(sendreq->req_comm); \ + OMPI_REQUEST_FINI(&sendreq->req_ompi); \ + opal_convertor_cleanup( &(sendreq->req_convertor) ); \ + opal_free_list_return ( &mca_part_base_psend_requests, \ + (opal_free_list_item_t*)sendreq); \ + } + +#endif diff --git a/ompi/mca/part/persist/post_configure.sh b/ompi/mca/part/persist/post_configure.sh new file mode 100644 index 00000000000..d06ec572027 --- /dev/null +++ b/ompi/mca/part/persist/post_configure.sh @@ -0,0 +1 @@ +DIRECT_CALL_HEADER="ompi/mca/part/rma/part_rma.h" diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 8d861dc5672..69fdad4d0b1 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -316,8 +316,14 @@ libmpi_c_mpi_la_SOURCES = \ pack_external_size.c \ pack.c \ pack_size.c \ + parrived.c \ pcontrol.c \ + pready.c \ + pready_list.c \ + pready_range.c \ + precv_init.c \ probe.c \ + psend_init.c \ publish_name.c \ query_thread.c \ raccumulate.c \ diff --git a/ompi/mpi/c/parrived.c b/ompi/mpi/c/parrived.c new file mode 100644 index 00000000000..9f2bcf45607 --- /dev/null +++ b/ompi/mpi/c/parrived.c @@ -0,0 +1,64 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Parrived = PMPI_Parrived +#endif +#define MPI_Parrived PMPI_Parrived +#endif + +static const char FUNC_NAME[] = "MPI_Parrived"; + + +int MPI_Parrived(MPI_Request request, MPI_Count partition, int *flag) +{ + int rc; + + SPC_RECORD(OMPI_SPC_ARRIVED, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request || OMPI_REQUEST_PART != request->req_type) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + rc = mca_part.part_parrived(partition, partition, flag, request); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/pready.c b/ompi/mpi/c/pready.c new file mode 100644 index 00000000000..808cbdaf315 --- /dev/null +++ b/ompi/mpi/c/pready.c @@ -0,0 +1,64 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Pready = PMPI_Pready +#endif +#define MPI_Pready PMPI_Pready +#endif + +static const char FUNC_NAME[] = "MPI_Pready"; + + +int MPI_Pready(int partition, MPI_Request request) +{ + int rc; + + SPC_RECORD(OMPI_SPC_PREADY, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request || OMPI_REQUEST_PART != request->req_type) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + rc = mca_part.part_pready(partition, partition, request); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/pready_list.c b/ompi/mpi/c/pready_list.c new file mode 100644 index 00000000000..94498eaba9b --- /dev/null +++ b/ompi/mpi/c/pready_list.c @@ -0,0 +1,65 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Pready_list = PMPI_Pready_list +#endif +#define MPI_Pready_list PMPI_Pready_list +#endif + +static const char FUNC_NAME[] = "MPI_Pready_list"; + + +int MPI_Pready_list(int length, int* partitions, MPI_Request request) +{ + int rc = OMPI_SUCCESS; + SPC_RECORD(OMPI_SPC_PREADY, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request || OMPI_REQUEST_PART != request->req_type) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + for(int i = 0; i < length && OMPI_SUCCESS == rc; i++) { + rc = mca_part.part_pready(partitions[i], partitions[i], request); + } + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/pready_range.c b/ompi/mpi/c/pready_range.c new file mode 100644 index 00000000000..07082cd79b7 --- /dev/null +++ b/ompi/mpi/c/pready_range.c @@ -0,0 +1,64 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Pready_range = PMPI_Pready_range +#endif +#define MPI_Pready_range PMPI_Pready_range +#endif + +static const char FUNC_NAME[] = "MPI_Pready_range"; + + +int MPI_Pready_range(int partition_low, int partition_high, MPI_Request request) +{ + int rc; + + SPC_RECORD(OMPI_SPC_PREADY, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request || OMPI_REQUEST_PART != request->req_type) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + rc = mca_part.part_pready(partition_low, partition_high, request); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/precv_init.c b/ompi/mpi/c/precv_init.c new file mode 100644 index 00000000000..3279cca0aeb --- /dev/null +++ b/ompi/mpi/c/precv_init.c @@ -0,0 +1,65 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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-2021 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Precv_init = PMPI_Precv_init +#endif +#define MPI_Precv_init PMPI_Precv_init +#endif + +static const char FUNC_NAME[] = "MPI_Precv_init"; + + +int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request) +{ + int rc; + + SPC_RECORD(OMPI_SPC_ARRIVED, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + rc = mca_part.part_precv_init(buf, partitions, count, datatype, source, tag, comm, info, 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 45f6c240d11..48b1cc76e77 100644 --- a/ompi/mpi/c/profile/Makefile.am +++ b/ompi/mpi/c/profile/Makefile.am @@ -296,8 +296,14 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ ppack_external_size.c \ ppack.c \ ppack_size.c \ + pparrived.c \ ppcontrol.c \ + ppready.c \ + ppready_list.c \ + ppready_range.c \ + pprecv_init.c \ pprobe.c \ + ppsend_init.c \ ppublish_name.c \ pquery_thread.c \ praccumulate.c \ diff --git a/ompi/mpi/c/psend_init.c b/ompi/mpi/c/psend_init.c new file mode 100644 index 00000000000..820e02d3fbe --- /dev/null +++ b/ompi/mpi/c/psend_init.c @@ -0,0 +1,65 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2018 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. 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/mca/part/part.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/runtime/ompi_spc.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_Psend_init = PMPI_Psend_init +#endif +#define MPI_Psend_init PMPI_Psend_init +#endif + +static const char FUNC_NAME[] = "MPI_Psend_init"; + + +int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request) +{ + int rc; + + SPC_RECORD(OMPI_SPC_ARRIVED, 1); + + if (MPI_PARAM_CHECK) { + rc = OMPI_SUCCESS; + + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == request) { + rc = MPI_ERR_REQUEST; + } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); + } + + rc = mca_part.part_psend_init(buf, partitions, count, datatype, dest, tag, comm, info, request); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/start.c b/ompi/mpi/c/start.c index c8862254cbe..0fbaa4013d1 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c @@ -14,6 +14,7 @@ * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -76,6 +77,7 @@ int MPI_Start(MPI_Request *request) switch((*request)->req_type) { case OMPI_REQUEST_PML: case OMPI_REQUEST_COLL: + case OMPI_REQUEST_PART: if ( MPI_PARAM_CHECK && !(*request)->req_persistent) { return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_REQUEST, FUNC_NAME); } diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am index 51befa145c6..60ff4e91192 100644 --- a/ompi/mpi/fortran/mpif-h/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/Makefile.am @@ -376,8 +376,14 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \ pack_external_size_f.c \ pack_f.c \ pack_size_f.c \ + parrived_f.c \ pcontrol_f.c \ + pready_f.c \ + pready_list_f.c \ + pready_range_f.c \ + precv_init_f.c \ probe_f.c \ + psend_init_f.c \ publish_name_f.c \ query_thread_f.c \ recv_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/parrived_f.c b/ompi/mpi/fortran/mpif-h/parrived_f.c new file mode 100644 index 00000000000..2dda6cbd4c4 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/parrived_f.c @@ -0,0 +1,85 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PARRIVED = ompi_parrived_f +#pragma weak pmpi_parrived = ompi_parrived_f +#pragma weak pmpi_parrived_ = ompi_parrived_f +#pragma weak pmpi_parrived__ = ompi_parrived_f + +#pragma weak PMPI_Parrived_f = ompi_parrived_f +#pragma weak PMPI_Parrived_f08 = ompi_parrived_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PARRIVED, + pmpi_parrived, + pmpi_parrived_, + pmpi_parrived__, + pompi_parrived_f, + (MPI_Fint *request, MPI_Fint *partition, MPI_Fint *flag, MPI_Fint *ierr), + (request, partition, flag, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PARRIVED = ompi_parrived_f +#pragma weak mpi_parrived = ompi_parrived_f +#pragma weak mpi_parrived_ = ompi_parrived_f +#pragma weak mpi_parrived__ = ompi_parrived_f + +#pragma weak MPI_Parrived_f = ompi_parrived_f +#pragma weak MPI_Parrived_f08 = ompi_parrived_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PARRIVED, + mpi_parrived, + mpi_parrived_, + mpi_parrived__, + ompi_parrived_f, + (MPI_Fint *request, MPI_Fint *partition, MPI_Fint *flag, MPI_Fint *ierr), + (request, partition, flag, ierr) ) +#else +#define ompi_parrived_f pompi_parrived_f +#endif +#endif + + +void ompi_parrived_f(MPI_Fint *request, MPI_Fint *partition, ompi_fortran_logical_t *flag, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Request c_req = PMPI_Request_f2c(*request); + OMPI_LOGICAL_NAME_DECL(flag); + + c_ierr = PMPI_Parrived(c_req, OMPI_FINT_2_INT(*partition), OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag)); + + OMPI_SINGLE_INT_2_LOGICAL(flag); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr && *flag) { + *request = OMPI_INT_2_FINT(c_req->req_f_to_c_index); + } +} diff --git a/ompi/mpi/fortran/mpif-h/pready_f.c b/ompi/mpi/fortran/mpif-h/pready_f.c new file mode 100644 index 00000000000..e4fa7c81c5f --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/pready_f.c @@ -0,0 +1,84 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PREADY = ompi_pready_f +#pragma weak pmpi_pready = ompi_pready_f +#pragma weak pmpi_pready_ = ompi_pready_f +#pragma weak pmpi_pready__ = ompi_pready_f + +#pragma weak PMPI_Pready_f = ompi_pready_f +#pragma weak PMPI_Pready_f08 = ompi_pready_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PREADY, + pmpi_pready, + pmpi_pready_, + pmpi_pready__, + pompi_pready_f, + (MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr), + (partition, request, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PREADY = ompi_pready_f +#pragma weak mpi_pready = ompi_pready_f +#pragma weak mpi_pready_ = ompi_pready_f +#pragma weak mpi_pready__ = ompi_pready_f + +#pragma weak MPI_Pready_f = ompi_pready_f +#pragma weak MPI_Pready_f08 = ompi_pready_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PREADY, + mpi_pready, + mpi_pready_, + mpi_pready__, + ompi_pready_f, + (MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr), + (partition, request, ierr) ) +#else +#define ompi_pready_f pompi_pready_f +#endif +#endif + + +void ompi_pready_f(MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Request c_req = PMPI_Request_f2c(*request); + + c_ierr = PMPI_Pready(OMPI_FINT_2_INT(*partition), c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + + if (MPI_SUCCESS == c_ierr) + { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/mpif-h/pready_list_f.c b/ompi/mpi/fortran/mpif-h/pready_list_f.c new file mode 100644 index 00000000000..fdbf85d6d58 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/pready_list_f.c @@ -0,0 +1,89 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PREADY_LIST = ompi_pready_list_f +#pragma weak pmpi_pready_list = ompi_pready_list_f +#pragma weak pmpi_pready_list_ = ompi_pready_list_f +#pragma weak pmpi_pready_list__ = ompi_pready_list_f + +#pragma weak PMPI_Pready_list_f = ompi_pready_list_f +#pragma weak PMPI_Pready_list_f08 = ompi_pready_list_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PREADY_LIST, + pmpi_pready_list, + pmpi_pready_list_, + pmpi_pready_list__, + pompi_pready_list_f, + (MPI_Fint *length, MPI_Fint *partitions, MPI_Fint *request, MPI_Fint *ierr), + (length, partitions, request, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PREADY_LIST = ompi_pready_list_f +#pragma weak mpi_pready_list = ompi_pready_list_f +#pragma weak mpi_pready_list_ = ompi_pready_list_f +#pragma weak mpi_pready_list__ = ompi_pready_list_f + +#pragma weak MPI_Pready_list_f = ompi_pready_list_f +#pragma weak MPI_Pready_list_f08 = ompi_pready_list_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PREADY_LIST, + mpi_pready_list, + mpi_pready_list_, + mpi_pready_list__, + ompi_pready_list_f, + (MPI_Fint *length, MPI_Fint *partitions, MPI_Fint *request, MPI_Fint *ierr), + (length, partitions, request, ierr) ) +#else +#define ompi_pready_list_f pompi_pready_list_f +#endif +#endif + + +void ompi_pready_list_f(MPI_Fint *length, MPI_Fint *partitions, MPI_Fint *request, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Request c_req = PMPI_Request_f2c(*request); + int *c_partitions = (int*)malloc(sizeof(int)*OMPI_FINT_2_INT(*length)); + for(int i = 0; i < OMPI_FINT_2_INT(*length); i++) + { + c_partitions[i] = OMPI_FINT_2_INT(partitions[i]); + } + + c_ierr = PMPI_Pready_list(OMPI_FINT_2_INT(*length), c_partitions, c_req); + + free(c_partitions); + + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/mpif-h/pready_range_f.c b/ompi/mpi/fortran/mpif-h/pready_range_f.c new file mode 100644 index 00000000000..958a260dcba --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/pready_range_f.c @@ -0,0 +1,81 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PREADY_RANGE = ompi_pready_range_f +#pragma weak pmpi_pready_range = ompi_pready_range_f +#pragma weak pmpi_pready_range_ = ompi_pready_range_f +#pragma weak pmpi_pready_range__ = ompi_pready_range_f + +#pragma weak PMPI_Pready_range_f = ompi_pready_range_f +#pragma weak PMPI_Pready_range_f08 = ompi_pready_range_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PREADY_RANGE, + pmpi_pready_range, + pmpi_pready_range_, + pmpi_pready_range__, + pompi_pready_range_f, + (MPI_Fint *partition_low, MPI_Fint *partition_high, MPI_Fint *request, MPI_Fint *ierr), + (partition_low, partition_high, request, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PREADY_RANGE = ompi_pready_range_f +#pragma weak mpi_pready_range = ompi_pready_range_f +#pragma weak mpi_pready_range_ = ompi_pready_range_f +#pragma weak mpi_pready_range__ = ompi_pready_range_f + +#pragma weak MPI_Pready_range_f = ompi_pready_range_f +#pragma weak MPI_Pready_range_f08 = ompi_pready_range_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PREADY_RANGE, + mpi_pready_range, + mpi_pready_range_, + mpi_pready_range__, + ompi_pready_range_f, + (MPI_Fint *partition_low, MPI_Fint *partition_high, MPI_Fint *request, MPI_Fint *ierr), + (partition_low, partition_high, request, ierr) ) +#else +#define ompi_pready_range_f pompi_pready_range_f +#endif +#endif + + +void ompi_pready_range_f(MPI_Fint *partition_low, MPI_Fint *partition_high, MPI_Fint *request, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Request c_req = PMPI_Request_f2c(*request); + + c_ierr = PMPI_Pready_range(OMPI_FINT_2_INT(*partition_low), OMPI_FINT_2_INT(*partition_high), c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/mpif-h/precv_init_f.c b/ompi/mpi/fortran/mpif-h/precv_init_f.c new file mode 100644 index 00000000000..b411e06a460 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/precv_init_f.c @@ -0,0 +1,94 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PRECV_INIT = ompi_precv_init_f +#pragma weak pmpi_precv_init = ompi_precv_init_f +#pragma weak pmpi_precv_init_ = ompi_precv_init_f +#pragma weak pmpi_precv_init__ = ompi_precv_init_f + +#pragma weak PMPI_Precv_init_f = ompi_precv_init_f +#pragma weak PMPI_Precv_init_f08 = ompi_precv_init_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PRECV_INIT, + pmpi_precv_init, + pmpi_precv_init_, + pmpi_precv_init__, + pompi_precv_init_f, + (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr), + (buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PRECV_INIT = ompi_precv_init_f +#pragma weak mpi_precv_init = ompi_precv_init_f +#pragma weak mpi_precv_init_ = ompi_precv_init_f +#pragma weak mpi_precv_init__ = ompi_precv_init_f + +#pragma weak MPI_Precv_init_f = ompi_precv_init_f +#pragma weak MPI_Precv_init_f08 = ompi_precv_init_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PRECV_INIT, + mpi_precv_init, + mpi_precv_init_, + mpi_precv_init__, + ompi_precv_init_f, + (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr), + (buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) ) +#else +#define ompi_precv_init_f pompi_precv_init_f +#endif +#endif + + +void ompi_precv_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Info c_info; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c (*comm); + + c_ierr = PMPI_Precv_init(OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*partitions), + OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, c_info, &c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/mpif-h/profile/Makefile.am b/ompi/mpi/fortran/mpif-h/profile/Makefile.am index f0326e7f1a4..076c801b817 100644 --- a/ompi/mpi/fortran/mpif-h/profile/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/profile/Makefile.am @@ -289,8 +289,14 @@ linked_files = \ ppack_external_size_f.c \ ppack_f.c \ ppack_size_f.c \ + pparrived_f.c \ ppcontrol_f.c \ + ppready_f.c \ + ppready_list_f.c \ + ppready_range_f.c \ + pprecv_init_f.c \ pprobe_f.c \ + ppsend_init_f.c \ ppublish_name_f.c \ pquery_thread_f.c \ precv_f.c \ diff --git a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h index ef3d487eb11..c6ff0e02038 100644 --- a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h +++ b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h @@ -16,6 +16,7 @@ * reserved. * Copyright (c) 2016-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -339,7 +340,13 @@ PN2(void, MPI_Pack_external, mpi_pack_external, MPI_PACK_EXTERNAL, (char *datare PN2(void, MPI_Pack_external_size, mpi_pack_external_size, MPI_PACK_EXTERNAL_SIZE, (char *datarep, MPI_Fint *incount, MPI_Fint *datatype, MPI_Aint *size, MPI_Fint *ierr, int datarep_len)); PN2(void, MPI_Pack, mpi_pack, MPI_PACK, (char *inbuf, MPI_Fint *incount, MPI_Fint *datatype, char *outbuf, MPI_Fint *outsize, MPI_Fint *position, MPI_Fint *comm, MPI_Fint *ierr)); PN2(void, MPI_Pack_size, mpi_pack_size, MPI_PACK_SIZE, (MPI_Fint *incount, MPI_Fint *datatype, MPI_Fint *comm, MPI_Fint *size, MPI_Fint *ierr)); +PN2(void, MPI_Parrived, mpi_parrived, MPI_PARRIVED, (MPI_Fint *request, MPI_Fint *partition, ompi_fortran_logical_t *flag, MPI_Fint *ierr)); PN2(void, MPI_Pcontrol, mpi_pcontrol, MPI_PCONTROL, (MPI_Fint *level)); +PN2(void, MPI_Pready, mpi_pready, MPI_PREADY, (MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr)); +PN2(void, MPI_Pready_list, mpi_pready_list, MPI_PREADY_LIST, (MPI_Fint *length, MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr)); +PN2(void, MPI_Pready_range, mpi_pready_range, MPI_PREADY_RANGE, (MPI_Fint *partition_low, MPI_Fint *partition_high, MPI_Fint *request, MPI_Fint *ierr)); +PN2(void, MPI_Precv_init, mpi_precv_init, MPI_PRECV_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *src, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)); +PN2(void, MPI_Psend_init, mpi_psend_init, MPI_PSEND_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)); PN2(void, MPI_Probe, mpi_probe, MPI_PROBE, (MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr)); PN2(void, MPI_Publish_name, mpi_publish_name, MPI_PUBLISH_NAME, (char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr, int service_name_len, int port_name_len)); PN2(void, MPI_Put, mpi_put, MPI_PUT, (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *win, MPI_Fint *ierr)); diff --git a/ompi/mpi/fortran/mpif-h/psend_init_f.c b/ompi/mpi/fortran/mpif-h/psend_init_f.c new file mode 100644 index 00000000000..655ce8d7945 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/psend_init_f.c @@ -0,0 +1,94 @@ +/* + * 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) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2021 Bull S.A.S. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + +#if OMPI_BUILD_MPI_PROFILING +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak PMPI_PSEND_INIT = ompi_psend_init_f +#pragma weak pmpi_psend_init = ompi_psend_init_f +#pragma weak pmpi_psend_init_ = ompi_psend_init_f +#pragma weak pmpi_psend_init__ = ompi_psend_init_f + +#pragma weak PMPI_Psend_init_f = ompi_psend_init_f +#pragma weak PMPI_Psend_init_f08 = ompi_psend_init_f +#else +OMPI_GENERATE_F77_BINDINGS (PMPI_PSEND_INIT, + pmpi_psend_init, + pmpi_psend_init_, + pmpi_psend_init__, + pompi_psend_init_f, + (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr), + (buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) ) +#endif +#endif + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_PSEND_INIT = ompi_psend_init_f +#pragma weak mpi_psend_init = ompi_psend_init_f +#pragma weak mpi_psend_init_ = ompi_psend_init_f +#pragma weak mpi_psend_init__ = ompi_psend_init_f + +#pragma weak MPI_Psend_init_f = ompi_psend_init_f +#pragma weak MPI_Psend_init_f08 = ompi_psend_init_f +#else +#if ! OMPI_BUILD_MPI_PROFILING +OMPI_GENERATE_F77_BINDINGS (MPI_PSEND_INIT, + mpi_psend_init, + mpi_psend_init_, + mpi_psend_init__, + ompi_psend_init_f, + (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr), + (buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) ) +#else +#define ompi_psend_init_f pompi_psend_init_f +#endif +#endif + + +void ompi_psend_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Info c_info; + MPI_Datatype c_type = PMPI_Type_f2c(*datatype); + MPI_Request c_req; + MPI_Comm c_comm; + + c_info = PMPI_Info_f2c(*info); + c_comm = PMPI_Comm_f2c (*comm); + + c_ierr = PMPI_Psend_init(OMPI_F2C_BOTTOM(buf), + OMPI_FINT_2_INT(*partitions), + OMPI_FINT_2_INT(*count), + c_type, OMPI_FINT_2_INT(*dest), + OMPI_FINT_2_INT(*tag), + c_comm, c_info, &c_req); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + *request = PMPI_Request_c2f(c_req); + } +} diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 59efbc732d1..66c7b5e9c8a 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -13,6 +13,7 @@ # Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. # Copyright (c) 2019 Triad National Security, LLC. All rights # reserved. +# Copyright (c) 2020 Sandia National Laboratories. All rights reserved. # # $COPYRIGHT$ # @@ -356,8 +357,14 @@ mpi_api_files = \ pack_external_size_f08.F90 \ pack_f08.F90 \ pack_size_f08.F90 \ + parrived_f08.F90 \ pcontrol_f08.F90 \ + pready_f08.F90 \ + pready_range_f08.F90 \ + pready_list_f08.F90 \ + precv_init_f08.F90 \ probe_f08.F90 \ + psend_init_f08.F90 \ publish_name_f08.F90 \ put_f08.F90 \ query_thread_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h index ca0a690f4da..e5c3a6f5b27 100644 --- a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h @@ -9,6 +9,7 @@ ! Copyright (c) 2012 Inria. All rights reserved. ! Copyright (c) 2015-2020 Research Organization for Information Science ! and Technology (RIST). All rights reserved. +! Copyright (c) 2021 Bull S.A.S. All rights reserved. ! $COPYRIGHT$ ! ! This file provides the interface specifications for the MPI Fortran @@ -145,6 +146,7 @@ ! MPI_Is_thread_main ! MPI_Op_commutative ! MPI_Op_create +! MPI_Parrived ! MPI_Type_get_attr ! MPI_Win_get_attr ! MPI_Win_test @@ -276,6 +278,55 @@ subroutine ompi_issend_f(buf,count,datatype,dest,tag,comm,request,ierror) & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_issend_f +subroutine ompi_psend_init_f(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) & + BIND(C, name="ompi_psend_init_f") + implicit none + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions, count, dest, tag + INTEGER, INTENT(IN) :: datatype + INTEGER, INTENT(IN) :: comm + INTEGER, INTENT(IN) :: info + INTEGER, INTENT(OUT) :: request + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_psend_init_f + +subroutine ompi_precv_init_f(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) & + BIND(C, name="ompi_precv_init_f") + implicit none + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions, count, dest, tag + INTEGER, INTENT(IN) :: datatype + INTEGER, INTENT(IN) :: comm + INTEGER, INTENT(IN) :: info + INTEGER, INTENT(OUT) :: request + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_precv_init_f + +subroutine ompi_pready_f(partition,request,ierror) & + BIND(C, name="ompi_pready_f") + implicit none + INTEGER, INTENT(IN) :: partition + INTEGER, INTENT(IN) :: request + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_pready_f + +subroutine ompi_pready_list_f(length,partitions,request,ierror) & + BIND(C, name="ompi_pready_list_f") + implicit none + INTEGER, INTENT(IN) :: length + INTEGER, INTENT(IN) :: partitions(*) + INTEGER, INTENT(IN) :: request + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_pready_list_f + +subroutine ompi_pready_range_f(partition_low,partition_high,request,ierror) & + BIND(C, name="ompi_pready_range_f") + implicit none + INTEGER, INTENT(IN) :: partition_low, partition_high + INTEGER, INTENT(IN) :: request + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_pready_range_f + subroutine ompi_probe_f(source,tag,comm,status,ierror) & BIND(C, name="ompi_probe_f") use :: mpi_f08_types, only : MPI_Status diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in index aa00ed83998..e847524e1d1 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in @@ -166,6 +166,84 @@ subroutine MPI_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror) end subroutine MPI_Issend_f08 end interface MPI_Issend +interface MPI_Precv_init +subroutine MPI_Precv_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + implicit none + !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf + !GCC$ ATTRIBUTES NO_ARG_CHECK :: buf + !$PRAGMA IGNORE_TKR buf + !DIR$ IGNORE_TKR buf + !IBM* IGNORE_TKR buf + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions, count, dest, tag + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Precv_init_f08 +end interface MPI_Precv_init + +interface MPI_Psend_init +subroutine MPI_Psend_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + implicit none + !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf + !GCC$ ATTRIBUTES NO_ARG_CHECK :: buf + !$PRAGMA IGNORE_TKR buf + !DIR$ IGNORE_TKR buf + !IBM* IGNORE_TKR buf + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions, count, dest, tag + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Psend_init_f08 +end interface MPI_Psend_init + +interface MPI_Pready +subroutine MPI_Pready_f08(partition,request,ierror) + use :: mpi_f08_types, only : MPI_Request + implicit none + INTEGER, INTENT(IN) :: partition + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Pready_f08 +end interface MPI_Pready + +interface MPI_Pready_list +subroutine MPI_Pready_list_f08(length,partitions,request,ierror) + use :: mpi_f08_types, only : MPI_Request + implicit none + INTEGER, INTENT(IN) :: length + INTEGER, DIMENSION(*), INTENT(IN) :: partitions + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Pready_list_f08 +end interface MPI_Pready_list + +interface MPI_Pready_range +subroutine MPI_Pready_range_f08(partition_low,partition_high,request,ierror) + use :: mpi_f08_types, only : MPI_Request + implicit none + INTEGER, INTENT(IN) :: partition_low, partition_high + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Pready_range_f08 +end interface MPI_Pready_range + +interface MPI_Parrived +subroutine MPI_Parrived_f08(request,partition,flag,ierror) + use :: mpi_f08_types, only : MPI_Request + implicit none + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, INTENT(IN) :: partition + LOGICAL, INTENT(OUT) :: flag + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Parrived_f08 +end interface MPI_Parrived + interface MPI_Probe subroutine MPI_Probe_f08(source,tag,comm,status,ierror) use :: mpi_f08_types, only : MPI_Comm, MPI_Status diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h index 0ba04afc841..fbee9871716 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h @@ -29,6 +29,18 @@ #define MPI_Isend_f08 PMPI_Isend_f08 #define MPI_Issend PMPI_Issend #define MPI_Issend_f08 PMPI_Issend_f08 +#define MPI_Precv_init PMPI_Precv_init +#define MPI_Precv_init_f08 PMPI_Precv_init_f08 +#define MPI_Psend_init PMPI_Psend_init +#define MPI_Psend_init_f08 PMPI_Psend_init_f08 +#define MPI_Pready PMPI_Pready +#define MPI_Pready_f08 PMPI_Pready_f08 +#define MPI_Pready_list PMPI_Pready_list +#define MPI_Pready_list_f08 PMPI_Pready_list_f08 +#define MPI_Pready_range PMPI_Pready_range +#define MPI_Pready_range_f08 PMPI_Pready_range_f08 +#define MPI_Parrived PMPI_Parrived +#define MPI_Parrived_f08 PMPI_Parrived_f08 #define MPI_Probe PMPI_Probe #define MPI_Probe_f08 PMPI_Probe_f08 #define MPI_Recv PMPI_Recv diff --git a/ompi/mpi/fortran/use-mpi-f08/parrived_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/parrived_f08.F90 new file mode 100644 index 00000000000..7116fb1511b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/parrived_f08.F90 @@ -0,0 +1,28 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine MPI_Parrived_f08(request,partition,flag,ierror) + ! See note in mpi-f-interfaces-bind.h for why we "use mpi" here and + ! call a PMPI_* subroutine below. + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + use :: mpi, only : PMPI_Parrived + implicit none + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, INTENT(IN) :: partition + LOGICAL, INTENT(OUT) :: flag + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call PMPI_Parrived(request%MPI_VAL,partition,flag,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Parrived_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pready_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pready_f08.F90 new file mode 100644 index 00000000000..45ff490c4b1 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pready_f08.F90 @@ -0,0 +1,25 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine MPI_Pready_f08(partition,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + use :: ompi_mpifh_bindings, only : ompi_pready_f + implicit none + INTEGER, INTENT(IN) :: partition + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_pready_f(partition,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Pready_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pready_list_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pready_list_f08.F90 new file mode 100644 index 00000000000..179e4fdf840 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pready_list_f08.F90 @@ -0,0 +1,26 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine MPI_Pready_list_f08(length,partitions,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + use :: ompi_mpifh_bindings, only : ompi_pready_list_f + implicit none + INTEGER, INTENT(IN) :: length + INTEGER, dimension(*), INTENT(IN) :: partitions + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_pready_list_f(length,partitions,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Pready_list_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/pready_range_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/pready_range_f08.F90 new file mode 100644 index 00000000000..d85d617295a --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/pready_range_f08.F90 @@ -0,0 +1,25 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine MPI_Pready_range_f08(partition_low,partition_high,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request + use :: ompi_mpifh_bindings, only : ompi_pready_range_f + implicit none + INTEGER, INTENT(IN) :: partition_low,partition_high + TYPE(MPI_Request), INTENT(IN) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_pready_range_f(partition_low,partition_high,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Pready_range_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 new file mode 100644 index 00000000000..9e5c8e417f6 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/precv_init_f08.F90 @@ -0,0 +1,33 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! Copyright (c) 2021 Bull S.A.S. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +#include "mpi-f08-rename.h" + +subroutine MPI_Precv_init_f08(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request + use :: ompi_mpifh_bindings, only : ompi_precv_init_f + implicit none + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions,count, dest, tag + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_precv_init_f(buf,partitions,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & + info%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Precv_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 new file mode 100644 index 00000000000..3c68b2c1cae --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/psend_init_f08.F90 @@ -0,0 +1,31 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +! Copyright (c) 2021 Bull S.A.S. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine MPI_Psend_init_f08(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Info, MPI_Request + use :: ompi_mpifh_bindings, only : ompi_psend_init_f + implicit none + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: partitions,count, dest, tag + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_psend_init_f(buf,partitions,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL, & + info%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Psend_init_f08 diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in index 649e62d39d5..76130d7cee4 100644 --- a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in @@ -11,6 +11,7 @@ ! reserved. ! Copyright (c) 2015-2020 Research Organization for Information Science ! and Technology (RIST). All rights reserved. +! Copyright (c) 2021 Bull S.A.S. All rights reserved. ! $COPYRIGHT$ ! ! Additional copyrights may follow @@ -2494,6 +2495,94 @@ end subroutine MPI_Issend end interface + +interface + +subroutine MPI_Psend_init(buf, partitions, count, datatype, dest, tag, & + comm, info, request, ierror) + @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf + @OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: buf + integer, intent(in) :: partitions + integer, intent(in) :: count + integer, intent(in) :: datatype + integer, intent(in) :: dest + integer, intent(in) :: tag + integer, intent(in) :: comm + integer, intent(in) :: info + integer, intent(out) :: request + integer, intent(out) :: ierror +end subroutine MPI_Psend_init + +end interface + + +interface + +subroutine MPI_Precv_init(buf, partitions, count, datatype, dest, tag, & + comm, info, request, ierror) + @OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf + @OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: buf + integer, intent(in) :: partitions + integer, intent(in) :: count + integer, intent(in) :: datatype + integer, intent(in) :: dest + integer, intent(in) :: tag + integer, intent(in) :: comm + integer, intent(in) :: info + integer, intent(out) :: request + integer, intent(out) :: ierror +end subroutine MPI_Precv_init + +end interface + + +interface + +subroutine MPI_Pready(partition, request, ierror) + integer, intent(in) :: partition + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready + +end interface + + +interface + +subroutine MPI_Pready_list(length, partitions, request, ierror) + integer, intent(in) :: length + integer, dimension(*), intent(in) :: partitions + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready_list + +end interface + + +interface + +subroutine MPI_Pready_range(partition_low, partition_high, request, ierror) + integer, intent(in) :: partition_low + integer, intent(in) :: partition_high + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready_range + +end interface + + +interface + +subroutine MPI_Parrived(request, partition, flag, ierror) + integer, intent(in) :: request + integer, intent(in) :: partition + logical, intent(in) :: flag + integer, intent(out) :: ierror +end subroutine MPI_Parrived + +end interface + + interface subroutine MPI_Lookup_name(service_name, info, port_name, ierror) diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h b/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h index a03b92d4df4..6e0906bc562 100644 --- a/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h @@ -197,8 +197,14 @@ #define MPI_Pack_external PMPI_Pack_external #define MPI_Pack_external_size PMPI_Pack_external_size #define MPI_Pack_size PMPI_Pack_size +#define MPI_Parrived PMPI_Parrived #define MPI_Pcontrol PMPI_Pcontrol +#define MPI_Pready PMPI_Pready +#define MPI_Pready_list PMPI_Pready_list +#define MPI_Pready_range PMPI_Pready_range +#define MPI_Precv_init PMPI_Precv_init #define MPI_Probe PMPI_Probe +#define MPI_Psend_init PMPI_Psend_init #define MPI_Publish_name PMPI_Publish_name #define MPI_Put PMPI_Put #define MPI_Query_thread PMPI_Query_thread diff --git a/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h b/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h index 97f352fca34..34a391b53b1 100644 --- a/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h @@ -13,6 +13,7 @@ ! Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved ! Copyright (c) 2016-2018 Research Organization for Information Science ! and Technology (RIST). All rights reserved. +! Copyright (c) 2021 Sandia National Laboratories. All rights reserved. ! $COPYRIGHT$ ! ! Additional copyrights may follow @@ -1211,6 +1212,53 @@ end subroutine MPI_Probe end interface +interface + +subroutine MPI_Parrived(request, partition, flag, ierror) + integer, intent(in) :: request + integer, intent(in) :: partition + logical, intent(out) :: flag + integer, intent(out) :: ierror +end subroutine MPI_Parrived + +end interface + + +interface + +subroutine MPI_Pready(partition, request, ierror) + integer, intent(in) :: partition + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready + +end interface + + +interface + +subroutine MPI_Pready_list(length, array_of_partitions, request, ierror) + integer, intent(in) :: length + integer, dimension(*), intent(in) :: array_of_partitions + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready_list + +end interface + + +interface + +subroutine MPI_Pready_range(partition_low, partition_high, request, ierror) + integer, intent(in) :: partition_low + integer, intent(in) :: partition_high + integer, intent(in) :: request + integer, intent(out) :: ierror +end subroutine MPI_Pready_range + +end interface + + interface subroutine MPI_Query_thread(provided, ierror) diff --git a/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h b/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h index e8e5d6d9582..1a93fbb6658 100644 --- a/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h +++ b/ompi/mpi/fortran/use-mpi-tkr/pmpi-f90-interfaces.h @@ -108,6 +108,10 @@ #define MPI_Pack_size PMPI_Pack_size #define MPI_Pcontrol PMPI_Pcontrol #define MPI_Probe PMPI_Probe +#define MPI_Parrived PMPI_Parrived +#define MPI_Pready PMPI_Pready +#define MPI_Pready_list PMPI_Pready_list +#define MPI_Pready_range PMPI_Pready_range #define MPI_Query_thread PMPI_Query_thread #define MPI_Register_datarep PMPI_Register_datarep #define MPI_Request_free PMPI_Request_free diff --git a/ompi/mpi/man/man3/MPI_Parrived.3in b/ompi/mpi/man/man3/MPI_Parrived.3in new file mode 100644 index 00000000000..a7ffa129b0b --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Parrived.3in @@ -0,0 +1,66 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Parrived 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Parrived\fP \- Tests for completion of a specified receive-side partition. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Parrived(MPI_Request\fI *request\fP, int\fI partition\fP, int\fI *flag\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PARRIVED(REQUEST, PARTITION, FLAG IERROR\fP) + INTEGER \fIREQUEST, PARTITION, FLAG(*), IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Parrived(\fIrequest\fP, \fIpartition\fP, \fIflag\fP, \fIierror\fP) + TYPE(MPI_Request), INTENT(in) :: \fIrequest\fP + INTEGER, INTENT(IN) :: \fIpartition\fP + INTEGER, INTENT(out) :: \fIflag\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +request +Communication request (handle). +.TP 1i +partition +The number of the partition to test for completion (integer). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +flag +True if partition is completed. +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH SEE ALSO +MPI_Pready_list, MPI_Pready_range, MPI_Parrived +.br diff --git a/ompi/mpi/man/man3/MPI_Pready.3in b/ompi/mpi/man/man3/MPI_Pready.3in new file mode 100644 index 00000000000..609f3fba2c4 --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Pready.3in @@ -0,0 +1,61 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Pready 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Pready\fP \- Indicates that a given send-side partition is ready to be transferred. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Pready(int\fI partition\fP, MPI_Request\fI *request\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PREADY(PARTITION, REQUEST, IERROR\fP) + INTEGER \fIPARTITION, REQUEST, IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Pready(\fIpartition\fP, \fIrequest\fP, \fIierror\fP) + INTEGER, INTENT(IN) :: \fIpartition\fP + TYPE(MPI_Request), INTENT(IN) :: \fIrequest\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +partition +The number of the partition to mark ready for transfer (integer). +.TP 1i +request +Communication request (handle). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH SEE ALSO +MPI_Pready_list, MPI_Pready_range, MPI_Parrived +.br diff --git a/ompi/mpi/man/man3/MPI_Pready_list.3in b/ompi/mpi/man/man3/MPI_Pready_list.3in new file mode 100644 index 00000000000..44302fa6232 --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Pready_list.3in @@ -0,0 +1,65 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Pready_list 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Pready_list\fP \- Indicates that a list given send-side partitions are ready to be transferred. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Pready_list(int\fI length\fP, int\fI *partitions\fP, MPI_Request\fI *request\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PREADY_LIST(LENGTH, PARTITIONS, REQUEST, IERROR\fP) + INTEGER \fILENGTH, PARTITIONS(*), REQUEST, IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Pready_list(\fIlength\fP, \fIpartitions\fP, \fIrequest\fP, \fIierror\fP) + INTEGER, INTENT(IN) :: \fIlength\fP + INTEGER, INTENT(IN) :: \fIpartitions\fP + TYPE(MPI_Request), INTENT(IN) :: \fIrequest\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +length +The length of the given partition array (integer). +.TP 1i +partitions +An array of numbers of partitions to mark ready for transfer (integer). +.TP 1i +request +Communication request (handle). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH SEE ALSO +MPI_Pready, MPI_Pready_range, MPI_Parrived +.br diff --git a/ompi/mpi/man/man3/MPI_Pready_range.3in b/ompi/mpi/man/man3/MPI_Pready_range.3in new file mode 100644 index 00000000000..d32b30141b7 --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Pready_range.3in @@ -0,0 +1,64 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Pready_range 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Pready_range\fP \- Indicates that a given range os send-side partitions are ready to be transferred. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Pready_range(int\fI partition_low\fP, int\fI partition_high\fP, MPI_Request\fI *request\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PREADY(PARTITION_LOW, PARTITION_HIGH, REQUEST, IERROR\fP) + INTEGER \fIPARTITION_LOW, PARTITION_HIGH, REQUEST, IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Pready(\fIpartition_low\fP, \fIpartition_high\fP, \fIrequest\fP, \fIierror\fP) + INTEGER, INTENT(IN) :: \fIpartition_low\fP, \fIpartition_high\fP + TYPE(MPI_Request), INTENT(IN) :: \fIrequest\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +partition_low +The lowest of the range of partitions to mark ready for transfer (integer). +.TP 1i +partition_high +The highest of the range of partitions to mark ready for transfer (integer). +.TP 1i +request +Communication request (handle). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH SEE ALSO +MPI_Pready, MPI_Pready_list, MPI_Parrived +.br diff --git a/ompi/mpi/man/man3/MPI_Precv_init.3in b/ompi/mpi/man/man3/MPI_Precv_init.3in new file mode 100644 index 00000000000..4db68db98af --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Precv_init.3in @@ -0,0 +1,89 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Precv_init 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Precv_init\fP \- Initializes a partitioned receive. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Precv_init(const void *\fIbuf\fP, int\fI partitions\fP, int\fI count\fP, MPI_Datatype\fI datatype\fP, int\fI dest\fP, + int\fI tag\fP, MPI_Comm\fI comm\fP, MPI_Request\fI *request\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PRECV_INIT(\fIBUF, PARTITIONS, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR\fP) + \fIBUF\fP(*) + INTEGER \fIPARTITIONS, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Precv_init(\fIbuf\fP, \fIpartitions\fP, \fIcount\fP, \fIdatatype\fP, \fIdest\fP, \fItag\fP, \fIcomm\fP, \fIrequest\fP, \fIierror\fP) + TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: \fIbuf\fP + INTEGER, INTENT(IN) :: \fIpartitions\fP, \fIcount\fP, \fIdest\fP, \fItag\fP + TYPE(MPI_Datatype), INTENT(IN) :: \fIdatatype\fP + TYPE(MPI_Comm), INTENT(IN) :: \fIcomm\fP + TYPE(MPI_Request), INTENT(OUT) :: \fIrequest\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +buf +Initial address of receive buffer (choice). +.TP 1i +partitions +Number of partitions (integer). +.TP 1i +count +Number of elements to be received per partition (integer). +.TP 1i +datatype +Datatype of each element (handle). +.TP 1i +dest +Rank of source (integer). +.TP 1i +tag +Message tag (integer). +.TP 1i +comm +Communicator (handle). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +request +Communication request (handle). +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH NOTE +.ft R +The current implementation is an early prototype and is not fully compliant with the MPI-4.0 specification. Specifically this function and it's counterpart (MPI_Psend_init) will block until the partitioned communication request is initialized on both ends. This behavior will be corrected in future versions. + +.SH SEE ALSO +MPI_Psend_init +.br diff --git a/ompi/mpi/man/man3/MPI_Psend_init.3in b/ompi/mpi/man/man3/MPI_Psend_init.3in new file mode 100644 index 00000000000..75ec8443d30 --- /dev/null +++ b/ompi/mpi/man/man3/MPI_Psend_init.3in @@ -0,0 +1,89 @@ +.\" -*- nroff -*- +.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved. +.\" Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. +.\" Copyright 2006-2008 Sun Microsystems, Inc. +.\" Copyright (c) 1996 Thinking Machines Corporation +.\" Copyright (c) 2020 Google, LLC. All rights reserved. +.\" Copyright (c) 2020 Sandia National Laboratories. All rights reserved. +.\" $COPYRIGHT$ +.TH MPI_Psend_init 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPI_Psend_init\fP \- Initializes a partitioned send. + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +int MPI_Psend_init(const void *\fIbuf\fP, int\fI partitions\fP, int\fI count\fP, MPI_Datatype\fI datatype\fP, int\fI dest\fP, + int\fI tag\fP, MPI_Comm\fI comm\fP, MPI_Request\fI *request\fP) + +.fi +.SH Fortran Syntax +.nf +USE MPI +! or the older form: INCLUDE 'mpif.h' +MPI_PSEND_INIT(\fIBUF, PARTITIONS, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR\fP) + \fIBUF\fP(*) + INTEGER \fIPARTITIONS, COUNT, DATATYPE, DEST, TAG, COMM, REQUEST, IERROR\fP + +.fi +.SH Fortran 2008 Syntax +.nf +USE mpi_f08 +MPI_Psend_init(\fIbuf\fP, \fIpartitions\fP, \fIcount\fP, \fIdatatype\fP, \fIdest\fP, \fItag\fP, \fIcomm\fP, \fIrequest\fP, \fIierror\fP) + TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: \fIbuf\fP + INTEGER, INTENT(IN) :: \fIpartitions\fP, \fIcount\fP, \fIdest\fP, \fItag\fP + TYPE(MPI_Datatype), INTENT(IN) :: \fIdatatype\fP + TYPE(MPI_Comm), INTENT(IN) :: \fIcomm\fP + TYPE(MPI_Request), INTENT(OUT) :: \fIrequest\fP + INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP + +.fi +.SH INPUT PARAMETERS +.ft R +.TP 1i +buf +Initial address of send buffer (choice). +.TP 1i +partitions +Number of partitions (integer). +.TP 1i +count +Number of elements to be sent per partition (integer). +.TP 1i +datatype +Datatype of each element (handle). +.TP 1i +dest +Rank of source (integer). +.TP 1i +tag +Message tag (integer). +.TP 1i +comm +Communicator (handle). + +.SH OUTPUT PARAMETERS +.ft R +.TP 1i +request +Communication request (handle). +.ft R +.TP 1i +IERROR +Fortran only: Error status (integer). + +.SH ERRORS +Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. +.sp +Before the error value is returned, the current MPI error handler is +called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. + +.SH NOTE +.ft R +The current implementation is an early prototype and is not fully compliant with the MPI-4.0 specification. Specifically this function and it's counterpart (MPI_Precv_init) will block until the partitioned communication request is initialized on both ends. This behavior will be corrected in future versions. + +.SH SEE ALSO +MPI_Precv_init +.br diff --git a/ompi/mpi/man/man3/Makefile.am b/ompi/mpi/man/man3/Makefile.am index 11023df23e0..133725af0f6 100644 --- a/ompi/mpi/man/man3/Makefile.am +++ b/ompi/mpi/man/man3/Makefile.am @@ -292,8 +292,14 @@ TEMPLATE_FILES = \ MPI_Pack_external.3in \ MPI_Pack_external_size.3in \ MPI_Pack_size.3in \ + MPI_Parrived.3in \ MPI_Pcontrol.3in \ + MPI_Pready.3in \ + MPI_Pready_list.3in \ + MPI_Pready_range.3in \ + MPI_Precv_init.3in \ MPI_Probe.3in \ + MPI_Psend_init.3in \ MPI_Publish_name.3in \ MPI_Put.3in \ MPI_Query_thread.3in \ diff --git a/ompi/request/request_dbg.h b/ompi/request/request_dbg.h index 7251b96dc5b..e6aa3757d06 100644 --- a/ompi/request/request_dbg.h +++ b/ompi/request/request_dbg.h @@ -28,6 +28,7 @@ typedef enum { OMPI_REQUEST_NULL, /**< NULL request */ OMPI_REQUEST_NOOP, /**< A request that does nothing (e.g., to PROC_NULL) */ OMPI_REQUEST_COMM, /**< MPI-3 non-blocking communicator duplication */ + OMPI_REQUEST_PART, /**< MPI-4 partitioned communication request */ OMPI_REQUEST_MAX /**< Maximum request type */ } ompi_request_type_t; diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 4daf0e9f253..ee2dd73b993 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -78,6 +78,7 @@ #include "ompi/mca/pml/base/base.h" #include "ompi/mca/bml/base/base.h" #include "ompi/mca/osc/base/base.h" +#include "ompi/mca/part/base/base.h" #include "ompi/mca/coll/base/coll_base_functions.h" #include "ompi/mca/coll/base/base.h" #include "ompi/runtime/ompi_rte.h" @@ -334,6 +335,10 @@ int ompi_mpi_finalize(void) if (OMPI_SUCCESS != (ret = ompi_osc_base_finalize())) { goto done; } + if (OMPI_SUCCESS != (ret = mca_part_base_finalize())) { + goto done; + } + /* free communicator resources. this MUST come before finalizing the PML * as this will call into the pml */ @@ -444,6 +449,9 @@ int ompi_mpi_finalize(void) if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_osc_base_framework))) { goto done; } + if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_part_base_framework))) { + goto done; + } if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_coll_base_framework))) { goto done; } diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index e6f5306d8f9..f666785f5d6 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2006-2009 University of Houston. All rights reserved. * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014-2021 Research Organization for Information Science @@ -88,6 +88,7 @@ #include "ompi/mca/pml/base/base.h" #include "ompi/mca/bml/base/base.h" #include "ompi/mca/osc/base/base.h" +#include "ompi/mca/part/base/base.h" #include "ompi/mca/coll/base/base.h" #include "ompi/mca/io/io.h" #include "ompi/mca/io/base/base.h" @@ -693,6 +694,11 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, error = "ompi_osc_base_open() failed"; goto error; } + + if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_part_base_framework, 0))) { + error = "ompi_part_base_open() failed"; + goto error; + } /* In order to reduce the common case for MPI apps (where they don't use MPI-2 IO or MPI-1 topology functions), the io and @@ -806,6 +812,14 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, goto error; } + + if (OMPI_SUCCESS != + (ret = mca_part_base_select(OPAL_ENABLE_PROGRESS_THREADS, + ompi_mpi_thread_multiple))) { + error = "mca_part_base_select() failed"; + goto error; + } + /* io and topo components are not selected here -- see comment above about the io and topo frameworks being loaded lazily */