Parallel Codes.

The adaptive refinement algorithms use a divide-and-conquer approach: the D-dimensional domain is partitioned into S^D many subregions, where S denotes the number of subdivisions per dimension. Multi-quadrature "kernels" compute the integral on each subregion along with error estimates. The subregions with the most significant errors are further refined and their integrals recomputed. As with standard adaptive algorithms, the stopping criterion is reached when the global error estimate drops below a certain threshold.

The multi-quadrature computations can be performed across all subregions simultaneously using a data-parallel computation model, since the input and output data for different subregions are independent.

The main algorithms are implemented in the following source files:

The basic idea is that the STL multimap container can be used to sort quadrature subregions ("data") according to error estimates ("keys), providing an efficient means for steering the refinement algorithm. Instead of using a true heap model, all scratch space for the multi-quadrature kernels is allocated in advance.

The basic idea is to bundle data for a region (interval boundaries, value of the integral, error estimates) into one structure and use an STL priority queue to steer the refinement algorithm. The comparison relation must be defined to compare error estimates between different regions.

A workflow for isolating numerically intensive computations in a parallel module (say, for GPU execution) follows a basic paradigm:

  1. initialize device and computation kernels,
  2. initialize buffers for transferring data between the host and parallel devices,
  3. send input data to the parallel device,
  4. execute the parallel routine(s),
  5. retrieve the output data from the parallel device.

Classes defined in CLWorkFlow.hpp are intended to simplify this process by managing various OpenCL objects and wrapping essential routines from the OpenCL API in member functions.

Configuration notes

Building the programs requires an awareness of the source tree in order that the header paths can be correctly specified (by the -I flag) when compiling different sources. The same is true for the OpenCL kernels, although these are built by calling the JIT compiler from a host program. This "second level" of configuration is also managed using settings in Makefile.am. However if one wants to modify the programs or compile them in a different source tree, the following notes explain how to modify the kernel configuration(s):

All of the configuration parameters for the kernel source tree are macros that can be passed via the -D flag when compiling the host program. Those currently in use are:

The only header included by kernel sources is the config.h file in the source tree root. The JIT compiler requires the absolute path.

 All Classes Functions Variables