Program Listing for File netio3_utility.cpp

Return to documentation for file (network/netio3_utility.cpp)

#include "network/netio3_utility.hpp"

[[nodiscard]] netio3::NetworkMode
network::utility::get_network_mode(NetworkMode mode) {
  switch (mode) {
  case NetworkMode::rdma:
    return netio3::NetworkMode::RDMA;
  case NetworkMode::tcp:
    return netio3::NetworkMode::TCP;
  default:
    throw std::logic_error("Invalid NetworkMode");
  }
}

[[nodiscard]] netio3::NetworkType
network::utility::get_network_type(NetworkMode mode) {
  switch (mode) {
  case NetworkMode::rdma:
    return netio3::NetworkType::LIBFABRIC;
  case NetworkMode::tcp:
    return netio3::NetworkType::ASYNCMSG;
  default:
    throw std::logic_error("Invalid NetworkMode");
  }
}