From c96fc9d23024b2ad070b1b0b39f66aa6ffa90d8e Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Fri, 20 Dec 2024 17:30:07 -0800 Subject: [PATCH] Raise number of threads used by GASNet by default + add warning if exceeded --- Signed-off-by: Brad Chamberlain --- runtime/src/tasks/qthreads/tasks-qthreads.c | 12 +++++++++++- third-party/gasnet/Makefile | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/src/tasks/qthreads/tasks-qthreads.c b/runtime/src/tasks/qthreads/tasks-qthreads.c index 02cb8cb6ef32..568a21718103 100644 --- a/runtime/src/tasks/qthreads/tasks-qthreads.c +++ b/runtime/src/tasks/qthreads/tasks-qthreads.c @@ -502,7 +502,17 @@ static void setupAvailableParallelism(int32_t maxThreads) { if (hwpar > 0) { // Limit the parallelism to the maximum imposed by the comm layer. if (0 < maxThreads && maxThreads < hwpar) { - hwpar = maxThreads; + if (chpl_nodeID == 0) { + char msg[1024]; + snprintf(msg, sizeof(msg), + "The CHPL_COMM setting is limiting the number of threads " + "to %d, rather than the hardware's preference of %d. " + "If using CHPL_COMM=gasnet, set 'GASNET_MAX_THREADS' to " + "a higher number in your environment to address this.\n", + maxThreads, hwpar); + chpl_warning(msg, 0, 0); + } + hwpar = maxThreads; } // diff --git a/third-party/gasnet/Makefile b/third-party/gasnet/Makefile index fecfda6fc03d..9d0aec0fa542 100644 --- a/third-party/gasnet/Makefile +++ b/third-party/gasnet/Makefile @@ -135,7 +135,7 @@ gasnet-config: FORCE mkdir -p $(GASNET_BUILD_DIR) cd $(GASNET_SUBDIR) && ./Bootstrap -T $(XTRA_CONFIG_COMMAND) - $(ENSURE_GASNET_COMPATIBLE_COMPILER) cd $(GASNET_BUILD_DIR) && $(CHPL_GASNET_ENV_VARS) $(GASNET_SUBDIR)/$(CHPL_GASNET_CFG_SCRIPT) --prefix=$(GASNET_INSTALL_DIR) $(CHPL_GASNET_CFG_OPTIONS) --disable-seq --enable-par --disable-parsync $(CHPL_GASNET_CFG_OPTIONS) + $(ENSURE_GASNET_COMPATIBLE_COMPILER) cd $(GASNET_BUILD_DIR) && $(CHPL_GASNET_ENV_VARS) $(GASNET_SUBDIR)/$(CHPL_GASNET_CFG_SCRIPT) --prefix=$(GASNET_INSTALL_DIR) --disable-seq --enable-par --disable-parsync --with-max-pthreads-per-node=65535 $(CHPL_GASNET_CFG_OPTIONS) gasnet-build: FORCE $(ENSURE_GASNET_COMPATIBLE_COMPILER) cd $(GASNET_BUILD_DIR) && $(MAKE) all