* @param now The current time of the simulation
* @return The delta of time till the next action will finish
*/
- virtual double next_occuring_event(double now);
- virtual double next_occuring_event_lazy(double now);
- virtual double next_occuring_event_full(double now);
+ virtual double next_occurring_event(double now);
+ virtual double next_occurring_event_lazy(double now);
+ virtual double next_occurring_event_full(double now);
+
+ XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event()") double next_occuring_event(double now)
+ {
+ return next_occurring_event(now);
+ }
+ XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event_lazy()") double next_occuring_event_lazy(double now)
+ {
+ return next_occurring_event_lazy(now);
+ }
+ XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event_full()") double next_occuring_event_full(double now)
+ {
+ return next_occurring_event_full(now);
+ }
private:
Action* extract_action(Action::StateSet* list);
* The only model that is not is ns-3: computing the next timestamp moves the model up to that point,
* so we need to call it only when the next timestamp of other sources is computed.
*/
- virtual bool next_occuring_event_is_idempotent() { return true; }
+ virtual bool next_occurring_event_is_idempotent() { return true; }
+
+ XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event_is_idempotent()") bool next_occuring_event_is_idempotent()
+ {
+ return next_occurring_event_is_idempotent();
+ }
private:
std::unique_ptr<lmm::System> maxmin_system_;
maxmin_system_.reset(system);
}
-double Model::next_occuring_event(double now)
+double Model::next_occurring_event(double now)
{
// FIXME: set the good function once and for all
if (update_algorithm_ == Model::UpdateAlgo::LAZY)
- return next_occuring_event_lazy(now);
+ return next_occurring_event_lazy(now);
else if (update_algorithm_ == Model::UpdateAlgo::FULL)
- return next_occuring_event_full(now);
+ return next_occurring_event_full(now);
else
xbt_die("Invalid cpu update mechanism!");
}
-double Model::next_occuring_event_lazy(double now)
+double Model::next_occurring_event_lazy(double now)
{
XBT_DEBUG("Before share resources, the size of modified actions set is %zu", maxmin_system_->modified_set_->size());
maxmin_system_->lmm_solve();
}
}
-double Model::next_occuring_event_full(double /*now*/)
+double Model::next_occurring_event_full(double /*now*/)
{
maxmin_system_->solve();
kernel::activity::ActivityImpl::on_suspended.connect(remove_active_activity);
}
-double VMModel::next_occuring_event(double now)
+double VMModel::next_occurring_event(double now)
{
/* TODO: update action's cost with the total cost of processes on the VM. */
}
/* 2. Ready. Get the next occurring event */
- return surf_cpu_model_vm->next_occuring_event(now);
+ return surf_cpu_model_vm->next_occurring_event(now);
}
/************
public:
VMModel();
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double /*now*/, double /*delta*/) override{};
};
}
return new CpuTi(this, host, speed_per_pstate, core);
}
-double CpuTiModel::next_occuring_event(double now)
+double CpuTiModel::next_occurring_event(double now)
{
double min_action_duration = -1;
CpuTiModel& operator=(const CpuTiModel&) = delete;
~CpuTiModel() override;
Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
CpuTiList modified_cpus_;
return new DiskS19(this, id, get_maxmin_system(), read_bw, write_bw);
}
-double DiskS19Model::next_occuring_event(double now)
+double DiskS19Model::next_occurring_event(double now)
{
- return DiskModel::next_occuring_event_full(now);
+ return DiskModel::next_occurring_event_full(now);
}
void DiskS19Model::update_actions_state(double /*now*/, double delta)
public:
DiskS19Model();
DiskImpl* createDisk(const std::string& id, double read_bw, double write_bw) override;
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
};
{
all_existing_models.push_back(this);
}
-double HostCLM03Model::next_occuring_event(double now)
+double HostCLM03Model::next_occurring_event(double now)
{
- double min_by_cpu = surf_cpu_model_pm->next_occuring_event(now);
+ double min_by_cpu = surf_cpu_model_pm->next_occurring_event(now);
double min_by_net =
- surf_network_model->next_occuring_event_is_idempotent() ? surf_network_model->next_occuring_event(now) : -1;
- double min_by_sto = surf_storage_model->next_occuring_event(now);
- double min_by_dsk = surf_disk_model->next_occuring_event(now);
+ surf_network_model->next_occurring_event_is_idempotent() ? surf_network_model->next_occurring_event(now) : -1;
+ double min_by_sto = surf_storage_model->next_occurring_event(now);
+ double min_by_dsk = surf_disk_model->next_occurring_event(now);
XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f, %s min_by_dsk %f", this,
typeid(surf_cpu_model_pm).name(), min_by_cpu, typeid(surf_network_model).name(), min_by_net,
class XBT_PRIVATE HostCLM03Model : public HostModel {
public:
HostCLM03Model();
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
};
}
return nullptr;
}
-double NetworkConstantModel::next_occuring_event(double /*now*/)
+double NetworkConstantModel::next_occurring_event(double /*now*/)
{
double min = -1.0;
for (kernel::resource::Action const& action : *get_started_action_set()) {
public:
NetworkConstantModel();
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
LinkImpl* create_link(const std::string& name, const std::vector<double>& bws, double lat,
return rate;
}
-double NetworkModel::next_occuring_event_full(double now)
+double NetworkModel::next_occurring_event_full(double now)
{
- double minRes = Model::next_occuring_event_full(now);
+ double minRes = Model::next_occurring_event_full(now);
for (Action const& action : *get_started_action_set()) {
const NetworkAction& net_action = static_cast<const NetworkAction&>(action);
* @return The new bandwidth.
*/
virtual double get_bandwidth_constraint(double rate, double bound, double size);
- double next_occuring_event_full(double now) override;
+ double next_occurring_event_full(double now) override;
LinkImpl* loopback_ = nullptr;
};
return new NetworkNS3Action(this, size, src, dst);
}
-double NetworkNS3Model::next_occuring_event(double now)
+double NetworkNS3Model::next_occurring_event(double now)
{
double time_to_next_flow_completion = 0.0;
- XBT_DEBUG("ns3_next_occuring_event");
+ XBT_DEBUG("ns3_next_occurring_event");
//get the first relevant value from the running_actions list
LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidth, double latency,
s4u::Link::SharingPolicy policy) override;
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
- double next_occuring_event(double now) override;
- bool next_occuring_event_is_idempotent() override { return false; }
+ double next_occurring_event(double now) override;
+ bool next_occurring_event_is_idempotent() override { return false; }
void update_actions_state(double now, double delta) override;
};
set_maxmin_system(nullptr);
}
-double HostL07Model::next_occuring_event(double now)
+double HostL07Model::next_occurring_event(double now)
{
- double min = HostModel::next_occuring_event_full(now);
+ double min = HostModel::next_occurring_event_full(now);
for (kernel::resource::Action const& action : *get_started_action_set()) {
const L07Action& net_action = static_cast<const L07Action&>(action);
if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min)) {
HostL07Model& operator=(const HostL07Model&) = delete;
~HostL07Model() override;
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
kernel::resource::CpuAction* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
const double* bytes_amount, double rate) override;
attach);
}
-double StorageN11Model::next_occuring_event(double now)
+double StorageN11Model::next_occurring_event(double now)
{
- return StorageModel::next_occuring_event_full(now);
+ return StorageModel::next_occurring_event_full(now);
}
void StorageN11Model::update_actions_state(double /*now*/, double delta)
StorageN11Model();
StorageImpl* createStorage(const std::string& id, const std::string& type_id, const std::string& content_name,
const std::string& attach) override;
- double next_occuring_event(double now) override;
+ double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
};
/* Physical models MUST be resolved first */
XBT_DEBUG("Looking for next event in physical models");
- double next_event_phy = surf_host_model->next_occuring_event(NOW);
+ double next_event_phy = surf_host_model->next_occurring_event(NOW);
if ((time_delta < 0.0 || next_event_phy < time_delta) && next_event_phy >= 0.0) {
time_delta = next_event_phy;
}
if (surf_vm_model != nullptr) {
XBT_DEBUG("Looking for next event in virtual models");
- double next_event_virt = surf_vm_model->next_occuring_event(NOW);
+ double next_event_virt = surf_vm_model->next_occurring_event(NOW);
if ((time_delta < 0.0 || next_event_virt < time_delta) && next_event_virt >= 0.0)
time_delta = next_event_virt;
}
for (auto const& model : all_existing_models) {
if (model != surf_host_model && model != surf_vm_model && model != surf_network_model &&
model != surf_storage_model && model != surf_disk_model) {
- double next_event_model = model->next_occuring_event(NOW);
+ double next_event_model = model->next_occurring_event(NOW);
if ((time_delta < 0.0 || next_event_model < time_delta) && next_event_model >= 0.0)
time_delta = next_event_model;
}
double next_event_date = simgrid::kernel::profile::future_evt_set.next_date();
XBT_DEBUG("Next TRACE event: %f", next_event_date);
- if (not surf_network_model->next_occuring_event_is_idempotent()) { // NS3, I see you
+ if (not surf_network_model->next_occurring_event_is_idempotent()) { // NS3, I see you
if (next_event_date != -1.0) {
time_delta = std::min(next_event_date - NOW, time_delta);
} else {
XBT_DEBUG("Run the NS3 network at most %fs", time_delta);
// run until min or next flow
- model_next_action_end = surf_network_model->next_occuring_event(time_delta);
+ model_next_action_end = surf_network_model->next_occurring_event(time_delta);
XBT_DEBUG("Min for network : %f", model_next_action_end);
if (model_next_action_end >= 0.0)
while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) {
if (resource->is_used() || (watched_hosts.find(resource->get_cname()) != watched_hosts.end())) {
time_delta = next_event_date - NOW;
- XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta);
+ XBT_DEBUG("This event invalidates the next_occurring_event() computation of models. Next event set to %f",
+ time_delta);
}
// FIXME: I'm too lame to update NOW live, so I change it and restore it so that the real update with surf_min will work
double round_start = NOW;