From e8a8a4eff62f09fde8d73dae597bfbd09f3c9786 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Mon, 11 Jan 2016 11:56:07 +0100 Subject: [PATCH] Remove SIMIX wrappers --- include/simgrid/simix.h | 2 +- src/simgrid/host.cpp | 21 +++++++++++++-------- src/simix/smx_host.cpp | 28 ---------------------------- src/simix/smx_host_private.h | 5 ----- 4 files changed, 14 insertions(+), 42 deletions(-) diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 8cfd2db1ae..12e805b1f3 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -218,7 +218,7 @@ XBT_PUBLIC(void) SIMIX_host_on(sg_host_t host); XBT_PUBLIC(void) SIMIX_host_off(sg_host_t host, smx_process_t issuer); XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data); XBT_PUBLIC(void*) SIMIX_host_self_get_data(void); -XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_mounted_storage_list(sg_host_t host); + /********************************* Process ************************************/ XBT_PUBLIC(int) SIMIX_process_count(void); XBT_PUBLIC(smx_process_t) SIMIX_process_self(void); diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 1b3176c91a..19330ae0b7 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -12,6 +12,7 @@ #include "surf/surf.h" // routing_get_network_element_type FIXME:killme #include "src/simix/smx_private.hpp" +#include "src/surf/host_interface.hpp" size_t sg_host_count() { @@ -264,12 +265,16 @@ int Host::getPState() void Host::getParams(vm_params_t params) { - simgrid::simix::kernel(std::bind(SIMIX_host_get_params, this, params)); + simgrid::simix::kernel([&]() { + this->extension()->getParams(params); + }); } void Host::setParams(vm_params_t params) { - simgrid::simix::kernel(std::bind(SIMIX_host_set_params, this, params)); + simgrid::simix::kernel([&]() { + this->extension()->setParams(params); + }); } /** @@ -279,9 +284,9 @@ void Host::setParams(vm_params_t params) */ xbt_dict_t Host::getMountedStorageList() { - return simgrid::simix::kernel(std::bind( - SIMIX_host_get_mounted_storage_list, this - )); + return simgrid::simix::kernel([&] { + return this->extension()->getMountedStorageList(); + }); } /** @@ -291,9 +296,9 @@ xbt_dict_t Host::getMountedStorageList() */ xbt_dynar_t Host::getAttachedStorageList() { - return simgrid::simix::kernel(std::bind( - SIMIX_host_get_attached_storage_list, this - )); + return simgrid::simix::kernel([&] { + return this->extension()->getAttachedStorageList(); + }); } } diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 6bea3c18af..5a7f0fa611 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -529,31 +529,3 @@ void SIMIX_set_category(smx_synchro_t synchro, const char *category) synchro->comm.surf_comm->setCategory(category); } } - -/** - * \brief Function to get the parameters of the given the SIMIX host. - * - * \param host the host to get_phys_host (a sg_host_t) - * \param param the parameter object space to be overwritten (a ws_params_t) - */ -void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params) -{ - ind_vm->extension()->getParams(params); -} - -void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params) -{ - ind_vm->extension()->setParams(params); -} - -xbt_dict_t SIMIX_host_get_mounted_storage_list(sg_host_t host) -{ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return host->extension()->getMountedStorageList(); -} - -xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host) -{ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return host->extension()->getAttachedStorageList(); -} diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 5933ec2c13..ad4ec428f4 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -50,7 +50,6 @@ XBT_PRIVATE e_smx_state_t SIMIX_process_execution_get_state(smx_synchro_t synchr XBT_PRIVATE void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority); XBT_PRIVATE void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound); XBT_PRIVATE void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask); -XBT_PRIVATE xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host); XBT_PRIVATE void SIMIX_host_execution_suspend(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_host_execution_resume(smx_synchro_t synchro); @@ -88,10 +87,6 @@ XBT_PRIVATE void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsig XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm); -XBT_PRIVATE void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params); - -XBT_PRIVATE void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params); - SG_END_DECL() #endif -- 2.20.1