This is an automated email from the ASF dual-hosted git repository.

philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new d991a8e52e [VL][BUILD][DOC] Change BUILD_JEMALLOC to 
ENABLE_JEMALLOC_STATS (#7650)
d991a8e52e is described below

commit d991a8e52e2ff6c110a6189925634551eaecfed7
Author: surnaik <[email protected]>
AuthorDate: Thu Oct 24 12:52:10 2024 +0530

    [VL][BUILD][DOC] Change BUILD_JEMALLOC to ENABLE_JEMALLOC_STATS (#7650)
---
 cpp/CMakeLists.txt                     |  2 +-
 cpp/compile.sh                         | 10 +++++-----
 cpp/velox/CMakeLists.txt               |  4 ++--
 cpp/velox/memory/VeloxMemoryManager.cc |  4 ++--
 dev/builddeps-veloxbe.sh               |  8 ++++----
 docs/get-started/build-guide.md        |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 351113662d..ff934a2a8e 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -46,7 +46,7 @@ option(BUILD_VELOX_BACKEND "Build Velox backend" ON)
 option(BUILD_TESTS "Build Tests" OFF)
 option(BUILD_EXAMPLES "Build Examples" OFF)
 option(BUILD_BENCHMARKS "Build Benchmarks" OFF)
-option(BUILD_JEMALLOC "Build Jemalloc from Source" OFF)
+option(ENABLE_JEMALLOC_STATS "Prints Jemalloc stats for debugging" OFF)
 option(BUILD_GLOG "Build Glog from Source" OFF)
 option(USE_AVX512 "Build with AVX-512 optimizations" OFF)
 option(ENABLE_HBM "Enable HBM allocator" OFF)
diff --git a/cpp/compile.sh b/cpp/compile.sh
index 24da362f56..7006f69a3a 100755
--- a/cpp/compile.sh
+++ b/cpp/compile.sh
@@ -21,7 +21,7 @@ BUILD_VELOX_BACKEND=OFF
 BUILD_TESTS=OFF
 BUILD_EXAMPLES=OFF
 BUILD_BENCHMARKS=OFF
-BUILD_JEMALLOC=OFF
+ENABLE_JEMALLOC_STATS=OFF
 ENABLE_QAT=OFF
 ENABLE_HBM=OFF
 ENABLE_GCS=OFF
@@ -69,8 +69,8 @@ for arg in "$@"; do
     BUILD_BENCHMARKS=("${arg#*=}")
     shift # Remove argument name from processing
     ;;
-  --build_jemalloc=*)
-    BUILD_JEMALLOC=("${arg#*=}")
+  --enable_jemalloc_stats=*)
+    ENABLE_JEMALLOC_STATS=("${arg#*=}")
     shift # Remove argument name from processing
     ;;
   --enable_qat=*)
@@ -122,7 +122,7 @@ echo "BUILD_VELOX_BACKEND=${BUILD_VELOX_BACKEND}"
 echo "BUILD_TESTS=${BUILD_TESTS}"
 echo "BUILD_EXAMPLES=${BUILD_EXAMPLES}"
 echo "BUILD_BENCHMARKS=${BUILD_BENCHMARKS}"
-echo "BUILD_JEMALLOC=${BUILD_JEMALLOC}"
+echo "ENABLE_JEMALLOC_STATS=${ENABLE_JEMALLOC_STATS}"
 echo "ENABLE_HBM=${ENABLE_HBM}"
 echo "ENABLE_GCS=${ENABLE_GCS}"
 echo "ENABLE_S3=${ENABLE_S3}"
@@ -137,7 +137,7 @@ cd build
 cmake .. \
   -DBUILD_TESTS=${BUILD_TESTS} \
   -DBUILD_EXAMPLES=${BUILD_EXAMPLES} \
-  -DBUILD_JEMALLOC=${BUILD_JEMALLOC} \
+  -DENABLE_JEMALLOC_STATS=${ENABLE_JEMALLOC_STATS} \
   -DBUILD_VELOX_BACKEND=${BUILD_VELOX_BACKEND} \
   -DVELOX_HOME=${VELOX_HOME} \
   -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
