/*** CPU burning */ void gras_cpu_burn(double flops) { smx_action_t execution; if (flops > 0){ execution = SIMIX_req_host_execute("task", SIMIX_host_self(), flops, 1); SIMIX_req_host_execution_wait(execution); } }
void smpi_execute_flops(double flops) { smx_action_t action; smx_host_t host; host = SIMIX_host_self(); XBT_DEBUG("Handle real computation time: %f flops", flops); action = simcall_host_execute("computation", host, flops, 1); #ifdef HAVE_TRACING simcall_set_category (action, TRACE_internal_smpi_get_category()); #endif simcall_host_execution_wait(action); }
/** * \brief Return the total energy consumed by a host (in Joules) * * \return Returns the consumed energy */ double smpi_get_host_consumed_energy() { return sg_host_get_consumed_energy(SIMIX_host_self()); }
/** @brief Gets the pstate at which the processor currently running */ int smpi_get_host_pstate() { return sg_host_get_pstate(SIMIX_host_self()); }
/** * \brief Sets the pstate at which the processor should run * * \param pstate_index pstate to switch to */ void smpi_set_host_pstate(int pstate_index) { sg_host_set_pstate(SIMIX_host_self(), pstate_index); }
/** * \brief Return the number of pstates defined for the current host */ int smpi_get_host_nb_pstates() { return sg_host_get_nb_pstates(SIMIX_host_self()); }
/** * \brief Return the current speed of the processor (in flop/s) * * \return Returns the current processor speed */ double smpi_get_host_current_power_peak() { return SIMIX_host_self()->getPstateSpeedCurrent(); }
/** * \brief Return the speed of the processor (in flop/s) at a given pstate * * \param pstate_index pstate to test * \return Returns the processor speed associated with pstate_index */ double smpi_get_host_power_peak_at(int pstate_index) { return SIMIX_host_self()->getPstateSpeed(pstate_index); }
/** * \brief Return the current speed of the processor (in flop/s) * * \return Returns the current processor speed */ double smpi_get_host_current_power_peak(void) { return SIMIX_host_self()->currentPowerPeak(); }
/** * \brief Return the speed of the processor (in flop/s) at a given pstate * * \param pstate_index pstate to test * \return Returns the processor speed associated with pstate_index */ double smpi_get_host_power_peak_at(int pstate_index) { return SIMIX_host_self()->powerPeakAt(pstate_index); }
/** * \brief Return the current speed of the processor (in flop/s) * * \return Returns the current processor speed */ double smpi_get_host_current_power_peak(void) { return simcall_host_get_current_power_peak(SIMIX_host_self()); }
/** * \brief Return the speed of the processor (in flop/s) at a given pstate * * \param pstate_index pstate to test * \return Returns the processor speed associated with pstate_index */ double smpi_get_host_power_peak_at(int pstate_index) { return simcall_host_get_power_peak_at(SIMIX_host_self(), pstate_index); }