Project

General

Profile

Bug #22931

beginRun is called more than once in a Shared Module

Added by Lisa Goodenough 4 days ago. Updated about 16 hours ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Infrastructure
Target version:
-
Start date:
07/12/2019
Due date:
% Done:

100%

Estimated time:
Spent time:
Occurs In:
Scope:
Internal
Experiment:
Mu2e
SSI Package:
Duration:

Description

I have constructed a Shared Producer Module for Mu2e Offline and have run it with two schedules. I am finding that beginRun is being called twice, once from each Schedule. Since Shared Module should only have one instance of the module, beginRun should only be called once.

History

#1 Updated by Paul Russo 4 days ago

There is an actual reason why it is explicitly called for each schedule. Imagine a module that has an array indexed by schedule id that that accumulates information over the duration of a run (separately for each schedule). The begin run callback is a good place to setup the entries of this array for each schedule.

So the expected behavior is that the shared module checks the schedule id. If it is doing schedule-specific work, then it can do an if test on the schedule id, and if it is not, then it can just do the work only for schedule id 0 (also an if test on the schedule id).

#2 Updated by Kyle Knoepfel 4 days ago

This will require a discussion, Paul. Currently, art calls beginRun n times for n schedules for a shared module but endRun only once for that same module. I do not believe this asymmetry is intentional. We should resolve it.

#3 Updated by Paul Russo 4 days ago

No argument there, just pointing out that it isn't as trivial as it seems at first glance. :-)

#4 Updated by Kyle Knoepfel about 21 hours ago

  • Status changed from New to Accepted

#5 Updated by Kyle Knoepfel about 16 hours ago

  • % Done changed from 0 to 100
  • Assignee set to Kyle Knoepfel
  • Status changed from Accepted to Resolved
  • Category set to Infrastructure
  • Project changed from cet-is to art

This bug has been fixed with commit art:1ec3d3c.



Also available in: Atom PDF