Program Listing for File Issues.hpp

Return to documentation for file (BackendLibfabric/Issues.hpp)

#ifndef NETIO3BACKEND_BACKENDLIBFABRIC_ISSUES_HPP
#define NETIO3BACKEND_BACKENDLIBFABRIC_ISSUES_HPP

#include <format>

#include <ers/ers.h>

namespace netio3 {
  ERS_DECLARE_ISSUE(libfabric, LibFabricError, message, ((const std::string&)message))
  ERS_DECLARE_ISSUE(libfabric,
                    LibFabricLogicError,
                    std::format("Internal logic error: {}", message),
                    ((const std::string&)message))
  ERS_DECLARE_ISSUE(libfabric,
                    LibFabricCmError,
                    std::format("CM error: {}", message),
                    ((const std::string&)message))
  ERS_DECLARE_ISSUE(libfabric,
                    LibFabricCqError,
                    std::format("CQ error: {}", message),
                    ((const std::string&)message))
  ERS_DECLARE_ISSUE(libfabric,
                    LibFabricBufferError,
                    std::format("Error using buffers: {}", message),
                    ((const std::string&)message))
  ERS_DECLARE_ISSUE(libfabric,
                    LibfabricDomainError,
                    std::format("Failed to create fabric/domain because: {}", message),
                    ((const std::string&)message))
  ERS_DECLARE_ISSUE(
    libfabric,
    TooManyBuffersRequested,
    std::format("Number of buffers above maximum alowed: {0} vs {1}. Using {1} buffers.",
                num_requested,
                num_allowed),
    ((std::size_t)num_requested)((std::size_t)num_allowed))
}  // namespace netio3

#endif  // NETIO3BACKEND_BACKENDLIBFABRIC_ISSUES_HPP