From 5ed2717302967542cffa061e1815d1e68d9a8be2 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 2 Feb 2024 15:32:28 -0500 Subject: [PATCH 1/4] Updates to enable jemalloc build This PR has updates necessary to build GEOS with jemalloc. It adds an option `USE_JEMALLOC` that by default is `OFF`. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86c8b109..8b3195cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,17 @@ ecbuild_add_executable ( LIBS GEOSgcm_GridComp esmf OpenMP::OpenMP_Fortran ) +# Using JeMalloc will be optional, default OFF +option (USE_JEMALLOC "Use JeMalloc" OFF) +if (USE_JEMALLOC) + find_package (JeMalloc) + if (JeMalloc_FOUND) + target_link_libraries (GEOSgcm.x JeMalloc::JeMalloc) + else () + message (FATAL_ERROR "USE_JEMALLOC is ON but JeMalloc is not found") + endif () +endif () + ecbuild_add_executable ( TARGET idfupd.x SOURCES idfupd.F90 From a892f137c2cdc67e3efb8a6111f5e3e735744d50 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Fri, 2 Aug 2024 10:00:03 -0400 Subject: [PATCH 2/4] Use cleaner CMake --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b3195cf..86e8c4ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,12 +7,8 @@ ecbuild_add_executable ( # Using JeMalloc will be optional, default OFF option (USE_JEMALLOC "Use JeMalloc" OFF) if (USE_JEMALLOC) - find_package (JeMalloc) - if (JeMalloc_FOUND) - target_link_libraries (GEOSgcm.x JeMalloc::JeMalloc) - else () - message (FATAL_ERROR "USE_JEMALLOC is ON but JeMalloc is not found") - endif () + find_package (JeMalloc REQUIRED) + target_link_libraries (GEOSgcm.x JeMalloc::JeMalloc) endif () ecbuild_add_executable ( From 6ee54430aca1fec8625993920129b342ef93e75c Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 9 Jan 2025 09:15:33 -0500 Subject: [PATCH 3/4] v11: Fixes for SCM --- scm_setup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scm_setup b/scm_setup index b4828e77..d4f8331d 100755 --- a/scm_setup +++ b/scm_setup @@ -233,9 +233,13 @@ then SED="$(command -v sed) " ISED="$SED -i.macbak " fi + PRELOAD_COMMAND='DYLD_INSERT_LIBRARIES' + LD_LIBRARY_PATH_CMD='DYLD_LIBRARY_PATH' else SED="$(command -v sed) " ISED="$SED -i " + PRELOAD_COMMAND='LD_PRELOAD' + LD_LIBRARY_PATH_CMD='LD_LIBRARY_PATH' fi case $selected_case in @@ -513,6 +517,8 @@ s?@BATCH_TASKS?$BATCH_TASKS?g s?@BATCH_TIME?$BATCH_TIME?g s?@BATCH_GROUP?$BATCH_GROUP?g s?@BATCH_JOBNAME?$BATCH_JOBNAME?g +s?@PRELOAD_COMMAND?$PRELOAD_COMMAND?g +s?@LD_LIBRARY_PATH_CMD?$LD_LIBRARY_PATH_CMD?g EOF $ISED -f $expdir/sedfile $expdir/scm_run.j From a339eae75ee6b754eda3230db8440208c6617bf8 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 9 Jan 2025 11:05:27 -0500 Subject: [PATCH 4/4] Read weights if found --- scm_run.j | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scm_run.j b/scm_run.j index dc185f7d..35f0cefe 100755 --- a/scm_run.j +++ b/scm_run.j @@ -32,4 +32,6 @@ cd $EXPDIR $GEOSBIN/construct_extdata_yaml_list.py GEOS_ChemGridComp.rc +echo "file_weights: true" >> extdata.yaml + $RUN_CMD 1 ./GEOSgcm.x --logging_config 'logging.yaml'