art-framework-suite / art

The implementation of the art physics event processing framework
Other
2 stars 7 forks source link

"%#" stub in art output file names and the Mu2e use case #137

Closed pavel1murat closed 1 year ago

pavel1murat commented 1 year ago

What problem are you trying to solve?

issue with the art output file naming

Describe your feature request

I'm running a Mu2e DAQ (artdaq) job with the RootOutput module configured as follows (I suspect that RootDAQOutput is a flavor of RootOutput)

rootOutput: {
    module_type    : RootDAQOut 
    fileName       : "/scratch/mu2e/mu2etrk_mu2e_pasha_018/OutputData/raw.mu2e.trkvst.annex.%06r_%08s.art"
    #        fileName       : "/scratch/mu2e/mu2etrk_mu2e_pasha_018/OutputData/raw.mu2e.trkvst.annex.%06r_%08s_%03#.art"
    fileProperties : { maxSize : 100000 granularity: SubRun}
}

The output file name pattern corresponds to the file naming scheme adopted by Mu2e.

Art complains about the "%#" stub being missing, the commented out line makes it happy.

However with the granularity=SubRun and the chosen file naming pattern the "%#" stub is not really required.

Would it be possible to modify the art behavior to support the Mu2e file naming scheme? - that would save a lot of unnecessary file renamings

Please add the "high priority" label to this issue.

knoepfel commented 1 year ago

@pavel1murat, see the very last parameter of the allowed RootOutput configuration (art --print-description RootOutput):

<module label>: {
  module_type: RootOutput

  fileProperties {
    ...
  }

  ...
  ## If file-switching has been enabled, the output filename pattern
  ## must have a '%#' format specifier by default.  This ensures that
  ## an output file will never be overwritten for a given job execution.
  ## 
  ## For some workflows, this restriction is unnecessary if the user can
  ## guarantee that the specified filename pattern will create distinct
  ## output files.
  ## 
  ## If 'checkFileName' is set to 'false', then the '%#' is not required
  ## even if file-switching has been enabled.  In this processing mode,
  ## it is the user's responsibility to supply a filename pattern that
  ## will not result in output-file overwriting.
  ## 
  ## Do NOT set this to 'false' unless you know what you are doing!

  checkFileName: true  # default
}

In your case, you could set checkFileName to false.

pavel1murat commented 1 year ago

Kyle - as always - you thought about it - thanks!

On Mon, Aug 28, 2023 at 8:21 AM Kyle Knoepfel @.***> wrote:

@pavel1murat https://github.com/pavel1murat, see the very last parameter of the allowed RootOutput configuration (art --print-description RootOutput):

: { module_type: RootOutput fileProperties { ... } ... ## If file-switching has been enabled, the output filename pattern ## must have a '%#' format specifier by default. This ensures that ## an output file will never be overwritten for a given job execution. ## ## For some workflows, this restriction is unnecessary if the user can ## guarantee that the specified filename pattern will create distinct ## output files. ## ## If 'checkFileName' is set to 'false', then the '%#' is not required ## even if file-switching has been enabled. In this processing mode, ## it is the user's responsibility to supply a filename pattern that ## will not result in output-file overwriting. ## ## Do NOT set this to 'false' unless you know what you are doing! checkFileName: true # default } In your case, you could set checkFileName to false. — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you were mentioned.Message ID: ***@***.***>