RE: [ROOT] Loop over a tree/ntuple with threads

From: marc.hemberger@realtech.de
Date: Thu Sep 13 2001 - 09:44:44 MEST


Hi,

as far as I know, there is still a problem with some global pointers in
ROOT, which are not really TThread-safe, like gFile, the global pointer to
the current open file. But I guess Fons has that still in mind ;-) You have
to tweak the system a bit to do what you want. It ould be done in the same
way as for the canvas. I did that once but only in an intermediate version
of Root at the GSI. May be I find time to do that for the community ...

In general, using threads for some analysis on the same set of events is not
that easy as a sequential analysis. If you run on one machine with multiple
processors, the gain in speed by using multiple threads is very depending on
YOUR ability to "think multi-threaded" ;-() You have to take into account a
big part of thread creation load, scheduling, locking overhead,
synchronization of results (the results should come all together at the end)
and so on. Just take a look at the calculation of pi with several threads
(you can find that on the TThread-HOWTO). And I assume your analysis is more
complicated than that ;-( Threads are really nice, but must be estimated
very well.

If you want to distribute your analysis over several machines (which is
probably the better choice when you have only single or double processor
machines available) you should really take a look into PROOF, the parallel
ROOT facility. This should do your job. Fons?

Greetings,

Marc

-> -----Original Message-----
-> From: Arno Heister [mailto:heister@physik.rwth-aachen.de]
-> Sent: Wednesday, September 12, 2001 4:02 PM
-> To: roottalk@pcroot.cern.ch
-> Subject: [ROOT] Loop over a tree/ntuple with threads
-> 
-> 
-> Hi !
-> I'm doing an analysis with a modified object which I made by 
-> using the
-> MakeClass() command.
-> 
-> Now I want to speed up the processing of my ROOT-files by 
-> implementing a
-> special Loop() routine which is able to run as a thread. 
-> Each thread has
-> 
-> to process only a part of the events and at the end all events in my
-> ROOT-file are processed and are filled into the same 
-> array/histogram of
-> another file.
-> 
-> The different threads should  run on different computers (or
-> processors). I'm using the 3.01/06 version on a RedHat 6.1 platform.
-> 
-> Hardisks can be mounted via NFS ...
-> 
-> Is this implementation of a thread possible with f.e. the 
-> TThread-class
-> ?
-> 
-> Cheers, Arno Heister.
-> 
-> 
-> 
-> 
-> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET