class MailboxImpl;
}
-
+namespace lmm {
+class s_lmm_element_t;
+class s_lmm_variable_t;
+class s_lmm_constraint_t;
+class s_lmm_constraint_light_t;
+class s_lmm_system_t;
+}
namespace routing {
class NetPoint;
}
typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
typedef simgrid::surf::StorageImpl* surf_storage_t;
+typedef simgrid::kernel::lmm::s_lmm_element_t* lmm_element_t;
+typedef simgrid::kernel::lmm::s_lmm_variable_t* lmm_variable_t;
+typedef simgrid::kernel::lmm::s_lmm_constraint_t* lmm_constraint_t;
+typedef simgrid::kernel::lmm::s_lmm_constraint_light_t* lmm_constraint_light_t;
+typedef simgrid::kernel::lmm::s_lmm_system_t* lmm_system_t;
+
#else
typedef struct s4u_Actor s4u_Actor;
+++ /dev/null
-/* Copyright (c) 2009-2017. 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 MAXMIN_DATATYPES_HPP
-#define MAXMIN_DATATYPES_HPP
-
-namespace simgrid {
-namespace surf {
-typedef struct s_lmm_element_t* lmm_element_t;
-typedef struct s_lmm_variable_t* lmm_variable_t;
-typedef struct s_lmm_constraint_t* lmm_constraint_t;
-typedef struct s_lmm_constraint_light_t* lmm_constraint_light_t;
-typedef struct s_lmm_system_t* lmm_system_t;
-}
-}
-
-#endif
#include "simgrid/datatypes.h"
#include "simgrid/forward.h"
#include "src/internal_config.h"
-#include "surf/datatypes.hpp"
#include "xbt/config.h"
#include "xbt/dict.h"
#include "xbt/dynar.h"
/* 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. */
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "xbt/log.h"
#include "xbt/sysdep.h"
#include <algorithm>
#define SHOW_EXPR_D(expr) XBT_DEBUG(#expr " = %d", expr);
#define SHOW_EXPR_P(expr) XBT_DEBUG(#expr " = %p", expr);
-void simgrid::surf::bottleneck_solve(lmm_system_t sys)
+void simgrid::kernel::lmm::bottleneck_solve(lmm_system_t sys)
{
void* _var;
void* _var_next;
* Modeling the proportional fairness using the Lagrangian Optimization Approach. For a detailed description see:
* "ssh://username@scm.gforge.inria.fr/svn/memo/people/pvelho/lagrange/ppf.ps".
*/
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "xbt/log.h"
#include "xbt/sysdep.h"
#define RENO2_SCALING 1.0
namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace lmm {
double (*func_f_def)(lmm_variable_t, double);
double (*func_fp_def)(lmm_variable_t, double);
}
}
}
+}
/* \file callbacks.h */
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "xbt/backtrace.hpp"
#include "xbt/log.h"
#include "xbt/mallocator.h"
int sg_concurrency_limit = -1; /* Change this with --cfg=maxmin/concurrency-limit:VALUE */
namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace lmm {
typedef std::vector<int> dyn_light_t;
}
}
}
+}
#include <vector>
namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace lmm {
/** @addtogroup SURF_lmm
* @details
* Then, it is used to list all variables involved in constraint through constraint's xxx_element_set lists, or
* vice-versa list all constraints for a given variable.
*/
-XBT_PUBLIC_CLASS s_lmm_element_t {
+XBT_PUBLIC_CLASS s_lmm_element_t
+{
public:
int get_concurrency() const;
void decrease_concurrency();
* \li Active elements which variable's weight is non-zero (i.e. it is enabled) AND its element value is non-zero.
* LMM_solve iterates over active elements during resolution, dynamically making them active or unactive.
*/
-XBT_PUBLIC_CLASS s_lmm_constraint_t {
+XBT_PUBLIC_CLASS s_lmm_constraint_t
+{
public:
s_lmm_constraint_t() = default;
s_lmm_constraint_t(void* id_value, double bound_value);
* @param elem A element of constraint of the constraint or NULL
* @return A variable associated to a constraint
*/
- lmm_variable_t get_variable(lmm_element_t* elem) const;
+ lmm_variable_t get_variable(lmm_element_t * elem) const;
/**
* @brief Get a var associated to a constraint
* @param numelem parameter representing the number of elements to go
* @return A variable associated to a constraint
*/
- lmm_variable_t get_variable_safe(lmm_element_t* elem, lmm_element_t* nextelem, int* numelem) const;
+ lmm_variable_t get_variable_safe(lmm_element_t * elem, lmm_element_t * nextelem, int* numelem) const;
/**
* @brief Get the data associated to a constraint
* When something prevents us from enabling a variable, we "stage" the weight that we would have like to set, so that as
* soon as possible we enable the variable with desired weight
*/
-XBT_PUBLIC_CLASS s_lmm_variable_t {
+XBT_PUBLIC_CLASS s_lmm_variable_t
+{
public:
- void initialize(simgrid::surf::Action* id_value, double sharing_weight_value, double bound_value,
+ void initialize(simgrid::surf::Action * id_value, double sharing_weight_value, double bound_value,
int number_of_constraints, unsigned visited_value);
/**
/* \begin{For Lagrange only} */
double mu;
double new_mu;
- double (*func_f)(s_lmm_variable_t* var, double x); /* (f) */
- double (*func_fp)(s_lmm_variable_t* var, double x); /* (f') */
- double (*func_fpi)(s_lmm_variable_t* var, double x); /* (f')^{-1} */
+ double (*func_f)(s_lmm_variable_t * var, double x); /* (f) */
+ double (*func_fp)(s_lmm_variable_t * var, double x); /* (f') */
+ double (*func_fpi)(s_lmm_variable_t * var, double x); /* (f')^{-1} */
/* \end{For Lagrange only} */
private:
/**
* @brief LMM system
*/
-XBT_PUBLIC_CLASS s_lmm_system_t {
+XBT_PUBLIC_CLASS s_lmm_system_t
+{
public:
/**
* @brief Create a new Linear MaxMim system
* @param bound The maximum value of the variable (-1.0 if no maximum value)
* @param number_of_constraints The maximum number of constraint to associate to the variable
*/
- lmm_variable_t variable_new(simgrid::surf::Action* id, double weight_value, double bound, int number_of_constraints);
+ lmm_variable_t variable_new(simgrid::surf::Action * id, double weight_value, double bound, int number_of_constraints);
/**
* @brief Free a variable
/** @} */
}
}
+}
#endif
XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->pimpl_vm_->getPm()->getCname());
xbt_assert(cpu->model() == surf_cpu_model_vm);
- surf::lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
+ lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
vcpu_system->update_constraint_bound(cpu->constraint(), virt_overhead * solved_value);
}
#include "simgrid/s4u/Link.hpp"
#include "simgrid/sg_config.h"
#include "simgrid/simix.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/network_interface.hpp"
-#include "surf/maxmin.hpp"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U links");
#include "simgrid/instr.h"
#include "simgrid/simix.h"
#include "simgrid_config.h" /* what was compiled in? */
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/surf/surf_interface.hpp"
-#include "surf/maxmin.hpp"
#include "surf/surf.hpp"
#include "xbt/config.h"
#include "xbt/config.hpp"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "StorageImpl.hpp"
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "surf_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf, "Logging specific to the SURF storage module");
StorageModel::StorageModel() : Model()
{
- maxminSystem_ = new s_lmm_system_t(true /* lazy update */);
+ maxminSystem_ = new simgrid::kernel::lmm::s_lmm_system_t(true /* lazy update */);
}
StorageModel::~StorageModel()
#include "cpu_cas01.hpp"
#include "cpu_ti.hpp"
#include "simgrid/sg_config.h"
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include <algorithm>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, "Logging specific to the SURF CPU IMPROVED module");
}
p_cpuRunningActionSetThatDoesNotNeedBeingChecked = new ActionList();
- maxminSystem_ = new s_lmm_system_t(selectiveUpdate_);
+ maxminSystem_ = new simgrid::kernel::lmm::s_lmm_system_t(selectiveUpdate_);
if (getUpdateMechanism() == UM_LAZY) {
modifiedSet_ = new ActionLmmList();
#define SURF_CPU_INTERFACE_HPP_
#include "simgrid/s4u/Host.hpp"
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include <list>
#include "simgrid/s4u/Host.hpp"
#include "simgrid/sg_config.h"
#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
if (surf_network_model)
return;
- lmm_set_default_protocol_function(simgrid::surf::func_reno_f, simgrid::surf::func_reno_fp,
- simgrid::surf::func_reno_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fp,
+ simgrid::kernel::lmm::func_reno_fpi);
xbt_cfg_setdefault_double("network/latency-factor", 13.01);
xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
xbt_cfg_setdefault_double("network/weight-S", 20537);
- surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
+ surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::lagrange_solve);
all_existing_models->push_back(surf_network_model);
}
if (surf_network_model)
return;
- lmm_set_default_protocol_function(simgrid::surf::func_reno2_f, simgrid::surf::func_reno2_fp,
- simgrid::surf::func_reno2_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_reno2_f, simgrid::kernel::lmm::func_reno2_fp,
+ simgrid::kernel::lmm::func_reno2_fpi);
xbt_cfg_setdefault_double("network/latency-factor", 13.01);
xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
xbt_cfg_setdefault_double("network/weight-S", 20537);
- surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
+ surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::lagrange_solve);
all_existing_models->push_back(surf_network_model);
}
if (surf_network_model)
return;
- lmm_set_default_protocol_function(simgrid::surf::func_vegas_f, simgrid::surf::func_vegas_fp,
- simgrid::surf::func_vegas_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_vegas_f, simgrid::kernel::lmm::func_vegas_fp,
+ simgrid::kernel::lmm::func_vegas_fpi);
xbt_cfg_setdefault_double("network/latency-factor", 13.01);
xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
xbt_cfg_setdefault_double("network/weight-S", 20537);
- surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::surf::lagrange_solve);
+ surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::lagrange_solve);
all_existing_models->push_back(surf_network_model);
}
xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim.c_str());
}
- maxminSystem_ = new s_lmm_system_t(selectiveUpdate_);
+ maxminSystem_ = new simgrid::kernel::lmm::s_lmm_system_t(selectiveUpdate_);
loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
if (getUpdateMechanism() == UM_LAZY) {
#include <utility>
#include "simgrid/sg_config.h"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/HostImpl.hpp"
#include "src/surf/network_ib.hpp"
#include "src/surf/xml/platf.hpp"
-#include "surf/maxmin.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#define SURF_NETWORK_INTERFACE_HPP_
#include "simgrid/s4u/Link.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/PropertyHolder.hpp"
#include "src/surf/surf_interface.hpp"
-#include "surf/maxmin.hpp"
#include "xbt/base.h"
#include <list>
#include <unordered_map>
*
* @param system The lmm_system_t to solve
*/
- void (*f_networkSolve)(lmm_system_t) = lmm_solve;
+ void (*f_networkSolve)(lmm_system_t) = simgrid::kernel::lmm::lmm_solve;
/**
* @brief Get the right multiplicative factor for the latency.
namespace surf {
HostL07Model::HostL07Model() : HostModel() {
- maxminSystem_ = new s_lmm_system_t(true /* lazy */);
- maxminSystem_->solve_fun = &bottleneck_solve;
+ maxminSystem_ = new simgrid::kernel::lmm::s_lmm_system_t(true /* lazy */);
+ maxminSystem_->solve_fun = &simgrid::kernel::lmm::bottleneck_solve;
surf_network_model = new NetworkL07Model(this,maxminSystem_);
surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
}
#include "storage_n11.hpp"
#include "simgrid/s4u/Engine.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/kernel/routing/NetPoint.hpp"
-#include "surf/maxmin.hpp"
#include <cmath> /*ceil*/
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/msg.h"
+#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/surf_interface.hpp"
-#include "surf/maxmin.hpp"
#include "xbt/log.h"
#include "xbt/module.h"
#include "xbt/sysdep.h"
double b = 10.0;
if (method == LAGRANGE_VEGAS)
- lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
+ simgrid::kernel::lmm::lmm_set_default_protocol_function(
+ simgrid::kernel::lmm::func_vegas_f, simgrid::kernel::lmm::func_vegas_fp, simgrid::kernel::lmm::func_vegas_fpi);
else if (method == LAGRANGE_RENO)
- lmm_set_default_protocol_function(func_reno_f, func_reno_fpi, func_reno_fpi);
+ simgrid::kernel::lmm::lmm_set_default_protocol_function(
+ simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fpi, simgrid::kernel::lmm::func_reno_fpi);
- lmm_system_t Sys = new s_lmm_system_t(true);
+ lmm_system_t Sys = new simgrid::kernel::lmm::s_lmm_system_t(true);
lmm_constraint_t L1 = Sys->constraint_new(nullptr, a);
lmm_constraint_t L2 = Sys->constraint_new(nullptr, b);
lmm_constraint_t L3 = Sys->constraint_new(nullptr, a);
static void test2(method_t method)
{
if (method == LAGRANGE_VEGAS)
- lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_vegas_f, simgrid::kernel::lmm::func_vegas_fp,
+ simgrid::kernel::lmm::func_vegas_fpi);
if (method == LAGRANGE_RENO)
- lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fp,
+ simgrid::kernel::lmm::func_reno_fpi);
- lmm_system_t Sys = new s_lmm_system_t(true);
+ lmm_system_t Sys = new simgrid::kernel::lmm::s_lmm_system_t(true);
lmm_constraint_t CPU1 = Sys->constraint_new(nullptr, 200.0);
lmm_constraint_t CPU2 = Sys->constraint_new(nullptr, 100.0);
A[14][15] = 1.0;
if (method == LAGRANGE_VEGAS)
- lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_vegas_f, simgrid::kernel::lmm::func_vegas_fp,
+ simgrid::kernel::lmm::func_vegas_fpi);
if (method == LAGRANGE_RENO)
- lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
+ lmm_set_default_protocol_function(simgrid::kernel::lmm::func_reno_f, simgrid::kernel::lmm::func_reno_fp,
+ simgrid::kernel::lmm::func_reno_fpi);
- lmm_system_t Sys = new s_lmm_system_t(true);
+ lmm_system_t Sys = new simgrid::kernel::lmm::s_lmm_system_t(true);
/* Creates the constraints */
lmm_constraint_t* tmp_cnst = new lmm_constraint_t[15];
/* 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. */
-#include "surf/maxmin.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
#include "simgrid/msg.h"
#include "xbt/module.h"
#include "xbt/sysdep.h" /* time manipulation for benchmarking */
lmm_variable_t var[nb_var];
int used[nb_cnst];
- lmm_system_t Sys = new s_lmm_system_t(true);
+ lmm_system_t Sys = new simgrid::kernel::lmm::s_lmm_system_t(true);
for (int i = 0; i < nb_cnst; i++) {
cnst[i] = Sys->constraint_new(NULL, float_random(10.0));
src/include/mc/datatypes.h
src/include/mc/mc.h
src/include/simgrid/sg_config.h
- src/include/surf/datatypes.hpp
- src/include/surf/maxmin.hpp
src/include/surf/surf.hpp
src/include/xbt/parmap.hpp
src/mc/mc_mmu.hpp
set(SURF_SRC
src/kernel/lmm/fair_bottleneck.cpp
src/kernel/lmm/lagrange.cpp
+ src/kernel/lmm/maxmin.hpp
src/kernel/lmm/maxmin.cpp
src/kernel/routing/ClusterZone.cpp