Menu

#1 Enable OpenMP for ParallelSampler

open
nobody
None
5
2012-09-01
2011-04-28
No

One-line patch to enable OpenMP in ParallelSampler::update() for-loop.
You need to enable OpenMP (-fopenmp for GCC C/F77/C++) for this to work.

Don't know the internals of JAGS, maybe this is too naive and JAGS samplers could not be threaded.
But at least it fully loads all CPUs in my case.
In theory there should be virtually no trade-offs in parallelizing chains, in contrast to matrix operations.

Discussion

  • Alexey Stukalov

    Alexey Stukalov - 2011-04-28

    OpenMP enablement for ParallelSampler

     
  • Martyn Plummer

    Martyn Plummer - 2011-04-29

    Thanks. I designed this with eventually threading in mind (hence the one-line patch) but I'm not entirely convinced that the jrmath library is thread safe, and there are speed issues to consider. Linking JAGS to a multithreaded BLAS/LAPACK library is generally disastrous in terms of speed. Needs more testing.

     

Anonymous
Anonymous

Add attachments
Cancel