Skip to content

Commit

Permalink
[VL][BUILD][DOC] Change BUILD_JEMALLOC to ENABLE_JEMALLOC_STATS (#7650)
Browse files Browse the repository at this point in the history
  • Loading branch information
surnaik authored Oct 24, 2024
1 parent a5cbd1d commit d991a8e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions cpp/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=*)
Expand Down Expand Up @@ -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}"
Expand All @@ -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} \
Expand Down
4 changes: 2 additions & 2 deletions cpp/velox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions cpp/velox/memory/VeloxMemoryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include "VeloxMemoryManager.h"
#ifdef ENABLE_JEMALLOC
#ifdef ENABLE_JEMALLOC_STATS
#include <jemalloc/jemalloc.h>
#endif

Expand Down Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions dev/builddeps-veloxbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=*)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/build-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit d991a8e

Please sign in to comment.