Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 6c1ab96

Browse files
committed
usnic: show the local UDP ports
Signed-off-by: Jeff Squyres <[email protected]> (cherry picked from commit 87a5ccc)
1 parent ea6c3cd commit 6c1ab96

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
@@ -67,6 +67,30 @@
6767
static void finalize_one_channel(opal_btl_usnic_module_t *module,
6868
struct opal_btl_usnic_channel_t *channel);
6969

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

7195
/*
7296
* Loop over a block of procs sent to us in add_procs and see if we
@@ -157,12 +181,29 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
157181
modex->ipv4_addr,
158182
modex->netmask);
159183

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

167208
endpoints[i] = usnic_endpoint;
168209
++num_created;
@@ -1627,6 +1668,21 @@ static int create_ep(opal_btl_usnic_module_t* module,
16271668
assert(0 != sin->sin_port);
16281669
}
16291670

1671+
char *str;
1672+
if (USNIC_PRIORITY_CHANNEL == channel->chan_index) {
1673+
str = "priority";
1674+
} else if (USNIC_DATA_CHANNEL == channel->chan_index) {
1675+
str = "data";
1676+
} else {
1677+
str = "UNKNOWN";
1678+
}
1679+
opal_output_verbose(15, USNIC_OUT,
1680+
"btl:usnic:create_ep:%s: new usnic local endpoint channel %s: %s:%d",
1681+
module->fabric_info->fabric_attr->name,
1682+
str,
1683+
inet_ntoa(sin->sin_addr),
1684+
ntohs(sin->sin_port));
1685+
16301686
/* actual sizes */
16311687
channel->chan_rd_num = channel->info->rx_attr->size;
16321688
channel->chan_sd_num = channel->info->tx_attr->size;

0 commit comments

Comments
 (0)