Loading ifs/include/daemon/handler/rpc_defs.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #define LFS_RPC_DEFS_HPP extern "C" { #include <mercury.h> #include <margo.h> } Loading ifs/include/preload/preload_util.hpp +5 −22 Original line number Diff line number Diff line Loading @@ -26,27 +26,9 @@ struct MetadentryUpdateFlags { }; // Margo instances extern margo_instance_id ld_margo_ipc_id; extern margo_instance_id ld_margo_rpc_id; // local daemon address for margo ipc client extern hg_addr_t daemon_svr_addr; // IPC IDs extern hg_id_t ipc_minimal_id; extern hg_id_t ipc_config_id; extern hg_id_t ipc_mk_node_id; extern hg_id_t ipc_access_id; extern hg_id_t ipc_stat_id; extern hg_id_t ipc_rm_node_id; extern hg_id_t ipc_decr_size_id; extern hg_id_t ipc_update_metadentry_id; extern hg_id_t ipc_get_metadentry_size_id; extern hg_id_t ipc_update_metadentry_size_id; extern hg_id_t ipc_write_data_id; extern hg_id_t ipc_read_data_id; extern hg_id_t ipc_trunc_data_id; extern hg_id_t ipc_get_dirents_id; extern hg_id_t ipc_chunk_stat_id; // RPC IDs extern hg_id_t rpc_config_id; extern hg_id_t rpc_minimal_id; extern hg_id_t rpc_mk_node_id; extern hg_id_t rpc_stat_id; Loading Loading @@ -78,10 +60,11 @@ void cleanup_addresses(); bool get_addr_by_hostid(uint64_t hostid, hg_addr_t& svr_addr); bool is_local_op(size_t recipient); hg_return margo_create_wrap_helper(const hg_id_t rpc_id, uint64_t recipient, hg_handle_t& handle); hg_return margo_create_wrap(hg_id_t ipc_id, hg_id_t rpc_id, const std::string&, hg_handle_t& handle, bool force_rpc); hg_return margo_create_wrap(const hg_id_t rpc_id, const std::string&, hg_handle_t& handle); hg_return margo_create_wrap(const hg_id_t ipc_id, const hg_id_t rpc_id, const size_t& recipient, hg_handle_t& handle, bool force_rpc); #endif //IFS_PRELOAD_UTIL_HPP ifs/scripts/compile_dep.sh +3 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ fi cd ${CURR}/build $CMAKE -DMERCURY_USE_SELF_FORWARD:BOOL=ON -DMERCURY_USE_CHECKSUMS:BOOL=OFF -DBUILD_TESTING:BOOL=ON \ -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=${INSTALL} \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=ON ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ -DCMAKE_BUILD_TYPE:STRING=Debug -DMERCURY_USE_EAGER_BULK:BOOL=ON ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ make -j${CORES} make install Loading @@ -311,6 +311,8 @@ echo "############################################################ Installing: CURR=${SOURCE}/margo prepare_build_dir ${CURR} cd ${CURR} echo "########## Applying allow init option path" git apply ${PATCH_DIR}/margo_allow_init_options.patch ./prepare.sh cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig CFLAGS="-Wall -O3" Loading ifs/scripts/patches/margo_allow_init_options.patch 0 → 100644 +70 −0 Original line number Diff line number Diff line From 0609a71efbc02dc3d65768c9219770277c4329de Mon Sep 17 00:00:00 2001 From: Tommaso Tocci <tommaso@tocci.pro> Date: Thu, 11 Oct 2018 23:46:19 +0200 Subject: [PATCH] Add hg_init_info to margo init --- include/margo.h | 8 ++++++++ src/margo.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/margo.h b/include/margo.h index a5f7587..774b1f6 100644 --- a/include/margo.h +++ b/include/margo.h @@ -46,6 +46,7 @@ typedef ABT_eventual margo_request; /** * Initializes margo library. * @param [in] addr_str Mercury host address with port number + * @param [in] hg_init_info Mercury initialization options * @param [in] mode Mode to run Margo in: * - MARGO_CLIENT_MODE * - MARGO_SERVER_MODE @@ -67,6 +68,13 @@ typedef ABT_eventual margo_request; * call margo_wait_for_finalize() after margo_init() to relinguish control to * Margo. */ +margo_instance_id margo_init_info( + const char *addr_str, + int mode, + const struct hg_init_info *hg_init_info, + int use_progress_thread, + int rpc_thread_count); + margo_instance_id margo_init( const char *addr_str, int mode, diff --git a/src/margo.c b/src/margo.c index ea73fc2..da8f69e 100644 --- a/src/margo.c +++ b/src/margo.c @@ -171,7 +171,16 @@ static hg_return_t margo_handle_cache_put(margo_instance_id mid, static hg_id_t margo_register_internal(margo_instance_id mid, hg_id_t id, hg_proc_cb_t in_proc_cb, hg_proc_cb_t out_proc_cb, hg_rpc_cb_t rpc_cb, ABT_pool pool); -margo_instance_id margo_init(const char *addr_str, int mode, +margo_instance_id margo_init(const char *addr_str, + int mode, + int use_progress_thread, int rpc_thread_count) +{ + return margo_init_info(addr_str, mode, NULL, use_progress_thread, rpc_thread_count); +} + +margo_instance_id margo_init_info(const char *addr_str, + int mode, + const struct hg_init_info *hg_init_info, int use_progress_thread, int rpc_thread_count) { ABT_xstream progress_xstream = ABT_XSTREAM_NULL; @@ -268,7 +277,7 @@ margo_instance_id margo_init(const char *addr_str, int mode, rpc_pool = progress_pool; } - hg_class = HG_Init(addr_str, listen_flag); + hg_class = HG_Init_opt(addr_str, listen_flag, hg_init_info); if(!hg_class) goto err; hg_context = HG_Context_create(hg_class); -- 2.19.1 ifs/src/daemon/adafs_daemon.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,6 @@ bool init_rpc_server() { * @param hg_class */ void register_server_rpcs(margo_instance_id mid) { if (RPC_DATA->server_ipc_mid() == mid) MARGO_REGISTER(mid, hg_tag::fs_config, ipc_config_in_t, ipc_config_out_t, ipc_srv_fs_config); MARGO_REGISTER(mid, hg_tag::minimal, rpc_minimal_in_t, rpc_minimal_out_t, rpc_minimal); MARGO_REGISTER(mid, hg_tag::create, rpc_mk_node_in_t, rpc_err_out_t, rpc_srv_mk_node); Loading Loading
ifs/include/daemon/handler/rpc_defs.hpp +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #define LFS_RPC_DEFS_HPP extern "C" { #include <mercury.h> #include <margo.h> } Loading
ifs/include/preload/preload_util.hpp +5 −22 Original line number Diff line number Diff line Loading @@ -26,27 +26,9 @@ struct MetadentryUpdateFlags { }; // Margo instances extern margo_instance_id ld_margo_ipc_id; extern margo_instance_id ld_margo_rpc_id; // local daemon address for margo ipc client extern hg_addr_t daemon_svr_addr; // IPC IDs extern hg_id_t ipc_minimal_id; extern hg_id_t ipc_config_id; extern hg_id_t ipc_mk_node_id; extern hg_id_t ipc_access_id; extern hg_id_t ipc_stat_id; extern hg_id_t ipc_rm_node_id; extern hg_id_t ipc_decr_size_id; extern hg_id_t ipc_update_metadentry_id; extern hg_id_t ipc_get_metadentry_size_id; extern hg_id_t ipc_update_metadentry_size_id; extern hg_id_t ipc_write_data_id; extern hg_id_t ipc_read_data_id; extern hg_id_t ipc_trunc_data_id; extern hg_id_t ipc_get_dirents_id; extern hg_id_t ipc_chunk_stat_id; // RPC IDs extern hg_id_t rpc_config_id; extern hg_id_t rpc_minimal_id; extern hg_id_t rpc_mk_node_id; extern hg_id_t rpc_stat_id; Loading Loading @@ -78,10 +60,11 @@ void cleanup_addresses(); bool get_addr_by_hostid(uint64_t hostid, hg_addr_t& svr_addr); bool is_local_op(size_t recipient); hg_return margo_create_wrap_helper(const hg_id_t rpc_id, uint64_t recipient, hg_handle_t& handle); hg_return margo_create_wrap(hg_id_t ipc_id, hg_id_t rpc_id, const std::string&, hg_handle_t& handle, bool force_rpc); hg_return margo_create_wrap(const hg_id_t rpc_id, const std::string&, hg_handle_t& handle); hg_return margo_create_wrap(const hg_id_t ipc_id, const hg_id_t rpc_id, const size_t& recipient, hg_handle_t& handle, bool force_rpc); #endif //IFS_PRELOAD_UTIL_HPP
ifs/scripts/compile_dep.sh +3 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ fi cd ${CURR}/build $CMAKE -DMERCURY_USE_SELF_FORWARD:BOOL=ON -DMERCURY_USE_CHECKSUMS:BOOL=OFF -DBUILD_TESTING:BOOL=ON \ -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=${INSTALL} \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=ON ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ -DCMAKE_BUILD_TYPE:STRING=Debug -DMERCURY_USE_EAGER_BULK:BOOL=ON ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ make -j${CORES} make install Loading @@ -311,6 +311,8 @@ echo "############################################################ Installing: CURR=${SOURCE}/margo prepare_build_dir ${CURR} cd ${CURR} echo "########## Applying allow init option path" git apply ${PATCH_DIR}/margo_allow_init_options.patch ./prepare.sh cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig CFLAGS="-Wall -O3" Loading
ifs/scripts/patches/margo_allow_init_options.patch 0 → 100644 +70 −0 Original line number Diff line number Diff line From 0609a71efbc02dc3d65768c9219770277c4329de Mon Sep 17 00:00:00 2001 From: Tommaso Tocci <tommaso@tocci.pro> Date: Thu, 11 Oct 2018 23:46:19 +0200 Subject: [PATCH] Add hg_init_info to margo init --- include/margo.h | 8 ++++++++ src/margo.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/margo.h b/include/margo.h index a5f7587..774b1f6 100644 --- a/include/margo.h +++ b/include/margo.h @@ -46,6 +46,7 @@ typedef ABT_eventual margo_request; /** * Initializes margo library. * @param [in] addr_str Mercury host address with port number + * @param [in] hg_init_info Mercury initialization options * @param [in] mode Mode to run Margo in: * - MARGO_CLIENT_MODE * - MARGO_SERVER_MODE @@ -67,6 +68,13 @@ typedef ABT_eventual margo_request; * call margo_wait_for_finalize() after margo_init() to relinguish control to * Margo. */ +margo_instance_id margo_init_info( + const char *addr_str, + int mode, + const struct hg_init_info *hg_init_info, + int use_progress_thread, + int rpc_thread_count); + margo_instance_id margo_init( const char *addr_str, int mode, diff --git a/src/margo.c b/src/margo.c index ea73fc2..da8f69e 100644 --- a/src/margo.c +++ b/src/margo.c @@ -171,7 +171,16 @@ static hg_return_t margo_handle_cache_put(margo_instance_id mid, static hg_id_t margo_register_internal(margo_instance_id mid, hg_id_t id, hg_proc_cb_t in_proc_cb, hg_proc_cb_t out_proc_cb, hg_rpc_cb_t rpc_cb, ABT_pool pool); -margo_instance_id margo_init(const char *addr_str, int mode, +margo_instance_id margo_init(const char *addr_str, + int mode, + int use_progress_thread, int rpc_thread_count) +{ + return margo_init_info(addr_str, mode, NULL, use_progress_thread, rpc_thread_count); +} + +margo_instance_id margo_init_info(const char *addr_str, + int mode, + const struct hg_init_info *hg_init_info, int use_progress_thread, int rpc_thread_count) { ABT_xstream progress_xstream = ABT_XSTREAM_NULL; @@ -268,7 +277,7 @@ margo_instance_id margo_init(const char *addr_str, int mode, rpc_pool = progress_pool; } - hg_class = HG_Init(addr_str, listen_flag); + hg_class = HG_Init_opt(addr_str, listen_flag, hg_init_info); if(!hg_class) goto err; hg_context = HG_Context_create(hg_class); -- 2.19.1
ifs/src/daemon/adafs_daemon.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,6 @@ bool init_rpc_server() { * @param hg_class */ void register_server_rpcs(margo_instance_id mid) { if (RPC_DATA->server_ipc_mid() == mid) MARGO_REGISTER(mid, hg_tag::fs_config, ipc_config_in_t, ipc_config_out_t, ipc_srv_fs_config); MARGO_REGISTER(mid, hg_tag::minimal, rpc_minimal_in_t, rpc_minimal_out_t, rpc_minimal); MARGO_REGISTER(mid, hg_tag::create, rpc_mk_node_in_t, rpc_err_out_t, rpc_srv_mk_node); Loading