High Performance ComputingCS-400: Fall 2004
|
|
|
Programming Assignment 1Recall that the definite integral from a to b of a nonnegative function f(x) can be thought of as the area bounded below by the x-axis, bounded on the sides by the vertical lines x = a and x = b, and bounded above by the graph of the function f(x).
A computational approach to estimating the area of this interval is to partition the region into regular geometric shapes and then add the areas of the shapes. In the trapezoidal rule, the regular geometric shapes are trapezoids; each trapezoid has its base on the x-axis, vertical sides at a and b, and its top edge joining two points on f(x). The width of the base depends upon the number of intervals we partition (b - a) into. A relatively simple parallel version of this algorithm
apportions to each parallel process a single trapezoid to compute the area of,
followed by a summation of the areas. If we use p processes (processors),
then the width of the base of each is
|
|
|