From: Gabriel Corona Date: Tue, 5 Jan 2016 15:08:52 +0000 (+0100) Subject: [simix] Call directly the C++ SURF API instead of calling the C bindings X-Git-Tag: v3_13~1308 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5b8393a87f56dc683c4673c5258ca6bf07f33d52 [simix] Call directly the C++ SURF API instead of calling the C bindings --- diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 57f1fac826..65d59d67f7 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -10,6 +10,7 @@ #include "xbt/dict.h" #include "mc/mc.h" #include "src/mc/mc_replay.h" +#include "src/surf/host_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts"); @@ -44,7 +45,8 @@ void SIMIX_host_on(sg_host_t h) xbt_assert((host != NULL), "Invalid parameters"); if (h->isOff()) { - surf_host_turn_on(surf_host_resource_priv(h)); + simgrid::surf::Host* surf_host = h->extension(); + surf_host_turn_on(surf_host); unsigned int cpt; smx_process_arg_t arg; @@ -97,7 +99,8 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) xbt_assert((host != NULL), "Invalid parameters"); if (h->isOn()) { - surf_host_turn_off(surf_host_resource_priv(h)); + simgrid::surf::Host* surf_host = h->extension(); + surf_host_turn_off(surf_host); /* Clean Simulator data */ if (xbt_swag_size(host->process_list) != 0) { @@ -561,24 +564,22 @@ void SIMIX_set_category(smx_synchro_t synchro, const char *category) */ void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params) { - /* jump to ws_get_params(). */ - surf_host_get_params(ind_vm, params); + ind_vm->extension()->getParams(params); } void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params) { - /* jump to ws_set_params(). */ - surf_host_set_params(ind_vm, params); + ind_vm->extension()->setParams(params); } -xbt_dict_t SIMIX_host_get_mounted_storage_list(sg_host_t host){ +xbt_dict_t SIMIX_host_get_mounted_storage_list(sg_host_t host) +{ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - - return surf_host_get_mounted_storage_list(host); + return host->extension()->getMountedStorageList(); } -xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host){ +xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host) +{ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - - return surf_host_get_attached_storage_list(host); + return host->extension()->getAttachedStorageList(); }