Verified Commit 35e31289 authored by Marc Vef's avatar Marc Vef
Browse files

Adding UCX and OFI protocols

parent 42abcb06
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -58,11 +58,18 @@ constexpr auto get_chunk_stat = "rpc_srv_chunk_stat";
} // namespace tag

namespace protocol {
constexpr auto ofi_psm2 = "ofi+psm2";
constexpr auto na_sm = "na+sm";
constexpr auto ofi_sockets = "ofi+sockets";
constexpr auto ofi_tcp = "ofi+tcp";
constexpr auto ofi_verbs = "ofi+verbs";
constexpr auto na_sm = "na+sm";
constexpr auto ofi_psm2 = "ofi+psm2";
constexpr auto ucx_all = "ucx+all";
constexpr auto ucx_tcp = "ucx+tcp";
constexpr auto ucx_rc = "ucx+rc";
constexpr auto ucx_ud = "ucx+ud";
constexpr auto all_remote_protocols = {ofi_sockets, ofi_tcp, ofi_verbs,
                                       ofi_psm2,    ucx_all, ucx_tcp,
                                       ucx_rc,      ucx_ud};
} // namespace protocol
} // namespace gkfs::rpc

+8 −11
Original line number Diff line number Diff line
@@ -104,18 +104,15 @@ extract_protocol(const string& uri) {
        throw runtime_error(fmt::format("Invalid format for URI: '{}'", uri));
    }
    string protocol{};

    if(uri.find(gkfs::rpc::protocol::ofi_sockets) != string::npos) {
        protocol = gkfs::rpc::protocol::ofi_sockets;
    } else if(uri.find(gkfs::rpc::protocol::ofi_psm2) != string::npos) {
        protocol = gkfs::rpc::protocol::ofi_psm2;
    } else if(uri.find(gkfs::rpc::protocol::ofi_verbs) != string::npos) {
        protocol = gkfs::rpc::protocol::ofi_verbs;
    } else if(uri.find(gkfs::rpc::protocol::ofi_tcp) != string::npos) {
        protocol = gkfs::rpc::protocol::ofi_tcp;
    }
    // check for shared memory protocol. Can be plain shared memory or real ofi
    // protocol + auto_sm
    for(const auto& valid_protocol :
        gkfs::rpc::protocol::all_remote_protocols) {
        if(uri.find(valid_protocol) != string::npos) {
            protocol = valid_protocol;
            break;
        }
    }
    // check for shared memory protocol. Can be plain shared memory or real
    // ofi protocol + auto_sm
    if(uri.find(gkfs::rpc::protocol::na_sm) != string::npos) {
        if(protocol.empty())
            protocol = gkfs::rpc::protocol::na_sm;
+9 −5
Original line number Diff line number Diff line
@@ -477,15 +477,19 @@ parse_input(const cli_options& opts, const CLI::App& desc) {
    auto rpc_protocol = string(gkfs::rpc::protocol::ofi_sockets);
    if(desc.count("--rpc-protocol")) {
        rpc_protocol = opts.rpc_protocol;
        if(rpc_protocol != gkfs::rpc::protocol::ofi_verbs &&
           rpc_protocol != gkfs::rpc::protocol::ofi_sockets &&
           rpc_protocol != gkfs::rpc::protocol::ofi_psm2 &&
           rpc_protocol != gkfs::rpc::protocol::ofi_tcp) {
        auto protocol_found = false;
        for(const auto& valid_protocol :
            gkfs::rpc::protocol::all_remote_protocols) {
            if(rpc_protocol == valid_protocol) {
                protocol_found = true;
                break;
            }
        }
        if(!protocol_found)
            throw runtime_error(fmt::format(
                    "Given RPC protocol '{}' not supported. Check --help for supported protocols.",
                    rpc_protocol));
    }
    }

    auto use_auto_sm = desc.count("--auto-sm") != 0;
    GKFS_DATA->use_auto_sm(use_auto_sm);