Skip to content

Commit

Permalink
Add mpi.rank to rocprofiler activity records
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme committed Jan 23, 2025
1 parent 96c9e91 commit be2ee1d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/services/rocprofiler/RocProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ class RocProfilerService
Caliper c;
c.begin(s_instance->m_flush_region_attr, Variant("ROCPROFILER FLUSH"));

Entry mpi_rank_entry;

{
Attribute mpi_rank_attr = c.get_attribute("mpi.rank");
if (mpi_rank_attr)
mpi_rank_entry = c.get(mpi_rank_attr);
}

for (size_t i = 0; i < num_headers; ++i) {
auto* header = headers[i];

Expand Down Expand Up @@ -216,8 +224,11 @@ class RocProfilerService

cali::Node* correlation = static_cast<cali::Node*>(record->correlation_id.external.ptr);

FixedSizeSnapshotRecord<6> snapshot;
FixedSizeSnapshotRecord<8> snapshot;
c.make_record(6, attr, data, snapshot.builder(), correlation);
if (!mpi_rank_entry.empty())
snapshot.builder().append(mpi_rank_entry);

s_instance->m_channel.events()
.process_snapshot(&c, &s_instance->m_channel, SnapshotView(), snapshot.view());

Expand Down Expand Up @@ -253,8 +264,11 @@ class RocProfilerService

cali::Node* correlation = static_cast<cali::Node*>(record->correlation_id.external.ptr);

FixedSizeSnapshotRecord<6> snapshot;
FixedSizeSnapshotRecord<8> snapshot;
c.make_record(6, attr, data, snapshot.builder(), correlation);
if (!mpi_rank_entry.empty())
snapshot.builder().append(mpi_rank_entry);

s_instance->m_channel.events()
.process_snapshot(&c, &s_instance->m_channel, SnapshotView(), snapshot.view());

Expand Down

0 comments on commit be2ee1d

Please sign in to comment.