-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#ifndef SURF_MODEL_H_
#define SURF_MODEL_H_
+#include <xbt/asserts.h>
+#include <xbt/function_types.h>
+
#include "src/internal_config.h"
-#include "src/surf/surf_private.hpp"
-#include "xbt/function_types.h"
+#include <cfloat>
#include <cmath>
#include <functional>
#include <set>
/*********
* Utils *
*********/
+XBT_PRIVATE FILE* surf_fopen(const std::string& name, const char* mode);
+XBT_PRIVATE std::ifstream* surf_ifsopen(const std::string& name);
/* 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_latency_factor;
-extern XBT_PRIVATE double sg_bandwidth_factor;
-extern XBT_PRIVATE double sg_weight_S_parameter;
extern XBT_PRIVATE std::vector<std::string> surf_path;
extern XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;
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<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
+ if (false) { // debug
+ fprintf(stderr, "Updating %g -= %g +- %g\n", *variable, value, precision);
+ xbt_assert(value == 0.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(FLT_RADIX == 2 && *variable < precision * exp2(DBL_MANT_DIG));
+ }
*variable -= value;
if (*variable < precision)
*variable = 0.0;
*/
XBT_PUBLIC void surf_cpu_model_init_Cas01();
+XBT_ATTRIB_DEPRECATED_v337 ("Please use surf_disk_model_init_S19()") XBT_PUBLIC void surf_disk_model_init_default();
+XBT_PUBLIC void surf_disk_model_init_S19();
+
/** @ingroup SURF_models
* @brief Same as network model 'LagrangeVelho', only with different correction factors.
*
*
* @see surf_host_model_init_SMPI()
*/
-#if !HAVE_SMPI
-XBT_ATTRIB_NORETURN
-#endif
XBT_PUBLIC void surf_network_model_init_SMPI();
/** @ingroup SURF_models
*/
XBT_PUBLIC void surf_host_model_init_ptask_L07();
-XBT_PUBLIC void surf_disk_model_init_default();
-
/* --------------------
* Model Descriptions
* -------------------- */