Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this is actually an example of exec, no link to energy things
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Dec 2017 16:05:26 +0000 (17:05 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Dec 2017 16:41:59 +0000 (17:41 +0100)
examples/s4u/CMakeLists.txt
examples/s4u/README.doc
examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp [moved from examples/s4u/energy-pstate/s4u-energy-pstate.cpp with 81% similarity]
examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh [moved from examples/s4u/energy-pstate/s4u-energy-pstate.tesh with 91% similarity]

index 78cbb5f..a3fc8f1 100644 (file)
@@ -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)
index 37eaa95..90bdfa8 100644 (file)
@@ -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.
 
+  - <b>Using Pstates on a host</b>
+    @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.
 
-  - <b>Using Pstates on a host</b>
-    @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
similarity index 81%
rename from examples/s4u/energy-pstate/s4u-energy-pstate.cpp
rename to examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp
index 621da2c..1e7ac79 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
 static int dvfs(std::vector<std::string> 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<std::string> args)
   return 0;
 }
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   simgrid::s4u::Engine e(&argc, argv);
   std::vector<std::string> 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());
 
@@ -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