Skip to content

Implement PathStateCapture and PathStateRelease#48598

Merged
cmsbuild merged 1 commit intocms-sw:masterfrom
fwyzard:implement_PathActivityFilter
Jul 26, 2025
Merged

Implement PathStateCapture and PathStateRelease#48598
cmsbuild merged 1 commit intocms-sw:masterfrom
fwyzard:implement_PathActivityFilter

Conversation

@fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jul 21, 2025

PR description:

An edm::PathStateCapture produces an edm::PathStateToken when run.

The edm::PathStateToken is an empty struct, and acts as a "token"; it is used to communicate the status (active or not) of an edm::Path at a given point where an edm::PathStateCapture module is scheduled:

  • if the path is active, the module runs and produces the token;
  • if the path is not active the module does not run or produce the token.

While any product would work, the use of a dedicated empty type is more explicit.

An edm::PathStateToken may be consumed by an edm::PathStateRelease, an
EDFilter with a result of true if the token is present, false otherwise.

PR validation:

The new unit test passes.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

No backport expected.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 21, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48598/45564

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard for master.

It involves the following packages:

  • DataFormats/Common (core)
  • FWCore/Modules (core)

@Dr15Jones, @cmsbuild, @makortel, @smuzaffar can you please review it and eventually sign? Thanks.
@makortel, @missirol, @mmusich, @rovere, @wddgit this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 21, 2025

please test

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 21, 2025

@Dr15Jones here are the modules we discussed.
Suggestion for better modules' name would be quite welcome 😁

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 36KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e6f934/47313/summary.html
COMMIT: ec5a788
CMSSW: CMSSW_15_1_X_2025-07-21-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48598/47313/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 1
  • DQMHistoTests: Total histograms compared: 0
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 0
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0 KiB( 0 files compared)
  • Checked 0 log files, 0 edm output root files, 1 DQM output files

@@ -0,0 +1,31 @@
#include "DataFormats/Common/interface/PathActivityToken.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize PathActivityProducer may not be the final name, but the file name should match the name of the producer class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my bad, I forgot to rename the file.

@Dr15Jones
Copy link
Contributor

Suggestion for better modules' name would be quite welcome 😁

I'll try bouncing ideas of Matti once he is in. The important ideas is the Filter is trying to replicate the behavior seen by the Producer. So they form a pair. Maybe using Sender/Receiver in the names to denote the connection?

@makortel
Copy link
Contributor

Chris and I brainstormed on the naming and came up with a suggestion

  • PathActivityToken -> PathCheckpointToken
  • PathActivityProducer -> PathCheckpoint
  • PathActivityFilter -> PathCheckpointReplicator

Comment on lines +212 to +215
<class name="edm::PathActivityToken" ClassVersion="3">
<version ClassVersion="3" checksum="4071377827"/>
</class>
<class name="edm::Wrapper<edm::PathActivityToken>"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the data product be made transient (wrt OutputModules)

Suggested change
<class name="edm::PathActivityToken" ClassVersion="3">
<version ClassVersion="3" checksum="4071377827"/>
</class>
<class name="edm::Wrapper<edm::PathActivityToken>"/>
<class name="edm::PathActivityToken"/>
<class name="edm::Wrapper<edm::PathActivityToken>" persistent="false"/>

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the idea is to serialise it and transfer it over the network, which requires a dictionary.
The requirement could be bypassed using some spacial-casing - but in general I don't see why we shouldn't support storing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Marking the Wrapper transient doesn't preclude ROOT serialization in general. The persistent is a CMS-specific attribute, whose main impact is that OutputModules ignore such data products (plus some knock-on effects in the framework).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does one check at runtime if a Wrapper has a ROOT dictionary ?

DataFormats/Provenance/interface/BranchDescription.h only provides transient().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But orthogonal to that - why one should not be allowed to serialise this product ?

Copy link
Contributor

Choose a reason for hiding this comment

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

How does one check at runtime if a Wrapper has a ROOT dictionary ?

Presently the framework requires a dictionary for all data products put into the Event. When we (hopefully) get to the point that transient data products would not need a dictionary, we should provide a clear function to check whether a dictionary exists or not.

But orthogonal to that - why one should not be allowed to serialise this product ?

My line of thought was that if this data product would not have to be stored in files, we could easily avoid a class of mistakes of accidentally storing them (and taking disk space for no reason) by declaring it to be transient. (just to be clear, the "storage in files" is different from general ability to "serialize with ROOT", I wasn't sure which you meant).

But we don't need to argue about this further. I'm fine with allowing the persistency if there is a foreseen use case.

class PathActivityFilter : public global::EDFilter<> {
public:
explicit PathActivityFilter(ParameterSet const& config)
: token_(consumes<PathActivityToken>(config.getParameter<edm::InputTag>("producer"))) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you decide to go with Checkpoint in the name, then maybe this should be "checkpoint".

An `edm::PathStateCapture` produces an `edm::PathStateToken` when run.

The `edm::PathStateToken` is an empty struct, and acts as a "token"; it is used
to communicate the status (active or not) of an `edm::Path` at a given point
where an `edm::PathStateCapture` module is scheduled:
  - if the path is active, the module runs and produces the token;
  - if the path is not active the module does not run or produce the token.
While any product would work, the use of a dedicated empty type is more explicit.

An `edm::PathStateToken` may be consumed by an `edm::PathStateRelease`, an
`EDFilter` with a result of `true` if the token is present, `false` otherwise.
@fwyzard fwyzard force-pushed the implement_PathActivityFilter branch from 701a12b to 1511011 Compare July 25, 2025 04:17
@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 25, 2025

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48598/45598

@cmsbuild
Copy link
Contributor

Pull request #48598 was updated. @Dr15Jones, @makortel, @smuzaffar can you please check and sign again.

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 25, 2025

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 36KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e6f934/47384/summary.html
COMMIT: 1511011
CMSSW: CMSSW_15_1_X_2025-07-24-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48598/47384/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 4 lines to the logs
  • Reco comparison results: 7 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 4076162
  • DQMHistoTests: Total failures: 41
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4076101
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 215 log files, 184 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

Comparison differences are related to #47071 and #48504

@makortel
Copy link
Contributor

+core

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @rappoccio, @antoniovilela, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 332067c into cms-sw:master Jul 26, 2025
10 checks passed
@fwyzard fwyzard deleted the implement_PathActivityFilter branch August 13, 2025 15:10
@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 27, 2025

type ngt

@cmsbuild cmsbuild added the ngt label Nov 27, 2025
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.

5 participants