Verified Commit d8fb6dbe authored by Marc Vef's avatar Marc Vef
Browse files

Fix: Enable sm routing for local communication

parent d2cfbefc
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
#include <preload/preload_util.hpp>
#include <global/rpc/rpc_utils.hpp>
#include <global/rpc/distributor.hpp>
#include <global/global_func.hpp>

#include <fstream>
#include <iterator>
#include <memory>
#include <unordered_map>
#include <sstream>
#include <csignal>
#include <random>
@@ -210,8 +206,14 @@ bool lookup_all_hosts() {
    ::shuffle(hosts.begin(), hosts.end(), g); // Shuffle hosts vector
    // lookup addresses and put abstract server addresses into rpc_addresses
    for (auto& host : hosts) {
        string uri{};
        // If local use address provided by daemon in order to use automatic shared memory routing
        if (host == CTX->fs_conf()->host_id) {
            uri = CTX->daemon_addr_str();
        } else {
            auto hostname = CTX->fs_conf()->hosts.at(host);
        auto uri = get_uri_from_hostname(hostname);
            uri = get_uri_from_hostname(hostname);
        }
        auto remote_addr = margo_addr_lookup_retry(uri);
        if (remote_addr == HG_ADDR_NULL) {
            CTX->log()->error("{}() Failed to lookup address {}", __func__, uri);