Verified Commit 31e78184 authored by Marc Vef's avatar Marc Vef
Browse files

Fix: Margo handle cache with local communication

See: https://xgitlab.cels.anl.gov/sds/margo/issues/47

Workaround must be reverted once fixed.
parent d8fb6dbe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ echo "############################################################ Installing:
CURR=${SOURCE}/margo
prepare_build_dir ${CURR}
cd ${CURR}
echo "########## Applying margo handle cache fix"
git apply ${PATCH_DIR}/handle_cache.patch
./prepare.sh
cd ${CURR}/build
../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig CFLAGS="-Wall -O3"
+37 −0
Original line number Diff line number Diff line
diff --git a/include/margo.h b/include/margo.h
index 56aa9dd..9dd49a8 100644
--- a/include/margo.h
+++ b/include/margo.h
@@ -435,6 +435,12 @@ hg_return_t margo_create(
     hg_id_t id,
     hg_handle_t *handle);
 
+hg_return_t margo_create_cache(
+    margo_instance_id mid,
+    hg_addr_t addr,
+    hg_id_t id,
+    hg_handle_t *handle);
+
 /**
  * Destroy Mercury handle.
  *
diff --git a/src/margo.c b/src/margo.c
index df035c1..87c2524 100644
--- a/src/margo.c
+++ b/src/margo.c
@@ -716,6 +716,15 @@ hg_return_t margo_create(margo_instance_id mid, hg_addr_t addr,
     hg_id_t id, hg_handle_t *handle)
 {
     hg_return_t hret = HG_OTHER_ERROR;
+    hret = HG_Create(mid->hg_context, addr, id, handle);
+
+    return hret;
+}
+
+hg_return_t margo_create_cache(margo_instance_id mid, hg_addr_t addr,
+    hg_id_t id, hg_handle_t *handle)
+{
+    hg_return_t hret = HG_OTHER_ERROR;
 
     /* look for a handle to reuse */
     hret = margo_handle_cache_get(mid, addr, id, handle);
+5 −1
Original line number Diff line number Diff line
@@ -265,7 +265,11 @@ margo_create_wrap_helper(const hg_id_t rpc_id, uint64_t recipient, hg_handle_t&
        CTX->log()->error("{}() server address not resolvable for host id {}", __func__, recipient);
        return HG_OTHER_ERROR;
    }
    // TODO The following is a work around until https://xgitlab.cels.anl.gov/sds/margo/issues/47 is fixed
    if (recipient == CTX->fs_conf()->host_id)
        ret = margo_create(ld_margo_rpc_id, svr_addr, rpc_id, &handle);
    else
        ret = margo_create_cache(ld_margo_rpc_id, svr_addr, rpc_id, &handle);
    if (ret != HG_SUCCESS) {
        CTX->log()->error("{}() creating handle FAILED", __func__);
        return HG_OTHER_ERROR;