Unverified Commit c0de753f authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Add compile time option to disable shm comm

Shared-memory communication can be disabled through cmake
compile time option `-DUSE_SHM:BOOL=OFF`
parent 17401214
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -104,6 +104,9 @@ set_property(CACHE RPC_PROTOCOL PROPERTY STRINGS
)
message(STATUS "RPC protocol: '${RPC_PROTOCOL}'")

option(USE_SHM "Use shared memory for intra-node communication" ON)
message(STATUS "Shared-memory communication: ${USE_SHM}")

option(SYMLINK_SUPPORT "Compile with support for symlinks" ON)
if(SYMLINK_SUPPORT)
    add_definitions(-DHAS_SYMLINKS)
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@


#define RPC_PROTOCOL "@RPC_PROTOCOL@"
#cmakedefine01 USE_SHM

// Daemon path to auxiliary files
#define DAEMON_AUX_PATH "/tmp"
+4 −0
Original line number Diff line number Diff line
@@ -114,7 +114,11 @@ void register_client_rpcs(margo_instance_id mid) {
bool init_margo_client(const std::string& na_plugin) {
    // IMPORTANT: this struct needs to be zeroed before use
    struct hg_init_info hg_options = {};
#if USE_SHM
    hg_options.auto_sm = HG_TRUE;
#else
    hg_options.auto_sm = HG_FALSE;
#endif
    hg_options.stats = HG_FALSE;
    hg_options.na_class = nullptr;

+9 −0
Original line number Diff line number Diff line
@@ -182,7 +182,11 @@ void init_rpc_server(const string & protocol_port) {
    char addr_self_cstring[128];
    // IMPORTANT: this struct needs to be zeroed before use
    struct hg_init_info hg_options = {};
#if USE_SHM
    hg_options.auto_sm = HG_TRUE;
#else
    hg_options.auto_sm = HG_FALSE;
#endif
    hg_options.stats = HG_FALSE;
    hg_options.na_class = nullptr;
    // Start Margo (this will also initialize Argobots and Mercury internally)
@@ -367,6 +371,11 @@ int main(int argc, const char* argv[]) {
        cout << "Debug: OFF" << endl;
#endif
        cout << "RPC protocol: " << RPC_PROTOCOL << endl;
#if USE_SHM
        cout << "Shared-memory comm: ON" << endl;
#else
        cout << "Shared-memory comm: OFF" << endl;
#endif
        cout << "Chunk size: " << CHUNKSIZE << " bytes" << endl;
        return 0;
    }