Sorry for the long post below, I tried to explain everything I did in details.
OK. Here is the CINT version of the code:
// main.cxx
#include "TChain.h"
#include "TProof.h"
#include <iostream>
using namespace std;
int main()
{
TProof *p = TProof::Open("");
TChain *ch1 = new TChain("fTree");
ch1->Add("data.root");
cout<<"Found "<<ch1->GetEntries()<<" entries"<<endl;
ch1->SetProof();
ch1->Process("MySel.C+");
}
In the test data file data.root(see attached) I have three branches that I read in the selector. Please note that there are only 1000 entries inside. So, if I run this script with the CINT:[code]
[volynets@pclg-23]:~/Work/tests/root/proof/simple_tree$ root
root [0] .x main.cxx
+++ Starting PROOF-Lite with 4 workers +++
Opening connections to workers: OK (4 workers)
Setting up worker servers: OK (4 workers)
PROOF set to parallel mode (4 workers)
Info in TProofLite::SetQueryRunning: starting query: 1
Info in TUnixSystem::ACLiC: creating shared library /home/pclg-23/volynets/Work/tests/root/proof/simple_tree/./MySel_C.so
Looking up for exact location of files: OK (1 files)
Looking up for exact location of files: OK (1 files)
Info in TPacketizerAdaptive::TPacketizerAdaptive: Setting max number of workers per node to 4
Validating files: OK (1 files)
Info in TPacketizerAdaptive::TPacketizerAdaptive: fraction of remote files 1.000000
(int)0: merging output objects … / (-4 workers still sending)
root [1]
[/code]
It opens the Proof query process (with a very nice speed-o-meter), and seems to use all the 4 cores.
Then I try the second way: to compile the same code, with some modifications:
// main.C
#include "MySel.h" // Here is my selector, created with TChain::MakeSelector("MySel");
#include "TProof.h"
#include "TChain.h"
#include <iostream>
using namespace std;
int main()
{
TProof::Open("");
TChain *ch1 = new TChain("fTree");
ch1->Add("data.root");
cout<<"Found "<<ch1->GetEntries()<<" entries"<<endl;
ch1->SetProof();
MySel* s = new MySel; // Here I use the selector object
ch1->GetTree()->Process(s); // Here I use GetTree as I get "Warning in <TProofChain::Process>: not implemented"
}
compile with
g++ `root-config --libs --cflags` -lProof -lProofPlayer main.C MySel.C -o main
and run:
[volynets@pclg-23]:~/Work/tests/root/proof/simple_tree$ ./main
+++ Starting PROOF-Lite with 4 workers +++
Opening connections to workers: OK (4 workers)
Setting up worker servers: OK (4 workers)
PROOF set to parallel mode (4 workers)
Found 1000 entries
This is it. No proof as you said. I need to use this way if possible. What am I doing wrong?
I not only read from disk but make the analysis with my real program, which takes longer time than reading.
I compile both as I said. Did not understand about the ACLiC mode.
I need to use the second way by compiling the entire program. The question is whether I can do this with proof.
Thank you!
data.root (26.5 KB)
MySel.h (2.61 KB)
MySel.C (3.18 KB)