1 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "src/surf/surf_private.hpp"
14 #include <unordered_map>
21 /* user-visible parameters */
22 XBT_PUBLIC_DATA double sg_maxmin_precision;
23 XBT_PUBLIC_DATA double sg_surf_precision;
24 XBT_PUBLIC_DATA int sg_concurrency_limit;
26 extern XBT_PRIVATE double sg_latency_factor;
27 extern XBT_PRIVATE double sg_bandwidth_factor;
28 extern XBT_PRIVATE double sg_weight_S_parameter;
29 extern XBT_PRIVATE std::vector<std::string> surf_path;
30 extern XBT_PRIVATE std::unordered_map<std::string, tmgr_trace_t> traces_set_list;
31 extern XBT_PRIVATE std::set<std::string> watched_hosts;
33 static inline void double_update(double* variable, double value, double precision)
35 // printf("Updating %g -= %g +- %g\n",*variable,value,precision);
36 // xbt_assert(value==0 || value>precision);
37 // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may
38 // happen, and the precision mechanism is not active...
39 // xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
41 if (*variable < precision)
45 static inline int double_positive(double value, double precision)
47 return (value > precision);
50 static inline int double_equals(double value1, double value2, double precision)
52 return (fabs(value1 - value2) < precision);
55 /** \ingroup SURF_simulation
56 * \brief List of hosts that have just restarted and whose autorestart process should be restarted.
58 XBT_PUBLIC_DATA std::vector<sg_host_t> host_that_restart;
60 int XBT_PRIVATE __surf_is_absolute_file_path(const char *file_path);
66 #endif /* SURF_MODEL_H_ */