A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git]
/
src
/
simix
/
ActorImpl.cpp
diff --git
a/src/simix/ActorImpl.cpp
b/src/simix/ActorImpl.cpp
index
e0a2043
..
2a664f4
100644
(file)
--- a/
src/simix/ActorImpl.cpp
+++ b/
src/simix/ActorImpl.cpp
@@
-79,7
+79,8
@@
ActorImplPtr ActorImpl::attach(std::string name, void* data, s4u::Host* host,
if (not host->is_on()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname());
if (not host->is_on()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname());
- return nullptr;
+ std::rethrow_exception(
+ std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.")));
}
ActorImpl* actor = new ActorImpl(xbt::string(name), host);
}
ActorImpl* actor = new ActorImpl(xbt::string(name), host);
@@
-163,7
+164,7
@@
void ActorImpl::exit()
// Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that
if (not host_->is_on())
// Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that
if (not host_->is_on())
- this->throw_exception(std::make_exception_ptr(
simgrid::kernel::context::StopRequest
("host failed")));
+ this->throw_exception(std::make_exception_ptr(
ForcefulKillException
("host failed")));
/* destroy the blocking synchro if any */
if (waiting_synchro != nullptr) {
/* destroy the blocking synchro if any */
if (waiting_synchro != nullptr) {
@@
-272,14
+273,15
@@
void ActorImpl::yield()
if (context_->iwannadie) {
XBT_DEBUG("Actor %s@%s is dead", get_cname(), host_->get_cname());
if (context_->iwannadie) {
XBT_DEBUG("Actor %s@%s is dead", get_cname(), host_->get_cname());
- // throw simgrid::kernel::context::
StopRequest
(); Does not seem to properly kill the actor
+ // throw simgrid::kernel::context::
ForcefulKillException
(); Does not seem to properly kill the actor
context_->stop();
THROW_IMPOSSIBLE;
}
if (suspended_) {
XBT_DEBUG("Hey! I'm suspended.");
context_->stop();
THROW_IMPOSSIBLE;
}
if (suspended_) {
XBT_DEBUG("Hey! I'm suspended.");
- xbt_assert(exception_ != nullptr, "Gasp! This exception may be lost by subsequent calls.");
+
+ xbt_assert(exception_ == nullptr, "Gasp! This exception may be lost by subsequent calls.");
suspended_ = false;
suspend(this);
}
suspended_ = false;
suspend(this);
}
@@
-342,7
+344,7
@@
activity::ActivityImplPtr ActorImpl::suspend(ActorImpl* issuer)
return nullptr;
} else {
return nullptr;
} else {
- return activity::ExecImplPtr(new activity::ExecImpl("suspend", "",
nullptr,
this->host_))->start(0.0, 1.0, 0.0);
+ return activity::ExecImplPtr(new activity::ExecImpl("suspend", "", this->host_))->start(0.0, 1.0, 0.0);
}
}
}
}
@@
-450,7
+452,8
@@
ActorImplPtr ActorImpl::create(std::string name, simix::ActorCode code, void* da
if (not host->is_on()) {
XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name.c_str(), host->get_cname());
if (not host->is_on()) {
XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name.c_str(), host->get_cname());
- return nullptr;
+ std::rethrow_exception(
+ std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot create actor on failed host.")));
}
ActorImpl* actor = new ActorImpl(simgrid::xbt::string(name), host);
}
ActorImpl* actor = new ActorImpl(simgrid::xbt::string(name), host);
@@
-686,7
+689,7
@@
void SIMIX_process_on_exit(smx_actor_t actor, int_f_pvoid_pvoid_t fun, void* dat
SIMIX_process_on_exit(actor, [fun](int a, void* b) { fun((void*)(intptr_t)a, b); }, data);
}
SIMIX_process_on_exit(actor, [fun](int a, void* b) { fun((void*)(intptr_t)a, b); }, data);
}
-void SIMIX_process_on_exit(smx_actor_t actor, std::function<void(
int
, void*)> fun, void* data)
+void SIMIX_process_on_exit(smx_actor_t actor, std::function<void(
bool
, void*)> fun, void* data)
{
xbt_assert(actor, "current process not found: are you in maestro context ?");
{
xbt_assert(actor, "current process not found: are you in maestro context ?");