From 617075017301606a46bacd9ca7c8d1358d3db98f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 23 Nov 2017 21:57:23 +0100 Subject: [PATCH] Slight move from maxmin.hpp to surf_interface.hpp. --- src/include/surf/maxmin.hpp | 26 -------------------------- src/surf/surf_interface.hpp | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/include/surf/maxmin.hpp b/src/include/surf/maxmin.hpp index 8e03a7da0e..525d38d4c8 100644 --- a/src/include/surf/maxmin.hpp +++ b/src/include/surf/maxmin.hpp @@ -121,32 +121,6 @@ * constraint. */ -XBT_PUBLIC_DATA(double) sg_maxmin_precision; -XBT_PUBLIC_DATA(double) sg_surf_precision; -XBT_PUBLIC_DATA(int) sg_concurrency_limit; - -static inline void double_update(double* variable, double value, double precision) -{ - // printf("Updating %g -= %g +- %g\n",*variable,value,precision); - // xbt_assert(value==0 || value>precision); - // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may - // happen, and the precision mechanism is not active... - // xbt_assert(*variable< (2< precision); -} - -static inline int double_equals(double value1, double value2, double precision) -{ - return (fabs(value1 - value2) < precision); -} - /** @{ @ingroup SURF_lmm */ /** diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index 38bdbe0f09..3809adee86 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,10 @@ *********/ /* user-visible parameters */ +XBT_PUBLIC_DATA(double) sg_maxmin_precision; +XBT_PUBLIC_DATA(double) sg_surf_precision; +XBT_PUBLIC_DATA(int) sg_concurrency_limit; + extern XBT_PRIVATE double sg_tcp_gamma; extern XBT_PRIVATE double sg_latency_factor; extern XBT_PRIVATE double sg_bandwidth_factor; @@ -36,6 +41,28 @@ extern XBT_PRIVATE std::vector surf_path; extern XBT_PRIVATE std::unordered_map traces_set_list; extern XBT_PRIVATE std::set watched_hosts; +static inline void double_update(double* variable, double value, double precision) +{ + // printf("Updating %g -= %g +- %g\n",*variable,value,precision); + // xbt_assert(value==0 || value>precision); + // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may + // happen, and the precision mechanism is not active... + // xbt_assert(*variable< (2< precision); +} + +static inline int double_equals(double value1, double value2, double precision) +{ + return (fabs(value1 - value2) < precision); +} + extern "C" { XBT_PUBLIC(double) surf_get_clock(); } -- 2.20.1