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[]) {
12 numtype numarray[NUMBERS];
13 //unsigned int countarray[NUMBERS];
15 double startTime, endTime;
17 for (i = 0; i < NUMBERS; i++) {
22 startTime = omp_get_wtime();
23 printf ("calling algorithm 1:");
24 algorithm_1(numarray, NUMBERS, NULL);
25 printf ("sum: %i\n", numarray[NUMBERS-1]);
26 endTime = omp_get_wtime();
27 printf("took %f seconds.\n", endTime-startTime);
29 startTime = omp_get_wtime();
30 printf ("calling algorithm 2:");
31 result = algorithm_2(numarray, NUMBERS, NULL);
32 printf ("sum: %i\n", result);
33 endTime = omp_get_wtime();
34 printf("took %f seconds.\n", endTime-startTime);
36 startTime = omp_get_wtime();
37 printf ("calling algorithm 3:");
38 result = algorithm_3(numarray, NUMBERS, NULL);
39 printf ("sum: %i\n", result);
40 endTime = omp_get_wtime();
41 printf("took %f seconds.\n", endTime-startTime);