1 /* Copyright (c) 2013. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simgrid/simix.h"
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_dvfs, smpi,
12 "Logging specific to SMPI (experimental DVFS support)");
14 XBT_PUBLIC(double) smpi_get_host_power_peak_at_(int *pstate_index);
15 XBT_PUBLIC(void) smpi_set_host_power_peak_at_(int *pstate_index);
18 * \brief Return the speed of the processor (in flop/s) at a given pstate
20 * \param pstate_index pstate to test
21 * \return Returns the processor speed associated with pstate_index
23 double smpi_get_host_power_peak_at(int pstate_index)
25 return simcall_host_get_power_peak_at(SIMIX_host_self(), pstate_index);
28 double smpi_get_host_power_peak_at_(int *pstate_index)
30 return smpi_get_host_power_peak_at(*pstate_index);
34 * \brief Return the current speed of the processor (in flop/s)
36 * \return Returns the current processor speed
38 double smpi_get_host_current_power_peak_(void)
40 return simcall_host_get_current_power_peak(SIMIX_host_self());
44 * \brief Return the number of pstates defined for host
46 int smpi_get_host_nb_pstates_(void)
48 return simcall_host_get_nb_pstates(SIMIX_host_self());
52 * \brief Sets the speed of the processor (in flop/s) at a given pstate
54 * \param pstate_index pstate to switch to
56 void smpi_set_host_power_peak_at(int pstate_index)
58 simcall_host_set_power_peak_at(SIMIX_host_self(), pstate_index);
61 void smpi_set_host_power_peak_at_(int *pstate_index)
63 smpi_set_host_power_peak_at(*pstate_index);
67 * \brief Return the total energy consumed by a host (in Joules)
69 * \return Returns the consumed energy
71 double smpi_get_host_consumed_energy_(void)
73 return simcall_host_get_consumed_energy(SIMIX_host_self());