From: Martin Quinson Date: Fri, 8 Feb 2019 11:11:33 +0000 (+0100) Subject: improve the doc of this example X-Git-Tag: v3_22~376^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/286a7ee5511ab5c253359bd3c4e923f77c8c35e9?hp=-c improve the doc of this example --- 286a7ee5511ab5c253359bd3c4e923f77c8c35e9 diff --git a/examples/s4u/platform-failures/s4u-platform-failures.cpp b/examples/s4u/platform-failures/s4u-platform-failures.cpp index facd5db2ca..e4cca6a80a 100644 --- a/examples/s4u/platform-failures/s4u-platform-failures.cpp +++ b/examples/s4u/platform-failures/s4u-platform-failures.cpp @@ -3,6 +3,19 @@ /* 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 example shows how to work with the state profile of an host or a link, + * specifying when the resource must be turned on or off. + * + * To set such a profile, the first way is to use a file in the XML, while the second is to use the programmatic + * interface. Once this profile is in place, the resource will automatically be turned on and off. + * + * The actors running on an host that is turned off will receive a simgrid::HostFailureException. Since we specified + * on_failure="RESTART" for each actors in the XML file, they will be automatically restarted when the host starts + * again. + * + * Communications using failed links will .. fail. + */ + #include "simgrid/s4u.hpp" #include "xbt/str.h" @@ -36,7 +49,7 @@ static int master(int argc, char* argv[]) } catch (xbt_ex& e) { if (e.category != network_error) xbt_die("Unexpected behavior"); - XBT_INFO("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!", mailbox->get_cname()); + XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname()); delete payload; } }