Skip to content

Profile VMC

The profiling script builds VMC with RelWithDebInfo: optimized code plus debug information suitable for an external profiler. It does not start a profiler.

From the repository root:

Terminal window
./scripts/profile.sh

The command was run in the documentation workspace. Its complete output was:

-- The CXX compiler identification is GNU 13.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenMP found (CXX 4.5); using it for '#pragma omp simd'.
-- Configuring done (1.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/member/docs/Variational-Monte-Carlo/build-prof
[ 5%] Building CXX object CMakeFiles/vmc_lib.dir/src/blocking_analysis/blocking_analysis.cpp.o
...
[ 94%] Building CXX object CMakeFiles/vmc.dir/src/main.cpp.o
[100%] Linking CXX executable vmc
[100%] Built target vmc
Profiler build ready: ./build-prof/vmc

The resulting executable was inspected with:

Terminal window
file build-prof/vmc

Observed output:

build-prof/vmc: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=19219fd9c712e53b3929c3b84882075462bf1bcf, for GNU/Linux 3.2.0, with debug_info, not stripped

The configured cache values were inspected with:

Terminal window
cmake -LA -N build-prof | rg '^(CMAKE_BUILD_TYPE|CMAKE_CXX_COMPILER:|CMAKE_CXX_FLAGS_RELWITHDEBINFO|FP_64|VMC_ENABLE_CUDA|VMC_FAST_MATH)'

Observed output:

CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
FP_64:BOOL=ON
VMC_ENABLE_CUDA:BOOL=OFF
VMC_FAST_MATH:BOOL=OFF

Project-specific compiler options additionally select -O3, native CPU instructions, and frame pointers for RelWithDebInfo; see CMakeLists.txt.

The script accepts a custom build directory and the build feature flags:

Terminal window
./scripts/profile.sh my-profile-build
./scripts/profile.sh --fp32
./scripts/profile.sh --vmc-fast-math
./scripts/profile.sh --cuda

CPU builds default to build-prof/vmc; CUDA builds default to build-prof-cuda/vmc. Only the default CPU command was verified for this page.

The profiler executable reads config.cfg from its working directory exactly like the Release executable. Keep the configuration and random seed with the profile so another person can reproduce the workload.

The profiling build is defined by scripts/profile.sh and the RelWithDebInfo options in CMakeLists.txt.