Skip to content

Instantly share code, notes, and snippets.

@jsquyres
Created August 25, 2016 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsquyres/dd959a48b6d9d34a41261c7cf7998a5e to your computer and use it in GitHub Desktop.
Save jsquyres/dd959a48b6d9d34a41261c7cf7998a5e to your computer and use it in GitHub Desktop.
ben's suggested patch for https://github.com/open-mpi/ompi/pull/2007
diff --git a/opal/mca/btl/usnic/btl_usnic_module.c b/opal/mca/btl/usnic/btl_usnic_mod
ule.c
index cdc301b..ffcfa21 100644
--- a/opal/mca/btl/usnic/btl_usnic_module.c
+++ b/opal/mca/btl/usnic/btl_usnic_module.c
@@ -83,6 +83,10 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_
t *module,
int rc;
opal_proc_t* my_proc;
size_t num_created = 0;
+ char priority_address[64] = {0};
+ char data_address[64] = {0};
+ size_t size;
+
/* get pointer to my proc structure */
my_proc = opal_proc_local_get();
@@ -159,20 +163,22 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_modu
le_t *module,
modex->ipv4_addr,
modex->netmask);
- struct sockaddr_in *sinp, *sind;
- sinp = (struct sockaddr_in *)
- module->mod_channels[USNIC_PRIORITY_CHANNEL].info->src_addr;
- sind = (struct sockaddr_in *)
- module->mod_channels[USNIC_DATA_CHANNEL].info->src_addr;
+ /* Maybe do some error handling here*/
+ size = sizeof(priority_address);
+ fi_av_straddr(
+ module->av,
+ &module->mod_channels[USNIC_PRIORITY_CHANNEL].info->src_addr,
+ priority_address, &size);
+
+ size = sizeof(data_address);
+ fi_av_straddr(module->av,
+ &module->mod_channels[USNIC_DATA_CHANNEL].info->src_addr,
+ data_address, &size);
+
opal_output_verbose(5, USNIC_OUT,
- "btl:usnic:add_procs:%s: new usnic peer endpoint: %s, pr
iority port %d, data port %d (local: %s, pri=%d, data=%d)",
- module->fabric_info->fabric_attr->name,
- str,
- modex->ports[USNIC_PRIORITY_CHANNEL],
- modex->ports[USNIC_DATA_CHANNEL],
- inet_ntoa(sinp->sin_addr),
- ntohs(sinp->sin_port),
- ntohs(sind->sin_port));
+ "btl:usnic:add_procs:%s: new usnic peer endpoint: %s, pr
iority address: %s, data address: %s",
+ module->fabric_info->fabric_attr->name, str,
+ priority_address, data_address);
endpoints[i] = usnic_endpoint;
++num_created;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment