Skip to content

[rocprofiler-systems] Add MPI rank/size and configuration to rocpd_process metadata#3012

Open
mradosav-amd wants to merge 7 commits intodevelopfrom
users/mradosav-amd/rocpd-env
Open

[rocprofiler-systems] Add MPI rank/size and configuration to rocpd_process metadata#3012
mradosav-amd wants to merge 7 commits intodevelopfrom
users/mradosav-amd/rocpd-env

Conversation

@mradosav-amd
Copy link
Contributor

Motivation

When profiling MPI applications, the rocpd database's rocpd_process table lacked critical context about the MPI environment (rank, communicator size) and profiler configuration settings. This made it difficult to correlate profiling data with specific MPI processes and understand the configuration used during profiling.

Technical Details

  • Extended process metadata struct with environment and extdata JSON fields
  • Added print_settings_json() to serialize profiler configuration to JSON format
  • Implemented MPI init callback mechanism in mpi_gotcha to capture MPI_COMM_WORLD_RANK
    and MPI_COMM_WORLD_SIZE after MPI initialization
  • Configuration settings are now stored in extdata column; MPI environment in environment column
  • Added SQL quote escaping helper for JSON strings containing double quotes

JIRA ID

AIPROFSYST-175

Test Plan

  • Run profiler on MPI application with multiple ranks
  • Verify rocpd database contains correct MPI rank/size in rocpd_process.environment
  • Verify profiler configuration is stored in rocpd_process.extdata
  • Test with non-MPI applications to ensure no regressions

Test Result

  • rocpd_process table should contain JSON with MPI_COMM_WORLD_RANK and MPI_COMM_WORLD_SIZE for each MPI process
  • extdata column should contain JSON with all non-hidden, enabled configuration settings (e.g., ROCPROFSYS_OUTPUT_PATH, sampling settings, etc.)
  • Non-MPI applications should have empty environment but still populate extdata

Submission Checklist

Copy link
Contributor

@dgaliffiAMD dgaliffiAMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments below. It looks good overall. Thank you.

@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch 2 times, most recently from 1b7c28c to 235232a Compare February 9, 2026 07:55
@dgaliffiAMD dgaliffiAMD force-pushed the users/mradosav-amd/rocpd-env branch from 235232a to 8520a34 Compare February 17, 2026 18:29
@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch from 8520a34 to b96b7e2 Compare February 18, 2026 08:40
@dgaliffiAMD dgaliffiAMD force-pushed the users/mradosav-amd/rocpd-env branch from b96b7e2 to d424472 Compare February 18, 2026 20:18
@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch from d424472 to f1ecd95 Compare February 19, 2026 10:41
@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch 3 times, most recently from 4a4d416 to e4dba6d Compare February 26, 2026 11:17
@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch 2 times, most recently from 47a828d to 21bfc98 Compare February 26, 2026 15:22
@mradosav-amd mradosav-amd force-pushed the users/mradosav-amd/rocpd-env branch from 21bfc98 to 283cc70 Compare February 27, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants