From 2c6a3b5df02317f57ca83460cc5bb05cd7c7ee00 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 13 Oct 2008 22:27:08 +0000 Subject: [PATCH] added PRINT_RESULT #define off by default git-svn-id: svn://anubis/gvsu@199 45c1a28c-8058-47b2-ae61-ca45b979098e --- cs677/hw7/src/Makefile | 1 + cs677/hw7/src/floyd-parallel.cc | 3 +++ cs677/hw7/src/floyd-sequential.cc | 3 +++ 3 files changed, 7 insertions(+) diff --git a/cs677/hw7/src/Makefile b/cs677/hw7/src/Makefile index acfb729..bd5a190 100644 --- a/cs677/hw7/src/Makefile +++ b/cs677/hw7/src/Makefile @@ -4,6 +4,7 @@ TARGETS += floyd-sequential TARGETS += floyd-parallel CXXFLAGS := -fopenmp +#CXXFLAGS += -DPRINT_RESULT OBJS := $(foreach target,$(TARGETS),$(target).o) diff --git a/cs677/hw7/src/floyd-parallel.cc b/cs677/hw7/src/floyd-parallel.cc index de777eb..1b169ca 100644 --- a/cs677/hw7/src/floyd-parallel.cc +++ b/cs677/hw7/src/floyd-parallel.cc @@ -64,6 +64,8 @@ int main(int argc, char * argv[]) } gettimeofday(&after, NULL); /* Stop timing */ + +#ifdef PRINT_RESULT cout << "Result:" << endl; /* Print out the final matrix */ for (int i = 0; i < num_verts; i++) @@ -77,6 +79,7 @@ int main(int argc, char * argv[]) } printf("\n"); } +#endif double time_before = before.tv_sec + before.tv_usec / 1000000.0; double time_after = after.tv_sec + after.tv_usec / 1000000.0; diff --git a/cs677/hw7/src/floyd-sequential.cc b/cs677/hw7/src/floyd-sequential.cc index f1effab..4bc862f 100644 --- a/cs677/hw7/src/floyd-sequential.cc +++ b/cs677/hw7/src/floyd-sequential.cc @@ -63,6 +63,8 @@ int main(int argc, char * argv[]) } gettimeofday(&after, NULL); /* Stop timing */ + +#ifdef PRINT_RESULT cout << "Result:" << endl; /* Print out the final matrix */ for (int i = 0; i < num_verts; i++) @@ -76,6 +78,7 @@ int main(int argc, char * argv[]) } printf("\n"); } +#endif double time_before = before.tv_sec + before.tv_usec / 1000000.0; double time_after = after.tv_sec + after.tv_usec / 1000000.0;