Cpu::~Cpu() = default;
+/** @brief The amount of flop per second that this CPU can compute at its current DVFS level */
double Cpu::getPstateSpeedCurrent()
{
return speed_.peak;
Action::setState(state);
onStateChange(this, previous);
}
+/** @brief returns a list of all CPUs that this action is using */
std::list<Cpu*> CpuAction::cpus() {
std::list<Cpu*> retlist;
lmm_system_t sys = getModel()->getMaxminSystem();
* Action *
**********/
- void NetworkAction::setState(Action::State state){
+ void NetworkAction::setState(Action::State state)
+ {
Action::setState(state);
s4u::Link::onCommunicationStateChange(this);
}
+ /** @brief returns a list of all Links that this action is using */
+ std::list<LinkImpl*> NetworkAction::links()
+ {
+ std::list<LinkImpl*> retlist;
+ lmm_system_t sys = getModel()->getMaxminSystem();
+ int llen = lmm_get_number_of_cnst_from_var(sys, getVariable());
+
+ for (int i = 0; i < llen; i++) {
+ /* Beware of composite actions: ptasks put links and cpus together */
+ // extra pb: we cannot dynamic_cast from void*...
+ Resource* resource = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(sys, getVariable(), i)));
+ LinkImpl* link = dynamic_cast<LinkImpl*>(resource);
+ if (link != nullptr)
+ retlist.push_back(link);
+ }
+
+ return retlist;
+ }
}
}
#include "src/surf/PropertyHolder.hpp"
#include "src/surf/surf_interface.hpp"
#include "xbt/base.h"
+#include <list>
#include <unordered_map>
/***********
: simgrid::surf::Action(model, cost, failed, var) {};
void setState(simgrid::surf::Action::State state) override;
+ std::list<LinkImpl*> links();
double latency_;
double latCurrent_;