From 5fead402de3fe7505b3ee4b1de6f8a12596d215f Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Wed, 18 Jan 2012 01:22:39 +0100 Subject: [PATCH] code cleanup in prefix.c --- openmp/prefix/prefix.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openmp/prefix/prefix.c b/openmp/prefix/prefix.c index bc4790a..31271b4 100644 --- a/openmp/prefix/prefix.c +++ b/openmp/prefix/prefix.c @@ -18,7 +18,7 @@ int main (int argc, char* argv[]) { numtype numarray[NUMBERS]; unsigned long size; //unsigned int countarray[NUMBERS]; - double startTime; + double startTime, endTime; //TODO: read num file here. //first value in file = numcount @@ -26,17 +26,22 @@ int main (int argc, char* argv[]) { numarray[size] = 10; } +#ifdef DEBUG /* might want to comment this out, if numarray is big */ array_contents(numarray, size); +#endif printf("init done starting algorithm. size: %li\n", size); startTime = omp_get_wtime(); algorithm(numarray, size, NULL); - printf("DONE. took %f seconds.\n", omp_get_wtime()-startTime); - printf ("result: %li\n", numarray[(size-1)]); + endTime = omp_get_wtime(); + printf("DONE. took %f seconds.\n", endTime-startTime); + printf ("result: %li\n", numarray[size-1]); +#ifdef DEBUG /* might want to comment this out, if numarray is big */ array_contents(numarray, size); +#endif return 0; } -- 2.43.0