9 #ifndef FAIR_MQ_OFI_SOCKET_H 10 #define FAIR_MQ_OFI_SOCKET_H 12 #include <FairMQSocket.h> 13 #include <FairMQMessage.h> 14 #include <fairmq/ofi/Context.h> 15 #include <fairmq/ofi/Control.pb.h> 17 #include <boost/asio.hpp> 19 #include <netinet/in.h> 20 #include <rdma/fabric.h> 43 auto GetId() -> std::string {
return fId; }
45 auto Bind(
const std::string& address) ->
bool override;
46 auto Connect(
const std::string& address) ->
bool override;
48 auto Send(MessagePtr& msg,
int timeout = 0) ->
int override;
49 auto Receive(MessagePtr& msg,
int timeout = 0) ->
int override;
50 auto Send(std::vector<MessagePtr>& msgVec,
int timeout = 0) -> int64_t
override;
51 auto Receive(std::vector<MessagePtr>& msgVec,
int timeout = 0) -> int64_t
override;
53 auto TrySend(MessagePtr& msg) ->
int override;
54 auto TryReceive(MessagePtr& msg) ->
int override;
55 auto TrySend(std::vector<MessagePtr>& msgVec) -> int64_t
override;
56 auto TryReceive(std::vector<MessagePtr>& msgVec) -> int64_t
override;
58 auto GetSocket()
const ->
void* {
return fControlSocket; }
60 void SetLinger(
const int value)
override;
61 int GetLinger()
const override;
62 void SetSndBufSize(
const int value)
override;
63 int GetSndBufSize()
const override;
64 void SetRcvBufSize(
const int value)
override;
65 int GetRcvBufSize()
const override;
66 void SetSndKernelSize(
const int value)
override;
67 int GetSndKernelSize()
const override;
68 void SetRcvKernelSize(
const int value)
override;
69 int GetRcvKernelSize()
const override;
71 auto Close() ->
void override;
73 auto SetOption(
const std::string& option,
const void* value,
size_t valueSize) ->
void override;
74 auto GetOption(
const std::string& option,
void* value,
size_t* valueSize) ->
void override;
76 auto GetBytesTx()
const ->
unsigned long override {
return fBytesTx; }
77 auto GetBytesRx()
const ->
unsigned long override {
return fBytesRx; }
78 auto GetMessagesTx()
const ->
unsigned long override {
return fMessagesTx; }
79 auto GetMessagesRx()
const ->
unsigned long override {
return fMessagesRx; }
81 static auto GetConstant(
const std::string& constant) -> int;
88 fid_ep* fDataEndpoint;
89 fid_cq* fDataCompletionQueueTx;
90 fid_cq* fDataCompletionQueueRx;
92 std::atomic<unsigned long> fBytesTx;
93 std::atomic<unsigned long> fBytesRx;
94 std::atomic<unsigned long> fMessagesTx;
95 std::atomic<unsigned long> fMessagesRx;
97 fi_addr_t fRemoteDataAddr;
98 sockaddr_in fLocalDataAddr;
99 bool fWaitingForControlPeer;
100 boost::asio::io_service::strand fIoStrand;
105 auto SendImpl(MessagePtr& msg,
const int flags,
const int timeout) -> int;
106 auto ReceiveImpl(MessagePtr& msg,
const int flags,
const int timeout) -> int;
107 auto SendImpl(std::vector<MessagePtr>& msgVec,
const int flags,
const int timeout) -> int64_t;
108 auto ReceiveImpl(std::vector<MessagePtr>& msgVec,
const int flags,
const int timeout) -> int64_t;
110 auto InitDataEndpoint() -> void;
111 auto WaitForControlPeer() -> void;
112 auto AnnounceDataAddress() -> void;
113 auto SendControlMessage(std::unique_ptr<ControlMessage> ctrl) -> void;
114 auto ReceiveControlMessage() -> std::unique_ptr<ControlMessage>;
115 auto ProcessDataAddressAnnouncement(std::unique_ptr<ControlMessage> ctrl) -> void;
121 void free_string(
void* ,
void* hint);
Transport-wide context.
Definition: Context.h:38
Definition: FairMQSocket.h:74
Definition: FairMQTransportFactory.h:28
Definition: FairMQSocket.h:19
Tools for interfacing containers to the transport via polymorphic allocators.
Definition: DeviceRunner.h:23