Throw a HostFailureException when one tries to create (or attach) an
actor an a host that is not on.
If this happens during the parsing of the deployment file, just let it
go.
for MSG, we could die if this happens (we don't for now)
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
+> [ 0.000000] (0:maestro@) Deployment include some initially turned off Hosts, nevermind.
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.010309] (1:master@Tremblay) Send to worker-0 completed
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.010309] (1:master@Tremblay) Send to worker-0 completed
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
+> [ 0.000000] (0:maestro@) Deployment include some initially turned off Hosts, nevermind.
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.000000] (2:worker@Tremblay) Waiting a message on worker-0
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.000000] (2:worker@Tremblay) Waiting a message on worker-0
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
+> [ 0.000000] (0:maestro@) Deployment include some initially turned off Hosts, nevermind.
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.010309] (1:master@Tremblay) Send to worker-0 completed
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.010309] (1:master@Tremblay) Send to worker-0 completed
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
! output sort 19
$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
> [ 0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
+> [ 0.000000] (0:maestro@) Deployment include some initially turned off Hosts, nevermind.
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.000000] (2:worker@Tremblay) Waiting a message on worker-0
> [ 0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
> [ 0.000000] (1:master@Tremblay) Send a message to worker-0
> [ 0.000000] (2:worker@Tremblay) Waiting a message on worker-0
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "msg_private.hpp"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "msg_private.hpp"
+#include "simgrid/Exception.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/instr/instr_private.hpp"
#include "src/simix/ActorImpl.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/instr/instr_private.hpp"
#include "src/simix/ActorImpl.hpp"
xbt_dict_free(&properties);
smx_actor_t self = SIMIX_process_self();
xbt_dict_free(&properties);
smx_actor_t self = SIMIX_process_self();
- smx_actor_t process = simgrid::simix::simcall([name, function, data, host, &props, self] {
- return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(function), data, host, &props, self)
- .get();
- });
+ smx_actor_t actor = nullptr;
+ try {
+ actor = simgrid::simix::simcall([name, function, data, host, &props, self] {
+ return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(function), data, host, &props, self)
+ .get();
+ });
+ } catch (simgrid::HostFailureException const&) {
+ XBT_DEBUG("The warning has already been issued. Do nothing more than catching the exception.");
+ }
for (int i = 0; i != argc; ++i)
xbt_free(argv[i]);
xbt_free(argv);
for (int i = 0; i != argc; ++i)
xbt_free(argv[i]);
xbt_free(argv);
- if (process == nullptr)
return nullptr;
MSG_process_yield();
return nullptr;
MSG_process_yield();
- return process->ciface();
+ return actor->ciface();
}
/** @brief Returns the user data of a process.
}
/** @brief Returns the user data of a process.
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/Exception.hpp"
#include "simgrid/actor.h"
#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Exec.hpp"
#include "simgrid/actor.h"
#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Exec.hpp"
xbt_dict_free(&properties);
/* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
xbt_dict_free(&properties);
/* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
- smx_actor_t actor = simgrid::kernel::actor::ActorImpl::attach(name, data, host, &props).get();
- if (not actor)
+ smx_actor_t actor = nullptr;
+ try {
+ actor = simgrid::kernel::actor::ActorImpl::attach(name, data, host, &props).get();
+ } catch (simgrid::HostFailureException const&) {
xbt_die("Could not attach");
xbt_die("Could not attach");
simgrid::s4u::this_actor::yield();
return actor->ciface();
}
simgrid::s4u::this_actor::yield();
return actor->ciface();
}
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());
+ std::rethrow_exception(
+ std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.")));
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());
+ std::rethrow_exception(
+ std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot create actor on failed host.")));
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/Exception.hpp"
#include "simgrid/kernel/routing/ClusterZone.hpp"
#include "simgrid/kernel/routing/DijkstraZone.hpp"
#include "simgrid/kernel/routing/DragonflyZone.hpp"
#include "simgrid/kernel/routing/ClusterZone.hpp"
#include "simgrid/kernel/routing/DijkstraZone.hpp"
#include "simgrid/kernel/routing/DragonflyZone.hpp"
} else { // start_time <= SIMIX_get_clock()
XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->get_cname());
} else { // start_time <= SIMIX_get_clock()
XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->get_cname());
- simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create(
- arg->name.c_str(), std::move(code), nullptr, host, arg->properties.get(), nullptr);
-
+ simgrid::kernel::actor::ActorImplPtr actor = nullptr;
+ try {
+ actor = simgrid::kernel::actor::ActorImpl::create(arg->name.c_str(), std::move(code), nullptr, host,
+ arg->properties.get(), nullptr);
+ } catch (simgrid::HostFailureException const&) {
+ XBT_WARN("Deployment include some initially turned off Hosts, nevermind.");
+ }
/* The actor creation will fail if the host is currently dead, but that's fine */
if (actor != nullptr) {
if (arg->kill_time >= 0)
/* The actor creation will fail if the host is currently dead, but that's fine */
if (actor != nullptr) {
if (arg->kill_time >= 0)