From 75bd067571d21d035a1f7903ab1dd393a0f330fc Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 1 Feb 2012 18:57:24 +0100 Subject: [PATCH] Check the result of the computation Make sure the result of the computation is always the same --- pipepar/pipeline_template.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pipepar/pipeline_template.c b/pipepar/pipeline_template.c index 16958df..e80921e 100644 --- a/pipepar/pipeline_template.c +++ b/pipepar/pipeline_template.c @@ -27,6 +27,8 @@ typedef unsigned long data_t; long seq_len = 24/*27720*/; long nb_packets = 100000; struct timespec stage_time; +data_t result = 0; + /* $Stage_{i+1} (data_{j+1}) = E_i (data_{j+1}) + E_{i+1} (data_j)$ */ void process_stage(data_t *prev_pipeline_stage, data_t *next_pipeline_stage) @@ -73,6 +75,7 @@ void last_process_stage(data_t *prev_stage) process_stage(prev_stage, &next_stage); printf("%lu\n", next_stage); + result = next_stage; } int analyse_options(int argc, char *argv[]) @@ -266,10 +269,7 @@ int compute_metrics(void) last_process_stage(&state4); #elif NB_CORES > 3 #pragma omp task input (state3) - { - //printf("3.5) state1: %lu\n", state3); last_process_stage(&state3); - } #elif NB_CORES > 2 #pragma omp task input (state2) last_process_stage(&state2); @@ -283,6 +283,7 @@ int compute_metrics(void) } } } + printf("Final result: %lu\n", result); return 0; }