typedefs.h
1 
5 #pragma once
6 
7 #include <functional>
8 #include <limits>
9 #include <memory>
10 #include <string>
11 #include <unordered_map>
12 
13 #include <ucp/api/ucp.h>
14 
15 namespace ucxx {
16 
17 class Buffer;
18 class Request;
19 class RequestAm;
20 
28 typedef enum {
29  UCXX_LOG_LEVEL_FATAL, /* Immediate termination */
30  UCXX_LOG_LEVEL_ERROR, /* Error is returned to the user */
31  UCXX_LOG_LEVEL_WARN, /* Something's wrong, but we continue */
32  UCXX_LOG_LEVEL_DIAG, /* Diagnostics, silent adjustments or internal error handling */
33  UCXX_LOG_LEVEL_INFO, /* Information */
34  UCXX_LOG_LEVEL_DEBUG, /* Low-volume debugging */
35  UCXX_LOG_LEVEL_TRACE, /* High-volume debugging */
36  UCXX_LOG_LEVEL_TRACE_REQ, /* Every send/receive request */
37  UCXX_LOG_LEVEL_TRACE_DATA, /* Data sent/received on the transport */
38  UCXX_LOG_LEVEL_TRACE_ASYNC, /* Asynchronous progress engine */
39  UCXX_LOG_LEVEL_TRACE_FUNC, /* Function calls */
40  UCXX_LOG_LEVEL_TRACE_POLL, /* Polling functions */
41  UCXX_LOG_LEVEL_LAST, /* Last level barrier, not an actual level */
42  UCXX_LOG_LEVEL_PRINT /* Temporary output */
44 
50 enum class TransferDirection { Send = 0, Receive };
51 
58 enum Tag : ucp_tag_t {};
59 
66 enum TagMask : ucp_tag_t {};
67 
73 static constexpr TagMask TagMaskFull{std::numeric_limits<std::underlying_type_t<TagMask>>::max()};
74 
81 class TagRecvInfo {
82  public:
84  size_t length;
85 
92  explicit TagRecvInfo(const ucp_tag_recv_info_t& info);
93 };
94 
101 typedef std::unordered_map<std::string, std::string> ConfigMap;
102 
109 typedef std::function<void(ucs_status_t, std::shared_ptr<void>)> RequestCallbackUserFunction;
110 
117 typedef std::shared_ptr<void> RequestCallbackUserData;
118 
126 
134 
141 typedef std::function<std::shared_ptr<Buffer>(size_t)> AmAllocatorType;
142 
150 typedef std::function<void(std::shared_ptr<Request>, ucp_ep_h)> AmReceiverCallbackType;
151 
159 typedef std::string AmReceiverCallbackOwnerType;
160 
166 typedef uint64_t AmReceiverCallbackIdType;
167 
174 typedef const std::string AmReceiverCallbackInfoSerialized;
175 
182  public:
185 
186  AmReceiverCallbackInfo() = delete;
187 
195 };
196 
203 typedef const std::string SerializedRemoteKey;
204 
205 } // namespace ucxx
Information of an Active Message receiver callback.
Definition: typedefs.h:181
AmReceiverCallbackInfo(const AmReceiverCallbackOwnerType owner, AmReceiverCallbackIdType id)
Construct an AmReceiverCallbackInfo object.
const AmReceiverCallbackIdType id
The unique identifier of the callback.
Definition: typedefs.h:184
const AmReceiverCallbackOwnerType owner
The owner name of the callback.
Definition: typedefs.h:183
Information about probed tag message.
Definition: typedefs.h:81
size_t length
The size of the received data.
Definition: typedefs.h:84
TagRecvInfo(const ucp_tag_recv_info_t &info)
Construct a TagRecvInfo object from a UCP tag receive info structure.
Tag senderTag
Sender tag.
Definition: typedefs.h:83
Definition: address.h:15
std::function< void(ucs_status_t, std::shared_ptr< void >)> RequestCallbackUserFunction
A user-defined function to execute as part of a ucxx::Request callback.
Definition: typedefs.h:109
std::shared_ptr< void > RequestCallbackUserData
Data for the user-defined function provided to the ucxx::Request callback.
Definition: typedefs.h:117
std::unordered_map< std::string, std::string > ConfigMap
A UCP configuration map.
Definition: typedefs.h:101
RequestCallbackUserData EndpointCloseCallbackUserData
Data for the user-defined function provided to endpoint close callback.
Definition: typedefs.h:133
TransferDirection
The direction of a UCXX transfer.
Definition: typedefs.h:50
std::function< std::shared_ptr< Buffer >size_t)> AmAllocatorType
Custom Active Message allocator type.
Definition: typedefs.h:141
const std::string AmReceiverCallbackInfoSerialized
Serialized form of Active Message receiver callback information.
Definition: typedefs.h:174
const std::string SerializedRemoteKey
Serialized form of a remote key.
Definition: typedefs.h:203
ucxx_log_level_t
Available logging levels.
Definition: typedefs.h:28
uint64_t AmReceiverCallbackIdType
Active Message receiver callback identifier.
Definition: typedefs.h:166
RequestCallbackUserFunction EndpointCloseCallbackUserFunction
A user-defined function to execute after an endpoint closes.
Definition: typedefs.h:125
std::string AmReceiverCallbackOwnerType
Active Message receiver callback owner name.
Definition: typedefs.h:159
TagMask
Strong type for a UCP tag mask.
Definition: typedefs.h:66
Tag
Strong type for a UCP tag.
Definition: typedefs.h:58
std::function< void(std::shared_ptr< Request >, ucp_ep_h)> AmReceiverCallbackType
Active Message receiver callback.
Definition: typedefs.h:150