2015-02-19 23:41:41 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2004-01-10 01:09:51 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2007-12-21 09:02:00 +03:00
|
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
2012-10-04 18:39:51 +04:00
|
|
|
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
|
2012-03-21 21:46:15 +04:00
|
|
|
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
|
2015-02-19 23:41:41 +03:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-10 01:09:51 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-10-08 21:12:36 +04:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Top-level description of requests
|
|
|
|
*/
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#ifndef OMPI_REQUEST_H
|
|
|
|
#define OMPI_REQUEST_H
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2009-03-04 18:35:54 +03:00
|
|
|
#include "ompi_config.h"
|
2004-01-10 01:09:51 +03:00
|
|
|
#include "mpi.h"
|
2015-02-19 23:41:41 +03:00
|
|
|
#include "opal/class/opal_free_list.h"
|
2007-12-21 09:02:00 +03:00
|
|
|
#include "opal/class/opal_pointer_array.h"
|
2005-07-04 02:45:48 +04:00
|
|
|
#include "opal/threads/condition.h"
|
2009-03-04 18:35:54 +03:00
|
|
|
#include "ompi/constants.h"
|
2006-03-16 01:53:41 +03:00
|
|
|
|
2007-05-16 19:46:52 +04:00
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
2004-10-08 21:12:36 +04:00
|
|
|
/**
|
|
|
|
* Request class
|
|
|
|
*/
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_request_t);
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2009-06-10 18:57:28 +04:00
|
|
|
/*
|
|
|
|
* The following include pulls in shared typedefs with debugger plugins.
|
|
|
|
* For more information on why we do this see the Notice to developers
|
|
|
|
* comment at the top of the ompi_msgq_dll.c file.
|
2004-10-08 21:12:36 +04:00
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
|
2009-06-11 07:15:47 +04:00
|
|
|
#include "request_dbg.h"
|
2004-06-09 23:45:08 +04:00
|
|
|
|
2004-10-12 19:50:01 +04:00
|
|
|
struct ompi_request_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Required function to free the request and any associated resources.
|
2004-10-08 21:12:36 +04:00
|
|
|
*/
|
2004-10-20 02:00:19 +04:00
|
|
|
typedef int (*ompi_request_free_fn_t)(struct ompi_request_t** rptr);
|
2004-10-12 19:50:01 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Optional function to cancel a pending request.
|
|
|
|
*/
|
|
|
|
typedef int (*ompi_request_cancel_fn_t)(struct ompi_request_t* request, int flag);
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2007-12-21 09:02:00 +03:00
|
|
|
/*
|
|
|
|
* Optional function called when the request is completed from the MPI
|
|
|
|
* library perspective. This function is not allowed to release any
|
|
|
|
* ressources related to the request.
|
|
|
|
*/
|
|
|
|
typedef int (*ompi_request_complete_fn_t)(struct ompi_request_t* request);
|
|
|
|
|
2006-10-27 16:32:36 +04:00
|
|
|
/**
|
|
|
|
* Forward declaration
|
|
|
|
*/
|
|
|
|
struct ompi_communicator_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Forward declaration
|
|
|
|
*/
|
|
|
|
struct ompi_win_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Forward declaration
|
|
|
|
*/
|
|
|
|
struct ompi_file_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Union for holding several different MPI pointer types on the request
|
|
|
|
*/
|
|
|
|
typedef union ompi_mpi_object_t {
|
|
|
|
struct ompi_communicator_t *comm;
|
|
|
|
struct ompi_file_t *file;
|
|
|
|
struct ompi_win_t *win;
|
|
|
|
} ompi_mpi_object_t;
|
|
|
|
|
2004-10-08 21:12:36 +04:00
|
|
|
/**
|
2004-10-12 19:50:01 +04:00
|
|
|
* Main top-level request struct definition
|
2004-10-08 21:12:36 +04:00
|
|
|
*/
|
2004-10-12 19:50:01 +04:00
|
|
|
struct ompi_request_t {
|
2015-02-19 23:41:41 +03:00
|
|
|
opal_free_list_item_t super; /**< Base type */
|
2007-12-21 09:02:00 +03:00
|
|
|
ompi_request_type_t req_type; /**< Enum indicating the type of the request */
|
|
|
|
ompi_status_public_t req_status; /**< Completion status */
|
|
|
|
volatile bool req_complete; /**< Flag indicating wether request has completed */
|
|
|
|
volatile ompi_request_state_t req_state; /**< enum indicate state of the request */
|
|
|
|
bool req_persistent; /**< flag indicating if the this is a persistent request */
|
|
|
|
int req_f_to_c_index; /**< Index in Fortran <-> C translation array */
|
|
|
|
ompi_request_free_fn_t req_free; /**< Called by free */
|
|
|
|
ompi_request_cancel_fn_t req_cancel; /**< Optional function to cancel the request */
|
|
|
|
ompi_request_complete_fn_t req_complete_cb; /**< Called when the request is MPI completed */
|
2011-07-01 00:05:16 +04:00
|
|
|
void *req_complete_cb_data;
|
2007-12-21 09:02:00 +03:00
|
|
|
ompi_mpi_object_t req_mpi_object; /**< Pointer to MPI object that created this request */
|
2004-10-12 19:50:01 +04:00
|
|
|
};
|
2004-10-08 21:12:36 +04:00
|
|
|
|
|
|
|
/**
|
2004-10-12 19:50:01 +04:00
|
|
|
* Convenience typedef
|
2004-10-08 21:12:36 +04:00
|
|
|
*/
|
2004-10-12 19:50:01 +04:00
|
|
|
typedef struct ompi_request_t ompi_request_t;
|
2004-10-08 21:12:36 +04:00
|
|
|
|
2009-02-24 20:17:33 +03:00
|
|
|
/**
|
|
|
|
* Padded struct to maintain back compatibiltiy.
|
|
|
|
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
|
|
|
|
* for full explanation why we chose the following padding construct for predefines.
|
|
|
|
*/
|
|
|
|
#define PREDEFINED_REQUEST_PAD (sizeof(void*) * 32)
|
|
|
|
|
|
|
|
struct ompi_predefined_request_t {
|
|
|
|
struct ompi_request_t request;
|
|
|
|
char padding[PREDEFINED_REQUEST_PAD - sizeof(ompi_request_t)];
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct ompi_predefined_request_t ompi_predefined_request_t;
|
2004-10-08 21:12:36 +04:00
|
|
|
|
|
|
|
/**
|
2005-03-26 21:49:16 +03:00
|
|
|
* Initialize a request. This is a macro to avoid function call
|
2004-10-08 21:12:36 +04:00
|
|
|
* overhead, since this is typically invoked in the critical
|
|
|
|
* performance path (since requests may be re-used, it is possible
|
|
|
|
* that we will have to initialize a request multiple times).
|
|
|
|
*/
|
2006-03-16 01:53:41 +03:00
|
|
|
#define OMPI_REQUEST_INIT(request, persistent) \
|
|
|
|
do { \
|
|
|
|
(request)->req_complete = false; \
|
2006-10-18 20:11:50 +04:00
|
|
|
(request)->req_state = OMPI_REQUEST_INACTIVE; \
|
2006-03-16 01:53:41 +03:00
|
|
|
(request)->req_persistent = (persistent); \
|
2004-10-23 23:24:00 +04:00
|
|
|
} while (0);
|
2004-06-21 19:24:40 +04:00
|
|
|
|
2004-10-08 21:12:36 +04:00
|
|
|
/**
|
|
|
|
* Finalize a request. This is a macro to avoid function call
|
|
|
|
* overhead, since this is typically invoked in the critical
|
|
|
|
* performance path (since requests may be re-used, it is possible
|
|
|
|
* that we will have to finalize a request multiple times).
|
|
|
|
*
|
|
|
|
* When finalizing a request, if MPI_Request_f2c() was previously
|
|
|
|
* invoked on that request, then this request was added to the f2c
|
|
|
|
* table, and we need to remove it
|
2006-03-16 01:53:41 +03:00
|
|
|
*
|
|
|
|
* This function should be called only from the MPI layer. It should
|
|
|
|
* never be called from the PML. It take care of the upper level clean-up.
|
|
|
|
* When the user call MPI_Request_free we should release all MPI level
|
|
|
|
* ressources, so we have to call this function too.
|
2004-10-08 21:12:36 +04:00
|
|
|
*/
|
2006-03-16 01:53:41 +03:00
|
|
|
#define OMPI_REQUEST_FINI(request) \
|
|
|
|
do { \
|
|
|
|
(request)->req_state = OMPI_REQUEST_INVALID; \
|
|
|
|
if (MPI_UNDEFINED != (request)->req_f_to_c_index) { \
|
2007-12-21 09:02:00 +03:00
|
|
|
opal_pointer_array_set_item(&ompi_request_f_to_c_table, \
|
2006-03-16 01:53:41 +03:00
|
|
|
(request)->req_f_to_c_index, NULL); \
|
|
|
|
(request)->req_f_to_c_index = MPI_UNDEFINED; \
|
|
|
|
} \
|
|
|
|
} while (0);
|
2004-06-21 19:24:40 +04:00
|
|
|
|
2004-10-27 01:45:25 +04:00
|
|
|
/**
|
|
|
|
* Non-blocking test for request completion.
|
|
|
|
*
|
|
|
|
* @param request (IN) Array of requests
|
|
|
|
* @param complete (OUT) Flag indicating if index is valid (a request completed).
|
|
|
|
* @param status (OUT) Status of completed request.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
* Note that upon completion, the request is freed, and the
|
|
|
|
* request handle at index set to NULL.
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_test_fn_t)(ompi_request_t ** rptr,
|
|
|
|
int *completed,
|
|
|
|
ompi_status_public_t * status );
|
2004-10-12 19:50:01 +04:00
|
|
|
/**
|
|
|
|
* Non-blocking test for request completion.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param request (IN) Array of requests
|
|
|
|
* @param index (OUT) Index of first completed request.
|
|
|
|
* @param complete (OUT) Flag indicating if index is valid (a request completed).
|
|
|
|
* @param status (OUT) Status of completed request.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
* Note that upon completion, the request is freed, and the
|
|
|
|
* request handle at index set to NULL.
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_test_any_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
int *index,
|
|
|
|
int *completed,
|
|
|
|
ompi_status_public_t * status);
|
2004-10-12 19:50:01 +04:00
|
|
|
/**
|
|
|
|
* Non-blocking test for request completion.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param requests (IN) Array of requests
|
|
|
|
* @param completed (OUT) Flag indicating wether all requests completed.
|
|
|
|
* @param statuses (OUT) Array of completion statuses.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
* This routine returns completed==true if all requests have completed.
|
|
|
|
* The statuses parameter is only updated if all requests completed. Likewise,
|
|
|
|
* the requests array is not modified (no requests freed), unless all requests
|
|
|
|
* have completed.
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_test_all_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
int *completed,
|
|
|
|
ompi_status_public_t * statuses);
|
2006-07-25 19:29:37 +04:00
|
|
|
/**
|
|
|
|
* Non-blocking test for some of N requests to complete.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param requests (INOUT) Array of requests
|
|
|
|
* @param outcount (OUT) Number of finished requests
|
|
|
|
* @param indices (OUT) Indices of the finished requests
|
|
|
|
* @param statuses (OUT) Array of completion statuses.
|
|
|
|
* @return OMPI_SUCCESS, OMPI_ERR_IN_STATUS or failure status.
|
|
|
|
*
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_test_some_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
int * outcount,
|
|
|
|
int * indices,
|
|
|
|
ompi_status_public_t * statuses);
|
2004-10-12 22:01:39 +04:00
|
|
|
/**
|
|
|
|
* Wait (blocking-mode) for one requests to complete.
|
|
|
|
*
|
|
|
|
* @param request (IN) Pointer to request.
|
|
|
|
* @param status (OUT) Status of completed request.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_wait_fn_t)(ompi_request_t ** req_ptr,
|
|
|
|
ompi_status_public_t * status);
|
2004-10-12 19:50:01 +04:00
|
|
|
/**
|
|
|
|
* Wait (blocking-mode) for one of N requests to complete.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param requests (IN) Array of requests
|
|
|
|
* @param index (OUT) Index into request array of completed request.
|
|
|
|
* @param status (OUT) Status of completed request.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_wait_any_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
int *index,
|
|
|
|
ompi_status_public_t * status);
|
2004-10-12 19:50:01 +04:00
|
|
|
/**
|
|
|
|
* Wait (blocking-mode) for all of N requests to complete.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param requests (IN) Array of requests
|
|
|
|
* @param statuses (OUT) Array of completion statuses.
|
|
|
|
* @return OMPI_SUCCESS or failure status.
|
|
|
|
*
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_wait_all_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
ompi_status_public_t * statuses);
|
2006-07-25 19:29:37 +04:00
|
|
|
/**
|
|
|
|
* Wait (blocking-mode) for some of N requests to complete.
|
|
|
|
*
|
|
|
|
* @param count (IN) Number of requests
|
|
|
|
* @param requests (INOUT) Array of requests
|
|
|
|
* @param outcount (OUT) Number of finished requests
|
|
|
|
* @param indices (OUT) Indices of the finished requests
|
|
|
|
* @param statuses (OUT) Array of completion statuses.
|
|
|
|
* @return OMPI_SUCCESS, OMPI_ERR_IN_STATUS or failure status.
|
|
|
|
*
|
|
|
|
*/
|
2007-12-06 12:23:44 +03:00
|
|
|
typedef int (*ompi_request_wait_some_fn_t)(size_t count,
|
|
|
|
ompi_request_t ** requests,
|
|
|
|
int * outcount,
|
|
|
|
int * indices,
|
|
|
|
ompi_status_public_t * statuses);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replaceable request functions
|
|
|
|
*/
|
|
|
|
typedef struct ompi_request_fns_t {
|
|
|
|
ompi_request_test_fn_t req_test;
|
|
|
|
ompi_request_test_any_fn_t req_test_any;
|
|
|
|
ompi_request_test_all_fn_t req_test_all;
|
|
|
|
ompi_request_test_some_fn_t req_test_some;
|
|
|
|
ompi_request_wait_fn_t req_wait;
|
|
|
|
ompi_request_wait_any_fn_t req_wait_any;
|
|
|
|
ompi_request_wait_all_fn_t req_wait_all;
|
|
|
|
ompi_request_wait_some_fn_t req_wait_some;
|
|
|
|
} ompi_request_fns_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Globals used for tracking requests and request completion.
|
|
|
|
*/
|
2007-12-21 09:02:00 +03:00
|
|
|
OMPI_DECLSPEC extern opal_pointer_array_t ompi_request_f_to_c_table;
|
2007-12-06 12:23:44 +03:00
|
|
|
OMPI_DECLSPEC extern size_t ompi_request_waiting;
|
|
|
|
OMPI_DECLSPEC extern size_t ompi_request_completed;
|
2012-03-21 21:46:15 +04:00
|
|
|
OMPI_DECLSPEC extern size_t ompi_request_failed;
|
2007-12-06 12:23:44 +03:00
|
|
|
OMPI_DECLSPEC extern int32_t ompi_request_poll;
|
|
|
|
OMPI_DECLSPEC extern opal_mutex_t ompi_request_lock;
|
|
|
|
OMPI_DECLSPEC extern opal_condition_t ompi_request_cond;
|
2009-02-24 20:17:33 +03:00
|
|
|
OMPI_DECLSPEC extern ompi_predefined_request_t ompi_request_null;
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
OMPI_DECLSPEC extern ompi_predefined_request_t *ompi_request_null_addr;
|
2007-12-06 12:23:44 +03:00
|
|
|
OMPI_DECLSPEC extern ompi_request_t ompi_request_empty;
|
|
|
|
OMPI_DECLSPEC extern ompi_status_public_t ompi_status_empty;
|
|
|
|
OMPI_DECLSPEC extern ompi_request_fns_t ompi_request_functions;
|
2006-07-25 19:29:37 +04:00
|
|
|
|
2007-12-06 12:23:44 +03:00
|
|
|
/**
|
|
|
|
* Initialize the MPI_Request subsystem; invoked during MPI_INIT.
|
|
|
|
*/
|
|
|
|
int ompi_request_init(void);
|
2006-07-25 19:29:37 +04:00
|
|
|
|
2007-12-06 12:23:44 +03:00
|
|
|
/**
|
|
|
|
* Free a persistent request to a MPI_PROC_NULL peer (there's no
|
|
|
|
* freelist to put it back to, so we have to actually OBJ_RELEASE it).
|
|
|
|
*/
|
|
|
|
OMPI_DECLSPEC int ompi_request_persistent_proc_null_free(ompi_request_t **request);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shut down the MPI_Request subsystem; invoked during MPI_FINALIZE.
|
|
|
|
*/
|
|
|
|
int ompi_request_finalize(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel a pending request.
|
|
|
|
*/
|
|
|
|
static inline int ompi_request_cancel(ompi_request_t* request)
|
|
|
|
{
|
|
|
|
if (request->req_cancel != NULL) {
|
|
|
|
return request->req_cancel(request, true);
|
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Free a request.
|
|
|
|
*
|
|
|
|
* @param request (INOUT) Pointer to request.
|
|
|
|
*/
|
|
|
|
static inline int ompi_request_free(ompi_request_t** request)
|
|
|
|
{
|
2013-09-26 01:34:57 +04:00
|
|
|
return (*request)->req_free(request);
|
2007-12-06 12:23:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#define ompi_request_test (ompi_request_functions.req_test)
|
|
|
|
#define ompi_request_test_any (ompi_request_functions.req_test_any)
|
|
|
|
#define ompi_request_test_all (ompi_request_functions.req_test_all)
|
|
|
|
#define ompi_request_test_some (ompi_request_functions.req_test_some)
|
|
|
|
#define ompi_request_wait (ompi_request_functions.req_wait)
|
|
|
|
#define ompi_request_wait_any (ompi_request_functions.req_wait_any)
|
|
|
|
#define ompi_request_wait_all (ompi_request_functions.req_wait_all)
|
|
|
|
#define ompi_request_wait_some (ompi_request_functions.req_wait_some)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wait a particular request for completion
|
|
|
|
*/
|
2007-10-18 16:33:21 +04:00
|
|
|
static inline void ompi_request_wait_completion(ompi_request_t *req)
|
|
|
|
{
|
|
|
|
if(false == req->req_complete) {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#if OPAL_ENABLE_PROGRESS_THREADS
|
2007-10-18 16:33:21 +04:00
|
|
|
if(opal_progress_spin(&req->req_complete)) {
|
|
|
|
return;
|
|
|
|
}
|
2014-06-26 00:43:28 +04:00
|
|
|
#endif
|
2007-10-18 16:33:21 +04:00
|
|
|
OPAL_THREAD_LOCK(&ompi_request_lock);
|
|
|
|
ompi_request_waiting++;
|
|
|
|
while(false == req->req_complete) {
|
|
|
|
opal_condition_wait(&ompi_request_cond, &ompi_request_lock);
|
|
|
|
}
|
|
|
|
ompi_request_waiting--;
|
|
|
|
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-18 17:02:27 +04:00
|
|
|
/**
|
2008-05-30 07:58:39 +04:00
|
|
|
* Signal or mark a request as complete. If with_signal is true this will
|
|
|
|
* wake any thread pending on the request and ompi_request_lock should be
|
|
|
|
* held while calling this function. If with_signal is false, there will
|
|
|
|
* signal generated, and no lock required. This is a special case when
|
|
|
|
* the function is called from the critical path for small messages, where
|
|
|
|
* we know the current execution flow created the request, and is still
|
|
|
|
* in the _START macro.
|
|
|
|
*/
|
|
|
|
static inline int ompi_request_complete(ompi_request_t* request, bool with_signal)
|
2007-10-18 17:02:27 +04:00
|
|
|
{
|
2011-07-01 00:05:16 +04:00
|
|
|
ompi_request_complete_fn_t tmp = request->req_complete_cb;
|
|
|
|
if( NULL != tmp ) {
|
|
|
|
request->req_complete_cb = NULL;
|
|
|
|
tmp( request );
|
2007-12-21 09:02:00 +03:00
|
|
|
}
|
2007-10-18 17:02:27 +04:00
|
|
|
ompi_request_completed++;
|
|
|
|
request->req_complete = true;
|
2012-03-22 18:09:19 +04:00
|
|
|
if( OPAL_UNLIKELY(MPI_SUCCESS != request->req_status.MPI_ERROR) ) {
|
2012-03-21 21:46:15 +04:00
|
|
|
ompi_request_failed++;
|
|
|
|
}
|
2008-05-30 07:58:39 +04:00
|
|
|
if(with_signal && ompi_request_waiting) {
|
2008-03-27 21:37:11 +03:00
|
|
|
/* Broadcast the condition, otherwise if there is already a thread
|
|
|
|
* waiting on another request it can use all signals.
|
|
|
|
*/
|
|
|
|
opal_condition_broadcast(&ompi_request_cond);
|
|
|
|
}
|
2007-10-18 17:02:27 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2007-05-16 19:46:52 +04:00
|
|
|
END_C_DECLS
|
2006-07-25 19:29:37 +04:00
|
|
|
|
2004-01-10 01:09:51 +03:00
|
|
|
#endif
|