Assume that the problem size is n and there are p processors in the system. For the global sum example shown in the textbook pp.4~5, each processor is responsible for computing the local sum, I.e.,
for (my_i = my_first_i; my_i < my_last_i; my_i++) {
my_x = compute_next_value(..);
my_sum += my_x;
Get Free Quote!
369 Experts Online