Commit 0c981f6b authored by Philip Carns's avatar Philip Carns

utilize synchronous HG_Addr_lookup() if present

parent 1a9f89e1
......@@ -1058,6 +1058,14 @@ hg_return_t margo_addr_lookup(
hg_addr_t *addr)
{
hg_return_t hret;
#ifdef HG_Addr_lookup
/* Mercury 2.x provides two versions of lookup (async and sync). Choose the
* former if available to avoid context switch
*/
hret = HG_Addr_lookup2(mid->hg_class, name, addr);
#else /* !defined HG_Addr_lookup */
struct lookup_cb_evt *evt;
ABT_eventual eventual;
int ret;
......@@ -1065,7 +1073,7 @@ hg_return_t margo_addr_lookup(
ret = ABT_eventual_create(sizeof(*evt), &eventual);
if(ret != 0)
{
return(HG_NOMEM_ERROR);
return(HG_NOMEM_ERROR);
}
hret = HG_Addr_lookup(mid->hg_context, margo_addr_lookup_cb,
......@@ -1078,6 +1086,7 @@ hg_return_t margo_addr_lookup(
}
ABT_eventual_free(&eventual);
#endif
return(hret);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment