This source file includes following definitions.
- mca_btl_portals4_send
- mca_btl_portals4_sendi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "opal_config.h"
25 #include "opal/constants.h"
26 #include "opal/datatype/opal_convertor.h"
27
28 #include "btl_portals4.h"
29
30 int mca_btl_portals4_send(struct mca_btl_base_module_t* btl_base,
31 struct mca_btl_base_endpoint_t* endpoint,
32 struct mca_btl_base_descriptor_t* descriptor,
33 mca_btl_base_tag_t tag)
34 {
35 struct mca_btl_portals4_module_t* portals4_btl = (struct mca_btl_portals4_module_t*) btl_base;
36 mca_btl_portals4_frag_t *frag = (mca_btl_portals4_frag_t*) descriptor;
37 ptl_match_bits_t match_bits, msglen_type;
38 ptl_size_t put_length;
39 int ret;
40
41 frag->endpoint = endpoint;
42 frag->hdr.tag = tag;
43
44 put_length = frag->segments[0].base.seg_len;
45 if (put_length > portals4_btl->super.btl_eager_limit)
46 msglen_type = BTL_PORTALS4_LONG_MSG;
47 else msglen_type = BTL_PORTALS4_SHORT_MSG;
48
49 BTL_PORTALS4_SET_SEND_BITS(match_bits, 0, 0, tag, msglen_type);
50
51
52 while (OPAL_THREAD_ADD_FETCH32(&portals4_btl->portals_outstanding_ops, 1) >
53 portals4_btl->portals_max_outstanding_ops) {
54 OPAL_THREAD_ADD_FETCH32(&portals4_btl->portals_outstanding_ops, -1);
55 OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
56 "Call to mca_btl_portals4_component_progress (4)\n"));
57 mca_btl_portals4_component_progress();
58 }
59 OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
60 "mca_btl_portals4_send: Incrementing portals_outstanding_ops=%d\n",
61 portals4_btl->portals_outstanding_ops));
62
63 OPAL_OUTPUT_VERBOSE((50, opal_btl_base_framework.framework_output,
64 "PtlPut frag=%p rank=%x pid=%x tag=%x len=%ld match_bits=%lx\n",
65 (void*)frag, endpoint->ptl_proc.rank, endpoint->ptl_proc.phys.pid, tag,
66 put_length, (uint64_t)match_bits));
67
68 ret = PtlPut(portals4_btl->send_md_h,
69 (ptl_size_t) frag->segments[0].base.seg_addr.pval,
70 put_length,
71 (mca_btl_portals4_component.portals_need_ack ? PTL_ACK_REQ : PTL_NO_ACK_REQ),
72 endpoint->ptl_proc,
73 portals4_btl->recv_idx,
74 match_bits,
75 0,
76 (void *) frag,
77 tag);
78 if (ret != PTL_OK) {
79 opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals4_send: PtlPut failed with error %d", ret);
80 return OPAL_ERROR;
81 }
82 OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
83 "PtlPut frag=%p rank=%x pid=%x tag=%x addr=%p len=%ld match_bits=%lx",
84 (void*)frag, endpoint->ptl_proc.rank, endpoint->ptl_proc.phys.pid, tag,
85 (void *)frag->segments[0].base.seg_addr.pval, put_length, (uint64_t)match_bits));
86
87 return OPAL_SUCCESS;
88 }
89
90
91 int mca_btl_portals4_sendi(struct mca_btl_base_module_t* btl_base,
92 struct mca_btl_base_endpoint_t* endpoint,
93 struct opal_convertor_t* convertor,
94 void* header,
95 size_t header_size,
96 size_t payload_size,
97 uint8_t order,
98 uint32_t flags,
99 mca_btl_base_tag_t tag,
100 mca_btl_base_descriptor_t** des)
101 {
102 opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals_sendi is not implemented");
103 BTL_ERROR(("mca_btl_portals_sendi is not implemented"));
104 return OPAL_SUCCESS;
105 }