counter and proof

From: Marc Escalier <escalier_at_lal.in2p3.fr>
Date: Sat, 18 Sep 2010 16:24:25 +0200


Hello,

I'm looking for advices on the following problem :

i made a minimal test to check if it would be benefit for a given program that make some counters to use proof or not to use it.

If i understood correctly, with proof, which works with slave workers, one has to put the counters that derivates from TObject. So i found only TH1 could be useful as a counter (or also TParameter that could be much more fast to do myparameter->SetVal(myparameter->GetVal()+1).

So, if correct (?), if one uses a simple "int" as counter, then
the slave will not manage to "recollect" the counter, to do it correctly, since the counter
will be reinitialized on each slave. One should use something that inherits from TObject (?).

==>

So i checked if simple counter int was as performant as using TH1 as counter

i see a decrease of 10 for performance when using TH1 with regards to int, as it is expected (low level instruction versus high level complex instructions).

i put a minimal code to prove it below.

Then i don't understand what is the advantage (this not a criticize, i try to understand) to use proof, since the gain with the parallel workers would be counterbalanced by the important decrease in the
performance of the individual counter ? (in addition to the fact that initialization of the slave is also non reducible.

for example, if i understood correctly, one who would like to do counters, would have a program with int in a simple program and an another one with proof with TH1, with for example "10 workers" then the performance would be the same, even if the second has much more computers to work with, but would be 10 times slower for each individual operation ?

Is there a plan to have a "fast" counter that derivates from a TObject in order to use it with proof ?

by the way, why integer TH1 (TH1I) is a bit slower that float TH1 (TH1F)

thank you

(it put below minimal code+performances)



#include <iostream>
#include <TH1F.h>

using namespace std;

int main()
{

   int i;

   //TH1F *histo_float=new TH1F("histo_float","histo_float",100,0,1000);    TH1I *histo_int=new TH1I("histo_int","histo_int",100,0,1000);

   // int counter=0;

   for (i=0;i<3e8;i++) {

     //  histo_float->Fill(1);
     histo_int->Fill(1);
     //counter++;

   }

   // cout << "" << histo_float->GetEntries() << endl;    cout << "" << histo_int->GetEntries() << endl;    // cout << "counter=" << counter << endl;

   // delete histo_float;
   delete histo_int;
}

counter int :0.925 seconds
TH1F : 9.375 secondsd
TH1I : 10.265 seconds Received on Sat Sep 18 2010 - 16:24:29 CEST

This archive was generated by hypermail 2.2.0 : Sun Sep 19 2010 - 05:50:02 CEST