XBT_PUBLIC(int) sg_host_get_core(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_state(sg_host_t host);
+XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
+XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
+
SG_END_DECL()
XBT_PUBLIC(double) simcall_host_get_power_peak_at(sg_host_t host, int pstate_index);
XBT_PUBLIC(int) simcall_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(void) simcall_host_set_pstate(sg_host_t host, int pstate_index);
-XBT_PUBLIC(int) simcall_host_get_pstate(sg_host_t host);
-XBT_PUBLIC(double) simcall_host_get_consumed_energy(sg_host_t host);
XBT_PUBLIC(double) simcall_host_get_wattmin_at(sg_host_t host, int pstate);
XBT_PUBLIC(double) simcall_host_get_wattmax_at(sg_host_t host, int pstate);
* \param host host to test
*/
int MSG_host_get_pstate(msg_host_t host) {
- return simcall_host_get_pstate(host);
+ return sg_host_get_pstate(host);
}
/** \ingroup m_host_management
*/
double MSG_host_get_consumed_energy(msg_host_t host) {
xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return simcall_host_get_consumed_energy(host);
+ return sg_host_get_consumed_energy(host);
}
/** \ingroup m_host_management
* \brief Returns the amount of watt dissipated at the given pstate when the host is idling
* @return 1 if the host is active or 0 if it has crashed.
*/
int sg_host_get_state(sg_host_t host) {
- return surf_host_get_state(surf_host_resource_priv(host));
+ return surf_host_get_state(surf_host_resource_priv(host));
+}
+
+/** @brief Returns the total energy consumed by the host (in Joules) */
+double sg_host_get_consumed_energy(sg_host_t host) {
+ return surf_host_get_consumed_energy(host);
+}
+
+/** @brief Gets the pstate at which that host currently runs */
+int sg_host_get_pstate(sg_host_t host) {
+ return surf_host_get_pstate(host);
}
{
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(sg_host_t host)
-{
- return simcall_BODY_host_get_pstate(host);
-}
-/**
- * \ingroup simix_host_management
- * \brief Returns the total energy consumed by the host (in Joules)
- *
- * \param host A SIMIX host
- * \return the energy consumed by the host (double)
- */
-double simcall_host_get_consumed_energy(sg_host_t host)
-{
- return simcall_BODY_host_get_consumed_energy(host);
-}
/** \ingroup simix_host_management
* \brief Returns the amount of watt dissipated at the given pstate when the host is idling
*/
simcall->args[1].i = arg;
}
-static inline sg_host_t simcall_host_get_pstate__get__host(smx_simcall_t simcall) {
- return (sg_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 sg_host_t simcall_host_get_consumed_energy__get__host(smx_simcall_t simcall) {
- return (sg_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_get_consumed_energy__set__host(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline double simcall_host_get_consumed_energy__get__result(smx_simcall_t simcall){
- return simcall->result.d;
-}
-static inline void simcall_host_get_consumed_energy__set__result(smx_simcall_t simcall, double result){
- simcall->result.d = result;
-}
-
static inline sg_host_t simcall_host_get_mounted_storage_list__get__host(smx_simcall_t simcall) {
return (sg_host_t) simcall->args[0].dp;
}
}
-inline static int simcall_BODY_host_get_pstate(sg_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(sg_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_consumed_energy(host);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_HOST_GET_CONSUMED_ENERGY;
- 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.d;
- }
-
inline static xbt_dict_t simcall_BODY_host_get_mounted_storage_list(sg_host_t host) {
smx_process_t self = SIMIX_process_self();
SIMCALL_HOST_GET_WATTMIN_AT,
SIMCALL_HOST_GET_WATTMAX_AT,
SIMCALL_HOST_SET_PSTATE,
- SIMCALL_HOST_GET_PSTATE,
- SIMCALL_HOST_GET_CONSUMED_ENERGY,
SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST,
SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST,
SIMCALL_HOST_GET_PARAMS,
[SIMCALL_HOST_GET_WATTMIN_AT] = "SIMCALL_HOST_GET_WATTMIN_AT",
[SIMCALL_HOST_GET_WATTMAX_AT] = "SIMCALL_HOST_GET_WATTMAX_AT",
[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_GET_MOUNTED_STORAGE_LIST] = "SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST",
[SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST] = "SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST",
[SIMCALL_HOST_GET_PARAMS] = "SIMCALL_HOST_GET_PARAMS",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_HOST_GET_PSTATE:
- simcall->result.i = SIMIX_host_get_pstate((sg_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((sg_host_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_HOST_GET_MOUNTED_STORAGE_LIST:
simcall->result.dp = SIMIX_host_get_mounted_storage_list((sg_host_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
Func - host_get_wattmin_at (double) (host, void*, sg_host_t) (pstate_index, int)
Func - host_get_wattmax_at (double) (host, void*, sg_host_t) (pstate_index, int)
Proc - host_set_pstate (void) (host, void*, sg_host_t) (pstate_index, int)
-Func - host_get_pstate (int) (host, void*, sg_host_t)
-Func - host_get_consumed_energy (double) (host, void*, sg_host_t)
Func - host_get_mounted_storage_list (void*, xbt_dict_t) (host, void*, sg_host_t)
Func - host_get_attached_storage_list (void*, xbt_dynar_t) (host, void*, sg_host_t)
}
-int SIMIX_host_get_core(sg_host_t host){
- return surf_host_get_core(host);
-}
-
xbt_swag_t SIMIX_host_get_process_list(sg_host_t host){
smx_host_priv_t host_priv = sg_host_simix(host);
void SIMIX_host_set_pstate(sg_host_t host, int pstate_index) {
surf_host_set_pstate(host, pstate_index);
}
-int SIMIX_host_get_pstate(sg_host_t host) {
- return surf_host_get_pstate(host);
-}
-
-double SIMIX_host_get_consumed_energy(sg_host_t host) {
- return surf_host_get_consumed_energy(host);
-}
double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate) {
return surf_host_get_wattmin_at(host,pstate);
}
return surf_host_get_wattmax_at(host,pstate);
}
-int SIMIX_host_get_state(sg_host_t host){
- return surf_host_get_state(surf_host_resource_priv(host));
-}
-
void _SIMIX_host_free_process_arg(void *data)
{
smx_process_arg_t arg = *(void**)data;
arg->properties = properties;
arg->auto_restart = auto_restart;
- if( SIMIX_host_get_state(host) == SURF_RESOURCE_OFF
+ if( sg_host_get_state(host) == SURF_RESOURCE_OFF
&& !xbt_dict_get_or_null(watched_hosts_lib,sg_host_name(host))){
xbt_dict_set(watched_hosts_lib,sg_host_name(host),host,NULL);
XBT_DEBUG("Have pushed host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_name(host));
XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host);
XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
XBT_PRIVATE xbt_dict_t SIMIX_host_get_properties(sg_host_t host);
-XBT_PRIVATE int SIMIX_host_get_core(sg_host_t host);
XBT_PRIVATE xbt_swag_t SIMIX_host_get_process_list(sg_host_t host);
-XBT_PRIVATE int SIMIX_host_get_state(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_current_power_peak(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
XBT_PRIVATE int SIMIX_host_get_nb_pstates(sg_host_t host);
-XBT_PRIVATE double SIMIX_host_get_consumed_energy(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate);
XBT_PRIVATE double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate);
XBT_PRIVATE void SIMIX_host_set_pstate(sg_host_t host, int pstate_index);
-XBT_PRIVATE int SIMIX_host_get_pstate(sg_host_t host);
XBT_PRIVATE smx_synchro_t SIMIX_process_execute(smx_process_t issuer, const char *name,
double flops_amount, double priority, double bound, unsigned long affinity_mask);
XBT_PRIVATE smx_synchro_t SIMIX_process_parallel_execute(const char *name,
/* Add the process to the list of process to restart, only if
* the host is down
*/
- if (arg->auto_restart && !SIMIX_host_get_state(arg->host)) {
+ if (arg->auto_restart && !sg_host_get_state(arg->host)) {
SIMIX_host_add_auto_restart_process(arg->host,arg->name,arg->code, arg->data,
sg_host_name(arg->host),
SIMIX_timer_get_date(arg->kill_timer),
XBT_DEBUG("Start process %s on host '%s'", name, hostname);
- if (!SIMIX_host_get_state(host)) {
+ if (!sg_host_get_state(host)) {
int i;
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name,
hostname);
*
* \param pstate_index pstate to switch to
*/
-int smpi_get_host_pstate()
-{
- return simcall_host_get_pstate(SIMIX_host_self());
+int smpi_get_host_pstate() {
+ return sg_host_get_pstate(SIMIX_host_self());
}
/**
*
* \return Returns the consumed energy
*/
-double smpi_get_host_consumed_energy(void)
-{
- return simcall_host_get_consumed_energy(SIMIX_host_self());
+double smpi_get_host_consumed_energy(void) {
+ return sg_host_get_consumed_energy(SIMIX_host_self());
}