Skip to main content

Analytics

DMR can log structured analytics lines at each reconfiguration event. These logs can be visualized with the Jupyter notebook provided in viz/.

Enabling analytics

Set before launching your application:

export DMR_PRINT_ANALYTICS=1
dmr mpirun ...

Or enable it permanently at compile time:

cmake -B build -DDMR_PRINT_ANALYTICS=1

Log format

Each analytics line has the following CSV format:

[DMR ANALYTICS],<timestamp>,<function>,<event>,<world_size>,<node_count>,<reconfig_time>,<ce>,<pending_nodes>
FieldTypeDescription
timestampfloatUnix timestamp when the event was recorded
functionstringDMR function that emitted the event
eventstringEvent identifier (see below)
world_sizeintNumber of MPI processes in MPI_COMM_WORLD
node_countintNumber of nodes in MPI_COMM_WORLD
reconfig_timefloatSeconds to complete the last reconfiguration, or -1 if not applicable
cefloatLast TALP accumulated communication efficiency, or -1 if not available
pending_nodesintNodes requested from Slurm but not yet allocated

Example line:

[DMR ANALYTICS],1748000123.45,dmr_check,DMR_EVENT_CHECK_CALLED,8,8,-1.00,-1.000000,0

Events

EventWhen emitted
DMR_EVENT_NONENo event yet
DMR_EVENT_INIT_COMPLETEdmr_init completed
DMR_EVENT_CHECK_CALLEDdmr_check was called
DMR_EVENT_STAY_CURRENTPolicy decided to stay at current size
DMR_EVENT_START_EXPAND_SLURMResources requested from Slurm
DMR_EVENT_START_EXPAND_MPIMPI expansion process started
DMR_EVENT_START_SHRINKShrink triggered
DMR_EVENT_DATA_REDIST_COMPLETEData redistribution finished
DMR_EVENT_TALP_CHECK_CE_ACCTALP communication efficiency check performed
DMR_EVENT_LAST_FINALIZEdmr_finalize called outside a reconfiguration

Custom analytics events

You can emit your own analytics lines at any point using dmr_create_custom_analytics_event. This creates a snapshot of the current DMR runtime state tagged with your event string, which is then printed in the same format as built-in events and can be read by the notebook.

DMRAnalytics *event;

// Create a snapshot tagged with your event name
dmr_create_custom_analytics_event("MY_APP_PHASE_START", &event);

// Print it (only emits a line if DMR_PRINT_ANALYTICS=1)
dmr_print_analytics_from(event);

// Free when done
dmr_destroy_custom_analytics_event(event);

The event string must not collide with the built-in DMR_EVENT_* constants.

Visualizing with the Jupyter notebook

The notebook viz/dmr_analytics_visualizer.ipynb reads analytics logs and produces graphs. It filters [DMR ANALYTICS] lines automatically so you can feed it raw application output without preprocessing.

Available graphs

GraphRequires
Node/Process count over timeDMR_PRINT_ANALYTICS=1
Node/Process count over iterationDMR_PRINT_ANALYTICS=1, iterative app with dmr_check per iteration
Node count + pending nodes over time or iterationDMR_PRINT_ANALYTICS=1
Node count + communication efficiency over time or iterationDMR_PRINT_ANALYTICS=1 + DMR_USE_TALP=1

The viz/ folder has a flake.nix with all Python dependencies (pandas, matplotlib, numpy, Jupyter).

One-shot launch:

cd viz/
nix run

Opens Jupyter Notebook at http://127.0.0.1:8888 automatically.

Dev shell (for more control):

cd viz/
nix develop
jupyter notebook --ip=127.0.0.1
# or: jupyter lab --ip=127.0.0.1
caution

Use --ip=127.0.0.1 explicitly. The default localhost may fail to open in some browsers.

Setup: manual

Install the dependencies with pip:

pip install jupyter notebook pandas matplotlib numpy

Then launch:

cd viz/
jupyter notebook --ip=127.0.0.1

Usage

  1. Place your log file in the viz/ folder (or provide its absolute path).
  2. Open dmr_analytics_visualizer.ipynb.
  3. Edit the first cell to point to your log file:
dmr_log_files = [ "my_run.out" ]
  1. Run all cells. The notebook supports multiple log files for comparison.