Commit 8a787409 authored by Marc Vef's avatar Marc Vef
Browse files

Finished migration to margo 0.2. Also, solved Issue #13.

parent d0170dc9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include <preload/preload.hpp>

extern "C" {
#include <mercury.h>
#include <mercury_types.h>
#include <mercury_proc_string.h>
#include <margo.h>
}
+1 −4
Original line number Diff line number Diff line
@@ -74,16 +74,13 @@ int rpc_send_read(const hg_id_t ipc_read_data_id, const hg_id_t rpc_read_data_id
        err = out.res;
        LD_LOG_TRACE(debug_fd, "Got response %d\n", out.res);
        /* clean up resources consumed by this rpc */
        margo_bulk_free(in.bulk_handle);
        margo_free_output(handle, &out);
    } else {
        LD_LOG_ERROR0(debug_fd, "RPC rpc_send_read (timed out)");
        err = EAGAIN;
    }

    in.path = nullptr;

    margo_bulk_free(in.bulk_handle);
    margo_free_input(handle, &in);
    margo_destroy(handle);

    return err;
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
// margo
extern "C" {
#include <abt.h>
#include <abt-snoozer.h>
#include <mercury.h>
#include <margo.h>
}
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ void init_environment() {
 * Destroys the margo, argobots, and mercury environments
 */
void destroy_enviroment() {
//    margo_diag_dump(RPC_DATA->server_ipc_mid(), "-", 0);
    ADAFS_DATA->spdlogger()->info("About to finalize the margo server");
    margo_finalize(RPC_DATA->server_rpc_mid());
    margo_finalize(RPC_DATA->server_ipc_mid());
+0 −14
Original line number Diff line number Diff line
@@ -93,15 +93,11 @@ bool ipc_send_get_fs_config(const hg_id_t ipc_get_config_id) {
            printf("[ERR] Retrieving fs configurations from daemon");
        }
        /* clean up resources consumed by this rpc */
        out.rootdir = nullptr;
        out.mountdir = nullptr;
        out.hosts_raw = nullptr;
        margo_free_output(handle, &out);
    } else {
        LD_LOG_ERROR0(debug_fd, "IPC send_get_config (timed out)\n");
    }

    margo_free_input(handle, &in);
    margo_destroy(handle);
    return ret == HG_SUCCESS;
}
@@ -141,9 +137,6 @@ int ipc_send_open(const string& path, int flags, const mode_t mode, const hg_id_
        LD_LOG_ERROR0(debug_fd, "IPC send_open (timed out)\n");
    }

    in.path = nullptr; // XXX temporary. If this is not done free input crashes because of invalid pointer?!

    margo_free_input(handle, &in);
    margo_destroy(handle);
    return err;
}
@@ -179,16 +172,12 @@ int ipc_send_stat(const string& path, string& attr, const hg_id_t ipc_stat_id) {
            attr = out.db_val;
        }
        /* clean up resources consumed by this rpc */
        out.db_val = nullptr;
        margo_free_output(handle, &out);
    } else {
        LD_LOG_ERROR0(debug_fd, "IPC send_stat (timed out)\n");
        err = 1;
    }

    in.path = nullptr; // XXX temporary. If this is not done free input crashes because of invalid pointer?!

    margo_free_input(handle, &in);
    margo_destroy(handle);
    return err;
}
@@ -226,9 +215,6 @@ int ipc_send_unlink(const string& path, const hg_id_t ipc_unlink_id) {
        LD_LOG_ERROR0(debug_fd, "IPC send_unlink (timed out)\n");
    }

    in.path = nullptr; // XXX temporary. If this is not done free input crashes because of invalid pointer?!

    margo_free_input(handle, &in);
    margo_destroy(handle);
    return err;
}
 No newline at end of file
Loading