diff --git a/cpp/velox/CMakeLists.txt b/cpp/velox/CMakeLists.txt
index 9dec2d843c..7eaf5f1e61 100644
--- a/cpp/velox/CMakeLists.txt
+++ b/cpp/velox/CMakeLists.txt
@@ -245,14 +245,14 @@ set_target_properties(velox PROPERTIES 
LIBRARY_OUTPUT_DIRECTORY
 # applicable to other dependencies.
 find_package(Folly REQUIRED CONFIG)
 
-if(BUILD_JEMALLOC)
+if(ENABLE_JEMALLOC_STATS)
   include(Findjemalloc_pic)
   find_jemalloc()
   if(JEMALLOC_NOT_FOUND)
     include(Buildjemalloc_pic)
     build_jemalloc()
   endif()
-  add_definitions(-DENABLE_JEMALLOC)
+  add_definitions(-DENABLE_JEMALLOC_STATS)
   target_link_libraries(velox PUBLIC jemalloc::libjemalloc)
 endif()
 
diff --git a/cpp/velox/memory/VeloxMemoryManager.cc 
b/cpp/velox/memory/VeloxMemoryManager.cc
index 2165f79b51..19a5d45804 100644
--- a/cpp/velox/memory/VeloxMemoryManager.cc
+++ b/cpp/velox/memory/VeloxMemoryManager.cc
@@ -16,7 +16,7 @@
  */
 
 #include "VeloxMemoryManager.h"
-#ifdef ENABLE_JEMALLOC
+#ifdef ENABLE_JEMALLOC_STATS
 #include <jemalloc/jemalloc.h>
 #endif
 
@@ -379,7 +379,7 @@ VeloxMemoryManager::~VeloxMemoryManager() {
     LOG(ERROR) << "Failed to release Velox memory manager after " << 
accumulatedWaitMs
                << "ms as there are still outstanding memory resources. ";
   }
-#ifdef ENABLE_JEMALLOC
+#ifdef ENABLE_JEMALLOC_STATS
   je_gluten_malloc_stats_print(NULL, NULL, NULL);
 #endif
 }
diff --git a/dev/builddeps-veloxbe.sh b/dev/builddeps-veloxbe.sh
index ffd2cc2dcf..1ed6e62e29 100755
--- a/dev/builddeps-veloxbe.sh
+++ b/dev/builddeps-veloxbe.sh
@@ -12,7 +12,7 @@ BUILD_TYPE=Release
 BUILD_TESTS=OFF
 BUILD_EXAMPLES=OFF
 BUILD_BENCHMARKS=OFF
-BUILD_JEMALLOC=OFF
+ENABLE_JEMALLOC_STATS=OFF
 BUILD_VELOX_TESTS=OFF
 BUILD_VELOX_BENCHMARKS=OFF
 ENABLE_QAT=OFF
@@ -64,8 +64,8 @@ do
         BUILD_BENCHMARKS=("${arg#*=}")
         shift # Remove argument name from processing
         ;;
-        --build_jemalloc=*)
-        BUILD_JEMALLOC=("${arg#*=}")
+        --enable_jemalloc_stats=*)
+        ENABLE_JEMALLOC_STATS=("${arg#*=}")
         shift # Remove argument name from processing
         ;;
         --enable_qat=*)
@@ -205,7 +205,7 @@ function build_gluten_cpp {
   cd build
   cmake -DBUILD_VELOX_BACKEND=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
         -DVELOX_HOME=${VELOX_HOME} \
-        -DBUILD_TESTS=$BUILD_TESTS -DBUILD_EXAMPLES=$BUILD_EXAMPLES 
-DBUILD_BENCHMARKS=$BUILD_BENCHMARKS -DBUILD_JEMALLOC=$BUILD_JEMALLOC \
+        -DBUILD_TESTS=$BUILD_TESTS -DBUILD_EXAMPLES=$BUILD_EXAMPLES 
-DBUILD_BENCHMARKS=$BUILD_BENCHMARKS 
-DENABLE_JEMALLOC_STATS=$ENABLE_JEMALLOC_STATS \
         -DENABLE_HBM=$ENABLE_HBM -DENABLE_QAT=$ENABLE_QAT 
-DENABLE_IAA=$ENABLE_IAA -DENABLE_GCS=$ENABLE_GCS \
         -DENABLE_S3=$ENABLE_S3 -DENABLE_HDFS=$ENABLE_HDFS 
-DENABLE_ABFS=$ENABLE_ABFS ..
   make -j $NUM_THREADS
diff --git a/docs/get-started/build-guide.md b/docs/get-started/build-guide.md
index f281ede140..3c0c521e21 100644
--- a/docs/get-started/build-guide.md
+++ b/docs/get-started/build-guide.md
@@ -14,7 +14,7 @@ Please set them via `--`, e.g. `--build_type=Release`.
 | build_tests            | Build gluten cpp tests.                             
                                               | OFF     |
 | build_examples         | Build udf example.                                  
                                               | OFF     |
 | build_benchmarks       | Build gluten cpp benchmarks.                        
                                               | OFF     |
-| build_jemalloc         | Build with jemalloc.                                
                                               | OFF     |
+| enable_jemalloc_stats         | Print jemalloc stats for debugging.          
                                                                     | OFF     |
 | build_protobuf         | Build protobuf lib.                                 
                                               | OFF     |
 | enable_qat             | Enable QAT for shuffle data de/compression.         
                                               | OFF     |
 | enable_iaa             | Enable IAA for shuffle data de/compression.         
                                               | OFF     |


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to