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

Problem in schema evolution for processes. CheckByteCount warning/error #348

Closed
jgalan opened this issue Dec 12, 2022 · 10 comments · Fixed by #357
Closed

Problem in schema evolution for processes. CheckByteCount warning/error #348

jgalan opened this issue Dec 12, 2022 · 10 comments · Fixed by #357
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@jgalan
Copy link
Member

jgalan commented Dec 12, 2022

When trying to open and old ROOT file with a new version of TRestAxionGeneratorProcess I got on screen the usual error message when schema evolution was not working properly.

root [1] TRestRun r("../pipeline/dataset/BabyIAXO_TrueWolterMicromegasTest_00375.root")
Error in <TBufferFile::CheckByteCount>: object of class TRestAxionGeneratorProcess read too many bytes: 1646 instead of 1638
Warning in <TBufferFile::CheckByteCount>: TRestAxionGeneratorProcess::Streamer() not in sync with data on file ../pipeline/dataset/BabyIAXO_TrueWolterMicromegasTest_00375.root, fix Streamer()

The files can be found here: https://github.com/rest-for-physics/framework-data/tree/main/pipeline/dataset

There were also some discussions on the root-forum. It seems that when processing the data using restManager, the TRestAxionGeneratorProcess or any other process, will not appear when calling TFile::ShowStreamerInfo.

https://root-forum.cern.ch/t/checkbytecount-and-streamer-error/52716/19

This is really a critical problem, hope someone could invest some time to have a look. @rest-for-physics/core_dev

@jgalan jgalan added bug Something isn't working invalid This doesn't seem right labels Dec 12, 2022
@jgalan
Copy link
Member Author

jgalan commented Dec 12, 2022

It seems the problem only occurs on axionlib. When processing using pipeline/trexdm and using ShowStreamerInfo, the processes from rawlib appear. I cannot imagine what it is going on.

I have seen the problem also appears inside geant4lib.

@juanangp
Copy link
Member

I think I have seen this issue before while using a different ROOT and/or REST version
Can you please add more info?

  • Which REST and ROOT versions were used to generate the files?
  • Which REST and ROOT versions are used to read the files?

If there are changes within REST versions we should check the diffs to understand what is going on.

@jgalan
Copy link
Member Author

jgalan commented Dec 12, 2022

The files were generated with the latest master at framework and submodules.

The problem seems to be only at axionlib, and it is reproducible.

Just placing yourself at the latest master inside the framework, together with all submodules --latest.

Then, write a file launching

cd source/libraries/axion/examples/full-ray-tracing
restManager --c helioscope.rml --o test.root

Then, I get back to master in axionlib branch jgalan_axion_mass, where I added changes to TRestAxionGeneratorProcess data members.

After compilation, when trying to read the file, we get the usual errors when schema evolution is not properly integrated.

restRoot test.root
...
Attaching file test.root as run0...
Error in <TBufferFile::ReadClassBuffer>: Could not find the StreamerInfo for version 2 of the class TRestAxionGeneratorProcess, object skipped at offset 103
Error in <TBufferFile::CheckByteCount>: object of class TRestAxionGeneratorProcess read too few bytes: 2 instead of 1659
Attaching event TRestAxionEvent as ev0...
Attaching ana_tree0...
Attaching ev_tree0...

A synthome of the problem is that when invoking TFile::ShowStreamerInfo() it will not show up TRestAxionGeneratorProcess.

When I do the same inside pipeline/trex, it looks ok, I can see the different TRestRaw...Process when calling ShowStreamerInfo().

Really awkward. No clue.

See also https://root-forum.cern.ch/t/checkbytecount-and-streamer-error/52716/29

@jgalan
Copy link
Member Author

jgalan commented Dec 12, 2022

I also produced some files with a previous axionlib version. Some changes to TRestAxionGeneratorProcess were already merged to master.

So, if you try to open these files https://github.com/rest-for-physics/framework-data/tree/main/pipeline/dataset

using the latest axionlib master, you will also get a problem.

This is how I noticed that there was a problem.

@jgalan
Copy link
Member Author

jgalan commented Dec 12, 2022

If I include the process TRestEventRateAnalysisProcess (which is at the framework level) inside the axionlib ray-tracing chain, this process does not show up either when calling ShowStreamerInfo(), however it appears in pipeline/trex/ processing.

@jgalan
Copy link
Member Author

jgalan commented Dec 23, 2022

Hi @nkx111 I imagine this code was added by you, because I don't know why we need this inside TRestMetadata.

Int_t TRestMetadata::Write(const char* name, Int_t option, Int_t bufsize) {
    if (fStore) {
        configBuffer = ElementToString(fElement);
        return TNamed::Write(name, option, bufsize); 
    }
    return -1;
}   

Do you know why we call TNamed::Write? Could this be the source of the problem not having streamer for processes in the final file?

Shouldn't we also call TObject::Write.

@jgalan jgalan linked a pull request Dec 24, 2022 that will close this issue
@jgalan
Copy link
Member Author

jgalan commented Dec 24, 2022

Finally the problem was solved! See also: https://root-forum.cern.ch/t/checkbytecount-and-streamer-error/52716/19

PR #357 should fix this issue.

@jgalan
Copy link
Member Author

jgalan commented Dec 27, 2022

The pipeline at the PR #357 is failing. It is interesting that previously the pipeline/trex validation was producing the proper streamer, and now, after fixing the problem with processes not being properly stored in the streamer at the axionlib pipeline, the TREXDM pipeline is failing.

when executing:

restManager --c 02_signal.rml --f RawData_01928.root

I get the following issue:

Error in <TFile::WriteTObject>: Directory RawData_01928.root is not writable
Error in <TFile::WriteTObject>: Directory RawData_01928.root is not writable
Thread. Process-1detSignal
Error in <TFile::WriteTObject>: Directory RawData_01928.root is not writable
Thread. Process-2chActivity
Error in <TFile::WriteTObject>: Directory RawData_01928.root is not writable

That happens at the TRestProcessRunner::WriteProcessesMetadata.

I really don't know what it is going on. I believe the multi-file handling is something that was added with threads since we need to open independent files that will be later on merged into a final one. Please, @nkx111 will you have the time to have a look?

@jgalan
Copy link
Member Author

jgalan commented Dec 27, 2022

Perhaps the main difference between framework/pipeline/trex/ and libraries/axion/examples/full-ray-tracing is that the first receives an input file and the second doesn't.

@jgalan
Copy link
Member Author

jgalan commented Dec 28, 2022

I have added another patch (see commit c96d5dc) so that the changes that were affecting to the trexdm pipeline were not affecting. The changes introduced will only affect to the event processing chains that have no input file.

This patch will then not fix other chains, such as those that process restG4 generated data. If one tests for example using 08.aplhas, after processing with analysis.rml we will see that inside the generated analysis file, f->ShowStreamerInfo() will not show the TRestGeant4AnalysisProcess.

This needs to be fixed yet, but I need to produce a proper streamer now for axionlib, so I need #357 to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants