Parallelization of Atomic Image Reconstruction from Holograms
211
3.1 Parallelization of Reconstruction of Two-Dimensional
Atomic Images by OpenMP
Presently, according to the Eq. (1), in the loop of reconstruction of two-dimensional
atomic images at certain z on x-y plane, five loops of x, y, θ , φ, and λ are nested
from outer to inner loop. In this chapter, θ loop denotes the loop which accesses
contiguous elements in a dimension of array θ for short.
The strategy of optimization and parallelization of two-dimensional reconstruction is as follows:
1. Replace trigonometric function calls with array references
2. Apply loop interchange and
3. Choose a loop to be parallelized
These optimization and parallelization are explained below.
In reconstruction of two-dimensional atomic images, some calls of trigonometric
functions such as sin and cos in nested loops are replaced with references of arrays.
The values of the trigonometric functions are stored in the arrays before entering the
nested loops.
In this study, this nested loop is interchanged to λ, x, y, θ , and φ from outer to
inner loop to improve the cache hit ratio. The size of the three-dimensional input
array whose dimensions are λ, θ , and φ is about 10 MB and may not be stored on
the secondary cache. In order to improve the cache hit ratio, when λ is fixed at the
most outer loop, 500 KB data of the input array for a λ are stored on the cache and
accessed repeatedly in the nested loop of x, y, θ , and φ. In the original loop nests,
the index range of the inner-most λ loop is at most 20. After interchanging loops,
the index range of the inner-most φ is 360 and it is expected that SIMD instructions
in general purpose processors such as Intel AVX can be applied to the inner-most
loop.
After these optimizations, the x loop in the nested loops is parallelized by
OpenMP directive so that the performance of reconstruction of two-dimensional
atomic images is improved.
3.2 Parallelization of Reconstruction of Three-dimensional
Atomic Images by XcalableMP
In reconstruction of three-dimensional atomic images, according to the Eq. (1),
by extending the optimized and parallelized nested loop of reconstruction of twodimensional atomic images as described in Sect. 3.1, the six loops of λ, z, x, y, θ ,
and φ are nested from outer to inner loop. Similar to the two-dimensional loop, the
values of some trigonometric functions are calculated in advance before entering
the six nested loop.
Précédent

- 215/265

Suivant