Skip to content

Commit

Permalink
margo_init synchronization.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelkgutierrez committed Jun 27, 2018
1 parent 70ec6ef commit aa5b37b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/sdsdkv-client.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ struct sdsdkv_client : public personality {
// used for Mercury progress.
static const int rpc_thread_count = -1;
//
// TODO(skg) For both the client and the server, figure out if we want
// progress threads and what the rpc thread count sould be for both.

// Wait for server-side setup completion.
m_mpi->barrier(m_mpi->get_world_comm());
//
m_mid = margo_init(
m_config->comm_protocol.c_str(),
MARGO_CLIENT_MODE,
Expand Down Expand Up @@ -74,6 +80,8 @@ struct sdsdkv_client : public personality {
int
m_db_init(void)
{
printf("client here..\n");
//
hg_size_t gsize = ssg_get_group_size(m_gid);
//
for (decltype(gsize) i = 0; i < gsize; ++i) {
Expand Down
5 changes: 4 additions & 1 deletion src/sdsdkv-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ struct sdsdkv_server : public personality {
MARGO_SERVER_MODE,
use_progress_thread,
m_config->rpc_thread_count
);
);
if (m_mid == MARGO_INSTANCE_NULL) {
return SDSDKV_ERR_SERVICE;
}
//
margo_enable_remote_shutdown(m_mid);
// Make sure that server setup is done before moving on. Note that the
// clients will wait for all servers to init before starting their init.
m_mpi->barrier(m_mpi->get_world_comm());
//
return SDSDKV_SUCCESS;
}
Expand Down

0 comments on commit aa5b37b

Please sign in to comment.