This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Tools

Tools used in LACES projects

CPU Memory Usage Tracking tools

heaptrack

It provides efficient, time resolved memory usage, leaks, allocations, flamegraphs, etc. for large applications - even with release compilation. It has a nice gui which opens automatically (if the AppImage is used, otherwise install and run heaptrack_gui) when there’s display connected. heaptrack_gui is also available on ubuntu apt repository and be installed easily by doing (may need sudo):

apt install heaptrack_gui

Portable version can be found here in KDE Download Page. This AppImage worked on both Ubuntu 24.04LTE and Perlmutter. Find more details here: https://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux.html

Another advantage is that even if the application crashes, it stills saves the data upto that point.

valgrind --tool=massif

Well known tool for memory profiling. It takes long time for large applications since it slows down the application significantly. Official documentation can be found here: https://valgrind.org/docs/manual/ms-manual.html. It also has a GUI called massif-visualizer.

Linaro-MAP

Generic profiling tool. Find more details here: https://www.linaroforge.com/linaro-map/. Tried to use it for a large application, but it needs debug symbols as well as gets stuck at some point and produces no output.

gperftools / pprof

I didn’t use it but listing as an available option.

GPU or General Kokkos Memory Usage Tracking tools

Kokkos provides a set of tools to track memory usage. Find details here. Don’t forget to compile Kokkos with Kokkos_ENABLE_LIBDL=ON flag before using these tools.

Performance Profiling tools

HPCToolkit

Find details and usage here: https://hpctoolkit.org/. It is available in perlmutter through:

module load spack
spack env activate gcc
spack load hpctoolkit

TAU

TAU is also avaiable in perlmutter through the gcc spack environemt. It has higher overhead and I don’t have much experience with it.

Linaro-Forge

Available in perlmutter. Find details here: https://www.linaroforge.com/. Has a nice GUI. I never used it but listing as an option.

Remote GUI Connection

NERSC/Perlmutter Machines

  • Through ThinLinc. It also works with their sshproxy allowing to connect without password.

SCOREC Machines

  • Though Web Interface of Blue and Orange Portals.
  • Through aperture machines. See instructions here.

IDE

CLion

JetBrains C/C++ IDE. See the guide on configuring CLion’s CMake with Spack environments, modules, or custom shell setups.

1 - CLion: Configuring CMake with Custom Environments

Load Spack environments, modules, or custom variables before CLion runs CMake

CMake projects with many dependencies are straightforward to configure from a terminal — you load your environment (Spack, modules, etc.) and run cmake. CLion, however, invokes cmake from its own process, which does not inherit your shell environment. Manually adding paths like CMAKE_PREFIX_PATH in the CMake settings rarely captures everything and quickly becomes tedious.

A reliable workaround is to replace CLion’s cmake binary with a thin wrapper script that sets up the environment first.

1. Write a CMake Wrapper Script

Create a shell script on the machine where CLion will run CMake. The script should source your environment setup and then forward the original CMake invocation:

#!/bin/bash
# Load your environment — adapt this section to your setup.
# Examples: source a Spack env, load modules, export variables, etc.
. ~/.bashrc
load-spack                        # initialize Spack
spack env activate my-project-env # activate the relevant environment
spack load cmake                  # ensure cmake is on PATH

# Forward the full CMake command that CLion passes in
exec cmake "$@"

Make it executable:

chmod +x /path/to/cmake_env_wrap.sh

Adjust the environment setup lines to match your project. You can source module files, activate Conda/venv environments, export variables, or run any shell commands needed before CMake.

2. Set the Wrapper as CLion’s CMake Executable

Open Settings → Build, Execution, Deployment → Toolchains and replace the default CMake path with the full path to your wrapper script.

CLion Toolchain — CMake set to the wrapper script

3. Configure the CMake Profile

Open Settings → Build, Execution, Deployment → CMake and set up your build profile (build type, options, build directory, etc.) as you normally would. Because the toolchain now points to the wrapper, CLion will automatically load your environment every time it invokes CMake.

CLion CMake profile settings

How It Works

CLion calls the binary specified in the Toolchain’s CMake field for every configure, build, and reload operation. By pointing it to a wrapper script, the full shell environment — compilers, flags, CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, library paths, and any other variables — is available to CMake exactly as it would be in a terminal session.