From 355a9272b5a800f9652707ed5854d7be529b872c Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 15 May 2019 13:39:01 +0200 Subject: Heater example from Lustre v4 --- .../lustrev4_lustrec_heater_control/heater_control_main.c | 8 +++++++- .../heater_control_heater_control_loop.c | 14 +++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c index 351deed6..d0298840 100644 --- a/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c +++ b/test/monniaux/lustrev4_lustrec_heater_control/heater_control_main.c @@ -3,6 +3,7 @@ #include #include #include "heater_control_alloc.h" +#include "../clock.h" #include "../dm_random.c" static double _get_double(void) { @@ -22,6 +23,9 @@ int main (int argc, char *argv[]) { /* Main memory allocation */ heater_control_ALLOC(static,main_mem); + + clock_prepare(); + clock_start(); /* Initialize the main memory */ heater_control_reset(&main_mem); @@ -34,9 +38,11 @@ int main (int argc, char *argv[]) { double T3 = _get_double(); _Bool Heat_on; heater_control_step (T, T1, T2, T3, &Heat_on, &main_mem); - _put_bool("Heat_on", Heat_on); + // _put_bool("Heat_on", Heat_on); } + clock_stop(); + print_total_clock(); return 1; } diff --git a/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c index e4037e5a..d1a01268 100644 --- a/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c +++ b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c @@ -6,6 +6,7 @@ #include #include #include "../dm_random.c" +#include "../clock.h" #include "heater_control_heater_control.h" /* MACROS DEFINITIONS ****************/ @@ -39,6 +40,10 @@ int main(){ _boolean Heat_on; heater_control_heater_control_ctx_type ctx_struct; heater_control_heater_control_ctx_type* ctx = &ctx_struct; + + clock_prepare(); + clock_start(); + heater_control_heater_control_ctx_init(ctx); /* Main loop */ @@ -48,8 +53,11 @@ int main(){ T2 = _get_real("T2"); T3 = _get_real("T3"); heater_control_heater_control_step(T,T1,T2,T3,&Heat_on,ctx); - _put_bool("Heat_on", Heat_on); + // _put_bool("Heat_on", Heat_on); } - return 1; - + + clock_stop(); + print_total_clock(); + + return 1; } -- cgit