GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reuse same instances in hybrid generator by jackal1-66 · Pull Request #15983 · AliceO2Group/AliceO2

Conversation

@jackal1-66

@jackal1-66 jackal1-66 commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Launch single instances of generators which share the same exact configuration. This reduces configuration times and reduces memory usage as well. This is enabled by default, but it is configurable with a new parameter. In addition it is disabled by default when more than a single worker is set (per user decision)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jackal1-66
jackal1-66 requested a review from sawenzel as a code owner October 18, 2026 13:50
@alibuild alibuild mentioned this pull request Oct 18, 2026
Please consider the following formatting changes to #15983 jackal1-66/AliceO2#27
Closed
@jackal1-66
Reuse same instances in hybrid generator
41ee248
@jackal1-66
jackal1-66 force-pushed the hybridReuse branch from 99baa59 to 41ee248 Compare October 18, 2026 13:53
@sawenzel

sawenzel commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks @jackal1-66. This is a good step forward and should work fine. However, the reuse is implicit, which can be dangerous: it relies on two serialised configs matching exactly, so $O2_ROOT/... in one slot and an expanded path in another quietly gives two instances. Since it is on by default, it would also change the event sequence of existing JSONs. Instead, could we consider an explicit solution based on labels and refs, like so:

{
  "mode": "sequential",
  "generators": [
    { "name": "pythia8", "label": "mb",
      "config": { "config": "$O2_ROOT/share/Generators/egconfig/pythia8_inel.cfg" } },
    { "cocktail": [
        { "ref": "mb" },
        { "name": "external",
          "config": { "fileName": "${O2DPG_ROOT}/MC/config/PWGDQ/external/generator/GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV.C",
                      "funcName": "GeneratorParamPromptJpsiToElectronEvtGen_pp13TeV()" } } ] }
  ],
  "fractions": [3, 1]
}

A whole cocktail can be labelled and referenced in the same way:

"generators": [
  { "label": "jpsi", "cocktail": [ { "ref": "mb" }, { "name": "external", "config": { ... } } ] },
  { "ref": "mb" },
  { "ref": "jpsi" }
],
"fractions": [1, 3, 1]

fractions keeps its meaning. A ref must point to a label declared earlier and must not carry config or triggers. Most of this PR can stay: mSlotToInstance and the per-instance queues would be filled from the refs instead of the signatures, and reuseIdenticalGenerators would no longer be needed. By default, nothing would change for the user.

I would recommend that a referenced entry reports the sub-generator ID of the entry it points to. I can propose an implementation on top of your branch, together with a small tool in O2DPG next to o2_hybrid_gen.py that finds duplicated generators in existing configs and rewrites them with labels and refs. In addition, if we go this way, we should add an example in the documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sawenzel
sawenzel requested changes Oct 19, 2026
View reviewed changes

@sawenzel sawenzel left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

see inline comment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sawenzel sawenzel sawenzel requested changes

Requested changes must be addressed to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jackal1-66 @sawenzel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.