Re: TH1F::Fit(..) in multiple threads ?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 14 Oct 2010 09:24:06 -0500


  > Is there a recommended way to do things like this  > (running root applications with multiple threads) ?

At the very least you ought to use the TThread object so that ROOT is aware that it is run in a multi-thread environment.

Cheers,
Philippe.

On 10/14/10 2:34 AM, Andre Holzner wrote:
> Dear experts,
>
> we're trying to benefit from our multi-core CPUs
> and are trying to parallelize our program.
>
> Amongst other things, we tried to fit a function
> to a histogram using TH1F::Fit(..) in parallel threads
> (using ROOT 5.22.00d on slc5).
>
> As a test, we tried to fit 'pol3' to a histogram
> filled with random numbers drawn from a Gaussian distribution.
>
> This seems to work fine for one thread but when going
> to multiple threads, we get all kinds of error messages
> from things like
>
> Error: Too many '}' (tmpfile):2:
>
> to
>
> Unknown function: pol3
>
> to just segmentation violations. We are using plain
> pthread functions to create and wait for the threads
> for the moment.
>
> Is there a recommended way to do things like this
> (running root applications with multiple threads) ?
>
> Should we rather use fork(..) instead of creating threads
> to avoid sharing variables between subprocesses ?
>
> thanks,
>
> Andre
>
>
>
>
>
>
>
>
>
>
Received on Thu Oct 14 2010 - 16:24:13 CEST

This archive was generated by hypermail 2.2.0 : Mon Oct 18 2010 - 17:50:02 CEST