typedef simgrid::kernel::lmm::Element* lmm_element_t;
typedef const simgrid::kernel::lmm::Element* const_lmm_element_t;
typedef simgrid::kernel::lmm::ConstraintLight* lmm_constraint_light_t;
-typedef simgrid::kernel::lmm::System* lmm_system_t;
#else
ActionLmmListPtr getModifiedSet() const;
/** @brief Get the maxmin system of the current Model */
- lmm_system_t getMaxminSystem() const { return maxmin_system_; }
+ lmm::System* getMaxminSystem() const { return maxmin_system_; }
/**
* @brief Get the update mechanism of the current Model
virtual bool nextOccuringEventIsIdempotent() { return true; }
protected:
- lmm_system_t maxmin_system_ = nullptr;
+ lmm::System* maxmin_system_ = nullptr;
private:
e_UM_t update_mechanism_ = UM_UNDEFINED;
-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2018. 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. */
-/* Copyright (c) 2017-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
-/* Copyright (c) 2017-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
-/* Copyright (c) 2012-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2012-2018. 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. */
-/* Copyright (c) 2007-2011, 2013-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
#define SHOW_EXPR_D(expr) XBT_DEBUG(#expr " = %d", expr);
#define SHOW_EXPR_P(expr) XBT_DEBUG(#expr " = %p", expr);
-void simgrid::kernel::lmm::bottleneck_solve(lmm_system_t sys)
+void simgrid::kernel::lmm::bottleneck_solve(lmm::System* sys)
{
if (not sys->modified)
return;
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
* Local prototypes to implement the Lagrangian optimization with optimal step, also called dichotomy.
*/
// solves the proportional fairness using a Lagrangian optimization with dichotomy step
-void lagrange_solve(lmm_system_t sys);
+void lagrange_solve(kernel::lmm::System* sys);
// computes the value of the dichotomy using a initial values, init, with a specific variable or constraint
static double dichotomy(double init, double diff(double, const Constraint&), const Constraint& cnst, double min_error);
// computes the value of the differential of constraint cnst applied to lambda
return obj;
}
-void lagrange_solve(lmm_system_t sys)
+void lagrange_solve(kernel::lmm::System* sys)
{
/* Lagrange Variables. */
int max_iterations = 100;
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2018. 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. */
}
static inline void saturated_variable_set_update(ConstraintLight* cnst_light_tab,
- const dyn_light_t& saturated_constraints, lmm_system_t sys)
+ const dyn_light_t& saturated_constraints, System* sys)
{
/* Add active variables (i.e. variables that need to be set) from the set of constraints to saturate
* (cnst_light_tab)*/
delete[] cnst_light_tab;
}
-void lmm_solve(lmm_system_t sys)
+void lmm_solve(System* sys)
{
sys->solve();
}
* @brief Solve the lmm system
* @param sys The lmm system to solve
*/
-XBT_PUBLIC void lmm_solve(lmm_system_t sys);
+XBT_PUBLIC void lmm_solve(lmm::System* sys);
-XBT_PUBLIC void lagrange_solve(lmm_system_t sys);
-XBT_PUBLIC void bottleneck_solve(lmm_system_t sys);
+XBT_PUBLIC void lagrange_solve(lmm::System* sys);
+XBT_PUBLIC void bottleneck_solve(lmm::System* sys);
/** Default functions associated to the chosen protocol. When using the lagrangian approach. */
simgrid::kernel::resource::ActionLmmListPtr modified_set_ = nullptr;
- void (*solve_fun)(lmm_system_t self);
+ void (*solve_fun)(lmm::System* self);
private:
bool selective_update_active; /* flag to update partially the system only selecting changed portions */
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2018. 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. */
-/* Copyright (c) 2013-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2013-2018. 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. */
XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->getPm()->getCname());
xbt_assert(cpu->model() == surf_cpu_model_vm);
- lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
+ kernel::lmm::System* vcpu_system = cpu->model()->getMaxminSystem();
vcpu_system->update_constraint_bound(cpu->constraint(), virt_overhead * solved_value);
}
-/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2018. 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. */
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2018. 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. */
-/* Copyright ,(c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
* Resource *
************/
-StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, lmm_system_t maxminSystem, double bread,
- double bwrite, std::string type_id, std::string content_name, sg_size_t size,
+StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem,
+ double bread, double bwrite, std::string type_id, std::string content_name, sg_size_t size,
std::string attach)
: Resource(model, name.c_str(), maxminSystem->constraint_new(this, std::max(bread, bwrite)))
, piface_(name, this)
-/* Copyright (c) 2004-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2004-2018. 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. */
class StorageImpl : public kernel::resource::Resource, public PropertyHolder {
public:
/** @brief Storage constructor */
- StorageImpl(kernel::resource::Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
- std::string type_id, std::string content_name, sg_size_t size, std::string attach);
+ StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
+ double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach);
~StorageImpl() override;
maxmin_system_->modified_set_ = new kernel::resource::ActionLmmList();
}
-NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self)) : NetworkCm02Model()
+NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(kernel::lmm::System* self)) : NetworkCm02Model()
{
maxmin_system_->solve_fun = specificSolveFun;
}
* Resource *
************/
NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy, lmm_system_t system)
+ e_surf_link_sharing_policy_t policy, kernel::lmm::System* system)
: LinkImpl(model, name, system->constraint_new(this, sg_bandwidth_factor * bandwidth))
{
bandwidth_.scale = 1.0;
class NetworkCm02Model : public NetworkModel {
public:
NetworkCm02Model();
- explicit NetworkCm02Model(void (*solve_fun)(lmm_system_t self));
+ explicit NetworkCm02Model(void (*solve_fun)(kernel::lmm::System* self));
virtual ~NetworkCm02Model() = default;
LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy) override;
class NetworkCm02Link : public LinkImpl {
public:
NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy, lmm_system_t system);
+ e_surf_link_sharing_policy_t policy, kernel::lmm::System* system);
virtual ~NetworkCm02Link() = default;
void apply_event(tmgr_trace_event_t event, double value) override;
void setBandwidth(double value) override;
*
* @param system The lmm_system_t to solve
*/
- void (*f_networkSolve)(lmm_system_t) = simgrid::kernel::lmm::lmm_solve;
+ void (*f_networkSolve)(kernel::lmm::System*) = kernel::lmm::lmm_solve;
/**
* @brief Get the right multiplicative factor for the latency.
delete surf_cpu_model_pm;
}
-CpuL07Model::CpuL07Model(HostL07Model* hmodel, lmm_system_t sys) : CpuModel(), hostModel_(hmodel)
+CpuL07Model::CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys) : CpuModel(), hostModel_(hmodel)
{
maxmin_system_ = sys;
}
maxmin_system_ = nullptr;
}
-NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, lmm_system_t sys) : NetworkModel(), hostModel_(hmodel)
+NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys) : NetworkModel(), hostModel_(hmodel)
{
maxmin_system_ = sys;
loopback_ = NetworkL07Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
class CpuL07Model : public CpuModel {
public:
- CpuL07Model(HostL07Model* hmodel, lmm_system_t sys);
+ CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
~CpuL07Model();
Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
class NetworkL07Model : public NetworkModel {
public:
- NetworkL07Model(HostL07Model* hmodel, lmm_system_t sys);
+ NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
~NetworkL07Model();
LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy) override;
* Resource *
************/
-StorageN11::StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
- std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
+ double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach)
: StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
{
XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
class StorageN11 : public StorageImpl {
public:
- StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+ StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread, double bwrite,
std::string type_id, std::string content_name, sg_size_t size, std::string attach);
virtual ~StorageN11() = default;
StorageAction* read(sg_size_t size);
-/* Copyright (c) 2004-2005, 2007, 2009-2014, 2016-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2004-2018. 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. */
-/* Copyright (c) 2006-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2018. 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. */
/* A few tests for the maxmin library */
-/* Copyright (c) 2007-2018s. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
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 simgrid::kernel::lmm::System(true);
+ simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
simgrid::kernel::lmm::Constraint* L1 = Sys->constraint_new(nullptr, a);
simgrid::kernel::lmm::Constraint* L2 = Sys->constraint_new(nullptr, b);
simgrid::kernel::lmm::Constraint* L3 = Sys->constraint_new(nullptr, a);
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 simgrid::kernel::lmm::System(true);
+ simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
simgrid::kernel::lmm::Constraint* CPU1 = Sys->constraint_new(nullptr, 200.0);
simgrid::kernel::lmm::Constraint* CPU2 = Sys->constraint_new(nullptr, 100.0);
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 simgrid::kernel::lmm::System(true);
+ simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
/* Creates the constraints */
simgrid::kernel::lmm::Constraint** tmp_cnst = new simgrid::kernel::lmm::Constraint*[15];
simgrid::kernel::lmm::Variable* var[nb_var];
int used[nb_cnst];
- lmm_system_t Sys = new simgrid::kernel::lmm::System(true);
+ simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(true);
for (int i = 0; i < nb_cnst; i++) {
cnst[i] = Sys->constraint_new(NULL, float_random(10.0));