diff --git a/src/sst/core/config.cc b/src/sst/core/config.cc index 63939421f..524cf6daa 100644 --- a/src/sst/core/config.cc +++ b/src/sst/core/config.cc @@ -798,7 +798,11 @@ static const struct sstLongOpts_s sstOptions[] = { "verbose", 'v', "level", "Verbosity level to determine what information about core runtime is printed", &ConfigHelper::incrVerbose, &ConfigHelper::setVerbosity, true), DEF_ARG( - "num_threads", 'n', "NUM", "Number of parallel threads to use per rank", &ConfigHelper::setNumThreads, true), + "num-threads", 'n', "NUM", "Number of parallel threads to use per rank", &ConfigHelper::setNumThreads, true), + DEF_ARG( + "num_threads", 0, "NUM", + "[Deprecated] Number of parallel threads to use per rank (deprecated, please use --num-threads or -n instead)", + &ConfigHelper::setNumThreads, true), DEF_ARG( "sdl-file", 0, "FILE", "Specify SST Configuration file. Note: this is most often done by just specifying the file without an option.", diff --git a/src/sst/core/main.cc b/src/sst/core/main.cc index 0c595aba3..fcf634294 100644 --- a/src/sst/core/main.cc +++ b/src/sst/core/main.cc @@ -640,6 +640,20 @@ main(int argc, char* argv[]) } ////// End ConfigGraph Creation ////// +#ifdef SST_CONFIG_HAVE_MPI + // If we did a parallel load, check to make sure that all the + // ranks have the same thread count set (the python can change the + // thread count if not specified on the command line + if ( cfg.parallel_load() ) { + uint32_t max_thread_count = 0; + uint32_t my_thread_count = cfg.num_threads(); + MPI_Allreduce(&my_thread_count, &max_thread_count, 1, MPI_UINT32_T, MPI_MAX, MPI_COMM_WORLD); + if ( my_thread_count != max_thread_count ) { + g_output.fatal( + CALL_INFO, 1, "Thread counts do no match across ranks for configuration using parallel loading\n"); + } + } +#endif ////// Start Partitioning ////// double start_part = sst_get_cpu_time(); diff --git a/src/sst/core/model/python/pymodel.cc b/src/sst/core/model/python/pymodel.cc index f4ae15dc9..e951c6b2f 100644 --- a/src/sst/core/model/python/pymodel.cc +++ b/src/sst/core/model/python/pymodel.cc @@ -397,7 +397,7 @@ setSSTThreadCount(PyObject* UNUSED(self), PyObject* args) Config* cfg = gModel->getConfig(); long oldNThr = cfg->num_threads(); long nThr = SST_ConvertToCppLong(args); - if ( nThr > 0 && nThr <= oldNThr ) gModel->setConfigEntryFromModel("num_threads", std::to_string(nThr)); + gModel->setConfigEntryFromModel("num_threads", std::to_string(nThr)); return SST_ConvertToPythonLong(oldNThr); }