From 34803ab5554b83e70a652800872a5de378e067c3 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 14 Dec 2017 17:05:26 +0100 Subject: [PATCH] this is actually an example of exec, no link to energy things --- examples/s4u/CMakeLists.txt | 10 +++++----- examples/s4u/README.doc | 15 +++++++-------- .../s4u-exec-dvfs.cpp} | 12 ++++++------ .../s4u-exec-dvfs.tesh} | 4 ++-- 4 files changed, 20 insertions(+), 21 deletions(-) rename examples/s4u/{energy-pstate/s4u-energy-pstate.cpp => exec-dvfs/s4u-exec-dvfs.cpp} (81%) rename examples/s4u/{energy-pstate/s4u-energy-pstate.tesh => exec-dvfs/s4u-exec-dvfs.tesh} (91%) diff --git a/examples/s4u/CMakeLists.txt b/examples/s4u/CMakeLists.txt index 78cbb5f7ed..a3fc8f10d6 100644 --- a/examples/s4u/CMakeLists.txt +++ b/examples/s4u/CMakeLists.txt @@ -2,8 +2,8 @@ foreach (example actor-create actor-daemon actor-join actor-kill actor-lifetime app-chainsend app-masterworker app-pingpong app-token-ring async-wait async-waitany async-waitall cloud-simple - energy-exec energy-link energy-pstate energy-ptask energy-vm - exec-async exec-basic exec-monitor exec-remote + energy-exec energy-link energy-ptask energy-vm + exec-async exec-basic exec-dvfs exec-monitor exec-remote io-file-system io-file-remote io-storage-raw mutex platform-properties plugin-hostload @@ -38,13 +38,13 @@ endforeach() set(examples_src ${examples_src} PARENT_SCOPE) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent.tesh ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/energy-pstate/s4u-energy-pstate.tesh ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime.tesh ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield.tesh ${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}/exec-basic/s4u-exec-basic.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/exec-dvfs/s4u-exec-dvfs.tesh PARENT_SCOPE) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml @@ -72,8 +72,8 @@ foreach(example actor-create actor-daemon actor-join actor-kill actor-lifetime a async-wait async-waitall async-waitany cloud-simple dht-chord - energy-exec energy-link energy-pstate energy-ptask energy-vm - exec-async exec-basic exec-monitor exec-remote + energy-exec energy-link energy-ptask energy-vm + exec-async exec-basic exec-dvfs exec-monitor exec-remote platform-properties plugin-hostload mutex io-file-system io-file-remote io-storage-raw replay-comm replay-storage) diff --git a/examples/s4u/README.doc b/examples/s4u/README.doc index 37eaa95c56..90bdfa8f2c 100644 --- a/examples/s4u/README.doc +++ b/examples/s4u/README.doc @@ -94,6 +94,12 @@ TODO: document here the examples about plugins @ref examples/s4u/exec-remote/s4u-exec-remote.cpp \n Before its start, you can change the host on which a given execution will occur. + - Using Pstates on a host + @ref examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp and + @ref examples/platforms/energy_platform.xml \n + Show how define a set of pstatesfor a host in the XML, and how the current + pstate can be accessed/changed with @ref simgrid::s4u::Host::getPstateSpeed and @ref simgrid::s4u::Host::setPstate. + TODO: add an example about parallel executions. @subsection s4u_ex_activity_io I/O (using disks and files) @@ -225,13 +231,6 @@ also the tesh files in the example directories for details. This example shows how to retrieve the amount of energy consumed by the CPU during computations, and the impact of the pstate. - - Using Pstates on a host - @ref examples/s4u/energy-pstate/s4u-energy-pstate.cpp and - @ref examples/platforms/energy_platform.xml \n - Show how define a set of pstates for a host and how the current - pstate can be accessed/changed with @ref simgrid::s4u::Host::getPstateSpeed and @ref simgrid::s4u::Host::setPstate. - See also the platform XML file for have a details on how to declare the CPU capacity for each pstate. - */ /** @@ -252,13 +251,13 @@ also the tesh files in the example directories for details. @example examples/s4u/async-waitany/s4u-async-waitany.cpp @example examples/s4u/exec-basic/s4u-exec-basic.cpp @example examples/s4u/exec-async/s4u-exec-async.cpp +@example examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp @example examples/s4u/exec-monitor/s4u-exec-monitor.cpp @example examples/s4u/exec-remote/s4u-exec-remote.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-exec/s4u-energy-exec.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 @example examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp diff --git a/examples/s4u/energy-pstate/s4u-energy-pstate.cpp b/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp similarity index 81% rename from examples/s4u/energy-pstate/s4u-energy-pstate.cpp rename to examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp index 621da2ca01..1e7ac7922a 100644 --- a/examples/s4u/energy-pstate/s4u-energy-pstate.cpp +++ b/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp @@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test"); static int dvfs(std::vector args) { double workload = 100E6; - sg_host_t host = simgrid::s4u::this_actor::getHost(); + sg_host_t host = simgrid::s4u::this_actor::getHost(); int nb = sg_host_get_nb_pstates(host); XBT_INFO("Count of Processor states=%d", nb); @@ -46,19 +46,19 @@ static int dvfs(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; xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ + e.loadPlatform(argv[1]); /* - Load the platform description */ - simgrid::s4u::Actor::createActor("dvfs_test", simgrid::s4u::Host::by_name("MyHost1"), dvfs, args); - simgrid::s4u::Actor::createActor("dvfs_test", simgrid::s4u::Host::by_name("MyHost2"), dvfs, args); + simgrid::s4u::Actor::createActor("dvfs_test", simgrid::s4u::Host::by_name("MyHost1"), dvfs, args); + simgrid::s4u::Actor::createActor("dvfs_test", simgrid::s4u::Host::by_name("MyHost2"), dvfs, args); - e.run(); + e.run(); XBT_INFO("Total simulation time: %e", e.getClock()); diff --git a/examples/s4u/energy-pstate/s4u-energy-pstate.tesh b/examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh similarity index 91% rename from examples/s4u/energy-pstate/s4u-energy-pstate.tesh rename to examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh index 75de0f9793..dd0fe02587 100644 --- a/examples/s4u/energy-pstate/s4u-energy-pstate.tesh +++ b/examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh @@ -2,7 +2,7 @@ p Testing the DVFS-related functions -$ ${bindir:=.}/s4u-energy-pstate$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ${bindir:=.}/s4u-exec-dvfs$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3 > [ 0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000 > [ 0.000000] (2:dvfs_test@MyHost2) Count of Processor states=3 @@ -21,7 +21,7 @@ $ ${bindir:=.}/s4u-energy-pstate$EXEEXT ${platfdir}/energy_platform.xml "--log=r > [ 6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000 > [ 6.000000] (0:maestro@) Total simulation time: 6.000000e+00 -$ ${bindir:=.}/s4u-energy-pstate$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ${bindir:=.}/s4u-exec-dvfs$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3 > [ 0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000 > [ 0.000000] (2:dvfs_test@MyHost2) Count of Processor states=3 -- 2.20.1