-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */
/* 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. */
/* Start dispatching all messages to receivers, in a round robin fashion */
for (int i = 0; i < messages_count; i++) {
-
std::string msg_content = std::string("Message ") + std::to_string(i);
// Copy the data we send: 'msg_content' is not a stable storage location.
// It will be destroyed when this actor leaves the loop, ie before the receiver gets it
pending_comms.push_back(comm);
}
- /* Start sending messages to let the workers know that they should stop */ // sphinx-doc: send-begin
+ /* Start sending messages to let the workers know that they should stop */ // sphinx-doc: put-begin
for (int i = 0; i < receivers_count; i++) {
XBT_INFO("Send 'finalize' to 'receiver-%d'", i);
simgrid::s4u::CommPtr comm = mboxes[i]->put_async(new std::string("finalize"), 0);
/* Now that all message exchanges were initiated, wait for their completion in one single call */
simgrid::s4u::Comm::wait_all(&pending_comms);
- // sphinx-doc: send-end
+ // sphinx-doc: put-end
XBT_INFO("Goodbye now!");
}