2004-01-09 22:20:50 +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-07-11 02:16:38 +04: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.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-09 22:20:50 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2004-01-09 22:20:50 +03:00
|
|
|
#ifndef MCA_PML_BASE_REQUEST_H
|
|
|
|
#define MCA_PML_BASE_REQUEST_H
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/class/ompi_free_list.h"
|
|
|
|
#include "ompi/request/request.h"
|
2007-07-11 02:16:38 +04:00
|
|
|
#include "ompi/datatype/convertor.h"
|
2004-01-09 22:20:50 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2007-07-11 02:16:38 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* External list for the requests. They are declared as lists of
|
|
|
|
* the basic request type, which will allow all PML to overload
|
|
|
|
* the list. Beware these free lists have to be initialized
|
|
|
|
* directly by the PML who win the PML election.
|
|
|
|
*/
|
|
|
|
OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_send_requests;
|
|
|
|
OMPI_DECLSPEC extern ompi_free_list_t mca_pml_base_recv_requests;
|
2004-01-09 22:20:50 +03:00
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* Type of request.
|
|
|
|
*/
|
2004-01-12 22:17:09 +03:00
|
|
|
typedef enum {
|
2004-03-17 00:56:19 +03:00
|
|
|
MCA_PML_REQUEST_NULL,
|
2004-01-12 22:17:09 +03:00
|
|
|
MCA_PML_REQUEST_SEND,
|
2004-06-09 23:45:08 +04:00
|
|
|
MCA_PML_REQUEST_RECV,
|
|
|
|
MCA_PML_REQUEST_IPROBE,
|
|
|
|
MCA_PML_REQUEST_PROBE
|
2004-01-12 22:17:09 +03:00
|
|
|
} mca_pml_base_request_type_t;
|
|
|
|
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* Base type for PML P2P requests
|
|
|
|
*/
|
2004-03-12 01:02:01 +03:00
|
|
|
struct mca_pml_base_request_t {
|
2004-07-15 22:08:20 +04:00
|
|
|
ompi_request_t req_ompi; /**< base request */
|
2007-07-11 02:16:38 +04:00
|
|
|
volatile bool req_pml_complete; /**< flag indicating if the pt-2-pt layer is done with this request */
|
|
|
|
mca_pml_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 */
|
|
|
|
volatile bool req_free_called; /**< flag indicating if the user has freed this request */
|
|
|
|
ompi_convertor_t req_convertor; /**< always need the convertor */
|
2004-03-26 17:15:20 +03:00
|
|
|
void *req_addr; /**< pointer to application buffer */
|
|
|
|
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 */
|
2005-09-13 00:22:59 +04:00
|
|
|
struct ompi_proc_t* req_proc; /**< peer process */
|
2005-05-24 02:06:50 +04:00
|
|
|
uint64_t req_sequence; /**< sequence number for MPI pt-2-pt ordering */
|
2004-03-12 01:02:01 +03:00
|
|
|
};
|
|
|
|
typedef struct mca_pml_base_request_t mca_pml_base_request_t;
|
2004-01-09 22:20:50 +03:00
|
|
|
|
2007-07-11 02:16:38 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_request_t);
|
|
|
|
|
2006-01-26 02:15:36 +03:00
|
|
|
/*
|
|
|
|
* Mark the MPI request as completed and trigger the condition if required.
|
|
|
|
*/
|
|
|
|
#define MCA_PML_BASE_REQUEST_MPI_COMPLETE( request ) \
|
|
|
|
do { \
|
|
|
|
(request)->req_complete = true; \
|
|
|
|
ompi_request_completed++; \
|
|
|
|
if(ompi_request_waiting) { \
|
|
|
|
opal_condition_broadcast(&ompi_request_cond); \
|
|
|
|
} \
|
|
|
|
} while(0)
|
2004-01-09 22:20:50 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-01-09 22:20:50 +03:00
|
|
|
#endif
|
|
|
|
|