2004-10-12 19:50:01 +04: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.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* 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.
|
2006-11-02 06:34:53 +03:00
|
|
|
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-10-12 19:50:01 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OMPI_GEN_REQUEST_H
|
|
|
|
#define OMPI_GEN_REQUEST_H
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/request/request.h"
|
2004-10-12 19:50:01 +04:00
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
BEGIN_C_DECLS
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_grequest_t);
|
2004-10-12 19:50:01 +04:00
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Fortran type for generalized request query function
|
2005-03-26 21:49:16 +03:00
|
|
|
*/
|
2015-06-24 06:59:57 +03:00
|
|
|
typedef void (MPI_F_Grequest_query_function)(MPI_Aint *extra_state,
|
|
|
|
MPI_Fint *status,
|
2006-11-02 06:34:53 +03:00
|
|
|
MPI_Fint *ierr);
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Fortran type for generalized request free function
|
|
|
|
*/
|
2015-06-24 06:59:57 +03:00
|
|
|
typedef void (MPI_F_Grequest_free_function)(MPI_Aint *extra_state,
|
2006-11-02 06:34:53 +03:00
|
|
|
MPI_Fint *ierr);
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Fortran type for generalized request cancel function
|
|
|
|
*/
|
2015-06-24 06:59:57 +03:00
|
|
|
typedef void (MPI_F_Grequest_cancel_function)(MPI_Aint *extra_state,
|
|
|
|
ompi_fortran_logical_t *complete,
|
2006-11-02 06:34:53 +03:00
|
|
|
MPI_Fint *ierr);
|
2005-03-26 21:49:16 +03:00
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Union for query function for use in ompi_grequest_t
|
|
|
|
*/
|
2005-03-26 21:49:16 +03:00
|
|
|
typedef union {
|
|
|
|
MPI_Grequest_query_function* c_query;
|
|
|
|
MPI_F_Grequest_query_function* f_query;
|
|
|
|
} MPI_Grequest_query_fct_t;
|
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Union for free function for use in ompi_grequest_t
|
|
|
|
*/
|
2005-03-26 21:49:16 +03:00
|
|
|
typedef union {
|
|
|
|
MPI_Grequest_free_function* c_free;
|
|
|
|
MPI_F_Grequest_free_function* f_free;
|
|
|
|
} MPI_Grequest_free_fct_t;
|
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Union for cancel function for use in ompi_grequest_t
|
|
|
|
*/
|
2005-03-26 21:49:16 +03:00
|
|
|
typedef union {
|
|
|
|
MPI_Grequest_cancel_function* c_cancel;
|
|
|
|
MPI_F_Grequest_cancel_function* f_cancel;
|
|
|
|
} MPI_Grequest_cancel_fct_t;
|
2004-10-12 19:50:01 +04:00
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Main structure for MPI generalized requests
|
|
|
|
*/
|
2004-10-12 19:50:01 +04:00
|
|
|
struct ompi_grequest_t {
|
|
|
|
ompi_request_t greq_base;
|
2005-03-26 21:49:16 +03:00
|
|
|
MPI_Grequest_query_fct_t greq_query;
|
|
|
|
MPI_Grequest_free_fct_t greq_free;
|
|
|
|
MPI_Grequest_cancel_fct_t greq_cancel;
|
2004-10-12 19:50:01 +04:00
|
|
|
void *greq_state;
|
2006-11-02 06:34:53 +03:00
|
|
|
bool greq_funcs_are_c;
|
2004-10-12 19:50:01 +04:00
|
|
|
};
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
2004-10-12 19:50:01 +04:00
|
|
|
typedef struct ompi_grequest_t ompi_grequest_t;
|
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Start a generalized request (back end for MPI_GREQUEST_START)
|
2004-10-20 18:56:52 +04:00
|
|
|
*/
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC int ompi_grequest_start(
|
2004-10-12 19:50:01 +04:00
|
|
|
MPI_Grequest_query_function *gquery,
|
|
|
|
MPI_Grequest_free_function *gfree,
|
|
|
|
MPI_Grequest_cancel_function *gcancel,
|
|
|
|
void* gstate,
|
|
|
|
ompi_request_t** request);
|
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
|
|
|
* Complete a generalized request (back end for MPI_GREQUEST_COMPLETE)
|
2006-11-02 06:34:53 +03:00
|
|
|
*/
|
|
|
|
OMPI_DECLSPEC int ompi_grequest_complete(ompi_request_t *req);
|
|
|
|
|
2006-11-06 21:42:00 +03:00
|
|
|
/**
|
2006-11-02 06:34:53 +03:00
|
|
|
* Invoke the query function on a generalized request
|
2004-10-20 18:56:52 +04:00
|
|
|
*/
|
2006-11-02 06:34:53 +03:00
|
|
|
OMPI_DECLSPEC int ompi_grequest_invoke_query(ompi_request_t *request,
|
|
|
|
ompi_status_public_t *status);
|
2009-08-20 15:42:18 +04:00
|
|
|
END_C_DECLS
|
2004-10-12 19:50:01 +04:00
|
|
|
|
|
|
|
#endif
|