- s4u::onDeadlock() signal, run before stopping the simulation.
- s4u::Exec: asynchronous executions (abstraction of background
threads)
+ - s4u::Host->getLoad() returns the achieved speed in flops/s
S4U API changes
- Link::name() is deprecated and will be removed in v3.21, use
*/
void execute(double flops);
+ /** @brief Returns the current computation load (in flops per second) */
+ double getLoad();
+
private:
simgrid::xbt::string name_{"noname"};
std::unordered_map<std::string, Storage*>* mounts = nullptr; // caching
simcall_execution_wait(s);
}
+double Host::getLoad()
+{
+ return this->pimpl_cpu->getLoad();
+}
+
} // namespace simgrid
} // namespace s4u
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.h"
#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/kernel/lmm/maxmin.hpp" // Constraint
#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/HostImpl.hpp"
#include "xbt/utility.hpp"
isOn_ = false;
}
+double Resource::getLoad()
+{
+ return constraint_->get_usage();
+}
+
Model* Resource::model() const
{
return model_;
/** @brief Check if the current Resource is used (if it currently serves an action) */
virtual bool isUsed()=0;
+ /** @brief returns the current load (in flops per second, byte per second or similar) */
+ virtual double getLoad();
+
/** @brief Check if the current Resource is active */
virtual bool isOn() const;
/** @brief Check if the current Resource is shut down */