Skip to content

DPL: look up AliEn replicas without starting cling - #16268

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16268
Open

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16268

Conversation

@ktf

@ktf ktf commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

On an alien:// input the AOD reader started ROOT's interpreter even with
the native backend. TGrid::Connect goes through the plugin manager, which
runs P010_TJAlien.C, and the replica lookup gets its results as a TMap of
TObjString: hashing a TPair calls TPair::Class() and initialises cling.
That costs about 0.27 s and 57 MB per reader process.

  • connectToGrid() creates the TJAlien instance directly instead of
    TGrid::Connect, and sets gErrorIgnoreLevel to kPrint if it is unset so
    that ROOT's error handler does not read it from the environment
    through gROOT. It replaces the four TGrid::Connect calls.
  • gridReplicas() uses TJAlien::CommandRaw, which returns the results as
    plain strings, when JAliEn-ROOT provides it (TJALIEN_HAS_COMMAND_RAW).
    Otherwise it uses gGrid->Command as before.
  • gridReplicas() splits the LFN by hand instead of with a TUrl. A TUrl
    reads Url.Special from gEnv, which goes through gROOT and starts the
    interpreter once TROOT exists (seen with gdb in a grid run on
    Linux). The path is the same as TUrl::GetFile for LFNs.
  • The replicas the reader gets are logged at debug level.

Measured with a reader-only workflow on an alien:// AO2D: the reader no
longer loads libCling or any .pcm, and its footprint goes from
126-131 MB to 44-75 MB. The replicas are identical to those from
TGrid::Command. The driver still opens the file with ROOT for metadata
discovery, so it still starts cling.

@ktf
ktf requested a review from a team as a code owner December 3, 2026 08:07
On an alien:// input the AOD reader started ROOT's interpreter even with
the native backend. TGrid::Connect goes through the plugin manager, which
runs P010_TJAlien.C, and the replica lookup gets its results as a TMap of
TObjString: hashing a TPair calls TPair::Class() and initialises cling.
That costs about 0.27 s and 57 MB per reader process.

- connectToGrid() creates the TJAlien instance directly instead of
  TGrid::Connect, and sets gErrorIgnoreLevel to kPrint if it is unset so
  that ROOT's error handler does not read it from the environment
  through gROOT. It replaces the four TGrid::Connect calls.
- gridReplicas() uses TJAlien::CommandRaw, which returns the results as
  plain strings, when JAliEn-ROOT provides it (TJALIEN_HAS_COMMAND_RAW).
  Otherwise it uses gGrid->Command as before.
- gridReplicas() splits the LFN by hand instead of with a TUrl. A TUrl
  reads Url.Special from gEnv, which goes through gROOT and starts the
  interpreter once TROOT exists (seen with gdb in a grid run on
  Linux). The path is the same as TUrl::GetFile for LFNs.
- The replicas the reader gets are logged at debug level.

Measured with a reader-only workflow on an alien:// AO2D: the reader no
longer loads libCling or any .pcm, and its footprint goes from
126-131 MB to 44-75 MB. The replicas are identical to those from
TGrid::Command. The driver still opens the file with ROOT for metadata
discovery, so it still starts cling.
@ktf

ktf commented Dec 4, 2026 •

Copy link
Copy Markdown
Member Author

I have tested this on hyperloop by hand, reusing 821131, and downloading the files from alien rather than using the locally.
Everythingh works as expected; PSS goes from around 779 MB to 718 MB.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant