mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Setup ofi objects
FI_MSG API FI_EP_RDM, reliable datagram message (unconnected)
This commit is contained in:
committed by
Mohammad Al-Turany
parent
4250e3d45b
commit
630a1dbbce
62
fairmq/ofi/Context.h
Normal file
62
fairmq/ofi/Context.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef FAIR_MQ_OFI_CONTEXT_H
|
||||
#define FAIR_MQ_OFI_CONTEXT_H
|
||||
|
||||
#include <memory>
|
||||
#include <rdma/fabric.h>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace fair
|
||||
{
|
||||
namespace mq
|
||||
{
|
||||
namespace ofi
|
||||
{
|
||||
|
||||
enum class ConnectionType : bool { Bind, Connect };
|
||||
|
||||
/**
|
||||
* @class Context Context.h <fairmq/ofi/Context.h>
|
||||
* @brief Transport-wide context
|
||||
*
|
||||
* @todo TODO insert long description
|
||||
*/
|
||||
class Context
|
||||
{
|
||||
public:
|
||||
Context(int numberIoThreads = 1);
|
||||
~Context();
|
||||
|
||||
/// Deferred Ofi initialization
|
||||
auto InitOfi(ConnectionType type, std::string address) -> void;
|
||||
auto CreateOfiEndpoint() -> fid_ep*;
|
||||
auto CreateOfiCompletionQueue() -> fid_cq*;
|
||||
auto GetZmqVersion() const -> std::string;
|
||||
auto GetOfiApiVersion() const -> std::string;
|
||||
auto GetZmqContext() const -> void* { return fZmqContext; }
|
||||
|
||||
private:
|
||||
void* fZmqContext;
|
||||
fi_info* fOfiInfo;
|
||||
fid_fabric* fOfiFabric;
|
||||
fid_domain* fOfiDomain;
|
||||
|
||||
auto OpenOfiFabric() -> void;
|
||||
auto OpenOfiDomain() -> void;
|
||||
}; /* class Context */
|
||||
|
||||
struct ContextError : std::runtime_error { using std::runtime_error::runtime_error; };
|
||||
|
||||
} /* namespace ofi */
|
||||
} /* namespace mq */
|
||||
} /* namespace fair */
|
||||
|
||||
#endif /* FAIR_MQ_OFI_CONTEXT_H */
|
Reference in New Issue
Block a user