*.exe
examples/msg/actions-mpi/actions-mpi
examples/msg/actions-storage/actions-storage
+examples/msg/async-wait/async-wait
+examples/msg/async-waitall/async-waitall
+examples/msg/async-waitany/async-waitany
examples/msg/bittorrent/bittorrent
examples/msg/bittorrent/bittorrent_platfgen
examples/msg/chainsend/chainsend
examples/msg/energy-ptask/energy-ptask
examples/msg/energy-vm/energy-vm
examples/msg/gtnets/gtnets
-examples/msg/icomms/peer
-examples/msg/icomms/peer2
-examples/msg/icomms/peer3
examples/msg/io/file
examples/msg/io/file_unlink
examples/msg/io/remote
-foreach(x actions-mpi actions-storage dht-chord dht-pastry
+foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany dht-chord dht-pastry
exception energy-consumption energy-onoff energy-pstate energy-ptask energy-vm
migration pmm priority properties sendrecv set-maestro suspend start_kill_time synchro token_ring)
add_executable (${x} ${x}/${x}.c)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-mpi/actions-mpi_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actions-mpi/actions-mpi_split_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/actions-storage_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait2_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait3_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait4_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/async-waitall_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/async-waitany_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/chord.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/chord10.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/pastry10.xml
${CMAKE_CURRENT_SOURCE_DIR}/start_kill_time/start_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/start_kill_time/start_kill_d.xml PARENT_SCOPE)
-foreach(x actions-mpi actions-storage dht-chord migration priority properties sendrecv suspend synchro start_kill_time
- token_ring)
+foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany dht-chord migration priority properties
+ sendrecv suspend synchro start_kill_time token_ring)
ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
endforeach()
ADD_TESH_FACTORIES(msg-set-maestro "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/set-maestro/set-maestro.tesh)
ADD_TESH(msg-pmm --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
+
# This one is not usable:
# ADD_TESH_FACTORIES(msg-exception "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/exception/exception.tesh)
/* 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. */
-#include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
+#include "simgrid/msg.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
*
* @section MSG_ex_icomms Asynchronous communications
*
- * There is several examples of asynchronous communications coming in
- * the archive. In addition to the fully documented example \ref
- * MSG_ex_asynchronous_communications, there is several other
- * examples in the archive:
+ * There is several examples of asynchronous communications coming in the archive. In addition to the fully documented
+ * example \ref MSG_ex_asynchronous_communications, there is several other examples in the archive:
*
* - <b>msg/icomms/peer.c</b>: basic example of async functions (@ref MSG_task_isend, @ref MSG_task_irecv, @ref MSG_comm_wait)
*/
static int sender(int argc, char *argv[])
{
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
- double task_comp_size = xbt_str_parse_double(argv[2], "Invalid compute size: %s");
+ double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
long receivers_count = xbt_str_parse_int(argv[4], "Invalid amount of receivers: %s");
double sleep_start_time = xbt_str_parse_double(argv[5], "Invalid sleep start time: %s");
XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time, sleep_test_time);
- msg_comm_t comm = NULL;
int i;
msg_task_t task = NULL;
+ msg_comm_t comm = NULL;
MSG_process_sleep(sleep_start_time);
for (i = 0; i < number_of_tasks; i++) {
char mailbox[256];
p Test1 MSG_comm_test() with Sleep_sender > Sleep_receiver
! output sort 19
-$ ./peer ${srcdir:=.}/../../platforms/small_platform_fatpipe.xml ${srcdir:=.}/deployment_peer01.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../msg/async-wait/async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
> [ 0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
> [ 1.000000] (2:receiver@Ruby) Wait to receive a task
p Test2 MSG_comm_test() with Sleep_sender < Sleep_receiver
! output sort 19
-$ ./peer ${srcdir:=.}/../../platforms/small_platform_fatpipe.xml ${srcdir:=.}/deployment_peer02.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../msg/async-wait/async-wait2_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
> [ 0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
> [ 1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
p Test1 MSG_comm_wait() with Sleep_sender > Sleep_receiver
! output sort 19
-$ ./peer ${srcdir:=.}/../../platforms/small_platform_fatpipe.xml ${srcdir:=.}/deployment_peer03.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../msg/async-wait/async-wait3_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
> [ 0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
> [ 1.000000] (2:receiver@Ruby) Wait to receive a task
p Test2 MSG_comm_wait() with Sleep_sender < Sleep_receiver
! output sort 19
-$ ./peer ${srcdir:=.}/../../platforms/small_platform_fatpipe.xml ${srcdir:=.}/deployment_peer04.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../msg/async-wait/async-wait4_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
> [ 0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
> [ 1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
> [ 6.543146] (1:sender@Tremblay) Goodbye now!
> [ 6.543146] (2:receiver@Ruby) Received "finalize"
> [ 6.543146] (2:receiver@Ruby) I'm done. See you!
-
-p Test1 MSG_comm_waitall() for sender
-
-! output sort 19
-$ ./peer2 ${srcdir:=.}/../../platforms/small_platform_fatpipe.xml ${srcdir:=.}/deployment_peer.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
-> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_1
-> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2
-> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 finalize
-> [ 10.000000] (2:receiver@Ruby) Wait to receive a task
-> [ 10.004022] (2:receiver@Ruby) Received "Task_0"
-> [ 10.004022] (2:receiver@Ruby) Processing "Task_0"
-> [ 10.513732] (2:receiver@Ruby) "Task_0" done
-> [ 10.513732] (2:receiver@Ruby) Wait to receive a task
-> [ 10.517753] (2:receiver@Ruby) Received "Task_1"
-> [ 10.517753] (2:receiver@Ruby) Processing "Task_1"
-> [ 11.027463] (2:receiver@Ruby) "Task_1" done
-> [ 11.027463] (2:receiver@Ruby) Wait to receive a task
-> [ 11.031485] (2:receiver@Ruby) Received "Task_2"
-> [ 11.031485] (2:receiver@Ruby) Processing "Task_2"
-> [ 11.541195] (2:receiver@Ruby) "Task_2" done
-> [ 11.541195] (2:receiver@Ruby) Wait to receive a task
-> [ 11.543146] (0:maestro@) Simulation time 11.5431
-> [ 11.543146] (1:sender@Tremblay) Goodbye now!
-> [ 11.543146] (2:receiver@Ruby) Received "finalize"
-> [ 11.543146] (2:receiver@Ruby) I'm done. See you!
char sprintf_buffer[256];
sprintf(mailbox, "receiver-%ld", i % receivers_count);
sprintf(sprintf_buffer, "Task_%d", i);
- task =
- MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
- NULL);
+ task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL);
comm[i] = MSG_task_isend(task, mailbox);
XBT_INFO("Send to receiver-%ld Task_%d", i % receivers_count, i);
}
task = MSG_task_create("finalize", 0, 0, 0);
comm[i + number_of_tasks] = MSG_task_isend(task, mailbox);
XBT_INFO("Send to receiver-%ld finalize", i % receivers_count);
-
}
+
/* Here we are waiting for the completion of all communications */
MSG_comm_waitall(comm, (number_of_tasks + receivers_count), -1);
for (i = 0; i < number_of_tasks + receivers_count; i++)
--- /dev/null
+#! ./tesh
+p Test1 MSG_comm_waitall() for sender
+
+! output sort 19
+$ $SG_TEST_EXENV ${bindir:=.}/async-waitall ${srcdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/../msg/async-waitall/async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 finalize
+> [ 10.000000] (2:receiver@Ruby) Wait to receive a task
+> [ 10.004022] (2:receiver@Ruby) Received "Task_0"
+> [ 10.004022] (2:receiver@Ruby) Processing "Task_0"
+> [ 10.513732] (2:receiver@Ruby) "Task_0" done
+> [ 10.513732] (2:receiver@Ruby) Wait to receive a task
+> [ 10.517753] (2:receiver@Ruby) Received "Task_1"
+> [ 10.517753] (2:receiver@Ruby) Processing "Task_1"
+> [ 11.027463] (2:receiver@Ruby) "Task_1" done
+> [ 11.027463] (2:receiver@Ruby) Wait to receive a task
+> [ 11.031485] (2:receiver@Ruby) Received "Task_2"
+> [ 11.031485] (2:receiver@Ruby) Processing "Task_2"
+> [ 11.541195] (2:receiver@Ruby) "Task_2" done
+> [ 11.541195] (2:receiver@Ruby) Wait to receive a task
+> [ 11.543146] (0:maestro@) Simulation time 11.5431
+> [ 11.543146] (1:sender@Tremblay) Goodbye now!
+> [ 11.543146] (2:receiver@Ruby) Received "finalize"
+> [ 11.543146] (2:receiver@Ruby) I'm done. See you!
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-/** @addtogroup MSG_examples
- *
- * - <b>msg/icomms/peer3.c</b>: demonstrates the @ref MSG_comm_waitany function
- */
-
static int sender(int argc, char *argv[])
{
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
sprintf(mailbox, "receiver-%ld", (i % receivers_count));
sprintf(sprintf_buffer, "Task_%d", i);
- task =
- MSG_task_create(sprintf_buffer, task_comp_size,
- task_comm_size / coef, NULL);
+ task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size / coef, NULL);
comm = MSG_task_isend(task, mailbox);
xbt_dynar_push_as(d, msg_comm_t, comm);
XBT_INFO("Send to receiver-%ld %s comm_size %f", i % receivers_count, sprintf_buffer, task_comm_size / coef);
--- /dev/null
+#! ./tesh
+
+p Testing the MSG_comm_waitany function
+
+! output sort 19
+$ $SG_TEST_EXENV ${bindir:=.}/async-waitany ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/async-waitany/async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0 comm_size 1000000.000000
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-1 Task_1 comm_size 1000000.000000
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2 comm_size 1000000.000000
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-1 Task_3 comm_size 1000000.000000
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-0 Task_4 comm_size 1000000.000000
+> [ 0.000000] (1:sender@Tremblay) Send to receiver-1 Task_5 comm_size 1000000.000000
+> [ 10.000000] (2:receiver@Fafard) Wait to receive task 0
+> [ 10.000000] (2:receiver@Fafard) Wait to receive task 1
+> [ 10.000000] (2:receiver@Fafard) Wait to receive task 2
+> [ 10.000000] (3:receiver@Jupiter) Wait to receive task 0
+> [ 10.000000] (3:receiver@Jupiter) Wait to receive task 1
+> [ 10.000000] (3:receiver@Jupiter) Wait to receive task 2
+> [ 10.423774] (2:receiver@Fafard) Processing "Task_4"
+> [ 10.469435] (3:receiver@Jupiter) Processing "Task_3"
+> [ 11.079116] (2:receiver@Fafard) "Task_4" done
+> [ 11.079116] (2:receiver@Fafard) Processing "Task_0"
+> [ 11.124778] (3:receiver@Jupiter) "Task_3" done
+> [ 11.124778] (3:receiver@Jupiter) Processing "Task_1"
+> [ 11.734459] (2:receiver@Fafard) "Task_0" done
+> [ 11.734459] (2:receiver@Fafard) Processing "Task_2"
+> [ 11.780120] (3:receiver@Jupiter) "Task_1" done
+> [ 11.780120] (3:receiver@Jupiter) Processing "Task_5"
+> [ 12.389801] (2:receiver@Fafard) "Task_2" done
+> [ 12.415509] (2:receiver@Fafard) I'm done. See you!
+> [ 12.435462] (3:receiver@Jupiter) "Task_5" done
+> [ 12.454477] (0:maestro@) Simulation time 12.4545
+> [ 12.454477] (1:sender@Tremblay) Goodbye now!
+> [ 12.454477] (3:receiver@Jupiter) I'm done. See you!
+++ /dev/null
-foreach (example peer peer2 peer3)
- add_executable (${example} ${example}.c)
- target_link_libraries(${example} simgrid)
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.c)
-endforeach()
-
-ADD_TESH_FACTORIES(msg-icomms "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-ADD_TEST(msg-icomms-waitany ${CMAKE_BINARY_DIR}/examples/msg/icomms/peer3 ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/deployment_peer05.xml)
-
-set(examples_src ${examples_src} PARENT_SCOPE)
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/peer.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer01.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer02.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer03.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer04.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/deployment_peer05.xml PARENT_SCOPE)
examples/msg/cloud/CMakeLists.txt
examples/msg/dht-kademlia/CMakeLists.txt
examples/msg/gtnets/CMakeLists.txt
- examples/msg/icomms/CMakeLists.txt
examples/msg/io/CMakeLists.txt
examples/msg/masterslave/CMakeLists.txt
examples/msg/mc/CMakeLists.txt