A Sample Computation: Global Add
•
Adding a sequence of numbers x
1
, x
2
, …, x
n
•
The standard sequential solution …
•
•
•
•
•
•
The solution specifies an order of summation
that is not essential to the task
sum = 0;
for (i=0; i<n; i++) {
sum = sum + x[i+1];
}