1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2016 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
14 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
15 * reserved.
16 * Copyright (c) 2015 Research Organization for Information Science
17 * and Technology (RIST). All rights reserved.
18 * $COPYRIGHT$
19 *
20 * Additional copyrights may follow
21 *
22 * $HEADER$
23 */
24 /**
25 * @file
26 */
27 #ifndef MCA_PML_BASE_REQUEST_H
28 #define MCA_PML_BASE_REQUEST_H
29
30 #include "ompi_config.h"
31 #include "opal/class/opal_free_list.h"
32 #include "ompi/communicator/communicator.h"
33 #include "ompi/request/request.h"
34 #include "opal/datatype/opal_convertor.h"
35
36 BEGIN_C_DECLS
37
38 /**
39 * External list for the requests. They are declared as lists of
40 * the basic request type, which will allow all PML to overload
41 * the list. Beware these free lists have to be initialized
42 * directly by the PML who win the PML election.
43 */
44 OMPI_DECLSPEC extern opal_free_list_t mca_pml_base_send_requests;
45 OMPI_DECLSPEC extern opal_free_list_t mca_pml_base_recv_requests;
46
47 /**
48 * Type of request.
49 */
50 /*
51 * The following include pulls in shared typedefs with debugger plugins.
52 * For more information on why we do this see the Notice to developers
53 * comment at the top of the ompi_msgq_dll.c file.
54 */
55 #include "pml_base_request_dbg.h"
56
57
58 /**
59 * Base type for PML P2P requests
60 */
61 struct mca_pml_base_request_t {
62
63 /* START: These fields have to match the definition of the mca_pml_cm_request_t */
64 ompi_request_t req_ompi; /**< base request */
65 volatile int32_t req_pml_complete; /**< flag indicating if the pt-2-pt layer is done with this request */
66 volatile int32_t req_free_called; /**< flag indicating if the user has freed this request */
67 mca_pml_base_request_type_t req_type; /**< MPI request type - used for test */
68 struct ompi_communicator_t *req_comm; /**< communicator pointer */
69 struct ompi_datatype_t *req_datatype; /**< pointer to data type */
70 opal_convertor_t req_convertor; /**< always need the convertor */
71 /* END: These field have to match the definition of the mca_pml_cm_request_t */
72
73 void *req_addr; /**< pointer to application buffer */
74 size_t req_count; /**< count of user datatype elements */
75 int32_t req_peer; /**< peer process - rank w/in this communicator */
76 int32_t req_tag; /**< user defined tag */
77 struct ompi_proc_t* req_proc; /**< peer process */
78 uint64_t req_sequence; /**< sequence number for MPI pt-2-pt ordering */
79 };
80 typedef struct mca_pml_base_request_t mca_pml_base_request_t;
81
82 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_request_t);
83
84 END_C_DECLS
85
86 #endif
87