From ff52edfeb1b9c585656a745144fea2be10c90973 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 10 Jan 2016 00:26:22 +0100 Subject: [PATCH] bypass simix in simcall to surf::Cpu::setPState --- src/include/surf/surf.h | 1 - src/simgrid/host.cpp | 5 +++-- src/simix/smx_host.cpp | 3 --- src/simix/smx_host_private.h | 1 - src/surf/surf_c_bindings.cpp | 4 ---- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 25e8a47400..279955a981 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -450,7 +450,6 @@ XBT_PUBLIC(double) surf_host_get_current_power_peak(sg_host_t host); */ XBT_PUBLIC(double) surf_host_get_power_peak_at(sg_host_t host, int pstate_index); -XBT_PUBLIC(void) surf_host_set_pstate(sg_host_t host, int pstate_index); XBT_PUBLIC(double) surf_host_get_wattmin_at(sg_host_t resource, int pstate); XBT_PUBLIC(double) surf_host_get_wattmax_at(sg_host_t resource, int pstate); diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index c5c482375d..61de1034ea 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -251,8 +251,9 @@ Host* Host::by_name_or_create(const char* name) /** Set the pstate at which the host should run */ void Host::setPstate(int pstate_index) { - simgrid::simix::kernel( - std::bind(SIMIX_host_set_pstate, this, pstate_index)); + simgrid::simix::kernel(std::bind( + &simgrid::surf::Cpu::setPState, p_cpu, pstate_index + )); } /** Get the amount of watt dissipated at the given pstate when the host is idling */ diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index a6c4cb93b2..34d253e827 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -186,9 +186,6 @@ double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index) { return surf_host_get_power_peak_at(host, pstate_index); } -void SIMIX_host_set_pstate(sg_host_t host, int pstate_index) { - surf_host_set_pstate(host, pstate_index); -} double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate) { return surf_host_get_wattmin_at(host,pstate); } diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index a0b132c980..5d25ef4f39 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -43,7 +43,6 @@ 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 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 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, diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index a683814a84..d1907c694b 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -267,10 +267,6 @@ double surf_host_get_power_peak_at(sg_host_t host, int pstate_index){ return host->p_cpu->getPowerPeakAt(pstate_index); } -void surf_host_set_pstate(sg_host_t host, int pstate_index){ - host->p_cpu->setPState(pstate_index); -} - using simgrid::energy::HostEnergy; using simgrid::energy::surf_energy; -- 2.20.1