OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

pml_base_recvreq.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2010 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
13 * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved.
14 * $COPYRIGHT$
15 *
16 * Additional copyrights may follow
17 *
18 * $HEADER$
19 */
20 /**
21 * @file
22 */
23 #ifndef MCA_PML_BASE_RECV_REQUEST_H
24 #define MCA_PML_BASE_RECV_REQUEST_H
25
26 #include "ompi_config.h"
27 #include "ompi/mca/pml/base/pml_base_request.h"
28 #include "opal/datatype/opal_convertor.h"
29 #include "ompi/peruse/peruse-internal.h"
30
31 BEGIN_C_DECLS
32
33 /**
34 * Base type for receive requests.
35 */
36 struct mca_pml_base_recv_request_t {
37 mca_pml_base_request_t req_base; /**< base request */
38 size_t req_bytes_packed; /**< size of message being received */
39 };
40 typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t;
41
42 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t);
43
44 /**
45 * Initialize a receive request with call parameters.
46 *
47 * @param request (IN) Receive request.
48 * @param addr (IN) User buffer.
49 * @param count (IN) Number of elements of indicated datatype.
50 * @param datatype (IN) User defined datatype.
51 * @param src (IN) Source rank w/in the communicator.
52 * @param tag (IN) User defined tag.
53 * @param comm (IN) Communicator.
54 * @param persistent (IN) Is this a persistent request.
55 */
56 #define MCA_PML_BASE_RECV_REQUEST_INIT( \
57 request, \
58 addr, \
59 count, \
60 datatype, \
61 src, \
62 tag, \
63 comm, \
64 persistent) \
65 { \
66 /* increment reference count on communicator */ \
67 OBJ_RETAIN(comm); \
68 OBJ_RETAIN(datatype); \
69 \
70 OMPI_REQUEST_INIT(&(request)->req_base.req_ompi, persistent); \
71 (request)->req_base.req_ompi.req_mpi_object.comm = comm; \
72 (request)->req_base.req_ompi.req_peer = src; \
73 (request)->req_base.req_ompi.req_tag = tag; \
74 (request)->req_bytes_packed = 0; \
75 (request)->req_base.req_addr = addr; \
76 (request)->req_base.req_count = count; \
77 (request)->req_base.req_peer = src; \
78 (request)->req_base.req_tag = tag; \
79 (request)->req_base.req_comm = comm; \
80 (request)->req_base.req_proc = NULL; \
81 (request)->req_base.req_sequence = 0; \
82 (request)->req_base.req_datatype = datatype; \
83 /* What about req_type ? */ \
84 (request)->req_base.req_pml_complete = OPAL_INT_TO_BOOL(persistent); \
85 (request)->req_base.req_free_called = false; \
86 }
87 /**
88 *
89 *
90 */
91 #define MCA_PML_BASE_RECV_START( request ) \
92 do { \
93 (request)->req_pml_complete = false; \
94 \
95 /* always set the req_status.MPI_TAG to ANY_TAG before starting the \
96 * request. This field is used if cancelled to find out if the request \
97 * has been matched or not. \
98 */ \
99 (request)->req_ompi.req_status.MPI_SOURCE = OMPI_ANY_SOURCE; \
100 (request)->req_ompi.req_status.MPI_TAG = OMPI_ANY_TAG; \
101 (request)->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \
102 (request)->req_ompi.req_status._ucount = 0; \
103 (request)->req_ompi.req_status._cancelled = 0; \
104 (request)->req_ompi.req_mpi_object.comm = (request)->req_comm; \
105 (request)->req_ompi.req_peer = (request)->req_peer; \
106 \
107 (request)->req_ompi.req_complete = false; \
108 (request)->req_ompi.req_state = OMPI_REQUEST_ACTIVE; \
109 } while (0)
110
111 /**
112 * Return a receive request. Handle the release of the communicator and the
113 * attached datatype.
114 *
115 * @param request (IN) Receive request.
116 */
117 #define MCA_PML_BASE_RECV_REQUEST_FINI( request ) \
118 do { \
119 OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
120 OBJ_RELEASE( (request)->req_base.req_comm); \
121 OBJ_RELEASE( (request)->req_base.req_datatype ); \
122 opal_convertor_cleanup( &((request)->req_base.req_convertor) ); \
123 } while (0)
124
125 END_C_DECLS
126
127 #endif
128
pml_base_request.h
mca_pml_base_recv_request_t::req_base
mca_pml_base_request_t req_base
base request
Definition: pml_base_recvreq.h:37
mca_pml_base_recv_request_t
Base type for receive requests.
Definition: pml_base_recvreq.h:36
mca_pml_base_request_t
Type of request.
Definition: pml_base_request.h:57
mca_pml_base_recv_request_t::req_bytes_packed
size_t req_bytes_packed
size of message being received
Definition: pml_base_recvreq.h:38
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236