typedefs.h
1 
5 #pragma once
6 
7 #include <atomic>
8 #include <functional>
9 #include <limits>
10 #include <memory>
11 #include <optional>
12 #include <string>
13 #include <unordered_map>
14 
15 #include <ucp/api/ucp.h>
16 
17 namespace ucxx {
18 
19 class Buffer;
20 class Request;
21 class RequestAm;
22 
30 typedef enum {
31  UCXX_LOG_LEVEL_FATAL, /* Immediate termination */
32  UCXX_LOG_LEVEL_ERROR, /* Error is returned to the user */
33  UCXX_LOG_LEVEL_WARN, /* Something's wrong, but we continue */
34  UCXX_LOG_LEVEL_DIAG, /* Diagnostics, silent adjustments or internal error handling */
35  UCXX_LOG_LEVEL_INFO, /* Information */
36  UCXX_LOG_LEVEL_DEBUG, /* Low-volume debugging */
37  UCXX_LOG_LEVEL_TRACE, /* High-volume debugging */
38  UCXX_LOG_LEVEL_TRACE_REQ, /* Every send/receive request */
39  UCXX_LOG_LEVEL_TRACE_DATA, /* Data sent/received on the transport */
40  UCXX_LOG_LEVEL_TRACE_ASYNC, /* Asynchronous progress engine */
41  UCXX_LOG_LEVEL_TRACE_FUNC, /* Function calls */
42  UCXX_LOG_LEVEL_TRACE_POLL, /* Polling functions */
43  UCXX_LOG_LEVEL_LAST, /* Last level barrier, not an actual level */
44  UCXX_LOG_LEVEL_PRINT /* Temporary output */
46 
52 enum class TransferDirection { Send = 0, Receive };
53 
60 enum Tag : ucp_tag_t {};
61 
68 enum TagMask : ucp_tag_t {};
69 
75 static constexpr TagMask TagMaskFull{std::numeric_limits<std::underlying_type_t<TagMask>>::max()};
76 
83 typedef std::unordered_map<std::string, std::string> ConfigMap;
84 
91 typedef std::function<void(ucs_status_t, std::shared_ptr<void>)> RequestCallbackUserFunction;
92 
99 typedef std::shared_ptr<void> RequestCallbackUserData;
100 
108 
116 
123 typedef std::function<std::shared_ptr<Buffer>(size_t)> AmAllocatorType;
124 
132 typedef std::function<void(std::shared_ptr<Request>, ucp_ep_h)> AmReceiverCallbackType;
133 
141 typedef std::string AmReceiverCallbackOwnerType;
142 
148 typedef uint64_t AmReceiverCallbackIdType;
149 
156  public:
159 
160  AmReceiverCallbackInfo() = delete;
161 
169 };
170 
177 typedef const std::string SerializedRemoteKey;
178 
179 } // namespace ucxx
Information of an Active Message receiver callback.
Definition: typedefs.h:155
AmReceiverCallbackInfo(const AmReceiverCallbackOwnerType owner, AmReceiverCallbackIdType id)
Construct an AmReceiverCallbackInfo object.
const AmReceiverCallbackIdType id
The unique identifier of the callback.
Definition: typedefs.h:158
const AmReceiverCallbackOwnerType owner
The owner name of the callback.
Definition: typedefs.h:157
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:91
std::shared_ptr< void > RequestCallbackUserData
Data for the user-defined function provided to the ucxx::Request callback.
Definition: typedefs.h:99
std::unordered_map< std::string, std::string > ConfigMap
A UCP configuration map.
Definition: typedefs.h:83
RequestCallbackUserData EndpointCloseCallbackUserData
Data for the user-defined function provided to endpoint close callback.
Definition: typedefs.h:115
TransferDirection
The direction of a UCXX transfer.
Definition: typedefs.h:52
std::function< std::shared_ptr< Buffer >size_t)> AmAllocatorType
Custom Active Message allocator type.
Definition: typedefs.h:123
const std::string SerializedRemoteKey
Serialized form of a remote key.
Definition: typedefs.h:177
ucxx_log_level_t
Available logging levels.
Definition: typedefs.h:30
uint64_t AmReceiverCallbackIdType
Active Message receiver callback identifier.
Definition: typedefs.h:148
RequestCallbackUserFunction EndpointCloseCallbackUserFunction
A user-defined function to execute after an endpoint closes.
Definition: typedefs.h:107
std::string AmReceiverCallbackOwnerType
Active Message receiver callback owner name.
Definition: typedefs.h:141
TagMask
Strong type for a UCP tag mask.
Definition: typedefs.h:68
Tag
Strong type for a UCP tag.
Definition: typedefs.h:60
std::function< void(std::shared_ptr< Request >, ucp_ep_h)> AmReceiverCallbackType
Active Message receiver callback.
Definition: typedefs.h:132