20 #ifndef MTL_PORTALS_H_HAS_BEEN_INCLUDED
21 #define MTL_PORTALS_H_HAS_BEEN_INCLUDED
25 #include "opal/class/opal_free_list.h"
27 #include "opal/datatype/opal_convertor.h"
29 #include "ompi/mca/mtl/base/base.h"
31 #if OMPI_MTL_PORTALS4_FLOW_CONTROL
32 #include "mtl_portals4_flowctl.h"
37 struct mca_mtl_portals4_send_request_t;
94 #if OMPI_MTL_PORTALS4_FLOW_CONTROL
98 uint32_t send_queue_slots;
111 #if OPAL_ENABLE_DEBUG
114 uint32_t recv_opcount;
119 #define send_eq_h eqs_h[0]
120 #define recv_eq_h eqs_h[1]
124 #define REQ_SEND_TABLE_ID 2
125 #define REQ_READ_TABLE_ID 3
126 #define REQ_FLOWCTL_TABLE_ID 4
128 #if OMPI_MTL_PORTALS4_FLOW_CONTROL
129 #define MTL_PORTALS4_FLOWCTL_TRIGGER 0x01
130 #define MTL_PORTALS4_FLOWCTL_ALERT 0x02
131 #define MTL_PORTALS4_FLOWCTL_FANIN 0x03
132 #define MTL_PORTALS4_FLOWCTL_FANOUT 0x04
144 #define MTL_PORTALS4_PROTOCOL_MASK 0xF000000000000000ULL
145 #define MTL_PORTALS4_CONTEXT_MASK 0x0FFF000000000000ULL
146 #define MTL_PORTALS4_SOURCE_MASK 0x0000FFFF00000000ULL
147 #define MTL_PORTALS4_TAG_MASK 0x00000000FFFFFFFFULL
149 #define MTL_PORTALS4_PROTOCOL_IGNR MTL_PORTALS4_PROTOCOL_MASK
150 #define MTL_PORTALS4_CONTEXT_IGNR MTL_PORTALS4_CONTEXT_MASK
151 #define MTL_PORTALS4_SOURCE_IGNR MTL_PORTALS4_SOURCE_MASK
152 #define MTL_PORTALS4_TAG_IGNR 0x000000007FFFFFFFULL
154 #define MTL_PORTALS4_SHORT_MSG 0x1000000000000000ULL
155 #define MTL_PORTALS4_LONG_MSG 0x2000000000000000ULL
156 #define MTL_PORTALS4_READY_MSG 0x4000000000000000ULL
159 #define MTL_PORTALS4_SET_SEND_BITS(match_bits, contextid, source, tag, type) \
161 match_bits = contextid; \
162 match_bits = (match_bits << 16); \
163 match_bits |= source; \
164 match_bits = (match_bits << 32); \
165 match_bits |= (MTL_PORTALS4_TAG_MASK & tag) | type; \
169 #define MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits, contextid, source, tag) \
172 ignore_bits = MTL_PORTALS4_PROTOCOL_IGNR; \
174 match_bits = contextid; \
175 match_bits = (match_bits << 16); \
177 if (MPI_ANY_SOURCE == source) { \
178 match_bits = (match_bits << 32); \
179 ignore_bits |= MTL_PORTALS4_SOURCE_IGNR; \
181 match_bits |= source; \
182 match_bits = (match_bits << 32); \
185 if (MPI_ANY_TAG == tag) { \
186 ignore_bits |= MTL_PORTALS4_TAG_IGNR; \
188 match_bits |= (MTL_PORTALS4_TAG_MASK & tag); \
192 #define MTL_PORTALS4_IS_SHORT_MSG(match_bits) \
193 (0 != (MTL_PORTALS4_SHORT_MSG & match_bits))
194 #define MTL_PORTALS4_IS_LONG_MSG(match_bits) \
195 (0 != (MTL_PORTALS4_LONG_MSG & match_bits))
196 #define MTL_PORTALS4_IS_READY_MSG(match_bits) \
197 (0 != (MTL_PORTALS4_READY_MSG & match_bits))
199 #define MTL_PORTALS4_GET_TAG(match_bits) \
200 ((int)(match_bits & MTL_PORTALS4_TAG_MASK))
201 #define MTL_PORTALS4_GET_SOURCE(match_bits) \
202 ((int)((match_bits & MTL_PORTALS4_SOURCE_MASK) >> 32))
205 #define MTL_PORTALS4_SYNC_MSG 0x8000000000000000ULL
207 #define MTL_PORTALS4_SET_HDR_DATA(hdr_data, opcount, length, sync) \
209 hdr_data = (sync) ? 1 : 0; \
210 hdr_data = (hdr_data << 15); \
211 hdr_data |= opcount & 0x7FFFULL; \
212 hdr_data = (hdr_data << 48); \
213 hdr_data |= (length & 0xFFFFFFFFFFFFULL); \
216 #define MTL_PORTALS4_GET_LENGTH(hdr_data) ((size_t)(hdr_data & 0xFFFFFFFFFFFFULL))
217 #define MTL_PORTALS4_IS_SYNC_MSG(hdr_data) \
218 (0 != (MTL_PORTALS4_SYNC_MSG & hdr_data))
238 mca_pml_base_send_mode_t mode);
245 mca_pml_base_send_mode_t mode,
286 extern int ompi_mtl_portals4_progress(
void);
288 extern int ompi_mtl_portals4_get_error(
int ptl_error);
ptl_handle_eq_t eqs_h[2]
Event queue handles.
Definition: mtl_portals4.h:71
int recv_short_num
Number of short message blocks which should be created during startup.
Definition: mtl_portals4.h:47
ptl_pt_index_t flowctl_event_idx
portals index for flow control recovery operatings which generate full events
Definition: mtl_portals4.h:67
ptl_pt_index_t read_idx
portals index for long message rendezvous
Definition: mtl_portals4.h:62
opal_list_t active_recv_short_blocks
List of active short receive blocks.
Definition: mtl_portals4.h:84
uint32_t opcount
number of send-side operations started
Definition: mtl_portals4.h:92
ptl_pt_index_t send_idx
portals index for message matching
Definition: mtl_portals4.h:60
ptl_pt_index_t flowctl_idx
portals index for flow control recovery
Definition: mtl_portals4.h:64
size_t eager_limit
Eager limit; messages greater than this use a rendezvous protocol.
Definition: mtl_portals4.h:43
size_t recv_short_size
Size of short message blocks.
Definition: mtl_portals4.h:45
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
Remote Open MPI process structure.
Definition: proc.h:56
enum mca_mtl_portals4_module_t::@122 protocol
Protocol for long message transfer.
ptl_handle_md_t zero_md_h
MD for zero-length sends and acks.
Definition: mtl_portals4.h:75
Definition: opal_free_list.h:31
ptl_handle_ni_t ni_h
Network interface handle for matched interface.
Definition: mtl_portals4.h:57
An abstraction that represents a connection to a endpoint process.
Definition: mtl_mx_endpoint.h:50
Definition: opal_convertor.h:90
Matching Transport Layer.
Definition: opal_list.h:147
int queue_size
Length of both the receive and send event queues.
Definition: mtl_portals4.h:49
MTL module interface functions and attributes.
Definition: mtl.h:399
opal_list_t waiting_recv_short_blocks
List of short receive blocks waiting for FREE event.
Definition: mtl_portals4.h:89
ptl_handle_me_t long_overflow_me_h
long message receive overflow ME.
Definition: mtl_portals4.h:79
Definition: communicator.h:118
Definition: mtl_portals4_flowctl.h:13
Definition: mtl_portals4.h:39