-
Notifications
You must be signed in to change notification settings - Fork 29
/
psm_ep_connect.c
620 lines (554 loc) · 18.1 KB
/
psm_ep_connect.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/*
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright(c) 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Contact Information:
Intel Corporation, www.intel.com
BSD LICENSE
Copyright(c) 2015 Intel Corporation.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Copyright (c) 2003-2014 Intel Corporation. All rights reserved. */
#include "psm_user.h"
#include "psm_mq_internal.h"
int psmi_ep_device_is_enabled(const psm2_ep_t ep, int devid);
#if _HFI_DEBUGGING
PSMI_ALWAYS_INLINE(
char *psmi_getdevice(int type))
{
switch (type) {
case PTL_DEVID_IPS:
return "ips";
case PTL_DEVID_AMSH:
return "amsh";
case PTL_DEVID_SELF:
return "self";
default:
return "ips";
}
}
#endif
psm2_error_t
__psm2_ep_connect(psm2_ep_t ep, int num_of_epid, psm2_epid_t const *array_of_epid,
int const *array_of_epid_mask, /* can be NULL */
psm2_error_t *array_of_errors, psm2_epaddr_t *array_of_epaddr,
int64_t timeout)
{
psm2_error_t err = PSM2_OK;
ptl_ctl_t *ptlctl;
ptl_t *ptl;
int i, j, dup_idx;
int num_toconnect = 0;
int *epid_mask = NULL;
int *epid_mask_isdupof = NULL;
uint64_t t_start = get_cycles();
uint64_t t_left;
union psmi_envvar_val timeout_intval;
PSM2_LOG_MSG("entering");
PSMI_ERR_UNLESS_INITIALIZED(ep);
/*
* Normally we would lock here, but instead each implemented ptl component
* does its own locking. This is mostly because the ptl components are
* ahead of the PSM2 interface in that they can disconnect their peers.
*/
if (ep == NULL || array_of_epaddr == NULL || array_of_epid == NULL ||
num_of_epid < 1) {
err = psmi_handle_error(ep, PSM2_PARAM_ERR,
"Invalid psm2_ep_connect parameters");
goto fail_nolock;
}
PSMI_LOCK(ep->mq->progress_lock);
/* We need two of these masks to detect duplicates */
err = PSM2_NO_MEMORY;
epid_mask =
(int *)psmi_malloc(ep, UNDEFINED, sizeof(int) * num_of_epid);
if (epid_mask == NULL)
goto fail;
epid_mask_isdupof =
(int *)psmi_malloc(ep, UNDEFINED, sizeof(int) * num_of_epid);
if (epid_mask_isdupof == NULL)
goto fail;
err = PSM2_OK;
/* Eventually handle timeouts across all connects. */
for (j = 0; j < num_of_epid; j++) {
if (array_of_epid_mask != NULL && !array_of_epid_mask[j])
epid_mask[j] = 0;
else {
epid_mask[j] = 1;
array_of_errors[j] = PSM2_EPID_UNKNOWN;
array_of_epaddr[j] = NULL;
if (psmi_epid_version(array_of_epid[j]) >
PSMI_EPID_VERSION) {
psmi_handle_error(PSMI_EP_NORETURN, PSM2_INTERNAL_ERR,
" Unknown version of EPID - %"PRIu64" \n"
"Please upgrade PSM2 or set PSM2_ADDR_FMT=1 in the environment to force EPID version 1 \n",
psmi_epid_version(array_of_epid[j]));
}
num_toconnect++;
}
epid_mask_isdupof[j] = -1;
}
psmi_getenv("PSM2_CONNECT_TIMEOUT",
"End-point connection timeout over-ride. 0 for no time-out.",
PSMI_ENVVAR_LEVEL_USER, PSMI_ENVVAR_TYPE_UINT,
(union psmi_envvar_val)0, &timeout_intval);
if (getenv("PSM2_CONNECT_TIMEOUT")) {
timeout = timeout_intval.e_uint * SEC_ULL;
} else if (timeout > 0) {
/* The timeout parameter provides the minimum timeout. A heuristic
* is used to scale up the timeout linearly with the number of
* endpoints, and we allow one second per 100 endpoints. */
timeout = max(timeout, (num_toconnect * SEC_ULL) / 100);
}
if (timeout > 0 && timeout < PSMI_MIN_EP_CONNECT_TIMEOUT)
timeout = PSMI_MIN_EP_CONNECT_TIMEOUT;
_HFI_PRDBG("Connect to %d endpoints with time-out of %.2f secs\n",
num_toconnect, (double)timeout / 1e9);
/* Look for duplicates in input array */
for (i = 0; i < num_of_epid; i++) {
for (j = i + 1; j < num_of_epid; j++) {
if (array_of_epid[i] == array_of_epid[j] &&
epid_mask[i] && epid_mask[j]) {
epid_mask[j] = 0; /* don't connect more than once */
epid_mask_isdupof[j] = i;
}
}
}
for (i = 0; i < PTL_MAX_INIT; i++) {
if (ep->devid_enabled[i] == -1)
continue;
/* Set up the right connect ptrs */
switch (ep->devid_enabled[i]) {
case PTL_DEVID_IPS:
ptlctl = &ep->ptl_ips;
ptl = ep->ptl_ips.ptl;
break;
case PTL_DEVID_AMSH:
ptlctl = &ep->ptl_amsh;
ptl = ep->ptl_amsh.ptl;
break;
case PTL_DEVID_SELF:
ptlctl = &ep->ptl_self;
ptl = ep->ptl_self.ptl;
break;
default:
ptlctl = &ep->ptl_ips; /*no-unused */
ptl = ep->ptl_ips.ptl; /*no-unused */
psmi_handle_error(PSMI_EP_NORETURN, PSM2_INTERNAL_ERR,
"Unknown/unhandled PTL id %d\n",
ep->devid_enabled[i]);
break;
}
t_left = psmi_cycles_left(t_start, timeout);
if (_HFI_VDBG_ON) {
_HFI_VDBG_ALWAYS
("Trying to connect with device %s\n",
psmi_getdevice(ep->devid_enabled[i]));
}
if ((err = ptlctl->ep_connect(ptl, num_of_epid, array_of_epid,
epid_mask, array_of_errors,
array_of_epaddr,
cycles_to_nanosecs(t_left)))) {
if (_HFI_PRDBG_ON) {
_HFI_PRDBG_ALWAYS
("Connect failure in device %s err=%d\n",
psmi_getdevice(ep->devid_enabled[i]), err);
}
goto connect_fail;
}
/* Now process what's been connected */
for (j = 0; j < num_of_epid; j++) {
dup_idx = epid_mask_isdupof[j];
if (!epid_mask[j] && dup_idx == -1)
continue;
if (dup_idx != -1) { /* dup */
array_of_epaddr[j] = array_of_epaddr[dup_idx];
array_of_errors[j] = array_of_errors[dup_idx];
epid_mask_isdupof[j] = -1;
}
if (array_of_errors[j] == PSM2_OK) {
epid_mask[j] = 0; /* don't try on next ptl */
ep->connections++;
}
}
}
for (i = 0; i < num_of_epid; i++) {
ptl_ctl_t *c = NULL;
if (array_of_epid_mask != NULL && !array_of_epid_mask[i])
continue;
/* If we see unreachable here, that means some PTLs were not enabled */
if (array_of_errors[i] == PSM2_EPID_UNREACHABLE) {
err = PSM2_EPID_UNREACHABLE;
break;
}
psmi_assert_always(array_of_epaddr[i] != NULL);
c = array_of_epaddr[i]->ptlctl;
psmi_assert_always(c != NULL);
_HFI_VDBG("%-20s DEVICE %s (%p)\n",
psmi_epaddr_get_name(array_of_epid[i]),
c == &ep->ptl_ips ? "hfi" :
(c == &ep->ptl_amsh ? "amsh" : "self"),
(void *)array_of_epaddr[i]->ptlctl->ptl);
}
if (err == PSM2_OK)
for (i=0; i<num_of_epid; i++)
array_of_errors[i] = PSM2_OK;
connect_fail:
/* If the error is a timeout (at worse) and the client is OPA MPI,
* just return timeout to let OPA MPI handle the hostnames that
* timed out */
if (err != PSM2_OK) {
char errbuf[PSM2_ERRSTRING_MAXLEN];
size_t len;
int j = 0;
if (err == PSM2_EPID_UNREACHABLE) {
char *deverr = "of an incorrect setting";
char *eperr = "";
char *devname = NULL;
if (!psmi_ep_device_is_enabled(ep, PTL_DEVID_AMSH)) {
deverr =
"there is no shared memory PSM2 device (shm)";
eperr = " shared memory";
} else
if (!psmi_ep_device_is_enabled(ep, PTL_DEVID_IPS)) {
deverr =
"there is no OPA PSM2 device (hfi)";
eperr = " OPA";
}
len = snprintf(errbuf, sizeof(errbuf) - 1,
"Some%s endpoints could not be connected because %s "
"in the currently enabled PSM2_DEVICES (",
eperr, deverr);
for (i = 0; i < PTL_MAX_INIT && len < sizeof(errbuf) - 1;
i++) {
switch (ep->devid_enabled[i]) {
case PTL_DEVID_IPS:
devname = "hfi";
break;
case PTL_DEVID_AMSH:
devname = "shm";
break;
case PTL_DEVID_SELF:
default:
devname = "self";
break;
}
len +=
snprintf(errbuf + len,
sizeof(errbuf) - len - 1, "%s,",
devname);
}
if (len < sizeof(errbuf) - 1 && devname != NULL)
/* parsed something, remove trailing comma */
errbuf[len - 1] = ')';
} else
len = snprintf(errbuf, sizeof(errbuf) - 1,
"%s", err == PSM2_TIMEOUT ?
"Detected connection timeout" :
psm2_error_get_string(err));
/* first pass, look for all nodes with the error */
for (i = 0; i < num_of_epid && len < sizeof(errbuf) - 1; i++) {
if (array_of_epid_mask != NULL
&& !array_of_epid_mask[i])
continue;
if (array_of_errors[i] == PSM2_OK)
continue;
if (array_of_errors[i] == PSM2_EPID_UNREACHABLE &&
err != PSM2_EPID_UNREACHABLE)
continue;
if (err == array_of_errors[i]) {
len +=
snprintf(errbuf + len,
sizeof(errbuf) - len - 1, "%c %s",
j == 0 ? ':' : ',',
psmi_epaddr_get_hostname
(array_of_epid[i]));
j++;
}
}
errbuf[sizeof(errbuf) - 1] = '\0';
err = psmi_handle_error(ep, err, "%s", errbuf);
}
fail:
PSMI_UNLOCK(ep->mq->progress_lock);
fail_nolock:
if (epid_mask != NULL)
psmi_free(epid_mask);
if (epid_mask_isdupof != NULL)
psmi_free(epid_mask_isdupof);
PSM2_LOG_MSG("leaving");
return err;
}
PSMI_API_DECL(psm2_ep_connect)
psm2_error_t __psm2_ep_disconnect(psm2_ep_t ep, int num_of_epaddr,
psm2_epaddr_t *array_of_epaddr,
const int *array_of_epaddr_mask,
psm2_error_t *array_of_errors,
int64_t timeout)
{
return psm2_ep_disconnect2(ep, num_of_epaddr, array_of_epaddr,
array_of_epaddr_mask, array_of_errors,
PSM2_EP_DISCONNECT_GRACEFUL, timeout);
}
PSMI_API_DECL(psm2_ep_disconnect)
psm2_error_t __psm2_ep_disconnect2(psm2_ep_t ep, int num_of_epaddr,
psm2_epaddr_t *array_of_epaddr,
const int *array_of_epaddr_mask,
psm2_error_t *array_of_errors,
int mode, int64_t timeout)
{
psm2_error_t err = PSM2_OK;
ptl_ctl_t *ptlctl;
ptl_t *ptl;
int i, j, dup_idx;
int num_todisconnect = 0;
int *epaddr_mask = NULL;
int *epaddr_mask_isdupof = NULL;
uint64_t t_start = get_cycles();
uint64_t t_left;
union psmi_envvar_val timeout_intval;
PSM2_LOG_MSG("entering");
PSMI_ERR_UNLESS_INITIALIZED(ep);
/*
* Normally we would lock here, but instead each implemented ptl component
* does its own locking. This is mostly because the ptl components are
* ahead of the PSM2 interface in that they can disconnect their peers.
*/
if (ep == NULL || array_of_epaddr == NULL ||
num_of_epaddr < 1) {
err = psmi_handle_error(ep, PSM2_PARAM_ERR,
"Invalid psm2_ep_disconnect parameters");
goto fail_nolock;
}
PSMI_LOCK(ep->mq->progress_lock);
/* We need two of these masks to detect duplicates */
err = PSM2_NO_MEMORY;
epaddr_mask =
(int *)psmi_malloc(ep, UNDEFINED, sizeof(int) * num_of_epaddr);
if (epaddr_mask == NULL)
goto fail;
epaddr_mask_isdupof =
(int *)psmi_malloc(ep, UNDEFINED, sizeof(int) * num_of_epaddr);
if (epaddr_mask_isdupof == NULL)
goto fail;
err = PSM2_OK;
/* Eventually handle timeouts across all connects. */
for (j = 0; j < num_of_epaddr; j++) {
if (array_of_epaddr_mask != NULL && !array_of_epaddr_mask[j])
epaddr_mask[j] = 0;
else {
epaddr_mask[j] = 1;
array_of_errors[j] = PSM2_EPID_UNKNOWN;
num_todisconnect++;
}
epaddr_mask_isdupof[j] = -1;
}
psmi_getenv("PSM2_DISCONNECT_TIMEOUT",
"End-point disconnection timeout over-ride. 0 for no time-out.",
PSMI_ENVVAR_LEVEL_USER, PSMI_ENVVAR_TYPE_UINT,
(union psmi_envvar_val)0, &timeout_intval);
if (getenv("PSM2_DISCONNECT_TIMEOUT")) {
timeout = timeout_intval.e_uint * SEC_ULL;
} else if (timeout > 0) {
/* The timeout parameter provides the minimum timeout. A heuristic
* is used to scale up the timeout linearly with the number of
* endpoints, and we allow one second per 100 endpoints. */
timeout = max(timeout, (num_todisconnect * SEC_ULL) / 100);
}
if (timeout > 0 && timeout < PSMI_MIN_EP_CONNECT_TIMEOUT)
timeout = PSMI_MIN_EP_CONNECT_TIMEOUT;
_HFI_PRDBG("Disconnect %d endpoints with time-out of %.2f secs\n",
num_todisconnect, (double)timeout / 1e9);
/* Look for duplicates in input array */
for (i = 0; i < num_of_epaddr; i++) {
for (j = i + 1; j < num_of_epaddr; j++) {
if (array_of_epaddr[i] == array_of_epaddr[j] &&
epaddr_mask[i] && epaddr_mask[j]) {
epaddr_mask[j] = 0; /* don't disconnect more than once */
epaddr_mask_isdupof[j] = i;
}
}
}
for (i = 0; i < PTL_MAX_INIT; i++) {
if (ep->devid_enabled[i] == -1)
continue;
/* Set up the right connect ptrs */
switch (ep->devid_enabled[i]) {
case PTL_DEVID_IPS:
ptlctl = &ep->ptl_ips;
ptl = ep->ptl_ips.ptl;
break;
case PTL_DEVID_AMSH:
ptlctl = &ep->ptl_amsh;
ptl = ep->ptl_amsh.ptl;
break;
case PTL_DEVID_SELF:
ptlctl = &ep->ptl_self;
ptl = ep->ptl_self.ptl;
break;
default:
ptlctl = &ep->ptl_ips; /*no-unused */
ptl = ep->ptl_ips.ptl; /*no-unused */
psmi_handle_error(PSMI_EP_NORETURN, PSM2_INTERNAL_ERR,
"Unknown/unhandled PTL id %d\n",
ep->devid_enabled[i]);
break;
}
t_left = psmi_cycles_left(t_start, timeout);
if (_HFI_VDBG_ON) {
_HFI_VDBG_ALWAYS
("Trying to disconnect with device %s\n",
psmi_getdevice(ep->devid_enabled[i]));
}
if ((err = ptlctl->ep_disconnect(ptl, (mode == PSM2_EP_DISCONNECT_FORCE),
num_of_epaddr, array_of_epaddr,
epaddr_mask, array_of_errors,
cycles_to_nanosecs(t_left)))) {
if (_HFI_PRDBG_ON) {
_HFI_PRDBG_ALWAYS
("Disconnect failure in device %s err=%d\n",
psmi_getdevice(ep->devid_enabled[i]), err);
}
goto disconnect_fail;
}
/* Now process what's been disconnected */
for (j = 0; j < num_of_epaddr; j++) {
dup_idx = epaddr_mask_isdupof[j];
if (!epaddr_mask[j] && dup_idx == -1)
continue;
if (dup_idx != -1) { /* dup */
array_of_errors[j] = array_of_errors[dup_idx];
epaddr_mask_isdupof[j] = -1;
}
if (array_of_errors[j] == PSM2_OK) {
epaddr_mask[j] = 0; /* don't try on next ptl */
array_of_epaddr[j] = NULL;
ep->connections--;
}
}
}
for (i = 0; i < num_of_epaddr; i++) {
if (array_of_epaddr_mask != NULL && !array_of_epaddr_mask[i])
continue;
/* If we see unreachable here, that means some PTLs were not enabled */
if (array_of_errors[i] == PSM2_EPID_UNREACHABLE) {
err = PSM2_EPID_UNREACHABLE;
break;
}
}
disconnect_fail:
/* If the error is a timeout (at worse) and the client is OPA MPI,
* just return timeout to let OPA MPI handle the hostnames that
* timed out */
if (err != PSM2_OK) {
char errbuf[PSM2_ERRSTRING_MAXLEN];
size_t len;
int j = 0;
if (err == PSM2_EPID_UNREACHABLE) {
char *deverr = "of an incorrect setting";
char *eperr = "";
char *devname = NULL;
if (!psmi_ep_device_is_enabled(ep, PTL_DEVID_AMSH)) {
deverr =
"there is no shared memory PSM2 device (shm)";
eperr = " shared memory";
} else
if (!psmi_ep_device_is_enabled(ep, PTL_DEVID_IPS)) {
deverr =
"there is no OPA PSM2 device (hfi)";
eperr = " OPA";
}
len = snprintf(errbuf, sizeof(errbuf) - 1,
"Some%s endpoints could not be disconnected because %s "
"in the currently enabled PSM2_DEVICES (",
eperr, deverr);
for (i = 0; i < PTL_MAX_INIT && len < sizeof(errbuf) - 1; i++) {
switch (ep->devid_enabled[i]) {
case PTL_DEVID_IPS:
devname = "hfi";
break;
case PTL_DEVID_AMSH:
devname = "shm";
break;
case PTL_DEVID_SELF:
default:
devname = "self";
break;
}
len +=
snprintf(errbuf + len,
sizeof(errbuf) - len - 1, "%s,",
devname);
}
if (len < sizeof(errbuf) - 1 && devname != NULL)
/* parsed something, remove trailing comma */
errbuf[len - 1] = ')';
} else
len = snprintf(errbuf, sizeof(errbuf) - 1,
"%s", err == PSM2_TIMEOUT ?
"Detected disconnect timeout" :
psm2_error_get_string(err));
/* first pass, look for all nodes with the error */
for (i = 0; i < num_of_epaddr && len < sizeof(errbuf) - 1; i++) {
if (array_of_epaddr_mask != NULL
&& !array_of_epaddr_mask[i])
continue;
if (array_of_errors[i] == PSM2_OK)
continue;
if (array_of_errors[i] == PSM2_EPID_UNREACHABLE &&
err != PSM2_EPID_UNREACHABLE)
continue;
if (err == array_of_errors[i]) {
len +=
snprintf(errbuf + len,
sizeof(errbuf) - len - 1, "%c %s",
j == 0 ? ':' : ',',
psmi_epaddr_get_hostname
(array_of_epaddr[i]->epid));
j++;
}
}
errbuf[sizeof(errbuf) - 1] = '\0';
err = psmi_handle_error(ep, err, "%s", errbuf);
}
fail:
PSMI_UNLOCK(ep->mq->progress_lock);
fail_nolock:
if (epaddr_mask != NULL)
psmi_free(epaddr_mask);
if (epaddr_mask_isdupof != NULL)
psmi_free(epaddr_mask_isdupof);
PSM2_LOG_MSG("leaving");
return err;
}
PSMI_API_DECL(psm2_ep_disconnect2)