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.
Build the CPU profiling executable
Section titled “Build the CPU profiling executable”From the repository root:
./scripts/profile.shThe 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 vmcProfiler build ready: ./build-prof/vmcThe resulting executable was inspected with:
file build-prof/vmcObserved 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 strippedThe configured cache values were inspected with:
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=RelWithDebInfoCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUGFP_64:BOOL=ONVMC_ENABLE_CUDA:BOOL=OFFVMC_FAST_MATH:BOOL=OFFProject-specific compiler options additionally select -O3, native CPU
instructions, and frame pointers for RelWithDebInfo; see CMakeLists.txt.
Build another profiling variant
Section titled “Build another profiling variant”The script accepts a custom build directory and the build feature flags:
./scripts/profile.sh my-profile-build./scripts/profile.sh --fp32./scripts/profile.sh --vmc-fast-math./scripts/profile.sh --cudaCPU builds default to build-prof/vmc; CUDA builds default to
build-prof-cuda/vmc. Only the default CPU command was verified for this page.
Choose a profiling workload
Section titled “Choose a profiling workload”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.
Run the profiler
Section titled “Run the profiler”Source of truth
Section titled “Source of truth”The profiling build is defined by scripts/profile.sh and the
RelWithDebInfo options in CMakeLists.txt.