X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9532edf044eed31bcf6de22916c8824e18f373ad..4365fa8e81736673eae923310a05cdbf78ec88d8:/src/simix/libsmx.c diff --git a/src/simix/libsmx.c b/src/simix/libsmx.c index 35b3c8ec62..0e63140dea 100644 --- a/src/simix/libsmx.c +++ b/src/simix/libsmx.c @@ -10,10 +10,12 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "mc/mc_replay.h" #include "smx_private.h" -#include "mc/mc_interface.h" +#include "mc/mc_forward.h" #include "xbt/ex.h" #include /* isfinite() */ +#include "mc/mc.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix); @@ -191,14 +193,24 @@ int simcall_host_get_nb_pstates(smx_host_t host) /** * \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 */ -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); +} +/** + * \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); } /** @@ -212,6 +224,19 @@ double simcall_host_get_consumed_energy(smx_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 + */ +double simcall_host_get_wattmin_at(msg_host_t host, int pstate){ + return simcall_BODY_host_get_wattmin_at(host, pstate); +} +/** \ingroup simix_host_management + * \brief Returns the amount of watt dissipated at the given pstate when the host burns CPU at 100% + */ +double simcall_host_get_wattmax_at(msg_host_t host, int pstate){ + return simcall_BODY_host_get_wattmax_at(host, pstate); +} + /** @@ -532,6 +557,24 @@ void simcall_vm_destroy(smx_host_t vm) simcall_BODY_vm_destroy(vm); } +/** + * \ingroup simix_vm_management + * \brief Encompassing simcall to prevent the removal of the src or the dst node at the end of a VM migration + * The simcall actually invokes the following calls: + * simcall_vm_set_affinity(vm, src_pm, 0); + * simcall_vm_migrate(vm, dst_pm); + * simcall_vm_resume(vm); + * + * It is called at the end of the migration_rx_fun function from msg/msg_vm.c + * + * \param vm VM to migrate + * \param src_pm Source physical host + * \param dst_pmt Destination physical host + */ +void simcall_vm_migratefrom_resumeto(smx_host_t vm, smx_host_t src_pm, smx_host_t dst_pm) +{ + simcall_BODY_vm_migratefrom_resumeto(vm, src_pm, dst_pm); +} /** * \ingroup simix_process_management @@ -737,7 +780,7 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time) if (simix_global->kill_process_function) { XBT_DEBUG("Set kill time %f for process %s(%s)",kill_time, process->name, sg_host_name(process->smx_host)); - SIMIX_timer_set(kill_time, simix_global->kill_process_function, process); + process->kill_timer = SIMIX_timer_set(kill_time, simix_global->kill_process_function, process); } } }