next up previous contents
Next: 2D Distribution Example Up: Data Distribution Previous: BLOCK Distribution

 

CYCLIC Distribution

Deal out elements of an array to processors in a round robin fashion

        PROGRAM Round_Robin
         REAL, DIMENSION(20)      :: A
 !HPF$ PROCESSORS, DIMENSION(4)   :: P
 !HPF$ DISTRIBUTE (CYCLIC) ONTO P :: A
   ....

   figure12619
Figure 19: Visualisation of CYCLIC Distribution

If an array, A has tex2html_wrap_inline23600 elements and is mapped onto tex2html_wrap_inline23602 processors each processor gets (a maximum) total of tex2html_wrap23594 separate elements. See Figure 19.

As in the previous section, each processor gets five elements, but this time a different set of elements are received. The elements are dished out in a round-robin fashion starting from processor 1. The diagram indicates the elements that each processor is given.

The formula for the maximum number of elements that a processor can receive is the same as for BLOCK distribution.




next up previous contents
Next: 2D Distribution Example Up: Data Distribution Previous: BLOCK Distribution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996
Not for commercial use.