Skip to content

Commit 09ad7e8

Browse files
authored
Merge pull request #2007 from jsquyres/pr/usnic-show-local-udp-ports
usnic: show the local UDP ports
2 parents e03a40a + 87a5ccc commit 09ad7e8

File tree

1 file changed

+60
-4
lines changed

1 file changed

+60
-4
lines changed

opal/mca/btl/usnic/btl_usnic_module.c

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@
6969
static void finalize_one_channel(opal_btl_usnic_module_t *module,
7070
struct opal_btl_usnic_channel_t *channel);
7171

72+
static int channel_addr2str(opal_btl_usnic_module_t *module, int channel,
73+
char *str, size_t len_param)
74+
{
75+
size_t len;
76+
77+
len = len_param;
78+
fi_av_straddr(module->av, module->mod_channels[channel].info->src_addr,
79+
str, &len);
80+
if (len > len_param) {
81+
opal_show_help("help-mpi-btl-usnic.txt",
82+
"libfabric API failed",
83+
true,
84+
opal_process_info.nodename,
85+
module->linux_device_name,
86+
"fi_av_straddr", __FILE__, __LINE__,
87+
FI_ENODATA,
88+
"Failed to convert address to string: buffer too short");
89+
90+
return OPAL_ERR_OUT_OF_RESOURCE;
91+
}
92+
93+
return OPAL_SUCCESS;
94+
}
95+
7296

7397
/*
7498
* Loop over a block of procs sent to us in add_procs and see if we
@@ -159,12 +183,29 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
159183
modex->ipv4_addr,
160184
modex->netmask);
161185

186+
char local_pri_addr[64] = {0};
187+
rc = channel_addr2str(module, USNIC_PRIORITY_CHANNEL,
188+
local_pri_addr, sizeof(local_pri_addr));
189+
if (OPAL_SUCCESS != rc) {
190+
OBJ_RELEASE(usnic_proc);
191+
continue;
192+
}
193+
194+
char local_data_addr[64] = {0};
195+
rc = channel_addr2str(module, USNIC_DATA_CHANNEL,
196+
local_data_addr, sizeof(local_data_addr));
197+
if (OPAL_SUCCESS != rc) {
198+
OBJ_RELEASE(usnic_proc);
199+
continue;
200+
}
201+
162202
opal_output_verbose(5, USNIC_OUT,
163-
"btl:usnic:add_procs:%s: new usnic peer endpoint: %s, proirity port %d, data port %d",
203+
"btl:usnic:add_procs:%s: new usnic peer endpoint: pri=%s:%d, data=%s:%d (local: pri=%s, data=%s)",
164204
module->linux_device_name,
165-
str,
166-
modex->ports[USNIC_PRIORITY_CHANNEL],
167-
modex->ports[USNIC_DATA_CHANNEL]);
205+
str, modex->ports[USNIC_PRIORITY_CHANNEL],
206+
str, modex->ports[USNIC_DATA_CHANNEL],
207+
local_pri_addr,
208+
local_data_addr);
168209

169210
endpoints[i] = usnic_endpoint;
170211
++num_created;
@@ -1633,6 +1674,21 @@ static int create_ep(opal_btl_usnic_module_t* module,
16331674
assert(0 != sin->sin_port);
16341675
}
16351676

1677+
char *str;
1678+
if (USNIC_PRIORITY_CHANNEL == channel->chan_index) {
1679+
str = "priority";
1680+
} else if (USNIC_DATA_CHANNEL == channel->chan_index) {
1681+
str = "data";
1682+
} else {
1683+
str = "UNKNOWN";
1684+
}
1685+
opal_output_verbose(15, USNIC_OUT,
1686+
"btl:usnic:create_ep:%s: new usnic local endpoint channel %s: %s:%d",
1687+
module->fabric_info->fabric_attr->name,
1688+
str,
1689+
inet_ntoa(sin->sin_addr),
1690+
ntohs(sin->sin_port));
1691+
16361692
/* actual sizes */
16371693
channel->chan_rd_num = channel->info->rx_attr->size;
16381694
channel->chan_sd_num = channel->info->tx_attr->size;

0 commit comments

Comments
 (0)