From da9c9f1768716c163f9d30966ebf17efb8755fd6 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 5 Jun 2017 11:14:49 -0700 Subject: [PATCH] Reduces amount of Unchecked code in Olden/TreeAdd node.c --- MultiSource/Benchmarks/Olden/treeadd/node.c | 34 +++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/MultiSource/Benchmarks/Olden/treeadd/node.c b/MultiSource/Benchmarks/Olden/treeadd/node.c index 3c1bd7047..f61e91eac 100644 --- a/MultiSource/Benchmarks/Olden/treeadd/node.c +++ b/MultiSource/Benchmarks/Olden/treeadd/node.c @@ -23,13 +23,15 @@ extern int NumNodes; #endif -unchecked int dealwithargs(int argc, array_ptr argv : count(argc)); +unchecked +int dealwithargs(int argc, array_ptr argv : count(argc)); typedef struct { long level; } startmsg_t; -unchecked int main (int argc, array_ptr argv : count(argc)) +unchecked +int main (int argc, array_ptr argv : count(argc)) { ptr root = NULL; int level,result; @@ -42,33 +44,34 @@ unchecked int main (int argc, array_ptr argv : count(argc)) #endif level = dealwithargs(argc, argv); #endif + checked { #ifndef TORONTO CMMD_node_timer_clear(0); CMMD_node_timer_clear(1); #endif #ifdef TORONTO - chatting("Treeadd with %d levels on %d processors \n", - level, NumNodes); + unchecked { chatting("Treeadd with %d levels on %d processors \n", + level, NumNodes); } #else - chatting("Treeadd with %d levels on %d processors \n", - level, __NumNodes); + unchecked { chatting("Treeadd with %d levels on %d processors \n", + level, __NumNodes); } #endif /* only processor 0 will continue here. */ - chatting("About to enter TreeAlloc\n"); + unchecked { chatting("About to enter TreeAlloc\n"); } #ifndef TORONTO CMMD_node_timer_start(0); #endif #ifdef TORONTO - checked {root = TreeAlloc (level, 0, NumNodes);} + root = TreeAlloc (level, 0, NumNodes); #else - checked {root = TreeAlloc (level, 0, __NumNodes);} + root = TreeAlloc (level, 0, __NumNodes); #endif #ifndef TORONTO CMMD_node_timer_stop(0); #endif - chatting("About to enter TreeAdd\n"); + unchecked { chatting("About to enter TreeAdd\n"); } #ifndef PLAIN ClearAllStats(); @@ -77,24 +80,23 @@ unchecked int main (int argc, array_ptr argv : count(argc)) CMMD_node_timer_start(1); #endif { int i; for (i = 0; i < 100; ++i) - checked {result = TreeAdd (root);} + result = TreeAdd (root); } #ifndef TORONTO CMMD_node_timer_stop(1); #endif - chatting("Received result of %d\n",result); + unchecked { chatting("Received result of %d\n",result); } #ifndef TORONTO - chatting("Alloc Time = %f seconds\n", CMMD_node_timer_elapsed(0)); - chatting("Add Time = %f seconds\n", CMMD_node_timer_elapsed(1)); + unchecked { chatting("Alloc Time = %f seconds\n", CMMD_node_timer_elapsed(0)); } + unchecked { chatting("Add Time = %f seconds\n", CMMD_node_timer_elapsed(1)); } #endif #ifdef FUTURES __ShutDown(); #endif exit(0); - - + } } /* TreeAdd: