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)");
15 * \brief Return the speed of the processor (in flop/s) at a given pstate
17 * \param pstate_index pstate to test
18 * \return Returns the processor speed associated with pstate_index
20 double smpi_get_host_power_peak_at(int pstate_index)
22 return simcall_host_get_power_peak_at(SIMIX_host_self(), pstate_index);
26 * \brief Return the current speed of the processor (in flop/s)
28 * \return Returns the current processor speed
30 double smpi_get_host_current_power_peak(void)
32 return simcall_host_get_current_power_peak(SIMIX_host_self());
36 * \brief Return the number of pstates defined for host
38 int smpi_get_host_nb_pstates(void)
40 return simcall_host_get_nb_pstates(SIMIX_host_self());
44 * \brief Sets the speed of the processor (in flop/s) at a given pstate
46 * \param pstate_index pstate to switch to
48 void smpi_set_host_power_peak_at(int pstate_index)
50 simcall_host_set_power_peak_at(SIMIX_host_self(), pstate_index);
54 * \brief Return the total energy consumed by a host (in Joules)
56 * \return Returns the consumed energy
58 double smpi_get_host_consumed_energy(void)
60 return simcall_host_get_consumed_energy(SIMIX_host_self());
63 #include "smpi/smpif.h"
67 XBT_PUBLIC(doublereal) smpi_get_host_power_peak_at_(integer *pstate_index);
68 doublereal smpi_get_host_power_peak_at_(integer *pstate_index)
70 return (doublereal)smpi_get_host_power_peak_at((int)*pstate_index);
73 XBT_PUBLIC(doublereal) smpi_get_host_current_power_peak_(void);
74 doublereal smpi_get_host_current_power_peak_(void)
76 return smpi_get_host_current_power_peak();
79 XBT_PUBLIC(integer) smpi_get_host_nb_pstates_(void);
80 integer smpi_get_host_nb_pstates_(void)
82 return (integer)smpi_get_host_nb_pstates();
85 XBT_PUBLIC(void) smpi_set_host_power_peak_at_(integer *pstate_index);
86 void smpi_set_host_power_peak_at_(integer *pstate_index)
88 smpi_set_host_power_peak_at((int)*pstate_index);
91 XBT_PUBLIC(doublereal) smpi_get_host_consumed_energy_(void);
92 doublereal smpi_get_host_consumed_energy_(void)
94 return (doublereal)smpi_get_host_consumed_energy();