This source file includes following definitions.
- orte_iof_hnp_send_data_to_endpoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include "orte_config.h"
24 #include "orte/constants.h"
25
26 #include <errno.h>
27 #ifdef HAVE_UNISTD_H
28 #include <unistd.h>
29 #endif
30 #include <string.h>
31
32 #include "opal/dss/dss.h"
33
34 #include "orte/mca/rml/rml.h"
35 #include "orte/mca/rml/rml_types.h"
36 #include "orte/mca/errmgr/errmgr.h"
37 #include "orte/runtime/orte_globals.h"
38 #include "orte/mca/grpcomm/grpcomm.h"
39 #include "orte/util/name_fns.h"
40
41 #include "orte/mca/iof/iof.h"
42 #include "orte/mca/iof/base/base.h"
43
44 #include "iof_hnp.h"
45
46 int orte_iof_hnp_send_data_to_endpoint(orte_process_name_t *host,
47 orte_process_name_t *target,
48 orte_iof_tag_t tag,
49 unsigned char *data, int numbytes)
50 {
51 opal_buffer_t *buf;
52 int rc;
53 orte_grpcomm_signature_t *sig;
54
55
56
57
58
59
60 if (ORTE_JOB_FAMILY(host->jobid) == ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)
61 && orte_job_term_ordered) {
62 return ORTE_SUCCESS;
63 }
64
65 buf = OBJ_NEW(opal_buffer_t);
66
67
68
69
70 if (ORTE_SUCCESS != (rc = opal_dss.pack(buf, &tag, 1, ORTE_IOF_TAG))) {
71 ORTE_ERROR_LOG(rc);
72 OBJ_RELEASE(buf);
73 return rc;
74 }
75
76
77
78
79 if (ORTE_SUCCESS != (rc = opal_dss.pack(buf, target, 1, ORTE_NAME))) {
80 ORTE_ERROR_LOG(rc);
81 OBJ_RELEASE(buf);
82 return rc;
83 }
84
85
86 if (NULL != data) {
87
88 if (ORTE_SUCCESS != (rc = opal_dss.pack(buf, data, numbytes, OPAL_BYTE))) {
89 ORTE_ERROR_LOG(rc);
90 OBJ_RELEASE(buf);
91 return rc;
92 }
93 }
94
95
96 if (ORTE_PROC_MY_NAME->jobid == host->jobid &&
97 ORTE_VPID_WILDCARD == host->vpid) {
98
99 sig = OBJ_NEW(orte_grpcomm_signature_t);
100 sig->signature = (orte_process_name_t*)malloc(sizeof(orte_process_name_t));
101 sig->signature[0].jobid = ORTE_PROC_MY_NAME->jobid;
102 sig->signature[0].vpid = ORTE_VPID_WILDCARD;
103 (void)orte_grpcomm.xcast(sig, ORTE_RML_TAG_IOF_PROXY, buf);
104 OBJ_RELEASE(buf);
105 OBJ_RELEASE(sig);
106 return ORTE_SUCCESS;
107 }
108
109
110
111
112 if (0 > (rc = orte_rml.send_buffer_nb(host, buf, ORTE_RML_TAG_IOF_PROXY,
113 orte_rml_send_callback, NULL))) {
114 ORTE_ERROR_LOG(rc);
115 return rc;
116 }
117
118 return ORTE_SUCCESS;
119 }