From f57bd040b9e90df49ab5ca95da8c32af696d62d6 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 9 Dec 2017 18:05:14 +0100 Subject: [PATCH] sort examples, improve doc --- examples/msg/CMakeLists.txt | 5 ++--- examples/s4u/CMakeLists.txt | 9 +++++---- examples/s4u/README.doc | 10 +++++----- .../s4u-exec-basic.cpp} | 2 +- .../s4u-exec-basic.tesh} | 2 +- teshsuite/msg/CMakeLists.txt | 2 ++ .../msg/task-priority/task-priority.c | 9 +++++---- .../msg/task-priority/task-priority.tesh | 0 .../msg/task-priority/task-priority_d.xml | 0 9 files changed, 21 insertions(+), 18 deletions(-) rename examples/s4u/{actor-execute/s4u-actor-execute.cpp => exec-basic/s4u-exec-basic.cpp} (98%) rename examples/s4u/{actor-execute/s4u-actor-execute.tesh => exec-basic/s4u-exec-basic.tesh} (63%) rename {examples => teshsuite}/msg/task-priority/task-priority.c (79%) rename {examples => teshsuite}/msg/task-priority/task-priority.tesh (100%) rename {examples => teshsuite}/msg/task-priority/task-priority_d.xml (100%) diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index d630d38f4f..e5af2d861f 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -2,7 +2,6 @@ foreach(x app-masterworker app-pingpong app-token-ring cloud-capping cloud-masterworker cloud-migration cloud-simple cloud-two-tasks dht-pastry energy-consumption energy-onoff energy-vm platform-failures - task-priority plugin-hostload process-create process-join synchro-semaphore trace-categories @@ -44,7 +43,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 task-priority) +foreach (file app-chainsend app-masterworker app-pingpong dht-kademlia dht-pastry) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/${file}/${file}_d.xml) endforeach() @@ -73,7 +72,7 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/a foreach(x app-chainsend app-masterworker app-pingpong app-token-ring cloud-capping cloud-masterworker cloud-migration cloud-simple - cloud-two-tasks dht-pastry dht-kademlia platform-failures task-priority + cloud-two-tasks dht-pastry dht-kademlia platform-failures energy-consumption energy-onoff energy-vm plugin-hostload process-create process-join diff --git a/examples/s4u/CMakeLists.txt b/examples/s4u/CMakeLists.txt index eda4aa1361..30c2570031 100644 --- a/examples/s4u/CMakeLists.txt +++ b/examples/s4u/CMakeLists.txt @@ -1,9 +1,10 @@ foreach (example actions-comm actions-storage - actor-create actor-daemon actor-execute actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield + actor-create actor-daemon actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield app-masterworker app-pingpong app-token-ring async-wait async-waitany async-waitall cloud-progress-monitor energy-link energy-pstate energy-ptask energy-vm + exec-basic execute-priority io-file-system io-file-remote io-storage-raw platform-properties plugin-hostload mutex) @@ -42,7 +43,7 @@ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait.tesh ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany.tesh ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/actor-execute/s4u-actor-execute.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/exec-basic/s4u-exec-basic.tesh PARENT_SCOPE) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm-split_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm_d.xml @@ -66,13 +67,13 @@ set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-a ${CMAKE_CURRENT_SOURCE_DIR}/README.doc PARENT_SCOPE) foreach(example actions-comm actions-storage - actor-create actor-daemon actor-execute actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield + actor-create actor-daemon actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield app-bittorrent app-masterworker app-pingpong app-token-ring async-wait async-waitall async-waitany cloud-progress-monitor dht-chord energy-link energy-pstate energy-ptask energy-vm - execute-priority + exec-basic execute-priority platform-properties plugin-hostload mutex io-file-system io-file-remote io-storage-raw) ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" diff --git a/examples/s4u/README.doc b/examples/s4u/README.doc index 8828fe5885..7b8089191c 100644 --- a/examples/s4u/README.doc +++ b/examples/s4u/README.doc @@ -69,7 +69,7 @@ TODO: document here the examples about plugins @subsection s4u_ex_activity_exec Executions (using the CPU) - Basic execution. - @ref examples/s4u/actor-execute/s4u-actor-execute.cpp \n + @ref examples/s4u/exec-basic/s4u-exec-basic.cpp \n The computations done in your program are not reported to the simulated world, unless you explicitely request the simulator to pause the actor until a given amount of flops gets computed on its simulated @@ -212,7 +212,6 @@ respective advantages, depending on what you want to model. @example examples/s4u/actor-create/s4u-actor-create.cpp @example examples/s4u/actor-create/s4u-actor-create_d.xml @example examples/s4u/actor-daemon/s4u-actor-daemon.cpp -@example examples/s4u/actor-execute/s4u-actor-execute.cpp @example examples/s4u/actor-join/s4u-actor-join.cpp @example examples/s4u/actor-kill/s4u-actor-kill.cpp @example examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp @@ -220,12 +219,13 @@ respective advantages, depending on what you want to model. @example examples/s4u/actor-migration/s4u-actor-migration.cpp @example examples/s4u/actor-suspend/s4u-actor-suspend.cpp @example examples/s4u/actor-yield/s4u-actor-yield.cpp -@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp -@example examples/s4u/app-masterworker/s4u-app-masterworker.cpp -@example examples/s4u/app-pingpong/s4u-app-pingpong.cpp @example examples/s4u/async-wait/s4u-async-wait.cpp @example examples/s4u/async-waitall/s4u-async-waitall.cpp @example examples/s4u/async-waitany/s4u-async-waitany.cpp +@example examples/s4u/exec-basic/s4u-exec-basic.cpp +@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp +@example examples/s4u/app-masterworker/s4u-app-masterworker.cpp +@example examples/s4u/app-pingpong/s4u-app-pingpong.cpp @example examples/s4u/energy-pstate/s4u-energy-pstate.cpp @example examples/s4u/io-file-system/s4u-io-file-system.cpp @example examples/s4u/io-file-remote/s4u-io-file-remote.cpp diff --git a/examples/s4u/actor-execute/s4u-actor-execute.cpp b/examples/s4u/exec-basic/s4u-exec-basic.cpp similarity index 98% rename from examples/s4u/actor-execute/s4u-actor-execute.cpp rename to examples/s4u/exec-basic/s4u-exec-basic.cpp index eb90bed16c..e69d444ab4 100644 --- a/examples/s4u/actor-execute/s4u-actor-execute.cpp +++ b/examples/s4u/exec-basic/s4u-exec-basic.cpp @@ -37,7 +37,7 @@ static int privileged(std::vector /*args*/) return 0; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); std::vector args; diff --git a/examples/s4u/actor-execute/s4u-actor-execute.tesh b/examples/s4u/exec-basic/s4u-exec-basic.tesh similarity index 63% rename from examples/s4u/actor-execute/s4u-actor-execute.tesh rename to examples/s4u/exec-basic/s4u-exec-basic.tesh index ba18fdef04..21f58675a0 100644 --- a/examples/s4u/actor-execute/s4u-actor-execute.tesh +++ b/examples/s4u/exec-basic/s4u-exec-basic.tesh @@ -1,6 +1,6 @@ #! ./tesh p Start remote processes -$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-execute$EXEEXT ${platfdir}/small_platform.xml +$ $SG_TEST_EXENV ${bindir:=.}/s4u-exec-basic$EXEEXT ${platfdir}/small_platform.xml > [Tremblay:privileged:(2) 0.001500] [s4u_test/INFO] Done. > [Tremblay:executor:(1) 0.002000] [s4u_test/INFO] Done. diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 513493db69..6d11ad4004 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -5,6 +5,7 @@ foreach(x actions-comm actions-storage process-daemon process-kill process-lifetime process-migration process-suspend process-yield energy-ptask energy-pstate platform-properties io-file io-raw-storage io-file-remote + task-priority trace_integration) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) @@ -56,6 +57,7 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti ${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}/task-priority/task-priority_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 ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.5-hbp1.5.xml diff --git a/examples/msg/task-priority/task-priority.c b/teshsuite/msg/task-priority/task-priority.c similarity index 79% rename from examples/msg/task-priority/task-priority.c rename to teshsuite/msg/task-priority/task-priority.c index a162ffe032..d8abdb66ff 100644 --- a/examples/msg/task-priority/task-priority.c +++ b/teshsuite/msg/task-priority/task-priority.c @@ -6,10 +6,10 @@ #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); -static int test(int argc, char *argv[]) +static int test(int argc, char* argv[]) { double computation_amount = xbt_str_parse_double(argv[1], "Invalid argument: %s"); - double priority = xbt_str_parse_double(argv[2], "Invalid argument: %s"); + double priority = xbt_str_parse_double(argv[2], "Invalid argument: %s"); XBT_INFO("Hello! Running a task of size %g with priority %g", computation_amount, priority); msg_task_t task = MSG_task_create("Task", computation_amount, 0.0, NULL); @@ -22,11 +22,12 @@ static int test(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]); MSG_function_register("test", test); diff --git a/examples/msg/task-priority/task-priority.tesh b/teshsuite/msg/task-priority/task-priority.tesh similarity index 100% rename from examples/msg/task-priority/task-priority.tesh rename to teshsuite/msg/task-priority/task-priority.tesh diff --git a/examples/msg/task-priority/task-priority_d.xml b/teshsuite/msg/task-priority/task-priority_d.xml similarity index 100% rename from examples/msg/task-priority/task-priority_d.xml rename to teshsuite/msg/task-priority/task-priority_d.xml -- 2.20.1