From abb8cd6526f36e74ce4476e93aa588c03e78b11c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 23 Jan 2023 13:33:18 +0100 Subject: [PATCH] Cosmetics in examples' comments and description --- examples/README.rst | 4 ++-- examples/cpp/comm-failure/s4u-comm-failure.cpp | 4 ++-- examples/cpp/exec-failure/s4u-exec-failure.cpp | 13 +++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/README.rst b/examples/README.rst index cc3559548b..1412c501cb 100644 --- a/examples/README.rst +++ b/examples/README.rst @@ -456,7 +456,7 @@ The ``test_any()`` returns whether at least one activity of the set has complete Dealing with network failures ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This examples shows how to survive to network exceptions that occur when a link is turned off, or when the actor with whom +This examples shows how to survive to network exceptions that occurs when a link is turned off, or when the actor with whom you communicate fails because its host is turned off. In this case, any blocking operation such as ``put``, ``get`` or ``wait`` will raise an exception that you can catch and react to. See also :ref:`howto_churn`, :ref:`this example ` on how to attach a state profile to hosts and @@ -615,7 +615,7 @@ There is not much new compared to the above ptask example or the Dealing with host failures ^^^^^^^^^^^^^^^^^^^^^^^^^^ -This examples shows how to survive to host failure exceptions that occur when an host is turned off. The actor do not get notified when the host +This examples shows how to survive to host failure exceptions that occur when an host is turned off. The actors do not get notified when the host on which they run is turned off: they are just terminated in this case, and their ``on_exit()`` callback gets executed. For remote executions on failing hosts however, any blocking operation such as ``exec`` or ``wait`` will raise an exception that you can catch and react to. See also :ref:`howto_churn`, diff --git a/examples/cpp/comm-failure/s4u-comm-failure.cpp b/examples/cpp/comm-failure/s4u-comm-failure.cpp index d7fc941125..c278faca08 100644 --- a/examples/cpp/comm-failure/s4u-comm-failure.cpp +++ b/examples/cpp/comm-failure/s4u-comm-failure.cpp @@ -3,8 +3,8 @@ /* 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 react to a failed communication, which occures when a link is turned off. - * +/* This example shows how to react to a failed communication, which occurs when a link is turned off, + * or when the actor with whom you communicate fails because its host is turned off. */ #include diff --git a/examples/cpp/exec-failure/s4u-exec-failure.cpp b/examples/cpp/exec-failure/s4u-exec-failure.cpp index 1dd509a941..545b4f548b 100644 --- a/examples/cpp/exec-failure/s4u-exec-failure.cpp +++ b/examples/cpp/exec-failure/s4u-exec-failure.cpp @@ -3,16 +3,13 @@ /* 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 serialize a set of communications going through a link +/* This examples shows how to survive to host failure exceptions that occur when an host is turned off. * - * As for the other asynchronous examples, the sender initiates all the messages it wants to send and - * pack the resulting simgrid::s4u::CommPtr objects in a vector. - * At the same time, the receiver starts receiving all messages asynchronously. Without serialization, - * all messages would be received at the same timestamp in the receiver. + * The actors do not get notified when the host on which they run is turned off: they are just terminated + * in this case, and their ``on_exit()`` callback gets executed. * - * However, as they will be serialized in a link of the platform, the messages arrive 2 by 2. - * - * The sender then blocks until all ongoing communication terminate, using simgrid::s4u::Comm::wait_all() + * For remote executions on failing hosts however, any blocking operation such as ``exec`` or ``wait`` will + * raise an exception that you can catch and react to, as illustrated in this example. */ #include -- 2.20.1