From: Frederic Suter Date: Mon, 4 Dec 2017 22:14:54 +0000 (+0100) Subject: two more examples move to the dungeon X-Git-Tag: v3.18~166 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/10386701b4b7bbab3805268166269adc8c90e385?hp=-c two more examples move to the dungeon --- 10386701b4b7bbab3805268166269adc8c90e385 diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index cff91d92aa..8a1e439ebb 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -5,7 +5,7 @@ foreach(x app-masterworker app-pingpong app-token-ring io-file task-priority plugin-hostload process-create process-join - platform-properties process-startkilltime synchro-semaphore trace-categories + synchro-semaphore trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform trace-process-migration trace-host-user-variables) add_executable (${x} ${x}/${x}.c) @@ -44,8 +44,7 @@ foreach (file answer dht-kademlia node routing_table task) set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h) endforeach() -foreach (file app-chainsend app-masterworker app-pingpong dht-kademlia dht-pastry platform-properties - task-priority) +foreach (file app-chainsend app-masterworker app-pingpong dht-kademlia dht-pastry task-priority) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml) endforeach() @@ -70,11 +69,7 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/a ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/dogbone_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/onelink_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/two_clusters_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/baseline_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/kill_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_kill_d.xml PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/two_clusters_d.xml PARENT_SCOPE) foreach(x app-chainsend app-masterworker app-pingpong app-token-ring cloud-capping cloud-masterworker cloud-migration cloud-simple diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 40884fcc0a..ddb401bc00 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -2,8 +2,8 @@ foreach(x actions-comm actions-storage async-wait async-waitall async-waitany cloud-sharing get_sender host_on_off host_on_off_recv host_on_off_processes - process-daemon process-kill process-migration process-suspend process-yield - energy-ptask energy-pstate + process-daemon process-kill process-lifetime process-migration process-suspend process-yield + energy-ptask energy-pstate platform-properties io-raw-storage io-file-remote trace_integration) add_executable (${x} ${x}/${x}.c) @@ -50,6 +50,11 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/async-waitall_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/async-waitany_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/io-file-remote_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/platform_properties/platform-properties_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process-lifetime/baseline_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process-lifetime/kill_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process-lifetime/start_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process-lifetime/start_kill_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/process-yield/process-yield_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml @@ -72,9 +77,10 @@ foreach(x host_on_off host_on_off_processes host_on_off_recv get_sender task_destroy_cancel task_listen_from task_progress - process-daemon process-kill process-migration process-suspend process-yield + process-daemon process-kill process-lifetime process-migration process-suspend process-yield energy-ptask io-raw-storage io-file-remote + platform-properties trace_integration) ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms diff --git a/examples/msg/platform-properties/platform-properties.c b/teshsuite/msg/platform-properties/platform-properties.c similarity index 73% rename from examples/msg/platform-properties/platform-properties.c rename to teshsuite/msg/platform-properties/platform-properties.c index 515849849a..7a3dbeb20b 100644 --- a/examples/msg/platform-properties/platform-properties.c +++ b/teshsuite/msg/platform-properties/platform-properties.c @@ -7,19 +7,19 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Property test"); -static void test_host(const char*hostname) +static void test_host(const char* hostname) { - msg_host_t thehost = MSG_host_by_name(hostname); - xbt_dict_t props = MSG_host_get_properties(thehost); + msg_host_t thehost = MSG_host_by_name(hostname); + xbt_dict_t props = MSG_host_get_properties(thehost); xbt_dict_cursor_t cursor = NULL; - char *key; - char *data; - const char *noexist = "Unknown"; - const char *value; + char* key; + char* data; + const char* noexist = "Unknown"; + const char* value; char exist[] = "Hdd"; XBT_INFO("== Print the properties of the host '%s'", hostname); - xbt_dict_foreach(props, cursor, key, data) + xbt_dict_foreach (props, cursor, key, data) XBT_INFO(" Host property: '%s' -> '%s'", key, data); XBT_INFO("== Try to get a host property that does not exist"); @@ -47,24 +47,27 @@ static void test_host(const char*hostname) xbt_dict_free(&props); } -static int alice(int argc, char *argv[]) { /* Dump what we have on the current host */ +static int alice(int argc, char* argv[]) +{ /* Dump what we have on the current host */ test_host("host1"); return 0; } -static int carole(int argc, char *argv[]) {/* Dump what we have on a remote host */ +static int carole(int argc, char* argv[]) +{ /* Dump what we have on a remote host */ MSG_process_sleep(1); // Wait for alice to be done with its experiment test_host("host1"); return 0; } -static int david(int argc, char *argv[]) {/* Dump what we have on a remote host */ +static int david(int argc, char* argv[]) +{ /* Dump what we have on a remote host */ MSG_process_sleep(2); // Wait for alice and carole to be done with its experiment test_host("node-0.acme.org"); return 0; } -static int bob(int argc, char *argv[]) +static int bob(int argc, char* argv[]) { /* this host also tests the properties of the AS*/ msg_as_t root = MSG_zone_get_root(); @@ -74,15 +77,15 @@ static int bob(int argc, char *argv[]) XBT_INFO(" Process property: author -> %s", MSG_zone_get_property_value(root, "author")); /* Get the property list of current bob process */ - xbt_dict_t props = MSG_process_get_properties(MSG_process_self()); + xbt_dict_t props = MSG_process_get_properties(MSG_process_self()); xbt_dict_cursor_t cursor = NULL; - char *key; - char *data; - const char *noexist = "UnknownProcessProp"; - XBT_ATTRIB_UNUSED const char *value; + char* key; + char* data; + const char* noexist = "UnknownProcessProp"; + XBT_ATTRIB_UNUSED const char* value; XBT_INFO("== Print the properties of the process"); - xbt_dict_foreach(props, cursor, key, data) + xbt_dict_foreach (props, cursor, key, data) XBT_INFO(" Process property: %s -> %s", key, data); XBT_INFO("== Try to get a process property that does not exist"); @@ -94,14 +97,15 @@ static int bob(int argc, char *argv[]) return 0; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { unsigned int i; msg_host_t host; MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); MSG_function_register("alice", alice); MSG_function_register("bob", bob); @@ -113,14 +117,14 @@ int main(int argc, char *argv[]) XBT_INFO("There are %d hosts in the environment", MSG_get_host_number()); xbt_dynar_t hosts = MSG_hosts_as_dynar(); - xbt_dynar_foreach(hosts, i, host){ - XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host), MSG_host_get_speed(host)); + xbt_dynar_foreach (hosts, i, host) { + XBT_INFO("Host '%s' runs at %.0f flops/s", MSG_host_get_name(host), MSG_host_get_speed(host)); } xbt_dynar_free(&hosts); MSG_launch_application(argv[2]); - msg_error_t res = MSG_main(); + msg_error_t res = MSG_main(); - return res!=MSG_OK; + return res != MSG_OK; } diff --git a/examples/msg/platform-properties/platform-properties.tesh b/teshsuite/msg/platform-properties/platform-properties.tesh similarity index 96% rename from examples/msg/platform-properties/platform-properties.tesh rename to teshsuite/msg/platform-properties/platform-properties.tesh index 726b5521ad..079c43b836 100644 --- a/examples/msg/platform-properties/platform-properties.tesh +++ b/teshsuite/msg/platform-properties/platform-properties.tesh @@ -3,7 +3,7 @@ p Testing a MSG application with properties in the XML for Hosts, Links and Processes ! output sort 19 -$ $SG_TEST_EXENV ${bindir:=.}/platform-properties$EXEEXT ${platfdir}/prop.xml ${srcdir}/platform-properties_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/platform-properties$EXEEXT ${platfdir}/prop.xml ${srcdir:=.}/platform-properties_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:maestro@) There are 7 hosts in the environment > [ 0.000000] (0:maestro@) Host 'host1' runs at 1000000000 flops/s > [ 0.000000] (0:maestro@) Host 'host2' runs at 1000000000 flops/s diff --git a/examples/msg/platform-properties/platform-properties_d.xml b/teshsuite/msg/platform-properties/platform-properties_d.xml similarity index 100% rename from examples/msg/platform-properties/platform-properties_d.xml rename to teshsuite/msg/platform-properties/platform-properties_d.xml diff --git a/examples/msg/process-startkilltime/baseline_d.xml b/teshsuite/msg/process-lifetime/baseline_d.xml similarity index 100% rename from examples/msg/process-startkilltime/baseline_d.xml rename to teshsuite/msg/process-lifetime/baseline_d.xml diff --git a/examples/msg/process-startkilltime/kill_d.xml b/teshsuite/msg/process-lifetime/kill_d.xml similarity index 100% rename from examples/msg/process-startkilltime/kill_d.xml rename to teshsuite/msg/process-lifetime/kill_d.xml diff --git a/examples/msg/process-startkilltime/process-startkilltime.c b/teshsuite/msg/process-lifetime/process-lifetime.c similarity index 76% rename from examples/msg/process-startkilltime/process-startkilltime.c rename to teshsuite/msg/process-lifetime/process-lifetime.c index cb11383d88..5514c92996 100644 --- a/examples/msg/process-startkilltime/process-startkilltime.c +++ b/teshsuite/msg/process-lifetime/process-lifetime.c @@ -15,7 +15,7 @@ static int my_onexit(XBT_ATTRIB_UNUSED void* ignored1, XBT_ATTRIB_UNUSED void* i } /* Just sleep until termination */ -static int sleeper(int argc, char *argv[]) +static int sleeper(int argc, char* argv[]) { XBT_INFO("Hello! I go to sleep."); MSG_process_on_exit(my_onexit, NULL); @@ -25,15 +25,16 @@ static int sleeper(int argc, char *argv[]) return 0; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); - MSG_create_environment(argv[1]); /* - Load the platform description */ + MSG_create_environment(argv[1]); /* - Load the platform description */ MSG_function_register("sleeper", sleeper); - MSG_launch_application(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */ + MSG_launch_application(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */ msg_error_t res = MSG_main(); /* - Run the simulation */ XBT_INFO("Simulation time %g", MSG_get_clock()); diff --git a/examples/msg/process-startkilltime/process-startkilltime.tesh b/teshsuite/msg/process-lifetime/process-lifetime.tesh similarity index 85% rename from examples/msg/process-startkilltime/process-startkilltime.tesh rename to teshsuite/msg/process-lifetime/process-lifetime.tesh index fa4be4a292..3962690c50 100644 --- a/examples/msg/process-startkilltime/process-startkilltime.tesh +++ b/teshsuite/msg/process-lifetime/process-lifetime.tesh @@ -2,7 +2,7 @@ p Test0 Process without time -$ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${srcdir}/baseline_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster.xml ${srcdir:=.}/baseline_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:sleeper@node-0.acme.org) Hello! I go to sleep. > [ 10.000000] (1:sleeper@node-0.acme.org) Done sleeping. > [ 10.000000] (1:sleeper@node-0.acme.org) Exiting now (done sleeping or got killed). @@ -10,7 +10,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${sr p Test1 Process with start time -$ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${srcdir}/start_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster.xml ${srcdir:=.}/start_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:sleeper@node-0.acme.org) Hello! I go to sleep. > [ 1.000000] (2:sleeper@node-1.acme.org) Hello! I go to sleep. > [ 2.000000] (3:sleeper@node-2.acme.org) Hello! I go to sleep. @@ -34,7 +34,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${sr p Test1 Process with kill time ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${srcdir}/kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster.xml ${srcdir:=.}/kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:sleeper@node-1.acme.org) Hello! I go to sleep. > [ 0.000000] (2:sleeper@node-2.acme.org) Hello! I go to sleep. > [ 0.000000] (3:sleeper@node-3.acme.org) Hello! I go to sleep. @@ -47,7 +47,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${sr p Test2 Process with start and kill times ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/process-startkilltime ${platfdir}/cluster.xml ${srcdir}/start_kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster.xml ${srcdir:=.}/start_kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:sleeper@node-0.acme.org) Hello! I go to sleep. > [ 1.000000] (2:sleeper@node-1.acme.org) Hello! I go to sleep. > [ 2.000000] (3:sleeper@node-2.acme.org) Hello! I go to sleep. diff --git a/examples/msg/process-startkilltime/start_d.xml b/teshsuite/msg/process-lifetime/start_d.xml similarity index 100% rename from examples/msg/process-startkilltime/start_d.xml rename to teshsuite/msg/process-lifetime/start_d.xml diff --git a/examples/msg/process-startkilltime/start_kill_d.xml b/teshsuite/msg/process-lifetime/start_kill_d.xml similarity index 100% rename from examples/msg/process-startkilltime/start_kill_d.xml rename to teshsuite/msg/process-lifetime/start_kill_d.xml