include teshsuite/s4u/host-on-off-recv/host-on-off-recv.tesh
include teshsuite/s4u/host-on-off/host-on-off.cpp
include teshsuite/s4u/host-on-off/host-on-off.tesh
+include teshsuite/s4u/io-set-bw/io-set-bw.cpp
+include teshsuite/s4u/io-set-bw/io-set-bw.tesh
include teshsuite/s4u/is-router/is-router.cpp
include teshsuite/s4u/is-router/is-router.tesh
include teshsuite/s4u/issue71/issue71.cpp
void System::update_variable_penalty(Variable* var, double penalty)
{
xbt_assert(penalty >= 0, "Variable penalty should not be negative!");
-
if (penalty == var->sharing_penalty_)
return;
using Action::Action;
void set_state(simgrid::kernel::resource::Action::State state) override;
-
- double sharing_penalty_ = {};
};
} // namespace resource
/************
* Resource *
************/
-void DiskS19::update_penalties(double delta) const
-{
- const kernel::lmm::Element* elem = nullptr;
- const kernel::lmm::Element* nextelem = nullptr;
- size_t numelem = 0;
- while (const auto* var = get_constraint()->get_variable_safe(&elem, &nextelem, &numelem)) {
- auto* action = static_cast<DiskS19Action*>(var->get_id());
- action->sharing_penalty_ += delta;
- if (not action->is_suspended())
- get_model()->get_maxmin_system()->update_variable_penalty(action->get_variable(), action->sharing_penalty_);
- }
-}
-
void DiskS19::set_read_bandwidth(double value)
{
read_bw_.peak = value;
- get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), read_bw_.peak * read_bw_.scale);
-
- double delta = 1.0 / value - 1.0 / (read_bw_.peak * read_bw_.scale);
- update_penalties(delta);
+ if (get_read_constraint()) {
+ get_model()->get_maxmin_system()->update_constraint_bound(get_read_constraint(), read_bw_.peak * read_bw_.scale);
+ }
}
void DiskS19::set_write_bandwidth(double value)
{
write_bw_.peak = value;
- get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), write_bw_.peak * write_bw_.scale);
-
- double delta = 1.0 / value - 1.0 / (write_bw_.peak * write_bw_.scale);
- update_penalties(delta);
+ if (get_write_constraint()) {
+ get_model()->get_maxmin_system()->update_constraint_bound(get_write_constraint(), write_bw_.peak * write_bw_.scale);
+ }
}
void DiskS19::set_readwrite_bandwidth(double value)
{
readwrite_bw_ = value;
- if (get_constraint())
+ if (get_constraint()) {
get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), readwrite_bw_);
+ }
}
void DiskS19::apply_event(kernel::profile::Event* triggered, double value)
************/
class DiskS19 : public DiskImpl {
- void update_penalties(double delta) const;
-
public:
using DiskImpl::DiskImpl;
void set_read_bandwidth(double value) override;
comm-get-sender comm-pt2pt wait-all-for wait-any-for
cloud-interrupt-migration cloud-two-execs
concurrent_rw
- host-on-off host-on-off-actors host-on-off-recv
+ host-on-off host-on-off-actors host-on-off-recv io-set-bw
basic-link-test basic-parsing-test evaluate-get-route-time evaluate-parse-time is-router
storage_client_server listen_async pid
trace-integration
## Some need to be run with all factories, some don't need tesh to run
foreach(x actor actor-autorestart actor-suspend
activity-lifecycle comm-get-sender wait-all-for wait-any-for
- cloud-interrupt-migration cloud-two-execs concurrent_rw
+ cloud-interrupt-migration cloud-two-execs concurrent_rw io-set-bw
vm-live-migration vm-suicide)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
ADD_TESH_FACTORIES(tesh-s4u-${x} "*" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)