Skip to content

Commit

Permalink
Expose rpc_thread_count as user parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelkgutierrez committed Jun 26, 2018
1 parent 2ce0c01 commit 0b663ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/sdsdkv-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class sdsdkv_iconfig {
//
sdsdkv_config_personality personality;
//
int rpc_thread_count;
//
sdsdkv_config_hashing hash_be;
//
sdsdkv_config_db db_type;
Expand Down Expand Up @@ -86,6 +88,7 @@ class sdsdkv_iconfig {
//
init_comm = config.init_comm;
personality = config.personality;
rpc_thread_count = config.rpc_thread_count;
hash_be = config.hash_be;
db_type = config.db_type;
cmp_fn = config.cmp_fn;
Expand Down
5 changes: 1 addition & 4 deletions src/sdsdkv-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ struct sdsdkv_server : public personality {
m_margo_init(void)
{
static const int use_progress_thread = 0;
// A value of -1 directs Margo to use the same execution context as that
// used for Mercury progress.
static const int rpc_thread_count = -1;
//
m_mid = margo_init(
m_config->comm_protocol.c_str(),
MARGO_SERVER_MODE,
use_progress_thread,
rpc_thread_count
m_config->rpc_thread_count
);
if (m_mid == MARGO_INSTANCE_NULL) {
return SDSDKV_ERR_SERVICE;
Expand Down
2 changes: 2 additions & 0 deletions src/sdsdkv.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ typedef struct sdsdkv_config {
MPI_Comm init_comm;
/** Process personality. */
sdsdkv_config_personality personality;
/** Margo RPC thread count. Use -1 for default. */
int rpc_thread_count;
/** Hashing back-end. */
sdsdkv_config_hashing hash_be;
/** Database type. */
Expand Down
4 changes: 4 additions & 0 deletions tests/trivial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ main(int argc, char **argv)
erc = MPI_Comm_split(MPI_COMM_WORLD, personality, rank, &pcomm);
if (erc != MPI_SUCCESS) ABORT(rank, erc);

const int rpc_thread_count = -1;

sdsdkv_config dkv_config = {
/* .init_comm = */
MPI_COMM_WORLD,
/* .personality = */
personality,
/* .rpc_thread_count */
rpc_thread_count,
/* .hash_be = */
SDSDKV_HASHING_CH_PLACEMENT,
/* .db_type = */
Expand Down

0 comments on commit 0b663ab

Please sign in to comment.