Unlike before, the amount of data sent can vary, with the MPI reduction routines possibly using a tree type algorithm for parallel reduction. The intrinsic MPI calls should in most every case perform better than a user constructed one, and certainly no worse. The communication framework in the code was far from optimal, as was its intention. In the next assignment we expect to greatly increace the efficency by implementing a different algorithm that involves different communication flows. UPC One interesting part of the UPC-coded version of the problem of computing the interaction of fish influenced by gravity is the determination of the maximum change of any fish's motion, velocity, or acceleration.
All computation is performed on every processor.
This forces UPC to make all data available to all processors and may require significant communication to do so as the data sets grow larger. Also, this method does not take advantage of all of the processors that have been allocated to the problem. The second method computes the maximum of the local data locally and then stores that result into a global array. Each thread stores into a different location in that array. A barrier is erected to ensure that all threads compute the local maximum before proceeding.