blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
404 stars 83 forks source link

request/question Multithreading support for blitz++ #110

Closed ClmnsRck closed 5 years ago

ClmnsRck commented 5 years ago

Is Multithreading support built into Blitz++? Like TBB oder OpenMP? i have tried compiling blitz++ code with -ltbb -fopenmp(becuase of other code in there to), but it did nothing to the performance.

papadop commented 5 years ago

I think there is some multi-threading support in blitz, but this predates largely TBB or OpenMP times (I remember that the framework is named tau something). I have not seen any #pragma in current (well a few months back) blitz code, so do not expect openmp to work.

slayoo commented 5 years ago

The reference-countic logic in Blitz can be made thread-safe with a relevant preprocessor define (see docs). This triggers locking of increment/decrement operations on ref counts and of course affects performance (hence disabled by default). No multi-threaded operations are included. HTH

On Tue, Apr 9, 2019 at 3:23 PM +0200, "ClmnsRck" notifications@github.com<mailto:notifications@github.com> wrote:

Is Multithreading support built into Blitz++? Like TBB oder OpenMP? i have tried compiling blitz++ code with -ltbb -fopenmp(becuase of other code in there to), but it did nothing to the performance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/blitzpp/blitz/issues/110, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAFeVfzyopfJWpOWYHr3Y3flgh_jjZ1uks5vfJRXgaJpZM4ckfZL.

slayoo commented 5 years ago

tau is a profiling tool: http://www.cs.uoregon.edu/research/tau/home.php

here is the page on using tau to profile blitz: https://www.cs.uoregon.edu/research/paracomp/tau/tautools/users/blitz/settings.html

On Tue, Apr 9, 2019 at 4:05 PM +0200, "Theodore Papadopoulo" notifications@github.com<mailto:notifications@github.com> wrote:

I think there is some multi-threading support in blitz, but this predates largely TBB or OpenMP times (I remember that the framework is named tau something). I have not seen any #pragma in current (well a few months back) blitz code, so do not expect openmp to work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/blitzpp/blitz/issues/110#issuecomment-481266175, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAFeVbbYk6HXcakVdM_wFKi-Srj1mtxdks5vfJ4RgaJpZM4ckfZL.

WalterZimmer314 commented 4 years ago

Depends on your understanding of "Multithreading support".

The data structures itself are thread safe, so they can be used in multithreaded applications, e.g. openMP.

The implemented algorithms however are not parallelized, e.g. If you calculate the sin() of each element in an array, this is executed as one loop on a single core. You can however distribute multiple calculation over different arrays on different cores via a parallelization framework like OpenMP.

If you need the former, use some dedicated library for that (BLAS, LAPACK, ...), which you need probably anyway as Bliz++ implements the basic algorithms only.