From: Martin Quinson Date: Sat, 2 Dec 2017 21:17:56 +0000 (+0100) Subject: integrate examples/s4u/energy-pstate + move the msg version away X-Git-Tag: v3.18~179 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/96b2e6ce54454beda93c9c934e9336f323482d56 integrate examples/s4u/energy-pstate + move the msg version away --- diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index b525bb8c22..9c6caf63ad 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -1,7 +1,7 @@ # C examples 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-pstate energy-vm platform-failures + dht-pastry energy-consumption energy-onoff energy-vm platform-failures io-file io-remote task-priority plugin-hostload process-create process-join @@ -79,7 +79,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 io-file io-remote task-priority - energy-consumption energy-onoff energy-pstate energy-vm + energy-consumption energy-onoff energy-vm plugin-hostload process-create process-join process-startkilltime platform-properties synchro-semaphore) diff --git a/examples/msg/README.doc b/examples/msg/README.doc index 00c8f32a2d..00970c1c18 100644 --- a/examples/msg/README.doc +++ b/examples/msg/README.doc @@ -50,12 +50,6 @@ documentation, but it should remain readable directly. You can specify a start time and a kill time in the deployment file. See all *_d.xml files in this directory. - - Using Pstates on a host - @ref examples/msg/energy-pstate/energy-pstate.c\n - Show how define a set of pstates for a host and how the current - pstate can be accessed/changed with @ref MSG_get_host_current_power_peak and @ref MSG_set_host_pstate. - See also the platform XML file for have a details on how to declare the CPU capacity for each pstate. - @section msg_ex_tracing Tracing and visualization features Tracing can be activated by various configuration options which diff --git a/examples/s4u/README.doc b/examples/s4u/README.doc index 5583e38df3..a19f8747af 100644 --- a/examples/s4u/README.doc +++ b/examples/s4u/README.doc @@ -102,7 +102,7 @@ documentation, but it should remain readable directly. Actors can move or be moved from a host to another with the @ref migrate method. - Using Pstates on a host - @ref examples/s4u/energy-pstate/s4u-energy-pstate.c\n + @ref examples/s4u/energy-pstate/s4u-energy-pstate.cpp\n Show how define a set of pstates for a host and how the current pstate can be accessed/changed with @ref getPstateSpeed and @ref sg_host_set_pstate. See also the platform XML file for have a details on how to declare the CPU capacity for each pstate. @@ -178,6 +178,7 @@ simulated storages. @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-remote/s4u-io-file-remote.cpp @example examples/s4u/io-raw-storage/s4u-io-raw-storage.cpp @example examples/s4u/mutex/s4u-mutex.cpp diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 7def179999..b9b2851b5a 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -1,9 +1,9 @@ # C examples 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 + 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-ptask energy-pstate io-raw-storage trace_integration) add_executable (${x} ${x}/${x}.c) @@ -67,6 +67,7 @@ foreach(x actions-comm actions-storage async-wait async-waitall async-waitany app-bittorrent + energy-pstate host_on_off host_on_off_processes host_on_off_recv get_sender task_destroy_cancel task_listen_from task_progress diff --git a/examples/msg/energy-pstate/energy-pstate.c b/teshsuite/msg/energy-pstate/energy-pstate.c similarity index 89% rename from examples/msg/energy-pstate/energy-pstate.c rename to teshsuite/msg/energy-pstate/energy-pstate.c index de0d0d1a22..7bb46d60e8 100644 --- a/examples/msg/energy-pstate/energy-pstate.c +++ b/teshsuite/msg/energy-pstate/energy-pstate.c @@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test"); -static int dvfs(int argc, char *argv[]) +static int dvfs(int argc, char* argv[]) { double workload = 100E6; msg_host_t host = MSG_host_self(); @@ -28,8 +28,8 @@ static int dvfs(int argc, char *argv[]) XBT_INFO("Current power peak=%f", current_peak); // Run a task - msg_task_t task1 = MSG_task_create ("t1", workload, 0, NULL); - MSG_task_execute (task1); + msg_task_t task1 = MSG_task_create("t1", workload, 0, NULL); + MSG_task_execute(task1); MSG_task_destroy(task1); double task_time = MSG_get_clock(); @@ -49,15 +49,15 @@ static int dvfs(int argc, char *argv[]) XBT_INFO("Current power peak=%f", current_peak); // Run a second task - task1 = MSG_task_create ("t1", workload, 0, NULL); - MSG_task_execute (task1); + task1 = MSG_task_create("t1", workload, 0, NULL); + MSG_task_execute(task1); MSG_task_destroy(task1); task_time = MSG_get_clock() - task_time; XBT_INFO("Task2 simulation time: %e", task_time); // Verify the default pstate is set to 0 - host = MSG_host_by_name("MyHost2"); + host = MSG_host_by_name("MyHost2"); int nb2 = MSG_host_get_nb_pstates(host); XBT_INFO("Count of Processor states=%d", nb2); @@ -66,7 +66,7 @@ static int dvfs(int argc, char *argv[]) return 0; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { MSG_init(&argc, argv); diff --git a/examples/msg/energy-pstate/energy-pstate.tesh b/teshsuite/msg/energy-pstate/energy-pstate.tesh similarity index 100% rename from examples/msg/energy-pstate/energy-pstate.tesh rename to teshsuite/msg/energy-pstate/energy-pstate.tesh