Skip to content

Commit

Permalink
mpit: add an env var to optionally disable MPI_T usage
Browse files Browse the repository at this point in the history
Set OSHMPI_ENABLE_MPI_T=0 to disable MPI_T usage in OSHMPI. It is 1
(enabled) by default
  • Loading branch information
minsii committed May 7, 2021
1 parent 281dc44 commit 087a18a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/include/oshmpi_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ typedef struct {
* Invalid when OSHMPI_DISABLE_AM_ASYNC_THREAD is set.
* Default value is 1 if either AMO or RMA is AM based;
* otherwise 0.*/
unsigned int enable_mpit; /* OSHMPI_ENABLE_MPI_T: Control mpi_t utilization at shmem_init.
* Value: 0 or 1. Default is 1, enables MPI_T setting.
* Set OSHMPI_ENABLE_MPI_T=0 to disable. */
uint32_t mpi_gpu_features; /* OSHMPI_MPI_GPU_FEATURES: Arbitrary combination with bit shift defined in
* OSHMPI_mpi_gpu_feature_shift_t. none and all are two special values. */
#ifndef OSHMPI_DISABLE_DEBUG
Expand Down
12 changes: 11 additions & 1 deletion src/internal/setup_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,16 @@ static void print_env(void)
" OSHMPI_AMO_OPS %s\n"
" OSHMPI_ENABLE_ASYNC_THREAD %d\n"
" OSHMPI_MPI_GPU_FEATURES %s\n"
" OSHMPI_ENABLE_MPI_T %d\n"
#ifndef OSHMPI_DISABLE_DEBUG
" (Invalid options if OSHMPI is built with --enable-fast=ndebug)\n"
" OSHMPI_AMO_DBG_MODE %s\n"
" OSHMPI_RMA_DBG_MODE %s\n"
#endif
,OSHMPI_env.verbose, amo_ops_str,
OSHMPI_env.enable_async_thread,
mpi_gpu_features_str
mpi_gpu_features_str,
OSHMPI_env.enable_mpit
#ifndef OSHMPI_DISABLE_DEBUG
,getstr_env_dbg_mode(OSHMPI_env.amo_dbg_mode)
,getstr_env_dbg_mode(OSHMPI_env.rma_dbg_mode)
Expand Down Expand Up @@ -673,6 +675,11 @@ static void initialize_env(void)
if (OSHMPI_env.enable_async_thread != 0)
OSHMPI_env.enable_async_thread = 1;
#endif

OSHMPI_env.enable_mpit = 1;
val = getenv("OSHMPI_ENABLE_MPI_T");
if (val && strlen(val) && atoi(val) == 0)
OSHMPI_env.enable_mpit = 0;
}

static void set_mpit_cvar(const char *cvar_name, const void *val)
Expand Down Expand Up @@ -705,6 +712,9 @@ static void set_mpit_cvar(const char *cvar_name, const void *val)

static void initialize_mpit(void)
{
if (!OSHMPI_env.enable_mpit)
return;

int val = 1;
set_mpit_cvar("MPIR_CVAR_CH4_RMA_ENABLE_DYNAMIC_AM_PROGRESS", &val);
}
Expand Down

0 comments on commit 087a18a

Please sign in to comment.