Hi, rooters!
Does anybody use PROOF in your analysis?
I’ve tried to do it, because it’s strange to have a machine with 12 threads and use only one or two.
So for me now the problem is filling of histogram. I have such code:
I’ll skip the lines that I didn’t touch:
TreeParProc.h
class TreeParProc : public TSelector {
public:
....
Float_t TrackPara[177][17];
Int_t TriggerType[2];
Int_t nTracklets;
Int_t nTracks;
TH1F* fhpt;
....
void TreeParProc::Init(TTree *tree)
{
fTree = tree;
fTree->SetBranchAddress("TrackPara", TrackPara);
fTree->SetBranchAddress("nTracks", &nTracks);
fTree->SetBranchAddress("nTracklets", &nTracklets);
fTree->SetBranchAddress("TriggerType", TriggerType);
}
TreeParProc.C
void TreeParProc::Begin(TTree * /*tree*/)
{
::Info("","Begin of parallel data processing");
fhpt = new TH1F("pt4p", "pt4p", 100, 0., 2.);
TString option = GetOption();
}
Bool_t TreeParProc::Process(Long64_t entry)
{
fTree->GetEvent(entry);
Int_t nGoodTracks{};
Int_t charge{};
Float_t tempPt{};
Float_t tempPx{};
Float_t tempPy{};
for (auto j = 0; j < nTracks; ++j) {
if (!TrackPara[j][5] && !TrackPara[j][6]) return kTRUE;
::Info("", "Event num: %lld | track num: %d | px: %f | py: %f\n", entry, j, TrackPara[j][11], TrackPara[j][12]);
nGoodTracks++;
charge += TrackPara[j][7];
tempPx += TrackPara[j][12];
tempPy += TrackPara[j][12];
}
if (nGoodTracks < 4) return kTRUE;
tempPt = TMath::Sqrt(tempPx*tempPx+tempPy*tempPy);
if (charge == 0) fhpt->Fill(tempPt);
return kTRUE;
}
void TreeParProc::Terminate()
{
auto fot = new TFile("parallel.hist.root", "RECREATE");
fhpt->Write();
fot->Close();
}
In output of my info I see proper values of my data, but when I do hpt->Fill() I have the next one message in proof session:
14:52:28 11297 Wrk-0.3 | Info: Event num: 442 | track num: 2 | px: -0.492885 | py: 0.083113
14:52:28 11297 Wrk-0.3 | Info: Event num: 442 | track num: 3 | px: -0.053113 | py: -0.203568
14:52:28 11297 Wrk-0.3 | *** Break ***: segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f22d69fd687 in __GI___waitpid (pid=11721, stat_loc=stat_loc
entry=0x7ffd8274b168, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1 0x00007f22d6968067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2 0x00007f22d7826c23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:2099
#3 TUnixSystem::StackTrace (this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:2393
#4 0x00007f22d7829614 in TUnixSystem::DispatchSignals (this=0x55b9aa7b47c0, sig=kSigSegmentationViolation) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:3624
#5 <signal handler called>
#6 0x00007f22c8b4d3b9 in TreeParProc::Process(long long) () from /home/bdrum/.proof/cache/TreeParProc_C.so
#7 0x00007f22c973f5c7 in TProofPlayer::Process (this=0x55b9abac6cb0, dset=0x55b9ab6a79f0, selector_file=0x7ffd8274e2a9 "TreeParProc.C+", option=0x7ffd8274e2c9 "", nentries=-1, first=-1) at /home/bdrum/Projects/cern/root-dev/root/proof/proofplayer/src/TProofPlayer.cxx:1314
#8 0x00007f22cabc8199 in TProofServ::HandleProcess (this=0x55b9ab242b20, mess=<optimized out>, slb=0x0) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:4047
#9 0x00007f22cabc3747 in TProofServ::HandleSocketInput (this=0x55b9ab242b20, mess=0x55b9ab5f27e0, all=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:1653
#10 0x00007f22cabb6a02 in TProofServ::HandleSocketInput (this=0x55b9ab242b20) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:1364
#11 0x00007f22cabcd7e7 in TProofServLiteInputHandler::Notify (this=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServLite.cxx:177
#12 TProofServLiteInputHandler::ReadNotify (this=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServLite.cxx:169
#13 0x00007f22d7828a00 in TUnixSystem::CheckDescriptors (this=this
entry=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:1302
#14 0x00007f22d782a398 in TUnixSystem::DispatchOneEvent (this=0x55b9aa7b47c0, pendingOnly=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:1057
#15 0x00007f22d773fb91 in TSystem::InnerLoop (this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TSystem.cxx:412
#16 TSystem::Run (this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TSystem.cxx:362
#17 0x00007f22d76d2caf in TApplication::Run (this=0x55b9ab242b20, retrn=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TApplication.cxx:1176
#18 0x000055b9a9169670 in main (argc=<optimized out>, argv=0x7ffd8274f6c8) at /home/bdrum/Projects/cern/root-dev/root/main/src/pmain.cxx:260
===========================================================
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6 0x00007f22c8b4d3b9 in TreeParProc::Process(long long) () from /home/bdrum/.proof/cache/TreeParProc_C.so
#7 0x00007f22c973f5c7 in TProofPlayer::Process (this=0x55b9abac6cb0, dset=0x55b9ab6a79f0, selector_file=0x7ffd8274e2a9 "TreeParProc.C+", option=0x7ffd8274e2c9 "", nentries=-1, first=-1) at /home/bdrum/Projects/cern/root-dev/root/proof/proofplayer/src/TProofPlayer.cxx:1314
#8 0x00007f22cabc8199 in TProofServ::HandleProcess (this=0x55b9ab242b20, mess=<optimized out>, slb=0x0) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:4047
#9 0x00007f22cabc3747 in TProofServ::HandleSocketInput (this=0x55b9ab242b20, mess=0x55b9ab5f27e0, all=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:1653
#10 0x00007f22cabb6a02 in TProofServ::HandleSocketInput (this=0x55b9ab242b20) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServ.cxx:1364
#11 0x00007f22cabcd7e7 in TProofServLiteInputHandler::Notify (this=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServLite.cxx:177
#12 TProofServLiteInputHandler::ReadNotify (this=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/proof/proof/src/TProofServLite.cxx:169
#13 0x00007f22d7828a00 in TUnixSystem::CheckDescriptors (this=this
entry=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:1302
#14 0x00007f22d782a398 in TUnixSystem::DispatchOneEvent (this=0x55b9aa7b47c0, pendingOnly=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/core/unix/src/TUnixSystem.cxx:1057
#15 0x00007f22d773fb91 in TSystem::InnerLoop (this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TSystem.cxx:412
#16 TSystem::Run (this=0x55b9aa7b47c0) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TSystem.cxx:362
#17 0x00007f22d76d2caf in TApplication::Run (this=0x55b9ab242b20, retrn=<optimized out>) at /home/bdrum/Projects/cern/root-dev/root/core/base/src/TApplication.cxx:1176
#18 0x000055b9a9169670 in main (argc=<optimized out>, argv=0x7ffd8274f6c8) at /home/bdrum/Projects/cern/root-dev/root/main/src/pmain.cxx:260
===========================================================
14:52:33 11297 Wrk-0.3 | Error in <TProofServLite::HandleException>: caugth exception triggered by signal '1' while processing dset:'TDSet:events', file:'/home/bdrum/Projects/cern/alice/data/result.root' - check logs for possible stacktrace - last event: 442
So, what I missed, because in tutorial for parallel filling of histogram via random values they use just hist->Fill(x)?
Cheers,
Boris
ROOT Version: 6.17/01
Platform: ubuntu 18.04
Compiler: gcc 7.3.0