set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/async-waitany_d.xml PARENT_SCOPE)
foreach(x async-waitany)
- ADD_TESH(tesh-c-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/c/${x}
- --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/c/${x}
- ${CMAKE_HOME_DIRECTORY}/teshsuite/c/${x}/${x}.tesh)
+ ADD_TESH(c-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/c/${x}
+ --cd ${CMAKE_HOME_DIRECTORY}/examples/c/${x}
+ ${CMAKE_HOME_DIRECTORY}/examples/c/${x}/${x}.tesh)
endforeach()
sg_mailbox_t* mboxes = malloc(sizeof(sg_mailbox_t) * receivers_count);
for (long i = 0; i < receivers_count; i++) {
char mailbox_name[80];
- snprintf(mailbox_name, 79, "receiver-%ld", (i));
+ snprintf(mailbox_name, 79, "receiver-%ld", i);
sg_mailbox_t mbox = sg_mailbox_by_name(mailbox_name);
mboxes[i] = mbox;
}
/* Start dispatching all messages to receivers, in a round robin fashion */
for (int i = 0; i < messages_count; i++) {
char msg_content[80];
- snprintf(msg_content, 79, "Message_%d", i);
+ snprintf(msg_content, 79, "Message %d", i);
sg_mailbox_t mbox = mboxes[i % receivers_count];
XBT_INFO("Send '%s' to '%s'", msg_content, sg_mailbox_get_name(mbox));
- sg_comm_t comm = sg_mailbox_put_async(mbox, xbt_strdup(msg_content), msg_size);
- pending_comms[pending_comms_count++] = comm;
+ /* Create a communication representing the ongoing communication, and store it in pending_comms */
+ pending_comms[pending_comms_count++] = sg_mailbox_put_async(mbox, xbt_strdup(msg_content), msg_size);
}
/* Start sending messages to let the workers know that they should stop */
for (int i = 0; i < receivers_count; i++) {
XBT_INFO("Send 'finalize' to 'receiver-%d'", i);
char* end_msg = xbt_strdup("finalize");
sg_mailbox_t mbox = mboxes[i % receivers_count];
- sg_comm_t comm = sg_mailbox_put_async(mbox, end_msg, 0);
- pending_comms[pending_comms_count++] = comm;
+ pending_comms[pending_comms_count++] = sg_mailbox_put_async(mbox, end_msg, 0);
}
XBT_INFO("Done dispatching all messages");
/* 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
+ // Copy the data we send: the 'msg_content' variable is not a stable storage location.
+ // It will be destroyed when this actor leaves the loop, ie before the receiver gets the data
std::string* payload = new std::string(msg_content);
XBT_INFO("Send '%s' to '%s'", msg_content.c_str(), mboxes[i % receivers_count]->get_cname());
> [ 0.210917] (2:receiver@Ruby) I got a 'Message 1'.
> [ 0.316375] (2:receiver@Ruby) I got a 'Message 2'.
> [ 0.318326] (2:receiver@Ruby) I got a 'finalize'.
-> [ 0.318326] (1:sender@Tremblay) Goodbye now!
\ No newline at end of file
+> [ 0.318326] (1:sender@Tremblay) Goodbye now!
/* 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.
+ // Copy the data we send: the 'msg_content' variable is not a stable storage location.
// It will be destroyed when this actor leaves the loop, ie before the receiver gets it
std::string* payload = new std::string(msg_content);
/* 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.
+ // Copy the data we send: the 'msg_content' variable is not a stable storage location.
// It will be destroyed when this actor leaves the loop, ie before the receiver gets it
std::string* payload = new std::string(msg_content);
# The list of cmake build directories is constructed from the following list.
# Add your CMakeLists file here to see your subdir built.
set(CMAKEFILES_TXT
+ examples/c/CMakeLists.txt
examples/s4u/CMakeLists.txt
examples/smpi/CMakeLists.txt
examples/smpi/NAS/CMakeLists.txt
examples/deprecated/msg/mc/CMakeLists.txt
examples/deprecated/simdag/CMakeLists.txt
- teshsuite/c/CMakeLists.txt
teshsuite/java/CMakeLists.txt
teshsuite/lua/CMakeLists.txt
teshsuite/mc/CMakeLists.txt