- #include "simgrid/s4u.hpp"
- #include "xbt/str.h"
- #include <cstdlib>
- #include <iostream>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_wait, "Messages specific for this s4u example");
-
-/* Main function of the Sender process */
-class sender {
- long messages_count;
- long receivers_count;
- double sleep_start_time; /* - start time */
- double sleep_test_time; /* - test time */
- double msg_size;
- simgrid::s4u::MailboxPtr mbox;
-
-public:
- explicit sender(std::vector<std::string> args)
-{
- xbt_assert(args.size() == 7, "The sender function expects 6 arguments from the XML deployment file");
- messages_count = std::stol(args[1]); /* - number of tasks */
- msg_size = std::stod(args[2]); /* - computational cost */
- double task_comm_size = std::stod(args[3]); /* - communication cost */
- receivers_count = std::stol(args[4]); /* - number of receivers */
- double sleep_start_time = std::stod(args[5]); /* - start time */
- double sleep_test_time = std::stod(args[6]); /* - test time */
- XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time, sleep_test_time);
-}
-void operator()()
+/* This example shows how to use simgrid::s4u::this_actor::wait() to wait for a given communication.
+ *
+ * As for the other asynchronous examples, the sender initiate all the messages it wants to send and
+ * pack the resulting simgrid::s4u::CommPtr objects in a vector. All messages thus occurs concurrently.
+ *
+ * The sender then loops until there is no ongoing communication.
+ */
+
+#include "simgrid/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_wait, "Messages specific for this s4u example");
+
+static int sender(int argc, char** argv)