DepSpawn 1.2
 
Loading...
Searching...
No Matches
Integration with Blitz++

In Semantics we saw that DepSpawn tracks the memory occupied by the objects passed as arguments to the tasks in order to detect dependencies. While this suffices in many situations, sometimes it may be desirable to express dependencies on regions that are not consecutive, such as tiles of a matrix. For this reason DepSpawn provides support for Blitz++ arrays, which are well known for their efficiency, flexibility and intutive notation.

Unfortunately, using the standard distribution of Blitz++ would imply a noticeable overhead for DepSpawn to compute the dependencies between different arrays because of the lack of some useful information in the objects. For this reason, a slightly modified version of Blitz++, in which the arrays keep this information, is provided with DepSpawn. The installation of this library is totally optional.

Three things must be taken into account in order to use this feature:

  • Since it is optional, and the user may have even not installed Blitz++, DepSpawn only triggers (and compiles) the support code for Blitz++ if it detects that it is being in use, which requires including the Blitz++ headers before depspawn.h in the application.
  • Blitz++ is not compiled by default in thread-safe mode. For this reason in order to correctly compile a DepSpawn + Blitz++ application, it is necessary to define the macros
       -DBZ_THREADSAFE -DBZ_THREADSAFE_USE_TBB 
    
  • DepSpawn tracks separately dependencies between memory regions and Blitz++ arrays. For this reason any access to a Blitz++ array memory position that must be tracked shoyld be made only by means of Blitz++ arrays.