return detach();
}
+ Comm* abort_me();
+
Comm* wait_for(double timeout) override;
/*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
resource::Action* surf_action_ = nullptr;
protected:
+
+ std::vector<s4u::Host*> hosts_;
+
+
void inline set_name(std::string_view name)
{
// This is to keep name_ private while allowing ActivityImpl_T<??> to set it and then return a Ptr to qualified
virtual void finish() = 0; // Unlock all simcalls blocked on that activity, either because it was marked as done by
// the model or because it terminated without waiting for the model
+ virtual const std::vector<s4u::Host*>& get_hosts() const { return hosts_;} ;
+
void register_simcall(actor::Simcall* simcall);
void unregister_simcall(actor::Simcall* simcall);
void handle_activity_waitany(actor::Simcall* simcall);
#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
#include <simgrid/simix.h>
+#include "src/kernel/EngineImpl.hpp"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/kernel/activity/MailboxImpl.hpp"
#include "src/kernel/actor/SimcallObserver.hpp"
CommImpl& CommImpl::set_source(s4u::Host* from)
{
+ xbt_assert( from_ == nullptr );
from_ = from;
+ hosts_.push_back(from);
return *this;
}
CommImpl& CommImpl::set_destination(s4u::Host* to)
{
+ xbt_assert( to_ == nullptr );
to_ = to;
+ hosts_.push_back(to_);
return *this;
}
nullptr, [](resource::Action* a) { a->unref(); }};
double sharing_penalty_ = 1.0;
double bound_ = 0.0;
- std::vector<s4u::Host*> hosts_;
std::vector<double> flops_amounts_;
std::vector<double> bytes_amounts_;
int thread_count_ = 1;
issuer->kill(&actor);
}
for (const auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
- auto* exec = dynamic_cast<activity::ExecImpl*>(activity.get());
- if (exec != nullptr) {
- auto hosts = exec->get_hosts();
+ if (activity != nullptr) {
+ auto hosts = activity->get_hosts();
if (std::find(hosts.begin(), hosts.end(), &piface_) != hosts.end()) {
- exec->cancel();
- exec->set_state(activity::State::FAILED);
+ activity->cancel();
+ activity->set_state(activity::State::FAILED);
}
}
}