include examples/c/cloud-simple/cloud-simple.tesh
include examples/c/energy-exec/energy-exec.c
include examples/c/energy-exec/energy-exec.tesh
+include examples/c/exec-dvfs/exec-dvfs.c
+include examples/c/exec-dvfs/exec-dvfs.tesh
include examples/c/io-disk-raw/io-disk-raw.c
include examples/c/io-disk-raw/io-disk-raw.tesh
include examples/c/plugin-hostload/plugin-hostload.c
include teshsuite/msg/cloud-migration/cloud-migration.tesh
include teshsuite/msg/cloud-two-tasks/cloud-two-tasks.c
include teshsuite/msg/cloud-two-tasks/cloud-two-tasks.tesh
-include teshsuite/msg/energy-pstate/energy-pstate.c
-include teshsuite/msg/energy-pstate/energy-pstate.tesh
include teshsuite/msg/energy-ptask/energy-ptask.c
include teshsuite/msg/energy-ptask/energy-ptask.tesh
include teshsuite/msg/get_sender/get_sender.c
app-pingpong app-token-ring
async-waitall async-waitany
cloud-capping cloud-simple
+ exec-dvfs
energy-exec
io-disk-raw
plugin-hostload)
app-chainsend app-pingpong app-token-ring
async-waitall async-waitany
cloud-capping cloud-simple
+ exec-dvfs
energy-exec
io-disk-raw
plugin-hostload)
--- /dev/null
+/* Copyright (c) 2007-2020. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "simgrid/actor.h"
+#include "simgrid/engine.h"
+#include "simgrid/host.h"
+#include "xbt/asserts.h"
+#include "xbt/config.h"
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
+
+static void dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+{
+ sg_host_t host = sg_host_self();
+
+ int nb = sg_host_get_nb_pstates(host);
+ XBT_INFO("Count of Processor states=%d", nb);
+
+ double current_peak = sg_host_speed(host);
+ XBT_INFO("Current power peak=%f", current_peak);
+
+ sg_actor_self_execute(100E6);
+
+ double task_time = simgrid_get_clock();
+ XBT_INFO("Task1 simulation time: %e", task_time);
+
+ // Change power peak
+ int new_pstate = 2;
+ xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %d because it only provides %d pstates.",
+ sg_host_get_name(host), new_pstate, nb);
+
+ double peak_at = sg_host_get_pstate_speed(host, new_pstate);
+ XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_pstate);
+
+ sg_host_set_pstate(host, new_pstate);
+
+ current_peak = sg_host_speed(host);
+ XBT_INFO("Current power peak=%f", current_peak);
+
+ sg_actor_self_execute(100E6);
+
+ task_time = simgrid_get_clock() - task_time;
+ XBT_INFO("Task2 simulation time: %e", task_time);
+
+ // Verify the default pstate is set to 0
+ host = sg_host_by_name("MyHost2");
+ int nb2 = sg_host_get_nb_pstates(host);
+ XBT_INFO("Count of Processor states=%d", nb2);
+
+ double current_peak2 = sg_host_speed(host);
+ XBT_INFO("Current power peak=%f", current_peak2);
+}
+
+int main(int argc, char* argv[])
+{
+ simgrid_init(&argc, argv);
+
+ xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+
+ simgrid_load_platform(argv[1]);
+
+ sg_actor_t a1 = sg_actor_init("dvfs_test", sg_host_by_name("MyHost1"));
+ sg_actor_start(a1, dvfs, 0, NULL);
+
+ sg_actor_t a2 = sg_actor_init("dvfs_test", sg_host_by_name("MyHost2"));
+ sg_actor_start(a2, dvfs, 0, NULL);
+
+ simgrid_run();
+
+ XBT_INFO("Total simulation time: %e", simgrid_get_clock());
+
+ return 0;
+}
#!/usr/bin/env tesh
-p Testing the DVFS-related functions
-
-$ ${bindir:=.}/energy-pstate ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/exec-dvfs-c ${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
> [ 6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
> [ 6.000000] (0:maestro@) Total simulation time: 6.000000e+00
-$ ${bindir:=.}/energy-pstate ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
+$ ${bindir:=.}/exec-dvfs-c ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
> [ 0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
> [ 0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
cloud-migration cloud-two-tasks
get_sender host_on_off host_on_off_recv
process-lifetime
- energy-ptask energy-pstate platform-properties
+ energy-ptask platform-properties
io-file io-file-remote
task-priority
trace_integration)
async-wait
app-bittorrent
cloud-migration cloud-two-tasks
- energy-pstate
host_on_off host_on_off_processes host_on_off_recv
get_sender
task_destroy_cancel task_listen_from task_progress
+++ /dev/null
-/* Copyright (c) 2007-2020. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/msg.h"
-
-/** @addtogroup MSG_examples
- *
- * - <b>energy-pstate/energy-pstate.c</b> Shows how a set of pstates can be defined 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.
- * Make sure to read the platform XML file for details on how to declare the CPU capacity for each pstate.
- */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
-
-static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
-{
- double workload = 100E6;
- msg_host_t host = MSG_host_self();
-
- int nb = MSG_host_get_nb_pstates(host);
- XBT_INFO("Count of Processor states=%d", nb);
-
- double current_peak = MSG_host_get_speed(host);
- 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_destroy(task1);
-
- double task_time = MSG_get_clock();
- XBT_INFO("Task1 simulation time: %e", task_time);
-
- // Change power peak
- int new_pstate = 2;
- xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %d because it only provides %d pstates.",
- MSG_host_get_name(host), new_pstate, nb);
-
- double peak_at = MSG_host_get_power_peak_at(host, new_pstate);
- XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_pstate);
-
- MSG_host_set_pstate(host, new_pstate);
-
- current_peak = MSG_host_get_speed(host);
- XBT_INFO("Current power peak=%f", current_peak);
-
- // Run a second task
- 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");
- int nb2 = MSG_host_get_nb_pstates(host);
- XBT_INFO("Count of Processor states=%d", nb2);
-
- double current_peak2 = MSG_host_get_speed(host);
- XBT_INFO("Current power peak=%f", current_peak2);
- return 0;
-}
-
-int main(int argc, char* argv[])
-{
- MSG_init(&argc, argv);
-
- xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
-
- MSG_create_environment(argv[1]);
-
- MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost1"));
- MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost2"));
-
- msg_error_t res = MSG_main();
-
- XBT_INFO("Total simulation time: %e", MSG_get_clock());
-
- return res != MSG_OK;
-}