X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8c6bbb14f44b8daed5ea43d80880c6bf2155118b..d10cc68456b92872786aa00dcf4dfaddccd4fb44:/src/kernel/resource/Resource.hpp diff --git a/src/kernel/resource/Resource.hpp b/src/kernel/resource/Resource.hpp index bf67c6a42f..9e2f2842fc 100644 --- a/src/kernel/resource/Resource.hpp +++ b/src/kernel/resource/Resource.hpp @@ -101,10 +101,21 @@ public: 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.*/ - virtual double get_load() const { return constraint_->get_usage(); } + virtual double get_load() const { return constraint_->get_load(); } bool is_used() const override { return model_->get_maxmin_system()->constraint_used(constraint_); } };