- Full simDAG integration: Activity::start() actually starts only when all dependencies
are fullfiled. If it cannot be started right away, it will start as soon as it becomes
possible.
+ - Allow to set a concurrency limit on disks and hosts, as it was already the case for links.
Kernel:
- optimize an internal datastructure (use a set instead of a list for ongoing activities),
Disk* set_state_profile(kernel::profile::Profile* profile);
Disk* set_read_bandwidth_profile(kernel::profile::Profile* profile);
Disk* set_write_bandwidth_profile(kernel::profile::Profile* profile);
+ /**
+ * @brief Set the max amount of operations (either read or write) that can take place on this disk at the same time
+ *
+ * Use -1 to set no limit.
+ */
+ Disk* set_concurrency_limit(int limit);
+ int get_concurrency_limit() const;
IoPtr io_init(sg_size_t size, s4u::Io::OpType type) const;
Host* set_state_profile(kernel::profile::Profile* p);
Host* set_speed_profile(kernel::profile::Profile* p);
+ /**
+ * @brief Set the max amount of executions that can take place on this host at the same time
+ *
+ * Use -1 to set no limit.
+ */
+ Host* set_concurrency_limit(int limit);
+ int get_concurrency_limit() const;
+
/** @brief Convert the CPU's speed from string to double */
static std::vector<double> convert_pstate_speed_vector(const std::vector<std::string>& speed_per_state);
/**
/* setup the profile file with latency events (peak latency changes due to external load).
* Profile must contain absolute values */
virtual void set_latency_profile(kernel::profile::Profile* profile) = 0;
- /** @brief Set the concurrency limit for this link */
- virtual void set_concurrency_limit(int limit) const = 0;
- /** @brief Get the concurrency limit of this link */
- virtual int get_concurrency_limit() const = 0;
};
} // namespace simgrid::kernel::resource
lmm::Constraint* get_constraint() const { return constraint_; }
+ /** @brief Set the concurrency limit for this resource */
+ virtual void set_concurrency_limit(int limit) const
+ {
+ if (limit != -1)
+ get_constraint()->reset_concurrency_maximum();
+ get_constraint()->set_concurrency_limit(limit);
+ }
+
+ /** @brief Get the concurrency limit of this resource */
+ virtual int get_concurrency_limit() const { return get_constraint()->get_concurrency_limit(); }
+
/** @brief returns the current load due to activities (in flops per second, byte per second or similar)
*
* The load due to external usages modeled by profile files is ignored.*/
}
}
-void StandardLinkImpl::set_concurrency_limit(int limit) const
-{
- if (limit != -1) {
- get_constraint()->reset_concurrency_maximum();
- }
- get_constraint()->set_concurrency_limit(limit);
-}
-int StandardLinkImpl::get_concurrency_limit() const
-{
- return get_constraint()->get_concurrency_limit();
-}
-
} // namespace simgrid::kernel::resource
/* setup the profile file with latency events (peak latency changes due to external load).
* Profile must contain absolute values */
void set_latency_profile(kernel::profile::Profile* profile) override;
-
- void set_concurrency_limit(int limit) const override;
- int get_concurrency_limit() const override;
};
} // namespace simgrid::kernel::resource
[this, profile]() { this->pimpl_->set_write_bandwidth_profile(profile); });
return this;
}
+int Disk::get_concurrency_limit() const
+{
+ return pimpl_->get_concurrency_limit();
+}
+
+Disk* Disk::set_concurrency_limit(int limit)
+{
+ kernel::actor::simcall_object_access(pimpl_, [this, limit] { pimpl_->set_concurrency_limit(limit); });
+ return this;
+}
IoPtr Disk::io_init(sg_size_t size, Io::OpType type) const
{
return this;
}
+int Host::get_concurrency_limit() const
+{
+ return pimpl_cpu_->get_concurrency_limit();
+}
+
+Host* Host::set_concurrency_limit(int limit)
+{
+ kernel::actor::simcall_object_access(pimpl_cpu_, [this, limit] { pimpl_cpu_->set_concurrency_limit(limit); });
+ return this;
+}
+
/** Specify a profile turning the host on and off according to an exhaustive list or a stochastic law.
* The profile must contain boolean values. */
Host* Host::set_state_profile(kernel::profile::Profile* p)