13 #ifndef HERMES_RPC_THALLIUM_H_
14 #define HERMES_RPC_THALLIUM_H_
16 #include <arpa/inet.h>
18 #include <netinet/in.h>
19 #include <sys/socket.h>
21 #include <thallium.hpp>
22 #include <thallium/serialization/stl/pair.hpp>
23 #include <thallium/serialization/stl/string.hpp>
24 #include <thallium/serialization/stl/vector.hpp>
26 #include "buffer_organizer.h"
28 namespace tl = thallium;
105 template <
typename A>
118 template <
typename A>
124 template <
typename A>
133 template <
typename A>
136 ar &info.bandwidth_mbps;
140 #ifndef THALLIUM_USE_CEREAL
154 template <
typename A>
156 int val = (int)map_type;
168 template <
typename A>
176 template <
typename A>
178 int val = (int)priority;
183 template <
typename A>
191 template <
typename A>
193 int val = (int)violation;
198 template <
typename A>
207 template <
typename A>
214 template <
typename A>
222 template <
typename A>
229 template <
typename A>
236 template <
typename A>
240 ar &info.violation_size;
244 template <
typename A>
245 #ifndef THALLIUM_USE_CEREAL
246 void save(A &ar, api::Context &ctx) {
248 void save(A &ar,
const api::Context &ctx) {
250 ar.write(&ctx.buffer_organizer_retries, 1);
251 int val = (int)ctx.policy;
254 template <
typename A>
255 void load(A &ar, api::Context &ctx) {
257 ar.read(&ctx.buffer_organizer_retries, 1);
299 template <
typename ReturnType,
typename... Ts>
302 VLOG(1) <<
"Calling " << func_name <<
" on node " << node_id <<
" from node "
306 std::string server_name =
GetServerName(rpc, node_id, is_bo_func);
312 tl::remote_procedure remote_proc = state->
engine->define(func_name);
315 tl::endpoint server = state->
engine->lookup(server_name);
317 if constexpr (std::is_same<ReturnType, void>::value) {
318 remote_proc.disable_response();
319 remote_proc.on(server)(std::forward<Ts>(args)...);
321 ReturnType result = remote_proc.on(server)(std::forward<Ts>(args)...);
PlacementPolicy
Definition: hermes_types.h:73
Definition: adapter_utils.cc:35
BoPriority
Definition: buffer_organizer.h:33
MapType
Definition: metadata_management.h:58
void serialize(A &ar, BufferID &buffer_id)
Definition: rpc_thallium.h:67
const int kMaxServerNamePostfix
Definition: rpc_thallium.h:33
ThresholdViolation
Definition: metadata_management.h:67
const char kBoPrefix[]
Definition: rpc_thallium.h:34
const int kMaxServerNamePrefix
Definition: rpc_thallium.h:32
void load(A &ar, MapType &map_type)
Definition: rpc_thallium.h:169
void save(A &ar, MapType &map_type)
Definition: rpc_thallium.h:155
static bool IsBoFunction(const char *func_name)
Definition: rpc_thallium.h:280
static ThalliumState * GetThalliumState(RpcContext *rpc)
Definition: rpc_thallium.h:266
std::string GetRpcAddress(RpcContext *rpc, Config *config, u32 node_id, int port)
Definition: rpc_thallium.cc:788
const int kBoPrefixLength
Definition: rpc_thallium.h:36
uint32_t u32
Definition: hermes_types.h:42
ReturnType RpcCall(RpcContext *rpc, u32 node_id, const char *func_name, Ts... args)
Definition: rpc_thallium.h:300
std::string GetServerName(RpcContext *rpc, u32 node_id, bool is_buffer_organizer=false)
Definition: rpc_thallium.cc:802
static ClientThalliumState * GetClientThalliumState(RpcContext *rpc)
Definition: rpc_thallium.h:273
BoOperation
Definition: buffer_organizer.h:24
Definition: buffer_organizer.h:63
BoOperation op
Definition: buffer_organizer.h:64
BoArgs args
Definition: buffer_organizer.h:65
Definition: buffer_organizer.h:71
void * state
Definition: rpc.h:36
Definition: rpc_thallium.h:54
tl::engine * engine
Definition: rpc_thallium.h:55
ClientRpcContext client_rpc
Definition: rpc.h:44
u32 node_id
Definition: rpc.h:51
void * state
Definition: rpc.h:45
Definition: buffer_pool.h:440
u64 size
Definition: buffer_pool.h:443
u32 node_id
Definition: buffer_pool.h:441
u64 offset
Definition: buffer_pool.h:442
BucketID bucket_id
Definition: buffer_pool.h:444
Definition: rpc_thallium.h:41
char bo_server_name_postfix[kMaxServerNamePostfix]
Definition: rpc_thallium.h:44
ABT_xstream execution_stream
Definition: rpc_thallium.h:48
tl::engine * engine
Definition: rpc_thallium.h:46
char server_name_postfix[kMaxServerNamePostfix]
Definition: rpc_thallium.h:43
std::atomic< bool > kill_requested
Definition: rpc_thallium.h:45
char server_name_prefix[kMaxServerNamePrefix]
Definition: rpc_thallium.h:42
tl::engine * bo_engine
Definition: rpc_thallium.h:47
Definition: metadata_management.h:72
Definition: hermes_types.h:405
u64 as_int
Definition: hermes_types.h:417
Definition: buffer_organizer.h:43
BufferID src
Definition: buffer_organizer.h:46
struct hermes::BoArgs::@0 move_args
TargetID dest
Definition: buffer_organizer.h:47
Definition: hermes_types.h:358
u64 as_int
Definition: hermes_types.h:369
Definition: buffer_pool.h:93
u64 as_int
Definition: buffer_pool.h:107
Definition: hermes_types.h:198
u64 as_int
Definition: hermes_types.h:213
Definition: hermes_types.h:388
u64 as_int
Definition: hermes_types.h:399