From: Martin Quinson Date: Mon, 20 Jun 2016 09:52:00 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_14~940 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5ae4444e56c58d6a957263114cff7d81ff48f6a8?hp=30cac4e5c6996acf95284c98b9f27f375d2c634e Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/examples/java/app/masterworker/masterworker.xml b/examples/java/app/masterworker/masterworker.xml index d3d4cd86ed..bff3dcd18e 100644 --- a/examples/java/app/masterworker/masterworker.xml +++ b/examples/java/app/masterworker/masterworker.xml @@ -2,10 +2,10 @@ - - - - + + + + diff --git a/examples/java/process/startkilltime/startkilltime.xml b/examples/java/process/startkilltime/startkilltime.xml index dd3e3c73e6..348226e547 100644 --- a/examples/java/process/startkilltime/startkilltime.xml +++ b/examples/java/process/startkilltime/startkilltime.xml @@ -1,10 +1,10 @@ - - - - - - + + + + + + diff --git a/examples/msg/async-wait/async-wait2_d.xml b/examples/msg/async-wait/async-wait2_d.xml index fe79729d36..6e731068cd 100644 --- a/examples/msg/async-wait/async-wait2_d.xml +++ b/examples/msg/async-wait/async-wait2_d.xml @@ -3,12 +3,12 @@ - - - - - - + + + + + + diff --git a/examples/msg/async-wait/async-wait3_d.xml b/examples/msg/async-wait/async-wait3_d.xml index 651a8f4ebc..27c1d209fb 100644 --- a/examples/msg/async-wait/async-wait3_d.xml +++ b/examples/msg/async-wait/async-wait3_d.xml @@ -3,12 +3,12 @@ - - - - - - + + + + + + diff --git a/examples/msg/async-wait/async-wait4_d.xml b/examples/msg/async-wait/async-wait4_d.xml index 22650e2357..939d62e426 100644 --- a/examples/msg/async-wait/async-wait4_d.xml +++ b/examples/msg/async-wait/async-wait4_d.xml @@ -3,12 +3,12 @@ - - - - - - + + + + + + diff --git a/examples/msg/async-wait/async-wait_d.xml b/examples/msg/async-wait/async-wait_d.xml index bb55c55fa3..f72618e9ce 100644 --- a/examples/msg/async-wait/async-wait_d.xml +++ b/examples/msg/async-wait/async-wait_d.xml @@ -3,12 +3,12 @@ - - - - - - + + + + + + diff --git a/examples/msg/network-ns3/3hosts_2links_d.xml b/examples/msg/network-ns3/3hosts_2links_d.xml index 661289ad11..a360912ef8 100644 --- a/examples/msg/network-ns3/3hosts_2links_d.xml +++ b/examples/msg/network-ns3/3hosts_2links_d.xml @@ -2,9 +2,9 @@ - - - + + + diff --git a/examples/msg/network-ns3/3links-timer_d.xml b/examples/msg/network-ns3/3links-timer_d.xml index e196248d3b..c9727c3a7b 100644 --- a/examples/msg/network-ns3/3links-timer_d.xml +++ b/examples/msg/network-ns3/3links-timer_d.xml @@ -2,33 +2,33 @@ - - - + + + - - - + + + - - - + + + - - - + + + diff --git a/examples/msg/network-ns3/3links_d.xml b/examples/msg/network-ns3/3links_d.xml index 37ea1f8694..9ae01af3ea 100644 --- a/examples/msg/network-ns3/3links_d.xml +++ b/examples/msg/network-ns3/3links_d.xml @@ -2,25 +2,25 @@ - - - + + + - - - + + + - - - + + + diff --git a/examples/msg/network-ns3/crosstraffic_d.xml b/examples/msg/network-ns3/crosstraffic_d.xml index 14efa4115c..91ce4790b8 100644 --- a/examples/msg/network-ns3/crosstraffic_d.xml +++ b/examples/msg/network-ns3/crosstraffic_d.xml @@ -2,33 +2,33 @@ - - - + + + - - - + + + - - - + + + - - - + + + diff --git a/examples/msg/network-ns3/dogbone_d.xml b/examples/msg/network-ns3/dogbone_d.xml index 803a4f8261..cf3068b693 100644 --- a/examples/msg/network-ns3/dogbone_d.xml +++ b/examples/msg/network-ns3/dogbone_d.xml @@ -2,19 +2,19 @@ - - - + + + - - - + + + - + - + diff --git a/examples/msg/network-ns3/one_cluster_d.xml b/examples/msg/network-ns3/one_cluster_d.xml index 9c3dd43837..9eab752e5f 100644 --- a/examples/msg/network-ns3/one_cluster_d.xml +++ b/examples/msg/network-ns3/one_cluster_d.xml @@ -2,9 +2,9 @@ - - - + + + diff --git a/examples/msg/network-ns3/onelink_d.xml b/examples/msg/network-ns3/onelink_d.xml index eaaafc6d3e..4bc51076f5 100644 --- a/examples/msg/network-ns3/onelink_d.xml +++ b/examples/msg/network-ns3/onelink_d.xml @@ -2,9 +2,9 @@ - - - + + + diff --git a/examples/msg/network-ns3/two_clusters_d.xml b/examples/msg/network-ns3/two_clusters_d.xml index 99f25838db..db540cbbf2 100644 --- a/examples/msg/network-ns3/two_clusters_d.xml +++ b/examples/msg/network-ns3/two_clusters_d.xml @@ -2,9 +2,9 @@ - - - + + + diff --git a/examples/msg/task-priority/task-priority_d.xml b/examples/msg/task-priority/task-priority_d.xml index dc50e150ee..3d8f51371b 100644 --- a/examples/msg/task-priority/task-priority_d.xml +++ b/examples/msg/task-priority/task-priority_d.xml @@ -1,6 +1,12 @@ - - + + + + + + + + diff --git a/examples/platforms/bypassASroute.xml b/examples/platforms/bypassASroute.xml index f53ca934ae..7bca96a90b 100644 --- a/examples/platforms/bypassASroute.xml +++ b/examples/platforms/bypassASroute.xml @@ -13,17 +13,17 @@ - + - + - + - + diff --git a/examples/platforms/cloud.xml b/examples/platforms/cloud.xml index f7c2710060..e2cc7a3f27 100644 --- a/examples/platforms/cloud.xml +++ b/examples/platforms/cloud.xml @@ -1,336 +1,335 @@ - - - + + + - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - + + + + + + + + - - - - - - + + + - - - - - - - - + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - + + - - - + + + - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/examples/platforms/cluster.xml b/examples/platforms/cluster.xml index a67462865a..c306524dfc 100644 --- a/examples/platforms/cluster.xml +++ b/examples/platforms/cluster.xml @@ -1,16 +1,16 @@ - + diff --git a/examples/platforms/cluster_and_one_host.xml b/examples/platforms/cluster_and_one_host.xml index 02d11d7354..fbdad7e8ad 100644 --- a/examples/platforms/cluster_and_one_host.xml +++ b/examples/platforms/cluster_and_one_host.xml @@ -1,7 +1,7 @@ - + @@ -11,6 +11,8 @@ - + + + diff --git a/examples/platforms/cluster_dragonfly.xml b/examples/platforms/cluster_dragonfly.xml index b192871ba7..a8d66d0ab1 100644 --- a/examples/platforms/cluster_dragonfly.xml +++ b/examples/platforms/cluster_dragonfly.xml @@ -1,8 +1,9 @@ - - - + + + diff --git a/examples/platforms/cluster_fat_tree.xml b/examples/platforms/cluster_fat_tree.xml index 7ab17e7a1a..83ff7d9250 100644 --- a/examples/platforms/cluster_fat_tree.xml +++ b/examples/platforms/cluster_fat_tree.xml @@ -1,14 +1,14 @@ - + - - - + + + diff --git a/examples/platforms/cluster_torus.xml b/examples/platforms/cluster_torus.xml index a0bec806d4..2f23afbf18 100644 --- a/examples/platforms/cluster_torus.xml +++ b/examples/platforms/cluster_torus.xml @@ -1,8 +1,8 @@ - - - + + + diff --git a/examples/platforms/config.xml b/examples/platforms/config.xml index 3aaca87d97..0f4508919f 100644 --- a/examples/platforms/config.xml +++ b/examples/platforms/config.xml @@ -18,6 +18,8 @@ - + + + diff --git a/examples/platforms/data_center.xml b/examples/platforms/data_center.xml index cb11537316..5f29e6ef89 100644 --- a/examples/platforms/data_center.xml +++ b/examples/platforms/data_center.xml @@ -1,58 +1,58 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + - - + + + + + + - - - - + + - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/examples/platforms/dogbone.xml b/examples/platforms/dogbone.xml index 2e9b2eb363..a09b39f8c8 100644 --- a/examples/platforms/dogbone.xml +++ b/examples/platforms/dogbone.xml @@ -1,28 +1,28 @@ - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/examples/platforms/small_platform_fatpipe.xml b/examples/platforms/small_platform_fatpipe.xml index c810aa9d8f..0ff24b4876 100644 --- a/examples/platforms/small_platform_fatpipe.xml +++ b/examples/platforms/small_platform_fatpipe.xml @@ -12,9 +12,17 @@ - - - - + + + + + + + + + + < + link_ctn id="4"/> + diff --git a/examples/platforms/storage/remote_io.xml b/examples/platforms/storage/remote_io.xml index e3acf90a51..3caa9db0e7 100644 --- a/examples/platforms/storage/remote_io.xml +++ b/examples/platforms/storage/remote_io.xml @@ -1,7 +1,9 @@ - + + + - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/examples/platforms/storage/storage.xml b/examples/platforms/storage/storage.xml index 84130500d3..6372351c88 100644 --- a/examples/platforms/storage/storage.xml +++ b/examples/platforms/storage/storage.xml @@ -1,21 +1,23 @@ - + + + - - - + + + - - - + + + @@ -35,12 +37,14 @@ - - + + - + + + diff --git a/examples/platforms/three_multicore_hosts.xml b/examples/platforms/three_multicore_hosts.xml index adbed975d8..cbc9f00ab1 100644 --- a/examples/platforms/three_multicore_hosts.xml +++ b/examples/platforms/three_multicore_hosts.xml @@ -8,8 +8,14 @@ - - - + + + + + + + + + diff --git a/examples/platforms/two_hosts_platform_with_availability_included.xml b/examples/platforms/two_hosts_platform_with_availability_included.xml index 6a9dd8a9aa..35b2f2edc2 100644 --- a/examples/platforms/two_hosts_platform_with_availability_included.xml +++ b/examples/platforms/two_hosts_platform_with_availability_included.xml @@ -1,29 +1,29 @@ - -0.0 1.0 -11.0 0.5 -20.0 0.9 - - -1.0 -1.0 -2.0 1.0 - - -0.0 1.0 -10.0 0.8 -20.0 0.4 - + + 0.0 1.0 + 11.0 0.5 + 20.0 0.9 + + + 1.0 -1.0 + 2.0 1.0 + + + 0.0 1.0 + 10.0 0.8 + 20.0 0.4 + - - - - - - + + + + + + - - - + + + diff --git a/examples/s4u/CMakeLists.txt b/examples/s4u/CMakeLists.txt index e90125ec7b..f710b29f41 100644 --- a/examples/s4u/CMakeLists.txt +++ b/examples/s4u/CMakeLists.txt @@ -13,4 +13,17 @@ set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/README PARENT_SCO ADD_TESH_FACTORIES(s4u-basic "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/basic --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/basic s4u_basic.tesh) ADD_TESH_FACTORIES(s4u-io "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/io --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/io s4u_io.tesh) -ADD_TESH_FACTORIES(s4u-mutex "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/mutex --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/mutex s4u_mutex.tesh) +ADD_TESH_FACTORIES(s4u-mutex "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/mutex --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/mutex s4u_mutex.tesh) + +foreach(x actions-comm) + add_executable (s4u_${x} ${x}/s4u_${x}.cpp) + target_link_libraries(s4u_${x} simgrid) + set_target_properties(s4u_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) + set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/s4u_${x}.cpp) + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/s4u_${x}.tesh) +endforeach() + + +foreach(x actions-comm) + ADD_TESH_FACTORIES(s4u-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/${x} s4u_${x}.tesh) +endforeach() diff --git a/examples/s4u/actions-comm/s4u_actions-comm.cpp b/examples/s4u/actions-comm/s4u_actions-comm.cpp new file mode 100644 index 0000000000..cc773519aa --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm.cpp @@ -0,0 +1,317 @@ +/* Copyright (c) 2009-2016. 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. */ + +#include "simgrid/msg.h" +#include "simgrid/simix.h" /* semaphores for the barrier */ +#include +#include "simgrid/s4u.h" + +XBT_LOG_NEW_DEFAULT_CATEGORY(actions, "Messages specific for this msg example"); +int communicator_size = 0; + +static void action_Isend(const char *const *action); + +typedef struct { + int last_Irecv_sender_id; + int bcast_counter; + xbt_dynar_t isends; /* of msg_comm_t */ + /* Used to implement irecv+wait */ + xbt_dynar_t irecvs; /* of msg_comm_t */ + xbt_dynar_t tasks; /* of msg_task_t */ +} s_process_globals_t, *process_globals_t; + +/* Helper function */ +static double parse_double(const char *string) +{ + double value; + char *endptr; + + value = strtod(string, &endptr); + if (*endptr != '\0') + THROWF(unknown_error, 0, "%s is not a double", string); + return value; +} + +#define ACT_DEBUG(...) \ + if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose)) { \ + char *NAME = xbt_str_join_array(action, " "); \ + XBT_DEBUG(__VA_ARGS__); \ + xbt_free(NAME); \ + } else ((void)0) + +static void log_action(const char *const *action, double date) +{ + if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose)) { + char *name = xbt_str_join_array(action, " "); + XBT_VERB("%s %f", name, date); + xbt_free(name); + } +} + +static void asynchronous_cleanup(void) +{ + process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self()); + + /* Destroy any isend which correspond to completed communications */ + int found; + msg_comm_t comm; + while ((found = MSG_comm_testany(globals->isends)) != -1) { + xbt_dynar_remove_at(globals->isends, found, &comm); + MSG_comm_destroy(comm); + } +} + +/* My actions */ +static void action_send(const char *const *action) +{ + char to[250]; + const char *size_str = action[3]; + double size = parse_double(size_str); + double clock = MSG_get_clock(); + + snprintf(to,249, "%s_%s", MSG_process_get_name(MSG_process_self()), action[2]); + + ACT_DEBUG("Entering Send: %s (size: %g)", NAME, size); + if (size < 65536) { + action_Isend(action); + } else { + MSG_task_send(MSG_task_create(to, 0, size, NULL), to); + } + + log_action(action, MSG_get_clock() - clock); + asynchronous_cleanup(); +} + +static void action_Isend(const char *const *action) +{ + char to[250]; + const char *size = action[3]; + double clock = MSG_get_clock(); + process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self()); + + snprintf(to,249, "%s_%s", MSG_process_get_name(MSG_process_self()), action[2]); + msg_comm_t comm = MSG_task_isend(MSG_task_create(to, 0, parse_double(size), NULL), to); + xbt_dynar_push(globals->isends, &comm); + + XBT_DEBUG("Isend on %s", MSG_process_get_name(MSG_process_self())); + log_action(action, MSG_get_clock() - clock); + asynchronous_cleanup(); +} + +static void action_recv(const char *const *action) +{ + char mailbox_name[250]; + msg_task_t task = NULL; + double clock = MSG_get_clock(); + + snprintf(mailbox_name,249, "%s_%s", action[2], MSG_process_get_name(MSG_process_self())); + + ACT_DEBUG("Receiving: %s", NAME); + msg_error_t res = MSG_task_receive(&task, mailbox_name); + log_action(action, MSG_get_clock() - clock); + + if (res == MSG_OK) { + MSG_task_destroy(task); + } + asynchronous_cleanup(); +} + +static void action_Irecv(const char *const *action) +{ + char mailbox[250]; + double clock = MSG_get_clock(); + process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self()); + + XBT_DEBUG("Irecv on %s", MSG_process_get_name(MSG_process_self())); + + snprintf(mailbox,249, "%s_%s", action[2], MSG_process_get_name(MSG_process_self())); + msg_task_t t = NULL; + xbt_dynar_push(globals->tasks, &t); + msg_comm_t c = MSG_task_irecv((msg_task**)xbt_dynar_get_ptr(globals->tasks, xbt_dynar_length(globals->tasks) - 1), mailbox); + xbt_dynar_push(globals->irecvs, &c); + + log_action(action, MSG_get_clock() - clock); + asynchronous_cleanup(); +} + +static void action_wait(const char *const *action) +{ + msg_task_t task = NULL; + msg_comm_t comm; + double clock = MSG_get_clock(); + process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self()); + + xbt_assert(xbt_dynar_length(globals->irecvs), "action wait not preceded by any irecv: %s", + xbt_str_join_array(action, " ")); + + ACT_DEBUG("Entering %s", NAME); + comm = xbt_dynar_pop_as(globals->irecvs, msg_comm_t); + MSG_comm_wait(comm, -1); + task = xbt_dynar_pop_as(globals->tasks, msg_task_t); + MSG_comm_destroy(comm); + MSG_task_destroy(task); + + log_action(action, MSG_get_clock() - clock); +} + +/* FIXME: that's a poor man's implementation: we should take the message exchanges into account */ +static void action_barrier(const char *const *action) +{ + // static smx_mutex_t mutex = NULL; + // static smx_cond_t cond = NULL; + static simgrid::s4u::Mutex *mutex = NULL; + static simgrid::s4u::ConditionVariable *cond = NULL; + static int processes_arrived_sofar = 0; + if (mutex == NULL) { // first arriving on the barrier + mutex = new simgrid::s4u::Mutex(); + cond = new simgrid::s4u::ConditionVariable(); + processes_arrived_sofar = 0; + } + ACT_DEBUG("Entering barrier: %s (%d already there)", NAME, processes_arrived_sofar); + mutex->lock(); + if (++processes_arrived_sofar == communicator_size) { + cond->notify_all(); + mutex->unlock(); + } else { + cond->wait(mutex); + mutex->unlock(); + } + + ACT_DEBUG("Exiting barrier: %s", NAME); + + processes_arrived_sofar--; + if (processes_arrived_sofar<=0) { + delete cond; + delete mutex; + mutex = NULL; + } +} + +static void action_bcast(const char *const *action) +{ + char mailbox[80]; + double comm_size = parse_double(action[2]); + msg_task_t task = NULL; + double clock = MSG_get_clock(); + + process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self()); + + xbt_assert(communicator_size, "Size of Communicator is not defined, can't use collective operations"); + + const char * process_name = MSG_process_get_name(MSG_process_self()); + + char *bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++); + + if (!strcmp(process_name, "p0")) { + XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name); + + msg_comm_t *comms = xbt_new0(msg_comm_t, communicator_size - 1); + + for (int i = 1; i < communicator_size; i++) { + snprintf(mailbox,79, "%s_p0_p%d", bcast_identifier, i); + comms[i - 1] = MSG_task_isend(MSG_task_create(mailbox, 0, comm_size, NULL), mailbox); + } + MSG_comm_waitall(comms, communicator_size - 1, -1); + for (int i = 1; i < communicator_size; i++) + MSG_comm_destroy(comms[i - 1]); + xbt_free(comms); + + XBT_DEBUG("%s: all messages sent by %s have been received", bcast_identifier, process_name); + } else { + snprintf(mailbox,79, "%s_p0_%s", bcast_identifier, process_name); + MSG_task_receive(&task, mailbox); + MSG_task_destroy(task); + XBT_DEBUG("%s: %s has received", bcast_identifier, process_name); + } + + log_action(action, MSG_get_clock() - clock); + xbt_free(bcast_identifier); +} + +static void action_comm_size(const char *const *action) +{ + const char *size = action[2]; + double clock = MSG_get_clock(); + + communicator_size = parse_double(size); + log_action(action, MSG_get_clock() - clock); +} + +static void action_compute(const char *const *action) +{ + const char *amount = action[2]; + msg_task_t task = MSG_task_create("task", parse_double(amount), 0, NULL); + double clock = MSG_get_clock(); + + ACT_DEBUG("Entering %s", NAME); + MSG_task_execute(task); + MSG_task_destroy(task); + log_action(action, MSG_get_clock() - clock); +} + +static void action_init(const char *const *action) +{ + XBT_DEBUG("Initialize the counters"); + process_globals_t globals = (process_globals_t) calloc(1, sizeof(s_process_globals_t)); + globals->isends = xbt_dynar_new(sizeof(msg_comm_t), NULL); + globals->irecvs = xbt_dynar_new(sizeof(msg_comm_t), NULL); + globals->tasks = xbt_dynar_new(sizeof(msg_task_t), NULL); + MSG_process_set_data(MSG_process_self(), globals); +} + +static void action_finalize(const char *const *action) +{ + process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self()); + if (globals) { + asynchronous_cleanup(); + xbt_dynar_free_container(&(globals->isends)); + xbt_dynar_free_container(&(globals->irecvs)); + xbt_dynar_free_container(&(globals->tasks)); + xbt_free(globals); + } +} + +int main(int argc, char *argv[]) +{ + msg_error_t res = MSG_OK; + + /* Check the given arguments */ + MSG_init(&argc, argv); + /* Explicit initialization of the action module is required now*/ + MSG_action_init(); + + xbt_assert(argc > 2, + "Usage: %s platform_file deployment_file [action_files]\n" + "\t# if all actions are in the same file\n" + "\tExample: %s msg_platform.xml msg_deployment.xml actions\n" + "\t# if actions are in separate files, specified in deployment\n" + "\tExample: %s msg_platform.xml msg_deployment.xml ", + argv[0],argv[0],argv[0]); + + MSG_create_environment(argv[1]); + MSG_launch_application(argv[2]); + + /* Action registration */ + xbt_replay_action_register("init", action_init); + xbt_replay_action_register("finalize", action_finalize); + xbt_replay_action_register("comm_size", action_comm_size); + xbt_replay_action_register("send", action_send); + xbt_replay_action_register("Isend", action_Isend); + xbt_replay_action_register("recv", action_recv); + xbt_replay_action_register("Irecv", action_Irecv); + xbt_replay_action_register("wait", action_wait); + xbt_replay_action_register("barrier", action_barrier); + xbt_replay_action_register("bcast", action_bcast); + xbt_replay_action_register("compute", action_compute); + + /* Actually do the simulation using MSG_action_trace_run */ + res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here + + XBT_INFO("Simulation time %g", MSG_get_clock()); + + MSG_action_exit(); /* Explicit finalization of the action module */ + + return res != MSG_OK; +} diff --git a/examples/s4u/actions-comm/s4u_actions-comm.tesh b/examples/s4u/actions-comm/s4u_actions-comm.tesh new file mode 100644 index 0000000000..c20573723d --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm.tesh @@ -0,0 +1,27 @@ +! output sort 19 +$ ${bindir:=.}/s4u_actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u_actions-comm_split_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 20.703314] (1:p0@Tremblay) p0 recv p1 20.703314 +> [ 20.703314] (2:p1@Ruby) p1 send p0 1e10 20.703314 +> [ 30.897513] (0:maestro@) Simulation time 30.8975 +> [ 30.897513] (1:p0@Tremblay) p0 compute 1e9 10.194200 +> [ 30.897513] (2:p1@Ruby) p1 compute 1e9 10.194200 + +! output sort 19 +$ ${bindir:=.}/s4u_actions-comm --log=actions.thres=verbose ${srcdir:=.}/small_platform_fatpipe.xml s4u_actions-comm_d.xml s4u_actions-comm.txt "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (1:p0@Tremblay) p0 comm_size 3 0.000000 +> [ 1.037020] (1:p0@Tremblay) p0 bcast 5e8 1.037020 +> [ 1.037020] (2:p1@Ruby) p1 bcast 5e8 1.037020 +> [ 1.037020] (3:p2@Perl) p2 bcast 5e8 1.037020 +> [ 1.082894] (1:p0@Tremblay) p0 compute 4.5E6 0.045874 +> [ 1.123670] (1:p0@Tremblay) p0 compute 4E6 0.040777 +> [ 1.149156] (1:p0@Tremblay) p0 compute 2.5E6 0.025485 +> [ 1.149156] (2:p1@Ruby) p1 Irecv p0 0.000000 +> [ 1.149156] (3:p2@Perl) p2 Irecv p1 0.000000 +> [ 3.221244] (1:p0@Tremblay) p0 send p1 1e9 2.072088 +> [ 6.246256] (3:p2@Perl) p2 compute 5e8 5.097100 +> [ 11.343355] (2:p1@Ruby) p1 compute 1e9 10.194200 +> [ 11.343355] (2:p1@Ruby) p1 wait 0.000000 +> [ 11.343355] (2:p1@Ruby) p1 Isend p2 1e9 0.000000 +> [ 13.415443] (0:maestro@) Simulation time 13.4154 +> [ 13.415443] (1:p0@Tremblay) p0 compute 1e9 10.194200 +> [ 13.415443] (3:p2@Perl) p2 wait 7.169187 diff --git a/examples/s4u/actions-comm/s4u_actions-comm.txt b/examples/s4u/actions-comm/s4u_actions-comm.txt new file mode 100644 index 0000000000..58c7e619fa --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm.txt @@ -0,0 +1,37 @@ +# sample action file +p0 init +p1 init +p2 init + +p0 comm_size 3 +p0 bcast 5e8 +p1 bcast 5e8 +p2 bcast 5e8 + +p0 compute 4.5E6 +p0 compute 4E6 +p0 compute 2.5E6 + +p0 barrier +p1 barrier +p2 barrier + +p0 send p1 1e9 +p0 compute 1e9 + +p1 Irecv p0 +p1 compute 1e9 +p1 wait +p1 Isend p2 1e9 + +p2 Irecv p1 +p2 compute 5e8 +p2 wait + +p0 barrier +p1 barrier +p2 barrier + +p0 finalize +p1 finalize +p2 finalize diff --git a/examples/s4u/actions-comm/s4u_actions-comm_d.xml b/examples/s4u/actions-comm/s4u_actions-comm_d.xml new file mode 100644 index 0000000000..8a5602edf7 --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm_d.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/examples/s4u/actions-comm/s4u_actions-comm_split_d.xml b/examples/s4u/actions-comm/s4u_actions-comm_split_d.xml new file mode 100644 index 0000000000..64fc192bd7 --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm_split_d.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/examples/s4u/actions-comm/s4u_actions-comm_split_p0.txt b/examples/s4u/actions-comm/s4u_actions-comm_split_p0.txt new file mode 100644 index 0000000000..dd16140f49 --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm_split_p0.txt @@ -0,0 +1,6 @@ +# sample action file (with only the actions for p0, to be launched by deployment file) +p0 init +p0 recv p1 +p0 compute 1e9 +p0 finalize + diff --git a/examples/s4u/actions-comm/s4u_actions-comm_split_p1.txt b/examples/s4u/actions-comm/s4u_actions-comm_split_p1.txt new file mode 100644 index 0000000000..d7e9dfecf5 --- /dev/null +++ b/examples/s4u/actions-comm/s4u_actions-comm_split_p1.txt @@ -0,0 +1,5 @@ +# sample action file (with only the actions for p1, to be launched by deployment file) +p1 init +p1 send p0 1e10 +p1 compute 1e9 +p1 finalize diff --git a/include/simgrid/s4u.h b/include/simgrid/s4u.h index dde320556b..63b75a8bc4 100644 --- a/include/simgrid/s4u.h +++ b/include/simgrid/s4u.h @@ -12,6 +12,7 @@ #include "s4u/host.hpp" #include "s4u/mutex.hpp" +#include "s4u/conditionVariable.hpp" #include "s4u/Activity.hpp" #include "s4u/comm.hpp" diff --git a/include/simgrid/s4u/conditionVariable.hpp b/include/simgrid/s4u/conditionVariable.hpp new file mode 100644 index 0000000000..f2790166a2 --- /dev/null +++ b/include/simgrid/s4u/conditionVariable.hpp @@ -0,0 +1,67 @@ +/* Copyright (c) 2006-2016. 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. */ + +#ifndef SIMGRID_S4U_COND_VARIABLE_HPP +#define SIMGRID_S4U_COND_VARIABLE_HPP + +#include // std::swap + +#include +#include + +namespace simgrid { +namespace s4u { + +class Mutex; + +XBT_PUBLIC_CLASS ConditionVariable { + +public: + ConditionVariable(); + + ConditionVariable(ConditionVariable* cond) : cond_(SIMIX_cond_ref(cond->cond_)) {} + ~ConditionVariable(); + + // Copy+move (with the copy-and-swap idiom): + ConditionVariable(ConditionVariable const& cond) : cond_(SIMIX_cond_ref(cond.cond_)) {} + friend void swap(ConditionVariable& first, ConditionVariable& second) + { + using std::swap; + swap(first.cond_, second.cond_); + } + ConditionVariable& operator=(ConditionVariable cond) + { + swap(*this, cond); + return *this; + } + ConditionVariable(ConditionVariable&& cond) : cond_(nullptr) + { + swap(*this, cond); + } + + bool valid() const + { + return cond_ != nullptr; + } + + /** + * Wait functions + */ + void wait(Mutex *mutex); + void wait_for(Mutex *mutex, double time); + + /** + * Notify functions + */ + void notify(); + void notify_all(); + +private: + smx_cond_t cond_; + +}; +}} // namespace simgrid::s4u + +#endif /* SIMGRID_S4U_COND_VARIABLE_HPP */ diff --git a/include/simgrid/s4u/mutex.hpp b/include/simgrid/s4u/mutex.hpp index 201f0710a9..75b7d09c03 100644 --- a/include/simgrid/s4u/mutex.hpp +++ b/include/simgrid/s4u/mutex.hpp @@ -11,12 +11,14 @@ #include #include #include "simgrid/simix.h" +#include namespace simgrid { namespace s4u { +class ConditionVariable; XBT_PUBLIC_CLASS Mutex { - +friend ConditionVariable; public: Mutex() : mutex_(simcall_mutex_init()) {} diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index ebd25982e8..9beaaf80c3 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -384,6 +384,7 @@ XBT_PUBLIC(void) simcall_mutex_unlock(smx_mutex_t mutex); XBT_PUBLIC(smx_cond_t) simcall_cond_init(void); XBT_PUBLIC(void) SIMIX_cond_unref(smx_cond_t cond); +XBT_PUBLIC(smx_cond_t) SIMIX_cond_ref(smx_cond_t cond); XBT_PUBLIC(void) simcall_cond_signal(smx_cond_t cond); XBT_PUBLIC(void) simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex); XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond, diff --git a/src/s4u/s4u_conditionVariable.cpp b/src/s4u/s4u_conditionVariable.cpp new file mode 100644 index 0000000000..60e336548e --- /dev/null +++ b/src/s4u/s4u_conditionVariable.cpp @@ -0,0 +1,36 @@ +#include "simgrid/s4u/conditionVariable.hpp" +#include "simgrid/simix.h" + +using namespace simgrid; + +s4u::ConditionVariable::ConditionVariable() : cond_(simcall_cond_init()){ + +} + +s4u::ConditionVariable::~ConditionVariable() { + SIMIX_cond_unref(cond_); +} + +/** + * Wait functions + */ +void s4u::ConditionVariable::wait(s4u::Mutex *mutex) { + simcall_cond_wait(cond_, mutex->mutex_); +} + +void s4u::ConditionVariable::wait_for(s4u::Mutex *mutex, double timeout) { + simcall_cond_wait_timeout(cond_, mutex->mutex_, timeout); +} + +/** + * Notify functions + */ +void s4u::ConditionVariable::notify() { + simcall_cond_signal(cond_); +} + +void s4u::ConditionVariable::notify_all() { + simcall_cond_broadcast(cond_); +} + + diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 95ff865b0f..2d20719e85 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -352,12 +352,13 @@ void SIMIX_cond_broadcast(smx_cond_t cond) XBT_OUT(); } -/** - * \brief Destroys a condition. - * - * Destroys and frees the condition's memory. - * \param cond A condition - */ +smx_cond_t SIMIX_cond_ref(smx_cond_t cond) +{ + if (cond != nullptr) + intrusive_ptr_add_ref(cond); + return cond; +} + void SIMIX_cond_unref(smx_cond_t cond) { XBT_IN("(%p)",cond); diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.h index 943e1adf1c..73f87c1867 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.h @@ -66,6 +66,8 @@ typedef struct s_smx_sem { xbt_swag_t sleeping; /* list of sleeping process */ } s_smx_sem_t; + + XBT_PRIVATE void SIMIX_post_synchro(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall); XBT_PRIVATE void SIMIX_synchro_destroy(smx_synchro_t synchro); @@ -74,12 +76,11 @@ XBT_PRIVATE void SIMIX_synchro_finish(smx_synchro_t synchro); XBT_PRIVATE smx_cond_t SIMIX_cond_init(void); XBT_PRIVATE void SIMIX_cond_broadcast(smx_cond_t cond); XBT_PRIVATE void SIMIX_cond_signal(smx_cond_t cond); +XBT_PRIVATE void intrusive_ptr_add_ref(s_smx_cond_t *cond); +XBT_PRIVATE void intrusive_ptr_release(s_smx_cond_t *cond); XBT_PRIVATE XBT_PRIVATE smx_sem_t SIMIX_sem_init(unsigned int value); XBT_PRIVATE void SIMIX_sem_release(smx_sem_t sem); XBT_PRIVATE int SIMIX_sem_would_block(smx_sem_t sem); XBT_PRIVATE int SIMIX_sem_get_capacity(smx_sem_t sem); - -XBT_PRIVATE void intrusive_ptr_release(s_smx_cond_t *cond); -XBT_PRIVATE void intrusive_ptr_add_ref(s_smx_cond_t *cond); #endif diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s0-c0s1.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s0-c0s1.xml index 2f4692a012..68c4ccc583 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s0-c0s1.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s0-c0s1.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s0-c1s0.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s0-c1s0.xml index f5f4a76ec3..d12fc7b598 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s0-c1s0.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s0-c1s0.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s1-c0s2.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s1-c0s2.xml index b02d52dd94..6ae2f4ed74 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s1-c0s2.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s1-c0s2.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s1-c2s2.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s1-c2s2.xml index a648155282..4c9a178f85 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s1-c2s2.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s1-c2s2.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s0.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s0.xml index 6ce00b5352..33087be338 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s0.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s0.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s1.xml b/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s1.xml index e045ffa847..028b9a1dd6 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s1.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s1.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c1s1-c1s2.xml b/teshsuite/msg/trace_integration/test-hbp1-c1s1-c1s2.xml index 4c2b0f2890..8beb1c23f3 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c1s1-c1s2.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c1s1-c1s2.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1-c1s1-c3s2.xml b/teshsuite/msg/trace_integration/test-hbp1-c1s1-c3s2.xml index 9b629187db..c412fe1028 100644 --- a/teshsuite/msg/trace_integration/test-hbp1-c1s1-c3s2.xml +++ b/teshsuite/msg/trace_integration/test-hbp1-c1s1-c3s2.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml b/teshsuite/msg/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml index 9254e10c5b..b4a9f57a41 100644 --- a/teshsuite/msg/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml +++ b/teshsuite/msg/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml @@ -2,15 +2,15 @@ - - + + - - + + - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml b/teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml index e359c4121d..504497c286 100644 --- a/teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml +++ b/teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml @@ -2,15 +2,15 @@ - - + + - - + + - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp1.5-hbp1.5.xml b/teshsuite/msg/trace_integration/test-hbp1.5-hbp1.5.xml index df5a68a9dc..aaa2f6cf53 100644 --- a/teshsuite/msg/trace_integration/test-hbp1.5-hbp1.5.xml +++ b/teshsuite/msg/trace_integration/test-hbp1.5-hbp1.5.xml @@ -2,11 +2,11 @@ - - + + - - + + diff --git a/teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml b/teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml index 89fffccc77..163924b2db 100644 --- a/teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml +++ b/teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml @@ -2,11 +2,11 @@ - - + + - - + + diff --git a/teshsuite/simdag/platforms/Dijkstra.xml b/teshsuite/simdag/platforms/Dijkstra.xml index 9504826ec8..3637af9695 100644 --- a/teshsuite/simdag/platforms/Dijkstra.xml +++ b/teshsuite/simdag/platforms/Dijkstra.xml @@ -1,26 +1,34 @@ - - - + + + - + - - - - - + + + + + - - + + + + + + - - + + + + + + - - - - + + + + diff --git a/teshsuite/simdag/platforms/bogus_disk_attachment.xml b/teshsuite/simdag/platforms/bogus_disk_attachment.xml index 60c146862f..d038fc1a4f 100644 --- a/teshsuite/simdag/platforms/bogus_disk_attachment.xml +++ b/teshsuite/simdag/platforms/bogus_disk_attachment.xml @@ -1,8 +1,8 @@ - + diff --git a/teshsuite/simdag/platforms/bogus_missing_dst_gateway.xml b/teshsuite/simdag/platforms/bogus_missing_dst_gateway.xml index e237a2dc8b..d297f04c3f 100644 --- a/teshsuite/simdag/platforms/bogus_missing_dst_gateway.xml +++ b/teshsuite/simdag/platforms/bogus_missing_dst_gateway.xml @@ -3,16 +3,16 @@ - + - + - + diff --git a/teshsuite/simdag/platforms/bogus_missing_src_gateway.xml b/teshsuite/simdag/platforms/bogus_missing_src_gateway.xml index 00d76f9a26..b935300e5e 100644 --- a/teshsuite/simdag/platforms/bogus_missing_src_gateway.xml +++ b/teshsuite/simdag/platforms/bogus_missing_src_gateway.xml @@ -3,16 +3,16 @@ - + - + - + diff --git a/teshsuite/simdag/platforms/bogus_two_hosts_asymetric.xml b/teshsuite/simdag/platforms/bogus_two_hosts_asymetric.xml index 2c88726dc5..ec5230632a 100644 --- a/teshsuite/simdag/platforms/bogus_two_hosts_asymetric.xml +++ b/teshsuite/simdag/platforms/bogus_two_hosts_asymetric.xml @@ -1,17 +1,21 @@ - + - - + + - - + + + + + + diff --git a/teshsuite/simdag/platforms/link_attributes.xml b/teshsuite/simdag/platforms/link_attributes.xml index ee944055c8..62bc33dcc8 100644 --- a/teshsuite/simdag/platforms/link_attributes.xml +++ b/teshsuite/simdag/platforms/link_attributes.xml @@ -1,12 +1,12 @@ - - + + - - - - - + + + + + diff --git a/teshsuite/simdag/platforms/one_cluster.xml b/teshsuite/simdag/platforms/one_cluster.xml index 49a4694c0b..29c7984a7b 100644 --- a/teshsuite/simdag/platforms/one_cluster.xml +++ b/teshsuite/simdag/platforms/one_cluster.xml @@ -1,8 +1,8 @@ - - - + + + diff --git a/teshsuite/simdag/platforms/one_cluster_fullduplex.xml b/teshsuite/simdag/platforms/one_cluster_fullduplex.xml index 543f7f7fdf..d998894386 100644 --- a/teshsuite/simdag/platforms/one_cluster_fullduplex.xml +++ b/teshsuite/simdag/platforms/one_cluster_fullduplex.xml @@ -1,8 +1,8 @@ - - - + + + diff --git a/teshsuite/simdag/platforms/one_cluster_multicore.xml b/teshsuite/simdag/platforms/one_cluster_multicore.xml index 589aa15f40..18de9474b3 100644 --- a/teshsuite/simdag/platforms/one_cluster_multicore.xml +++ b/teshsuite/simdag/platforms/one_cluster_multicore.xml @@ -1,8 +1,7 @@ - - - + + + diff --git a/teshsuite/simdag/platforms/one_cluster_router_id.xml b/teshsuite/simdag/platforms/one_cluster_router_id.xml index 5111016b42..3682739d33 100644 --- a/teshsuite/simdag/platforms/one_cluster_router_id.xml +++ b/teshsuite/simdag/platforms/one_cluster_router_id.xml @@ -1,8 +1,8 @@ - - - + + + diff --git a/teshsuite/simdag/platforms/platform_2p_1bb.xml b/teshsuite/simdag/platforms/platform_2p_1bb.xml index ef7632ae1a..d996cbcc84 100644 --- a/teshsuite/simdag/platforms/platform_2p_1bb.xml +++ b/teshsuite/simdag/platforms/platform_2p_1bb.xml @@ -10,6 +10,8 @@ - + + + diff --git a/teshsuite/simdag/platforms/platform_2p_1fl.xml b/teshsuite/simdag/platforms/platform_2p_1fl.xml index 84bf34da26..12d217454e 100644 --- a/teshsuite/simdag/platforms/platform_2p_1fl.xml +++ b/teshsuite/simdag/platforms/platform_2p_1fl.xml @@ -7,6 +7,8 @@ - + + + diff --git a/teshsuite/simdag/platforms/platform_2p_1sl.xml b/teshsuite/simdag/platforms/platform_2p_1sl.xml index 53e2f8aae2..ed3396e407 100644 --- a/teshsuite/simdag/platforms/platform_2p_1sl.xml +++ b/teshsuite/simdag/platforms/platform_2p_1sl.xml @@ -7,6 +7,8 @@ - + + + diff --git a/teshsuite/simdag/platforms/platform_2p_1sl_hetero.xml b/teshsuite/simdag/platforms/platform_2p_1sl_hetero.xml index 55805e5b32..c0d1e78340 100644 --- a/teshsuite/simdag/platforms/platform_2p_1sl_hetero.xml +++ b/teshsuite/simdag/platforms/platform_2p_1sl_hetero.xml @@ -7,6 +7,8 @@ - + + + diff --git a/teshsuite/simdag/platforms/platform_2p_1switch.xml b/teshsuite/simdag/platforms/platform_2p_1switch.xml index bd1e546d71..34286fc98d 100644 --- a/teshsuite/simdag/platforms/platform_2p_1switch.xml +++ b/teshsuite/simdag/platforms/platform_2p_1switch.xml @@ -9,6 +9,10 @@ - - - + + + + + + + diff --git a/teshsuite/simdag/platforms/platform_include.xml b/teshsuite/simdag/platforms/platform_include.xml index 1c172ee265..d73a133809 100644 --- a/teshsuite/simdag/platforms/platform_include.xml +++ b/teshsuite/simdag/platforms/platform_include.xml @@ -2,7 +2,7 @@ - - + + diff --git a/teshsuite/simdag/platforms/properties.xml b/teshsuite/simdag/platforms/properties.xml index a15bf7a113..28dfd08334 100644 --- a/teshsuite/simdag/platforms/properties.xml +++ b/teshsuite/simdag/platforms/properties.xml @@ -2,13 +2,13 @@ - - - - - + + + + + - + diff --git a/teshsuite/simdag/platforms/test_of_is_router.xml b/teshsuite/simdag/platforms/test_of_is_router.xml index 3f5d239c2a..70d10ce573 100644 --- a/teshsuite/simdag/platforms/test_of_is_router.xml +++ b/teshsuite/simdag/platforms/test_of_is_router.xml @@ -3,29 +3,29 @@ - - - + + + - - - + + + - - - + + + + + + + + + + + + + - - - - - - - - - - diff --git a/teshsuite/simdag/platforms/three_hosts_non_symmetric_route.xml b/teshsuite/simdag/platforms/three_hosts_non_symmetric_route.xml index e4e0706fd8..b37590cff3 100644 --- a/teshsuite/simdag/platforms/three_hosts_non_symmetric_route.xml +++ b/teshsuite/simdag/platforms/three_hosts_non_symmetric_route.xml @@ -10,9 +10,18 @@ - - - - + + + + + + + + + + + + + diff --git a/teshsuite/simdag/platforms/two_clusters.xml b/teshsuite/simdag/platforms/two_clusters.xml index 5fa2b2b325..d8b7464dcf 100644 --- a/teshsuite/simdag/platforms/two_clusters.xml +++ b/teshsuite/simdag/platforms/two_clusters.xml @@ -7,11 +7,11 @@ - + - - - + + + diff --git a/teshsuite/simdag/platforms/two_clusters_router_id.xml b/teshsuite/simdag/platforms/two_clusters_router_id.xml index 7c0e117883..bbaf0c9e74 100644 --- a/teshsuite/simdag/platforms/two_clusters_router_id.xml +++ b/teshsuite/simdag/platforms/two_clusters_router_id.xml @@ -2,18 +2,18 @@ - - + + - + - - - - - - + + + + + + diff --git a/teshsuite/simdag/platforms/two_hosts_multi_hop.xml b/teshsuite/simdag/platforms/two_hosts_multi_hop.xml index 5048e04023..15a3b024b3 100644 --- a/teshsuite/simdag/platforms/two_hosts_multi_hop.xml +++ b/teshsuite/simdag/platforms/two_hosts_multi_hop.xml @@ -9,6 +9,10 @@ - + + + + + diff --git a/teshsuite/simdag/platforms/two_hosts_one_link.xml b/teshsuite/simdag/platforms/two_hosts_one_link.xml index 6140f0ba91..56e7e4b174 100644 --- a/teshsuite/simdag/platforms/two_hosts_one_link.xml +++ b/teshsuite/simdag/platforms/two_hosts_one_link.xml @@ -7,6 +7,8 @@ - + + + diff --git a/teshsuite/simdag/platforms/two_hosts_one_link_fullduplex.xml b/teshsuite/simdag/platforms/two_hosts_one_link_fullduplex.xml index 25c944cce6..515fd537bc 100644 --- a/teshsuite/simdag/platforms/two_hosts_one_link_fullduplex.xml +++ b/teshsuite/simdag/platforms/two_hosts_one_link_fullduplex.xml @@ -7,7 +7,11 @@ - - + + + + + + diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 1e16c2e835..ec842ee3e2 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -384,6 +384,7 @@ set(S4U_SRC src/s4u/s4u_host.cpp src/s4u/s4u_mailbox.cpp src/s4u/s4u_mutex.cpp + src/s4u/s4u_conditionVariable.cpp src/s4u/s4u_storage.cpp ) @@ -650,6 +651,7 @@ set(headers_to_install include/simgrid/s4u/host.hpp include/simgrid/s4u/mailbox.hpp include/simgrid/s4u/mutex.hpp + include/simgrid/s4u/conditionVariable.hpp include/simgrid/s4u/storage.hpp include/simgrid/s4u.h include/simgrid/plugins/energy.h