Fixed compile errors for enabled KAPS_STATISTIC.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Thu, 22 Jul 2010 11:08:16 +0000 (11:08 +0000)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Thu, 22 Jul 2010 11:08:16 +0000 (11:08 +0000)
[r27775]

brute_force.c
heuristical.c
heuristical_co.c
optimal.h

index e41f468..8785af0 100644 (file)
 #include "pbqp_node_t.h"
 #include "vector.h"
 
+#if KAPS_STATISTIC
+static int dump = 0;
+#endif
+
 /* Forward declarations. */
 static void apply_Brute_Force(pbqp *pbqp);
 
index f202c74..00f3993 100644 (file)
@@ -77,12 +77,10 @@ static void apply_RN(pbqp *pbqp)
 #endif
 
 #if KAPS_STATISTIC
-       if (dump == 0) {
-               FILE *fh = fopen("solutions.pb", "a");
-               fprintf(fh, "[%u]", min_index);
-               fclose(fh);
-               pbqp->num_rn++;
-       }
+       FILE *fh = fopen("solutions.pb", "a");
+       fprintf(fh, "[%u]", min_index);
+       fclose(fh);
+       pbqp->num_rn++;
 #endif
 
        /* Now that we found the local minimum set all other costs to infinity. */
index d345240..5759a5d 100644 (file)
@@ -92,12 +92,10 @@ static void apply_RN_co(pbqp *pbqp, plist_t *rpeo)
 #endif
 
 #if KAPS_STATISTIC
-       if (dump == 0) {
                FILE *fh = fopen("solutions.pb", "a");
                fprintf(fh, "[%u]", min_index);
                fclose(fh);
                pbqp->num_rn++;
-       }
 #endif
 
        /* Now that we found the local minimum set all other costs to infinity. */
@@ -108,18 +106,11 @@ static void apply_heuristic_reductions_co(pbqp *pbqp, plist_t *rpeo)
 {
        #if KAPS_TIMING
                /* create timers */
-               ir_timer_t *t_edge = ir_timer_register("be_pbqp_edges", "pbqp reduce independent edges");
-               ir_timer_t *t_r0 = ir_timer_register("be_pbqp_r0", "pbqp R0 reductions");
-               ir_timer_t *t_r1 = ir_timer_register("be_pbqp_r1", "pbqp R1 reductions");
-               ir_timer_t *t_r2 = ir_timer_register("be_pbqp_r2", "pbqp R2 reductions");
-               ir_timer_t *t_rn = ir_timer_register("be_pbqp_rN", "pbqp RN reductions");
-
-               /* reset timers */
-               ir_timer_reset(t_edge);
-               ir_timer_reset(t_r0);
-               ir_timer_reset(t_r1);
-               ir_timer_reset(t_r2);
-               ir_timer_reset(t_rn);
+               ir_timer_t *t_edge = ir_timer_new();
+               ir_timer_t *t_r0   = ir_timer_new();
+               ir_timer_t *t_r1   = ir_timer_new();
+               ir_timer_t *t_r2   = ir_timer_new();
+               ir_timer_t *t_rn   = ir_timer_new();
        #endif
 
        for (;;) {
@@ -165,11 +156,11 @@ static void apply_heuristic_reductions_co(pbqp *pbqp, plist_t *rpeo)
                        #endif
                } else {
                        #if KAPS_TIMING
-                               printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_edge), (double)ir_timer_elapsed_usec(t_edge) / 1000.0);
-                               printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r0), (double)ir_timer_elapsed_usec(t_r0) / 1000.0);
-                               printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r1), (double)ir_timer_elapsed_usec(t_r1) / 1000.0);
-                               printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r2), (double)ir_timer_elapsed_usec(t_r2) / 1000.0);
-                               printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_rn), (double)ir_timer_elapsed_usec(t_rn) / 1000.0);
+                               printf("pbqp reduce independent edges: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_edge) / 1000.0);
+                               printf("pbqp R0 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r0) / 1000.0);
+                               printf("pbqp R1 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r1) / 1000.0);
+                               printf("pbqp R2 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r2) / 1000.0);
+                               printf("pbqp RN reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_rn) / 1000.0);
                        #endif
 
                        return;
index 5424b59..e71a159 100644 (file)
--- a/optimal.h
+++ b/optimal.h
@@ -39,7 +39,7 @@ void apply_RI(pbqp *pbqp);
 void apply_RII(pbqp *pbqp);
 
 #if KAPS_STATISTIC
-void check_melting_possibility(pbqp *pbqp, pbqp_edge *edge)
+void check_melting_possibility(pbqp *pbqp, pbqp_edge *edge);
 #endif
 
 void back_propagate(pbqp *pbqp);