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

Add option to dump offloaded tracks as an event file #854

Merged
merged 7 commits into from
Jul 26, 2023

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Jul 13, 2023

This adds a shared "offload writer" that writes one "event" per flush call, with all threads sharing a single output file (so that the separate events can be parallelized when reloading the file).

@sethrj sethrj added enhancement New feature or request external Dependencies and framework-oriented features labels Jul 13, 2023
@sethrj sethrj requested a review from drbenmorgan July 13, 2023 13:46
@sethrj
Copy link
Member Author

sethrj commented Jul 13, 2023

@whokion Can you check out this branch, set options.offload_output_file = "cms-offload.hepmc3"; (and you can disable the SDs to speed it up a bit) and see if you can generate offload files from 100 ttbar events with CMSSW for the HLLHC and Run 3 configurations?

@whokion
Copy link
Contributor

whokion commented Jul 13, 2023

No problem. Just for my curiosity, is the cms-offload.hepmc3 different from celeritas-output.json with
options_->output_file = "celeritas-output.json"
or root output by cmsRun, for example, cms-hllhc-step2.root with
fileName = cms.untracked.string('file:cms-hllhc-step2.root')
inside cms.OutputModule("PoolOutputModule", ...)?

@sethrj
Copy link
Member Author

sethrj commented Jul 13, 2023

  • The JSON output file is for Celeritas internals (kernel diagnostics, etc.)
  • The ROOT output is for processed Geant4 physics data
  • The "offload" HepMC3 output file is for the tracks that Geant4 sends to celeritas

@whokion
Copy link
Contributor

whokion commented Jul 13, 2023

cmsRun with this branch runs successfully for both Run3 and HL-LHC configurations. Please see the size of file output with 100 ttbar events:
-rw-r--r-- 1 syjun g4gpu 3262865394 Jul 13 12:10 cms-offload-hllhc.hepmc3
-rw-r--r-- 1 syjun g4gpu 1136394364 Jul 13 11:22 cms-offload-run3.hepmc3

@whokion
Copy link
Contributor

whokion commented Jul 13, 2023

Temporarily, can down those output files by
wget https://g4cpt.fnal.gov/g4p/download/celeritas/cms-offload-run3.hepmc3
wget https://g4cpt.fnal.gov/g4p/download/celeritas/cms-offload-hllhc.hepmc3

@sethrj
Copy link
Member Author

sethrj commented Jul 17, 2023

@whokion Thanks for those files; I've downloaded them so you can delete if you want to clean up space.

@sethrj sethrj requested review from amandalund and removed request for drbenmorgan July 17, 2023 16:03
Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

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

Thanks @sethrj!

One minor observation: right now all the events in the output have event ID 0. This won't matter for us since we set our own sequential event IDs in the HepMC3 reader, but we might still want to add a evt.set_event_number(event_count_) in the EventWriter.

std::shared_ptr<StepCollector> step_collector_;
VecG4ParticleDef particles_;
std::string output_filename_;
std::shared_ptr<detail::OffloadWriter> offload_writer_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::shared_ptr<detail::OffloadWriter> offload_writer_;
SPOffloadWriter offload_writer_;

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, we definitely want to do that! I didn't notice that property.

@sethrj
Copy link
Member Author

sethrj commented Jul 17, 2023

I also realized that HepMC3PrimaryGenerator is giving all vertices the "event" position so I'll update and test that as well.

@sethrj
Copy link
Member Author

sethrj commented Jul 26, 2023

I'm going to actually move the hepmc3/io fix to a separate PR since that's a problem that exists on the v0.3 release.

@sethrj sethrj merged commit fc6bc02 into celeritas-project:develop Jul 26, 2023
1 check was pending
@sethrj sethrj deleted the accel-output branch July 26, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request external Dependencies and framework-oriented features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants