From: Martin Quinson Date: Tue, 9 Jun 2015 12:00:55 +0000 (+0200) Subject: further energy interface cleanups (see changelog) X-Git-Tag: v3_12~639 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5397eadb7c0c0482c2a0e658f772d3c165f4a44a further energy interface cleanups (see changelog) --- diff --git a/ChangeLog b/ChangeLog index 7f070bb48e..61dbb2d538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,7 @@ SimGrid (3.12) NOT RELEASED; urgency=low - set_data_size(t) -> set_bytes_amount(t) get_data_size(t) -> get_bytes_amount(t) - Massive cleanups in the functions related to the energy - - MSG_host_get_pstate_number() -> MSG_host_get_pstate_count() + - MSG_host_get_pstate_number() -> MSG_host_get_nb_pstates() jMSG: * Interface improvement: - Rename Host.isAvail() to Host.isOn() @@ -28,6 +28,8 @@ SimGrid (3.12) NOT RELEASED; urgency=low - popping: the strange dance that converts a user request into a kernel handling - smx_context_*: the virtualization mechanisms that embeed the user code - smx_*: the handling of each simcalls + * Interface cleanup: + - simcall_host_set_power_peak_at -> simcall_host_set_pstate * Rename smx_action_t into smx_synchro_t, making explicit that these things are used to synchronize processes with their environment. For example, a communication is a sort of synchronization involving @@ -59,10 +61,12 @@ SimGrid (3.12) NOT RELEASED; urgency=low - Replay can be used with SMP-aware algorithms - Memory occupation of replay should now be contained (temporary buffers allocated in collective algorithms should be shared between processes) - Replay can now replay several traces at the same time (check examples/smpi/replay_multiple example), to simulate interactions between several applications on a given platform. User can specify the start time of each instance. This should also allow replay + actual applications to run. - * Bug fixes + * Bug fixes - [#17799] : have mpi_group_range_incl and mpi_group_range_excl better test some corner cases - Correctly use loopback on fat-tree clusters - Asynchronous small messages shouldn't trigger deadlocks anymore + * Interface cleanup + - smpi_set_host_power_peak_at -> smpi_set_host_pstate SURF * Bug fixes - "Full" network optimization flag was broken since Surf++ diff --git a/examples/msg/energy/pstate/pstate.c b/examples/msg/energy/pstate/pstate.c index 0b2a8b6628..143251f843 100644 --- a/examples/msg/energy/pstate/pstate.c +++ b/examples/msg/energy/pstate/pstate.c @@ -17,7 +17,7 @@ * - energy/e1/e1.c 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_power_peak_at. + * MSG_set_host_pstate. * Make sure to read the platform XML file for details on how * to declare the CPU capacity for each pstate. * @@ -38,7 +38,7 @@ int dvfs(int argc, char *argv[]) int new_peak_index=2; host = MSG_host_self();; //MSG_get_host_by_name("MyHost1"); - int nb = MSG_host_get_pstate_count(host); + int nb = MSG_host_get_nb_pstates(host); XBT_INFO("Count of Processor states=%d", nb); double current_peak = MSG_host_get_current_power_peak(host); @@ -78,7 +78,7 @@ int dvfs(int argc, char *argv[]) // Verify the default pstate is set to 0 host = MSG_get_host_by_name("MyHost2"); - int nb2 = MSG_host_get_pstate_count(host); + int nb2 = MSG_host_get_nb_pstates(host); XBT_INFO("Count of Processor states=%d", nb2); double current_peak2 = MSG_host_get_current_power_peak(host); diff --git a/examples/smpi/energy/f77/sef.f b/examples/smpi/energy/f77/sef.f index a4c464448e..1c00d59bd7 100644 --- a/examples/smpi/energy/f77/sef.f +++ b/examples/smpi/energy/f77/sef.f @@ -37,7 +37,7 @@ end do do i = 0, pstates - 1 - call smpi_set_host_power_peak_at(i) + call smpi_set_host_pstate(i) t = MPI_Wtime() p = smpi_get_host_current_power_peak() print *, '[', t, '] [rank ', rank, '] Current pstate: ', i, diff --git a/examples/smpi/energy/f90/sef90.f90 b/examples/smpi/energy/f90/sef90.f90 index 833bf731c2..14e3a71af8 100644 --- a/examples/smpi/energy/f90/sef90.f90 +++ b/examples/smpi/energy/f90/sef90.f90 @@ -35,7 +35,7 @@ program main end do do i = 0, pstates - 1 - call smpi_set_host_power_peak_at(i) + call smpi_set_host_pstate(i) t = MPI_Wtime() p = smpi_get_host_current_power_peak() print *, '[', t, '] [rank ', rank, '] Current pstate: ', i, '; Current power: ', p diff --git a/examples/smpi/energy/se.c b/examples/smpi/energy/se.c index 2c4571a89a..11b27ee807 100644 --- a/examples/smpi/energy/se.c +++ b/examples/smpi/energy/se.c @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "%s%s\n", buf, (sz ? "" : " [...]")); for (i = 0; i < pstates; i++) { - smpi_set_host_power_peak_at(i); + smpi_set_host_pstate(i); fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n", MPI_Wtime(), rank, i, smpi_get_host_current_power_peak()); diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 9ea549243b..de58a7ca5d 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -327,7 +327,7 @@ XBT_PUBLIC(void) __MSG_host_destroy(msg_host_t host); XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate); XBT_PUBLIC(double) MSG_host_get_current_power_peak(msg_host_t h); -XBT_PUBLIC(int) MSG_host_get_pstate_count(msg_host_t h); +XBT_PUBLIC(int) MSG_host_get_nb_pstates(msg_host_t h); XBT_PUBLIC(void) MSG_host_set_pstate(msg_host_t h, int pstate); XBT_PUBLIC(double) MSG_host_get_consumed_energy(msg_host_t h); diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 78fbceacac..1cb3fd643a 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -319,7 +319,7 @@ XBT_PUBLIC(void) simcall_host_set_data(smx_host_t host, void *data); XBT_PUBLIC(double) simcall_host_get_current_power_peak(smx_host_t host); XBT_PUBLIC(double) simcall_host_get_power_peak_at(smx_host_t host, int pstate_index); XBT_PUBLIC(int) simcall_host_get_nb_pstates(smx_host_t host); -XBT_PUBLIC(void) simcall_host_set_power_peak_at(smx_host_t host, int pstate_index); +XBT_PUBLIC(void) simcall_host_set_pstate(smx_host_t host, int pstate_index); XBT_PUBLIC(double) simcall_host_get_consumed_energy(smx_host_t host); XBT_PUBLIC(smx_synchro_t) simcall_host_execute(const char *name, smx_host_t host, diff --git a/include/smpi/mpif.h.in b/include/smpi/mpif.h.in index 7f75138183..b6b94ebd1c 100644 --- a/include/smpi/mpif.h.in +++ b/include/smpi/mpif.h.in @@ -253,7 +253,7 @@ external smpi_get_host_power_peak_at external smpi_get_host_current_power_peak external smpi_get_host_nb_pstates - external smpi_set_host_power_peak_at + external smpi_set_host_pstate external smpi_get_host_consumed_energy double precision smpi_get_host_power_peak_at diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 97d02cc1ab..ef0e55b948 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -834,7 +834,7 @@ XBT_PUBLIC(void) smpi_execute(double duration); XBT_PUBLIC(double) smpi_get_host_power_peak_at(int pstate_index); XBT_PUBLIC(double) smpi_get_host_current_power_peak(void); XBT_PUBLIC(int) smpi_get_host_nb_pstates(void); -XBT_PUBLIC(void) smpi_set_host_power_peak_at(int pstate_index); +XBT_PUBLIC(void) smpi_set_host_pstate(int pstate_index); XBT_PUBLIC(double) smpi_get_host_consumed_energy(void); XBT_PUBLIC(int) smpi_usleep(useconds_t usecs); diff --git a/src/bindings/java/org/simgrid/surf/Cpu.java b/src/bindings/java/org/simgrid/surf/Cpu.java index e172525454..3ddad07692 100644 --- a/src/bindings/java/org/simgrid/surf/Cpu.java +++ b/src/bindings/java/org/simgrid/surf/Cpu.java @@ -158,12 +158,8 @@ public class Cpu extends Resource { return SurfJNI.Cpu_getNbPstates(swigCPtr, this); } - - /** - * @param pstate_index index of power peak to set - */ - public void setPowerPeakAt(int pstate_index) { - SurfJNI.Cpu_setPowerPeakAt(swigCPtr, this, pstate_index); + public void setPstate(int pstate_index) { + SurfJNI.Cpu_setPstate(swigCPtr, this, pstate_index); } diff --git a/src/bindings/java/org/simgrid/surf/SurfJNI.java b/src/bindings/java/org/simgrid/surf/SurfJNI.java index 697afea9d2..08169d647d 100644 --- a/src/bindings/java/org/simgrid/surf/SurfJNI.java +++ b/src/bindings/java/org/simgrid/surf/SurfJNI.java @@ -110,7 +110,7 @@ public class SurfJNI { public final static native double Cpu_getAvailableSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_); public final static native double Cpu_getPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2); public final static native int Cpu_getNbPstates(long jarg1, Cpu jarg1_); - public final static native void Cpu_setPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2); + public final static native void Cpu_setPstate(long jarg1, Cpu jarg1_, int jarg2); public final static native void Cpu_setState(long jarg1, Cpu jarg1_, int jarg2); public final static native void Cpu_director_connect(Cpu obj, long cptr, boolean mem_own, boolean weak_global); public final static native void Cpu_change_ownership(Cpu obj, long cptr, boolean take_or_release); @@ -247,8 +247,8 @@ public class SurfJNI { public static int SwigDirector_Cpu_getNbPstates(Cpu self) { return self.getNbPstates(); } - public static void SwigDirector_Cpu_setPowerPeakAt(Cpu self, int pstate_index) { - self.setPowerPeakAt(pstate_index); + public static void SwigDirector_Cpu_setPstate(Cpu self, int pstate_index) { + self.setPstate(pstate_index); } public static double SwigDirector_CpuAction_getRemains(CpuAction self) { return self.getRemains(); diff --git a/src/bindings/java/surf.i b/src/bindings/java/surf.i index 3890a89ef0..e35cff6117 100644 --- a/src/bindings/java/surf.i +++ b/src/bindings/java/surf.i @@ -293,7 +293,7 @@ public: virtual double getAvailableSpeed(); virtual double getPowerPeakAt(int pstate_index)=0; virtual int getNbPstates()=0; - virtual void setPowerPeakAt(int pstate_index)=0; + virtual void setPstate(int pstate_index)=0; void setState(e_surf_resource_state_t state); }; diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 6a887bcedb..6aadfc3cf2 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -627,7 +627,7 @@ XBT_PUBLIC(int) surf_workstation_get_nb_pstates(surf_resource_t host); * @param host [description] * @param pstate_index [description] */ -XBT_PUBLIC(void) surf_workstation_set_power_peak_at(surf_resource_t host, int pstate_index); +XBT_PUBLIC(void) surf_workstation_set_pstate(surf_resource_t host, int pstate_index); /** * @brief Get the consumed energy (in joules) of a workstation diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 6254436ee0..bce361c9b0 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -377,7 +377,7 @@ double MSG_host_get_current_power_peak(msg_host_t host) { * * \param host host to test */ -int MSG_host_get_pstate_count(msg_host_t host) { +int MSG_host_get_nb_pstates(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); return (simcall_host_get_nb_pstates(host)); @@ -392,7 +392,7 @@ int MSG_host_get_pstate_count(msg_host_t host) { void MSG_host_set_pstate(msg_host_t host, int pstate_index) { xbt_assert((host != NULL), "Invalid parameters (host is NULL)"); - simcall_host_set_power_peak_at(host, pstate_index); + simcall_host_set_pstate(host, pstate_index); } /** \ingroup m_host_management diff --git a/src/simix/libsmx.c b/src/simix/libsmx.c index 0ff35b7685..fb73b7ae01 100644 --- a/src/simix/libsmx.c +++ b/src/simix/libsmx.c @@ -198,9 +198,9 @@ int simcall_host_get_nb_pstates(smx_host_t host) * \param host A SIMIX host * \param pstate_index The pstate to which the CPU power will be set */ -void simcall_host_set_power_peak_at(smx_host_t host, int pstate_index) +void simcall_host_set_pstate(smx_host_t host, int pstate_index) { - simcall_BODY_host_set_power_peak_at(host, pstate_index); + simcall_BODY_host_set_pstate(host, pstate_index); } /** diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index e5515011cf..5ce83724ad 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -177,16 +177,16 @@ static inline void simcall_host_get_nb_pstates__set__result(smx_simcall_t simcal simcall->result.i = result; } -static inline smx_host_t simcall_host_set_power_peak_at__get__host(smx_simcall_t simcall) { +static inline smx_host_t simcall_host_set_pstate__get__host(smx_simcall_t simcall) { return (smx_host_t) simcall->args[0].dp; } -static inline void simcall_host_set_power_peak_at__set__host(smx_simcall_t simcall, void* arg) { +static inline void simcall_host_set_pstate__set__host(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline int simcall_host_set_power_peak_at__get__pstate_index(smx_simcall_t simcall) { +static inline int simcall_host_set_pstate__get__pstate_index(smx_simcall_t simcall) { return simcall->args[1].i; } -static inline void simcall_host_set_power_peak_at__set__pstate_index(smx_simcall_t simcall, int arg) { +static inline void simcall_host_set_pstate__set__pstate_index(smx_simcall_t simcall, int arg) { simcall->args[1].i = arg; } diff --git a/src/simix/popping_bodies.c b/src/simix/popping_bodies.c index a5fa70d259..7c4ea3b39d 100644 --- a/src/simix/popping_bodies.c +++ b/src/simix/popping_bodies.c @@ -291,14 +291,14 @@ inline static int simcall_BODY_host_get_nb_pstates(smx_host_t host) { return self->simcall.result.i; } -inline static void simcall_BODY_host_set_power_peak_at(smx_host_t host, int pstate_index) { +inline static void simcall_BODY_host_set_pstate(smx_host_t host, int pstate_index) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_host_set_power_peak_at(host, pstate_index); + if (0) SIMIX_host_set_pstate(host, pstate_index); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_HOST_SET_POWER_PEAK_AT; + self->simcall.call = SIMCALL_HOST_SET_PSTATE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) host; diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 0a74ebfc0f..0225d19cc6 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -31,7 +31,7 @@ typedef enum { SIMCALL_HOST_GET_CURRENT_POWER_PEAK, SIMCALL_HOST_GET_POWER_PEAK_AT, SIMCALL_HOST_GET_NB_PSTATES, - SIMCALL_HOST_SET_POWER_PEAK_AT, + SIMCALL_HOST_SET_PSTATE, SIMCALL_HOST_GET_CONSUMED_ENERGY, SIMCALL_HOST_EXECUTE, SIMCALL_HOST_PARALLEL_EXECUTE, diff --git a/src/simix/popping_generated.c b/src/simix/popping_generated.c index f6bcfeac86..e34eae3aff 100644 --- a/src/simix/popping_generated.c +++ b/src/simix/popping_generated.c @@ -35,7 +35,7 @@ const char* simcall_names[] = { [SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK", [SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT", [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES", - [SIMCALL_HOST_SET_POWER_PEAK_AT] = "SIMCALL_HOST_SET_POWER_PEAK_AT", + [SIMCALL_HOST_SET_PSTATE] = "SIMCALL_HOST_SET_PSTATE", [SIMCALL_HOST_GET_CONSUMED_ENERGY] = "SIMCALL_HOST_GET_CONSUMED_ENERGY", [SIMCALL_HOST_EXECUTE] = "SIMCALL_HOST_EXECUTE", [SIMCALL_HOST_PARALLEL_EXECUTE] = "SIMCALL_HOST_PARALLEL_EXECUTE", @@ -230,8 +230,8 @@ case SIMCALL_HOST_GET_NB_PSTATES: SIMIX_simcall_answer(simcall); break; -case SIMCALL_HOST_SET_POWER_PEAK_AT: - SIMIX_host_set_power_peak_at((smx_host_t) simcall->args[0].dp, simcall->args[1].i); +case SIMCALL_HOST_SET_PSTATE: + SIMIX_host_set_pstate((smx_host_t) simcall->args[0].dp, simcall->args[1].i); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 46ac4aa819..1f4e7b9fc6 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -59,7 +59,7 @@ Func - host_get_state (int) (host, void*, smx_host_t) Func - host_get_current_power_peak (double) (host, void*, smx_host_t) Func - host_get_power_peak_at (double) (host, void*, smx_host_t) (pstate_index, int) Func - host_get_nb_pstates (int) (host, void*, smx_host_t) -Proc - host_set_power_peak_at (void) (host, void*, smx_host_t) (pstate_index, int) +Proc - host_set_pstate (void) (host, void*, smx_host_t) (pstate_index, int) Func - host_get_consumed_energy (double) (host, void*, smx_host_t) Func - host_execute (void*, smx_synchro_t) (name, const char*) (host, void*, smx_host_t) (flops_amount, double) (priority, double) (bound, double) (affinity_mask, unsigned long) diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index 20e7abbbc7..5126b2dc28 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -232,10 +232,10 @@ int SIMIX_host_get_nb_pstates(smx_host_t host) { } -void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index) { +void SIMIX_host_set_pstate(smx_host_t host, int pstate_index) { xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - surf_workstation_set_power_peak_at(host, pstate_index); + surf_workstation_set_pstate(host, pstate_index); } double SIMIX_host_get_consumed_energy(smx_host_t host) { diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index f9c58eb9b0..9c108af466 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -51,7 +51,7 @@ double SIMIX_host_get_current_power_peak(smx_host_t host); double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index); int SIMIX_host_get_nb_pstates(smx_host_t host); double SIMIX_host_get_consumed_energy(smx_host_t host); -void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index); +void SIMIX_host_set_pstate(smx_host_t host, int pstate_index); smx_synchro_t SIMIX_host_execute(const char *name, smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask); smx_synchro_t SIMIX_host_parallel_execute(const char *name, diff --git a/src/smpi/smpi_dvfs.c b/src/smpi/smpi_dvfs.c index 608bba4cbb..395f84e696 100644 --- a/src/smpi/smpi_dvfs.c +++ b/src/smpi/smpi_dvfs.c @@ -46,9 +46,9 @@ int smpi_get_host_nb_pstates(void) * * \param pstate_index pstate to switch to */ -void smpi_set_host_power_peak_at(int pstate_index) +void smpi_set_host_pstate(int pstate_index) { - simcall_host_set_power_peak_at(SIMIX_host_self(), pstate_index); + simcall_host_set_pstate(SIMIX_host_self(), pstate_index); } /** @@ -96,10 +96,10 @@ integer smpi_get_host_nb_pstates_(void) return (integer)smpi_get_host_nb_pstates(); } -XBT_PUBLIC(void) smpi_set_host_power_peak_at_(integer *pstate_index); -void smpi_set_host_power_peak_at_(integer *pstate_index) +XBT_PUBLIC(void) smpi_set_host_pstate_(integer *pstate_index); +void smpi_set_host_pstate_(integer *pstate_index) { - smpi_set_host_power_peak_at((int)*pstate_index); + smpi_set_host_pstate((int)*pstate_index); } XBT_PUBLIC(doublereal) smpi_get_host_consumed_energy_(void); diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 342c6e5264..f5182c3e54 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -341,14 +341,14 @@ int CpuCas01::getNbPstates() return xbt_dynar_length(p_powerPeakList); } -void CpuCas01::setPowerPeakAt(int pstate_index) +void CpuCas01::setPstate(int pstate_index) { xbt_dynar_t plist = p_powerPeakList; xbt_assert((pstate_index <= (int)xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)"); - double new_power_peak = xbt_dynar_get_as(plist, pstate_index, double); + double new_pstate = xbt_dynar_get_as(plist, pstate_index, double); m_pstate = pstate_index; - m_powerPeak = new_power_peak; + m_powerPeak = new_pstate; } /********** diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 197325762c..46e9cafbb0 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -58,7 +58,7 @@ public: double getCurrentPowerPeak(); double getPowerPeakAt(int pstate_index); int getNbPstates(); - void setPowerPeakAt(int pstate_index); + void setPstate(int pstate_index); bool isUsed(); void setStateEvent(tmgr_trace_event_t stateEvent); void setPowerEvent(tmgr_trace_event_t stateEvent); diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index c4bc20c5bf..7e7ff09815 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -199,7 +199,7 @@ public: virtual int getNbPstates()=0; - virtual void setPowerPeakAt(int pstate_index)=0; + virtual void setPstate(int pstate_index)=0; void setState(e_surf_resource_state_t state); diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 83d176e4ad..3cb11990df 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -139,7 +139,7 @@ public: double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;}; double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; int getNbPstates() {THROW_UNIMPLEMENTED;}; - void setPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; + void setPstate(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; void modified(bool modified); CpuTiTgmrPtr p_availTrace; /*< Structure with data needed to integrate trace file */ diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index cb638c0707..3387974d10 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -356,8 +356,8 @@ int surf_workstation_get_nb_pstates(surf_resource_t resource){ return get_casted_workstation(resource)->getNbPstates(); } -void surf_workstation_set_power_peak_at(surf_resource_t resource, int pstate_index){ - return get_casted_workstation(resource)->setPowerPeakAt(pstate_index); +void surf_workstation_set_pstate(surf_resource_t resource, int pstate_index){ + return get_casted_workstation(resource)->setPstate(pstate_index); } double surf_workstation_get_consumed_energy(surf_resource_t resource){ diff --git a/src/surf/workstation_interface.cpp b/src/surf/workstation_interface.cpp index 6b021c5b5f..3a5472be10 100644 --- a/src/surf/workstation_interface.cpp +++ b/src/surf/workstation_interface.cpp @@ -155,9 +155,9 @@ int Workstation::getNbPstates() return p_cpu->getNbPstates(); } -void Workstation::setPowerPeakAt(int pstate_index) +void Workstation::setPstate(int pstate_index) { - p_cpu->setPowerPeakAt(pstate_index); + p_cpu->setPstate(pstate_index); } xbt_dict_t Workstation::getProperties() diff --git a/src/surf/workstation_interface.hpp b/src/surf/workstation_interface.hpp index 13ccd603ff..4c39287b6e 100644 --- a/src/surf/workstation_interface.hpp +++ b/src/surf/workstation_interface.hpp @@ -237,7 +237,7 @@ public: virtual double getPowerPeakAt(int pstate_index); virtual int getNbPstates(); - virtual void setPowerPeakAt(int pstate_index); + virtual void setPstate(int pstate_index); /** * @brief Return the storage of corresponding mount point diff --git a/src/surf/workstation_ptask_L07.cpp b/src/surf/workstation_ptask_L07.cpp index db86aab305..0904cf574c 100644 --- a/src/surf/workstation_ptask_L07.cpp +++ b/src/surf/workstation_ptask_L07.cpp @@ -443,7 +443,7 @@ int WorkstationL07::getNbPstates() return 0.0; } -void WorkstationL07::setPowerPeakAt(int /*pstate_index*/) +void WorkstationL07::setPstate(int /*pstate_index*/) { XBT_DEBUG("[ws_set_power_peak_at] Not implemented for workstation_ptask_L07"); } diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index 2b97f71882..39cb5fe392 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -110,7 +110,7 @@ public: e_surf_resource_state_t getState(); double getPowerPeakAt(int pstate_index); int getNbPstates(); - void setPowerPeakAt(int pstate_index); + void setPstate(int pstate_index); double getConsumedEnergy(); }; @@ -131,7 +131,7 @@ public: double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;}; double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; int getNbPstates() {THROW_UNIMPLEMENTED;}; - void setPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; + void setPstate(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; double getConsumedEnergy() {THROW_UNIMPLEMENTED;}; };