Feature #8593: Improve flexibility of output file handling
For DS-50 DAQ, don't open a new output file until a new run begins
Currently, in the ds50daq/artdaq/art system with the RootOutput module, when one run (or subrun) is finished, the disk file that is currently open is closed, and a new file is opened even though the next run (or subrun) may not start for a long time in the future.
When the system is shut down, the feature has the side effect of creating a file with no events in it (because a file is pre-opened for a run/subrun that never happens).
Ideally, disk files would be opened at the beginning of runs/subruns and closed at the end of runs/subruns, independent of whether earlier runs had been taken in the current session of the DAQ.
I can demonstrate this issue, if that would be helpful.
#1 Updated by Kurt Biery over 6 years ago
- Due date set to 07/31/2013
- Priority changed from Normal to High
Notes from Alessandro/Jim/Kurt discussion:
We believe that this has to do with the state handling inside of art. (any oversimplification here is my fault)
Alessandro points out that the problem with this feature is that when the new file is opened early, it could have the wrong run number if the first file was closed because of an end run, rather than a end subrun.
"The information in the file name must match the metadata inside the file."
Jim will talk with Chris to investigate how this might be accomplished.
[We didn't explicitly talk about a due date for this issue, so I need to double-check if my 31-July choice is valid. -Kurt]
#3 Updated by Kurt Biery over 6 years ago
No, it is still an issue.
The renaming functionality helps address Alessandro's concern that the filename correctly reflects the contents of the file (run number, etc.), but that was just one example of the sort of confusion that might result from a file that is created before the new run or subrun begins.
It is still desirable to only open new files when new runs and subruns begin, and to avoid creating extra empty files that need to be cleaned up.
#12 Updated by Kyle Knoepfel almost 4 years ago
- Subject changed from For DS-50 DAQ, don't open a new file until a new run begins to For DS-50 DAQ, don't open a new output file until a new run begins
- Status changed from Feedback to Accepted
- Assignee set to Kyle Knoepfel
- % Done changed from 0 to 90
- Estimated time changed from 0.00 h to 16.00 h
The implementation for this feature is largely complete. However, instead of delaying the opening of a new output file until
beginRun/beginSubRun, it will be delayed even further: an output file will be opened just before the first write to that new file is required. For many cases, this means that the output file is not opened until just before the first event of the new run/subrun is written.