next up previous
Next: Y-MP Process Up: Mandel Module Previous: AVS Interface

T3D Process

The T3D process for the mandel module is implemented in MPP Fortran [1] using the data sharing and work sharing models. These models automatically distribute data and loop computations among the available processors and eliminate the need for explicit message passing.

The T3D process receives its input parameters X, Y, and ZOOM, from a file written by the Y-MP process prior to calling the T3D process. Since this file consists of only one short line containing the three parameters, the I/O time required is negligible.

   figure146
Figure 8: MPP Fortran code for mandel module

The declarations and computational loop for the T3D process are shown in Figure 8. The 512 x 512 shared array PIX is used to store the iteration counts for each pixel in the image. The SHARED directive for this array tells the compiler to distribute the array over the PEs such that successive elements are stored in successive PEs, modulo N, where N is the number of PEs.

The DO SHARED directive preceding the iteration loop tells the compiler to assign the iterations of the nested loops with indices J and K to the PEs where PIX(J,K) is stored. This guarantees that the mandelbrot iteration for PIX(J,K) will be performed on the same PE where PIX(J,K) is stored. FLOPS is also a shared array and is used to keep track of the operation counts performed by each PE. The intrinsic function MY_PE() is used to obtain the PE number, which is stored in the private variable ME for indexing the FLOPS array.

Since the mandelbrot iteration diverges rapidly for external points away from the boundary of the set and not at all for internal points, the amount of computation to be performed varies greatly according to the position of a pixel in the image. Since the iteration for each pixel is performed on the PE where the pixel is stored, the distribution of the pixel array controls the PE assignments and hence the load distribution for the PEs. By assigning successive elements of the array to succesive PEs, every PE processes a subset of the pixels which is uniformly distributed over the entire image. This accounts for the nearly perfect load balancing observed in Figure 7.

When the computation loops on all PEs have finished, PE 0 writes the entire pixel array into the Y-MP process memory table using the MPP Fortran callable versions of the C language I/O functions open, seek, and write.


next up previous
Next: Y-MP Process Up: Mandel Module Previous: AVS Interface

Mitch Roth
Tue Aug 6 09:57:21 ADT 1996