1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
While Blitz++ can be used for parallel computing, it was not designed
primarily for this purpose. For this reason, you may want to investigate
some other available libraries, such as POOMA, before choosing to
implement a parallel code using Blitz++.
bzindex(parallel computing)
bzsect(Blitz++ and thread safety)
bzindex(thread safety)
To enable thread-safety in Blitz++, you need to do one of these things:
bzindex(BZ_THREADSAFE)
bzindex(BZ_MUTEX_...)
startit()
bzindex(REENTRANT)
it() Compile with tt(gcc -pthread), or tt(CC -mt) under Solaris.
(These options define tt(_REENTRANT), which tells Blitz++ to generate
thread-safe code).
it() Compile with tt(-DBZ_THREADSAFE), or tt(#define BZ_THREADSAFE)
before including any Blitz++ headers.
endit()
In threadsafe mode, Blitz++ array reference counts are safeguarded
by a mutex. By default, pthread mutexes are used.
If you would prefer a different mutex implementation, add the
appropriate tt(BZ_MUTEX) macros to tt(<blitz/blitz.h>) and send them
to tt(blitz-dev@oonumerics.org) for incorporation.
bzindex(locking (thread safety))
Blitz++ does not do locking for every array element access; this would
result in terrible performance. It is the job of the library
user to ensure that appropriate synchronization is used.
|