Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the convertToRaw script #39047

Merged
merged 3 commits into from Aug 14, 2022
Merged

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Aug 12, 2022

PR description:

Update the convertToRaw script:

  • change the default to 100 events per file, to match the value currently used online;
  • Improve the handling of the output and exit status of the subprocesses;
  • write a run####_cff.py file with the Source and Services to process the converted files;
  • add the -r/--range option to restrict the processing to a range of runs and lumisections;
  • add the -v/--verbose option to print additional message while preprocessing and converting the input files.

PR validation:

The new version runs and selects lumisections correctly.

Here is a sample output from running convertToRaw over one .root file:

$ convertToRaw -o /gpu_data/store/data/Run2022C/HLTPhysics/FED/v1 -r 34-65 root://eoscms.cern.ch//eos/cms/tier0/store/data/Run2022C/EphemeralHLTPhysics11/RAW/v1/000/357/329/00000/9e43f951-59ef-4dbf-85d1-28b5fa5f664f.root 
preprocessing input file root://eoscms.cern.ch//eos/cms/tier0/store/data/Run2022C/EphemeralHLTPhysics11/RAW/v1/000/357/329/00000/9e43f951-59ef-4dbf-85d1-28b5fa5f664f.root
  run 357329, lumisetion 29 is outside of the given range and will be skipped
  run 357329, lumisetion 30 is outside of the given range and will be skipped
  run 357329, lumisetion 31 is outside of the given range and will be skipped
  run 357329, lumisetion 32 is outside of the given range and will be skipped
  run 357329, lumisetion 33 is outside of the given range and will be skipped
  run 357329, lumisetion 34 with 463 events will be processed
  run 357329, lumisetion 35 with 431 events will be processed

found run 357329, lumi 34, with 463 events
cmsRun \
  /data/user/fwyzard/CMSSW_12_4_6/src/HLTrigger/Tools/python/convertToRaw.py \
  inputFiles=root://eoscms.cern.ch//eos/cms/tier0/store/data/Run2022C/EphemeralHLTPhysics11/RAW/v1/000/357/329/00000/9e43f951-59ef-4dbf-85d1-28b5fa5f664f.root \
  runNumber=357329 \
  lumiNumber=34 \
  eventsPerLumi=11655 \
  eventsPerFile=100 \
  outputPath=/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329_ls0034

found run 357329, lumi 35, with 431 events
cmsRun \
  /data/user/fwyzard/CMSSW_12_4_6/src/HLTrigger/Tools/python/convertToRaw.py \
  inputFiles=root://eoscms.cern.ch//eos/cms/tier0/store/data/Run2022C/EphemeralHLTPhysics11/RAW/v1/000/357/329/00000/9e43f951-59ef-4dbf-85d1-28b5fa5f664f.root \
  runNumber=357329 \
  lumiNumber=35 \
  eventsPerLumi=11655 \
  eventsPerFile=100 \
  outputPath=/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329_ls0035

And the corresponding /gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329_cff.py file:

import FWCore.ParameterSet.Config as cms

from EventFilter.Utilities.FedRawDataInputSource_cfi import source as _source
source = _source.clone(
    eventChunkSize = 200,   # MB
    eventChunkBlock = 200,  # MB
    numBuffers = 4,
    maxBufferedFiles = 4,
    fileListMode = True,
    fileNames = (
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0034_index000000.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0034_index000001.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0034_index000002.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0034_index000003.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0034_index000004.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0035_index000000.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0035_index000001.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0035_index000002.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0035_index000003.raw',
        '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1/run357329/run357329_ls0035_index000004.raw'
    )
)

from EventFilter.Utilities.EvFDaqDirector_cfi import EvFDaqDirector as _EvFDaqDirector
EvFDaqDirector = _EvFDaqDirector.clone(
    buBaseDir = '/gpu_data/store/data/Run2022C/HLTPhysics/FED/v1',
    runNumber = 357329
)

from EventFilter.Utilities.FastMonitoringService_cfi import FastMonitoringService as _FastMonitoringService
FastMonitoringService = _FastMonitoringService.clone()

If this PR will be backported please specify to which release cycle the backport is meant for:

To be backported to 12.4.x to convert data for use by the HLT.
See #39048.

Add the -r/--range option to restrict the processing to a range of runs
and lumisections.
@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 12, 2022

please test

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 12, 2022

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39047/31538

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard (Andrea Bocci) for master.

It involves the following packages:

  • HLTrigger/Tools (hlt)

@Martin-Grunewald, @missirol can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol, @silviodonato this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-689334/26793/summary.html
COMMIT: 57e087a
CMSSW: CMSSW_12_5_X_2022-08-12-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39047/26793/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: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3692476
  • DQMHistoTests: Total failures: 7
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3692446
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 50 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@missirol
Copy link
Contributor

+hlt

@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. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

events_per_file = 50
events_per_lumi = 11650
events_per_file = 100
events_per_lumi = 11655
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my education: how was 11655 chosen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's how many events we can expect an HLT node to process in each lumisection under nominal conditions: 100 kHz / 200 nodes × 23.31 s = 11655 events

After processing each run, write a cff.py file with the Source and the
necessary Services to process the converted files.

Improve the handling of the output and exit status of the subprocesses,
and add a -v/--verbose option to print additional message while
preprocessing and converting the input files.
@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 13, 2022

Fixed the case where the output has a single .raw file.

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 13, 2022

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39047/31547

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

Pull request #39047 was updated. @Martin-Grunewald, @missirol can you please check and sign again.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-689334/26801/summary.html
COMMIT: 9a4b207
CMSSW: CMSSW_12_5_X_2022-08-13-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39047/26801/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: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3692476
  • DQMHistoTests: Total failures: 7
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3692446
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 50 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

f.close()
with open(eor_file, 'w') as file:
file.write('{\n "data" : [ "%d", "%d", "%d", "%d" ],\n "definition" : "%s",\n "source" : "%s"\n}\n' % (summary['data'][0], summary['data'][1], summary['data'][2], summary['data'][3], summary['definition'], summary['source']))
file.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought with-open-as takes care of closing the file (so close wouldnt be needed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does, but I don't mind doing it explicitly

from EventFilter.Utilities.FastMonitoringService_cfi import FastMonitoringService as _FastMonitoringService
FastMonitoringService = _FastMonitoringService.clone()
""" % ('\n'.join(" '" + f + "'," for f in converted_files), args.output_directory, run))
file.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought with-open-as takes care of closing the file (so close wouldnt be needed).

@missirol
Copy link
Contributor

+hlt

Review comment is minor.

@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. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Aug 14, 2022

+1

@cmsbuild cmsbuild merged commit f44cb5d into cms-sw:master Aug 14, 2022
@fwyzard fwyzard deleted the update_convertToRaw_125x branch August 16, 2022 05:56
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.

None yet

4 participants