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_nb_pstates()
+ - New: MSG_host_get_pstate()
jMSG:
* Interface improvement:
- Rename Host.isAvail() to Host.isOn()
- [#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
+ * Energy/DVFS cleanup and improvement
+ - smpi_set_host_power_peak_at() -> smpi_set_host_pstate()
+ - new: smpi_get_host_pstate()
SURF
* Bug fixes
- "Full" network optimization flag was broken since Surf++
XBT_PUBLIC(double) MSG_host_get_current_power_peak(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(int) MSG_host_get_pstate(msg_host_t host);
+
XBT_PUBLIC(double) MSG_host_get_consumed_energy(msg_host_t h);
/*property handlers*/
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_pstate(smx_host_t host, int pstate_index);
+XBT_PUBLIC(int) simcall_host_get_pstate(smx_host_t host);
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,
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_pstate(int pstate_index);
+XBT_PUBLIC(int) smpi_get_host_pstate(void);
+
XBT_PUBLIC(double) smpi_get_host_consumed_energy(void);
XBT_PUBLIC(int) smpi_usleep(useconds_t usecs);
SurfJNI.Cpu_setPstate(swigCPtr, this, pstate_index);
}
+ public int getPstate() {
+ return SurfJNI.Cpu_getPstate(swigCPtr, this);
+ }
+
/**
* @param state The new state of the cpu
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_setPstate(long jarg1, Cpu jarg1_, int jarg2);
+ public final static native int Cpu_getPstate(long jarg1, Cpu jarg1_);
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);
public static void SwigDirector_Cpu_setPstate(Cpu self, int pstate_index) {
self.setPstate(pstate_index);
}
+ public static int SwigDirector_Cpu_getPstate(Cpu self) {
+ return self.getPstate();
+ }
public static double SwigDirector_CpuAction_getRemains(CpuAction self) {
return self.getRemains();
}
virtual double getPowerPeakAt(int pstate_index)=0;
virtual int getNbPstates()=0;
virtual void setPstate(int pstate_index)=0;
+ virtual int getPstate()=0;
void setState(e_surf_resource_state_t state);
};
*/
XBT_PUBLIC(int) surf_workstation_get_nb_pstates(surf_resource_t host);
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param host [description]
- * @param pstate_index [description]
- */
XBT_PUBLIC(void) surf_workstation_set_pstate(surf_resource_t host, int pstate_index);
+XBT_PUBLIC(int) surf_workstation_get_pstate(surf_resource_t host);
/**
* @brief Get the consumed energy (in joules) of a workstation
simcall_host_set_pstate(host, pstate_index);
}
+/** \ingroup m_host_management
+ * \brief Gets the pstate at which the given host is currently running. See also @ref SURF_plugin_energy.
+ *
+ * \param host host to test
+ */
+int MSG_host_get_pstate(msg_host_t host) {
+ return simcall_host_get_pstate(host);
+}
/** \ingroup m_host_management
* \brief Return the total energy consumed by a host (in Joules). See also @ref SURF_plugin_energy.
/**
* \ingroup simix_host_management
- * \brief Sets a new power peak for a host.
+ * \brief Sets the pstate at which the host should run
*
* \param host A SIMIX host
* \param pstate_index The pstate to which the CPU power will be set
{
simcall_BODY_host_set_pstate(host, pstate_index);
}
+/**
+ * \ingroup simix_host_management
+ * \brief Gets the pstate at which that host currently runs.
+ *
+ * \param host A SIMIX host
+ */
+int simcall_host_get_pstate(smx_host_t host)
+{
+ return simcall_BODY_host_get_pstate(host);
+}
/**
* \ingroup simix_host_management
simcall->args[1].i = arg;
}
+static inline smx_host_t simcall_host_get_pstate__get__host(smx_simcall_t simcall) {
+ return (smx_host_t) simcall->args[0].dp;
+}
+static inline void simcall_host_get_pstate__set__host(smx_simcall_t simcall, void* arg) {
+ simcall->args[0].dp = arg;
+}
+static inline int simcall_host_get_pstate__get__result(smx_simcall_t simcall){
+ return simcall->result.i;
+}
+static inline void simcall_host_get_pstate__set__result(smx_simcall_t simcall, int result){
+ simcall->result.i = result;
+}
+
static inline smx_host_t simcall_host_get_consumed_energy__get__host(smx_simcall_t simcall) {
return (smx_host_t) simcall->args[0].dp;
}
}
+inline static int simcall_BODY_host_get_pstate(smx_host_t host) {
+ smx_process_t self = SIMIX_process_self();
+
+ /* Go to that function to follow the code flow through the simcall barrier */
+ if (0) SIMIX_host_get_pstate(host);
+ /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
+
+ self->simcall.call = SIMCALL_HOST_GET_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;
+ if (self != simix_global->maestro_process) {
+ XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
+ SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
+ SIMIX_process_yield(self);
+ } else {
+ SIMIX_simcall_handle(&self->simcall, 0);
+ }
+ return self->simcall.result.i;
+ }
+
inline static double simcall_BODY_host_get_consumed_energy(smx_host_t host) {
smx_process_t self = SIMIX_process_self();
SIMCALL_HOST_GET_POWER_PEAK_AT,
SIMCALL_HOST_GET_NB_PSTATES,
SIMCALL_HOST_SET_PSTATE,
+ SIMCALL_HOST_GET_PSTATE,
SIMCALL_HOST_GET_CONSUMED_ENERGY,
SIMCALL_HOST_EXECUTE,
SIMCALL_HOST_PARALLEL_EXECUTE,
[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_PSTATE] = "SIMCALL_HOST_SET_PSTATE",
+ [SIMCALL_HOST_GET_PSTATE] = "SIMCALL_HOST_GET_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",
SIMIX_simcall_answer(simcall);
break;
+case SIMCALL_HOST_GET_PSTATE:
+ simcall->result.i = SIMIX_host_get_pstate((smx_host_t) simcall->args[0].dp);
+ SIMIX_simcall_answer(simcall);
+ break;
+
case SIMCALL_HOST_GET_CONSUMED_ENERGY:
simcall->result.d = SIMIX_host_get_consumed_energy((smx_host_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
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_pstate (void) (host, void*, smx_host_t) (pstate_index, int)
+Func - host_get_pstate (int) (host, void*, smx_host_t)
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)
surf_workstation_set_pstate(host, pstate_index);
}
+int SIMIX_host_get_pstate(smx_host_t host) {
+ return surf_workstation_get_pstate(host);
+}
double SIMIX_host_get_consumed_energy(smx_host_t host) {
xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
int SIMIX_host_get_nb_pstates(smx_host_t host);
double SIMIX_host_get_consumed_energy(smx_host_t host);
void SIMIX_host_set_pstate(smx_host_t host, int pstate_index);
+int SIMIX_host_get_pstate(smx_host_t host);
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,
}
/**
- * \brief Sets the speed of the processor (in flop/s) at a given pstate
+ * \brief Sets the pstate at which the processor should run
*
* \param pstate_index pstate to switch to
*/
{
simcall_host_set_pstate(SIMIX_host_self(), pstate_index);
}
+/**
+ * \brief Gets the pstate at which the processor currently running
+ *
+ * \param pstate_index pstate to switch to
+ */
+int smpi_get_host_pstate()
+{
+ return simcall_host_get_pstate(SIMIX_host_self());
+}
/**
* \brief Return the total energy consumed by a host (in Joules)
m_powerPeak = new_pstate;
}
+int CpuCas01::getPstate()
+{
+ return m_pstate;
+}
+
/**********
* Action *
**********/
double getPowerPeakAt(int pstate_index);
int getNbPstates();
void setPstate(int pstate_index);
+ int getPstate();
bool isUsed();
void setStateEvent(tmgr_trace_event_t stateEvent);
void setPowerEvent(tmgr_trace_event_t stateEvent);
virtual int getNbPstates()=0;
virtual void setPstate(int pstate_index)=0;
+ virtual int getPstate()=0;
void setState(e_surf_resource_state_t state);
double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
int getNbPstates() {THROW_UNIMPLEMENTED;};
void setPstate(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
+ int getPstate() { THROW_UNIMPLEMENTED;}
void modified(bool modified);
CpuTiTgmrPtr p_availTrace; /*< Structure with data needed to integrate trace file */
}
void surf_workstation_set_pstate(surf_resource_t resource, int pstate_index){
- return get_casted_workstation(resource)->setPstate(pstate_index);
+ get_casted_workstation(resource)->setPstate(pstate_index);
+}
+int surf_workstation_get_pstate(surf_resource_t resource){
+ return get_casted_workstation(resource)->getPstate();
}
double surf_workstation_get_consumed_energy(surf_resource_t resource){
{
p_cpu->setPstate(pstate_index);
}
+int Workstation::getPstate()
+{
+ return p_cpu->getPstate();
+}
xbt_dict_t Workstation::getProperties()
{
virtual double getPowerPeakAt(int pstate_index);
virtual int getNbPstates();
virtual void setPstate(int pstate_index);
+ virtual int getPstate();
/**
* @brief Return the storage of corresponding mount point
double WorkstationL07::getPowerPeakAt(int /*pstate_index*/)
{
- XBT_DEBUG("[ws_get_power_peak_at] Not implemented for workstation_ptask_L07");
- return 0.0;
+ THROW_UNIMPLEMENTED;
}
int WorkstationL07::getNbPstates()
{
- XBT_DEBUG("[ws_get_nb_pstates] Not implemented for workstation_ptask_L07");
- return 0.0;
+ THROW_UNIMPLEMENTED;
}
void WorkstationL07::setPstate(int /*pstate_index*/)
{
- XBT_DEBUG("[ws_set_power_peak_at] Not implemented for workstation_ptask_L07");
+ THROW_UNIMPLEMENTED;
+}
+
+int WorkstationL07::getPstate()
+{
+ THROW_UNIMPLEMENTED;
}
double WorkstationL07::getConsumedEnergy()
{
- XBT_DEBUG("[ws_get_consumed_energy] Not implemented for workstation_ptask_L07");
- return 0.0;
+ THROW_UNIMPLEMENTED;
}
CpuL07::CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t props,
double getPowerPeakAt(int pstate_index);
int getNbPstates();
void setPstate(int pstate_index);
+ int getPstate();
double getConsumedEnergy();
};
double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
int getNbPstates() {THROW_UNIMPLEMENTED;};
void setPstate(int /*pstate_index*/) {THROW_UNIMPLEMENTED;};
+ int getPstate() {THROW_UNIMPLEMENTED;};
double getConsumedEnergy() {THROW_UNIMPLEMENTED;};
};