Skip to content

Commit

Permalink
Remove Doxygen warnings for src/rpc_thallium.cc. (HDFGroup#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee committed Nov 1, 2022
1 parent dac061c commit ac3791d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/rpc_thallium.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace tl = thallium;

namespace hermes {

/** copy string to character array */
void CopyStringToCharArray(const std::string &src, char *dest, size_t max) {
size_t src_size = src.size();
if (src_size >= max) {
Expand All @@ -31,6 +32,7 @@ void CopyStringToCharArray(const std::string &src, char *dest, size_t max) {
dest[copy_size] = '\0';
}

/** start Thallium RPC server */
void ThalliumStartRpcServer(SharedMemoryContext *context, RpcContext *rpc,
Arena *arena, const char *addr,
i32 num_rpc_threads) {
Expand Down Expand Up @@ -498,6 +500,7 @@ void ThalliumStartRpcServer(SharedMemoryContext *context, RpcContext *rpc,
rpc_enforce_capacity_thresholds);
}

/** start buffer organizer */
void StartBufferOrganizer(SharedMemoryContext *context, RpcContext *rpc,
Arena *arena, const char *addr, int num_threads,
int port) {
Expand Down Expand Up @@ -597,6 +600,7 @@ void StartBufferOrganizer(SharedMemoryContext *context, RpcContext *rpc,
rpc_server->define("OrganizeBlob", rpc_organize_blob);
}

/** start global system view state update thread */
void StartGlobalSystemViewStateUpdateThread(SharedMemoryContext *context,
RpcContext *rpc, Arena *arena,
double sleep_ms) {
Expand Down Expand Up @@ -627,13 +631,15 @@ void StartGlobalSystemViewStateUpdateThread(SharedMemoryContext *context,
ABT_THREAD_ATTR_NULL, NULL);
}

/** stop global system view state update thread */
void StopGlobalSystemViewStateUpdateThread(RpcContext *rpc) {
ThalliumState *state = GetThalliumState(rpc);
state->kill_requested.store(true);
ABT_xstream_join(state->execution_stream);
ABT_xstream_free(&state->execution_stream);
}

/** initialize RPC context */
void InitRpcContext(RpcContext *rpc, u32 num_nodes, u32 node_id,
Config *config) {
rpc->num_nodes = num_nodes;
Expand All @@ -650,12 +656,14 @@ void InitRpcContext(RpcContext *rpc, u32 num_nodes, u32 node_id,
}
}

/** create RPC state */
void *CreateRpcState(Arena *arena) {
ThalliumState *result = PushClearedStruct<ThalliumState>(arena);

return result;
}

/** get protocol */
std::string GetProtocol(RpcContext *rpc) {
ThalliumState *tl_state = GetThalliumState(rpc);

Expand All @@ -667,6 +675,7 @@ std::string GetProtocol(RpcContext *rpc) {
return result;
}

/** initialize RPC clients */
void InitRpcClients(RpcContext *rpc) {
// TODO(chogan): Need a per-client persistent arena
ClientThalliumState *state =
Expand All @@ -678,6 +687,7 @@ void InitRpcClients(RpcContext *rpc) {
rpc->client_rpc.state = state;
}

/** shut down RPC clients */
void ShutdownRpcClients(RpcContext *rpc) {
ClientThalliumState *state = GetClientThalliumState(rpc);
if (state) {
Expand All @@ -690,6 +700,7 @@ void ShutdownRpcClients(RpcContext *rpc) {
}
}

/** finalize RPC context */
void FinalizeRpcContext(RpcContext *rpc, bool is_daemon) {
ThalliumState *state = GetThalliumState(rpc);

Expand All @@ -705,6 +716,7 @@ void FinalizeRpcContext(RpcContext *rpc, bool is_daemon) {
delete state->bo_engine;
}

/** run daemon */
void RunDaemon(SharedMemoryContext *context, RpcContext *rpc,
CommunicationContext *comm, Arena *trans_arena,
const char *shmem_name) {
Expand Down Expand Up @@ -736,6 +748,7 @@ void RunDaemon(SharedMemoryContext *context, RpcContext *rpc,
// google::ShutdownGoogleLogging();
}

/** finalize client */
void FinalizeClient(SharedMemoryContext *context, RpcContext *rpc,
CommunicationContext *comm, Arena *trans_arena,
bool stop_daemon) {
Expand All @@ -762,6 +775,7 @@ void FinalizeClient(SharedMemoryContext *context, RpcContext *rpc,
// google::ShutdownGoogleLogging();
}

/** get host name from node ID */
std::string GetHostNameFromNodeId(RpcContext *rpc, u32 node_id) {
std::string result;
// NOTE(chogan): node_id 0 is reserved as the NULL node
Expand All @@ -770,6 +784,7 @@ std::string GetHostNameFromNodeId(RpcContext *rpc, u32 node_id) {
return result;
}

/** get RPC address */
std::string GetRpcAddress(RpcContext *rpc, Config *config, u32 node_id,
int port) {
std::string result = config->rpc_protocol + "://";
Expand All @@ -783,6 +798,7 @@ std::string GetRpcAddress(RpcContext *rpc, Config *config, u32 node_id,
return result;
}

/** get server name */
std::string GetServerName(RpcContext *rpc, u32 node_id,
bool is_buffer_organizer) {
ThalliumState *tl_state = GetThalliumState(rpc);
Expand Down Expand Up @@ -829,6 +845,7 @@ std::string GetServerName(RpcContext *rpc, u32 node_id,
return result;
}

/** read bulk */
size_t BulkRead(RpcContext *rpc, u32 node_id, const char *func_name,
u8 *data, size_t max_size, BufferID id) {
std::string server_name = GetServerName(rpc, node_id);
Expand Down

0 comments on commit ac3791d

Please sign in to comment.