4 #include "algorithm_1.h"
5 #include "algorithm_2.h"
6 #include "algorithm_3.h"
8 #define NUMBERS 104857500
10 int main (int argc, char* argv[]) {
11 numtype numarray[NUMBERS];
12 //unsigned int countarray[NUMBERS];
14 double startTime, endTime;
16 for (i = 0; i < NUMBERS; i++) {
21 startTime = omp_get_wtime();
22 printf ("calling algorithm 1:");
23 algorithm_1(numarray, NUMBERS, NULL);
24 printf ("sum: %i\n", numarray[NUMBERS-1]);
25 endTime = omp_get_wtime();
26 printf("took %f seconds.\n", endTime-startTime);
28 startTime = omp_get_wtime();
29 printf ("calling algorithm 2:");
30 algorithm_2(numarray, NUMBERS, NULL);
31 printf ("sum: %i\n", numarray[NUMBERS-1]);
32 endTime = omp_get_wtime();
33 printf("took %f seconds.\n", endTime-startTime);
35 startTime = omp_get_wtime();
36 printf ("calling algorithm 3:");
37 algorithm_3(numarray, NUMBERS, NULL);
38 printf ("sum: %i\n", numarray[NUMBERS-1]);
39 endTime = omp_get_wtime();
40 printf("took %f seconds.\n", endTime-startTime);