A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b947bf
)
Move hosts_ to ActivityImpl_ to allow tracking of detached comms by maestro
author
Fabien Chaix
<chaix@ics.forth.gr>
Tue, 17 May 2022 11:00:53 +0000
(14:00 +0300)
committer
Fabien Chaix
<chaix@ics.forth.gr>
Wed, 18 May 2022 14:32:27 +0000
(17:32 +0300)
include/simgrid/s4u/Comm.hpp
patch
|
blob
|
history
src/kernel/activity/ActivityImpl.hpp
patch
|
blob
|
history
src/kernel/activity/CommImpl.cpp
patch
|
blob
|
history
src/kernel/activity/ExecImpl.hpp
patch
|
blob
|
history
src/surf/HostImpl.cpp
patch
|
blob
|
history
diff --git
a/include/simgrid/s4u/Comm.hpp
b/include/simgrid/s4u/Comm.hpp
index
84b0cbb
..
0acc9d2
100644
(file)
--- a/
include/simgrid/s4u/Comm.hpp
+++ b/
include/simgrid/s4u/Comm.hpp
@@
-158,6
+158,8
@@
public:
return detach();
}
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). */
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). */
diff --git
a/src/kernel/activity/ActivityImpl.hpp
b/src/kernel/activity/ActivityImpl.hpp
index
68defdb
..
a5feea5
100644
(file)
--- a/
src/kernel/activity/ActivityImpl.hpp
+++ b/
src/kernel/activity/ActivityImpl.hpp
@@
-38,6
+38,10
@@
public:
resource::Action* surf_action_ = nullptr;
protected:
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
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
@@
-81,6
+85,8
@@
public:
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 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);
void register_simcall(actor::Simcall* simcall);
void unregister_simcall(actor::Simcall* simcall);
void handle_activity_waitany(actor::Simcall* simcall);
diff --git
a/src/kernel/activity/CommImpl.cpp
b/src/kernel/activity/CommImpl.cpp
index
0dc962a
..
67ef311
100644
(file)
--- a/
src/kernel/activity/CommImpl.cpp
+++ b/
src/kernel/activity/CommImpl.cpp
@@
-11,6
+11,7
@@
#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
#include <simgrid/simix.h>
#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"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/kernel/activity/MailboxImpl.hpp"
#include "src/kernel/actor/SimcallObserver.hpp"
@@
-61,13
+62,17
@@
CommImpl& CommImpl::set_type(CommImplType type)
CommImpl& CommImpl::set_source(s4u::Host* from)
{
CommImpl& CommImpl::set_source(s4u::Host* from)
{
+ xbt_assert( from_ == nullptr );
from_ = from;
from_ = from;
+ hosts_.push_back(from);
return *this;
}
CommImpl& CommImpl::set_destination(s4u::Host* to)
{
return *this;
}
CommImpl& CommImpl::set_destination(s4u::Host* to)
{
+ xbt_assert( to_ == nullptr );
to_ = to;
to_ = to;
+ hosts_.push_back(to_);
return *this;
}
return *this;
}
diff --git
a/src/kernel/activity/ExecImpl.hpp
b/src/kernel/activity/ExecImpl.hpp
index
079402b
..
a6c691b
100644
(file)
--- a/
src/kernel/activity/ExecImpl.hpp
+++ b/
src/kernel/activity/ExecImpl.hpp
@@
-18,7
+18,6
@@
class XBT_PUBLIC ExecImpl : public ActivityImpl_T<ExecImpl> {
nullptr, [](resource::Action* a) { a->unref(); }};
double sharing_penalty_ = 1.0;
double bound_ = 0.0;
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;
std::vector<double> flops_amounts_;
std::vector<double> bytes_amounts_;
int thread_count_ = 1;
diff --git
a/src/surf/HostImpl.cpp
b/src/surf/HostImpl.cpp
index
5e7d0da
..
4f39fab
100644
(file)
--- a/
src/surf/HostImpl.cpp
+++ b/
src/surf/HostImpl.cpp
@@
-95,12
+95,11
@@
void HostImpl::turn_off(const actor::ActorImpl* issuer)
issuer->kill(&actor);
}
for (const auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
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()) {
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);
}
}
}
}
}
}