X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ea55b530facfb04b499b016152f739e024445aa4..b7630a950a6b865fcc195c58e39e6c3cfa550ccb:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 363423b5f6..71bf7a5c57 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -43,7 +43,7 @@ void SIMIX_host_on(sg_host_t h) xbt_assert((host != NULL), "Invalid parameters"); - if (surf_host_get_state(surf_host_resource_priv(h))==SURF_RESOURCE_OFF) { + if (h->getState()==SURF_RESOURCE_OFF) { surf_host_set_state(surf_host_resource_priv(h), SURF_RESOURCE_ON); unsigned int cpt; @@ -96,7 +96,7 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) xbt_assert((host != NULL), "Invalid parameters"); - if (surf_host_get_state(surf_host_resource_priv(h))==SURF_RESOURCE_ON) { + if (h->getState()==SURF_RESOURCE_ON) { surf_host_set_state(surf_host_resource_priv(h), SURF_RESOURCE_OFF); /* Clean Simulator data */ @@ -162,7 +162,7 @@ const char* SIMIX_host_self_get_name(void) } xbt_dict_t SIMIX_host_get_properties(sg_host_t host){ - return surf_host_get_properties(surf_host_resource_priv(host)); + return sg_host_get_properties(host); } @@ -322,12 +322,7 @@ smx_synchro_t SIMIX_process_execute(smx_process_t issuer, const char *name, surf_action_set_data(synchro->execution.surf_exec, synchro); surf_action_set_priority(synchro->execution.surf_exec, priority); - /* Note (hypervisor): for multicore, the bound value being passed to the - * surf layer should not be zero (i.e., unlimited). It should be the - * capacity of a CPU core. */ - if (bound == 0) - surf_cpu_action_set_bound(synchro->execution.surf_exec, sg_host_get_speed(issuer->host)); - else + if (bound != 0) surf_cpu_action_set_bound(synchro->execution.surf_exec, bound); if (affinity_mask != 0) { @@ -367,9 +362,9 @@ smx_synchro_t SIMIX_process_parallel_execute(const char *name, /* FIXME: what happens if host_list contains VMs and PMs. If * execute_parallel_task() does not change the state of the model, we can mix * them. */ - surf_model_t ws_model = surf_resource_model(host_list[0], SURF_HOST_LEVEL); + surf_host_model_t ws_model = surf_host_get_model(host_list[0]); for (i = 1; i < host_nb; i++) { - surf_model_t ws_model_tmp = surf_resource_model(host_list[i], SURF_HOST_LEVEL); + surf_host_model_t ws_model_tmp = surf_host_get_model(host_list[0]); if (ws_model_tmp != ws_model) { XBT_CRITICAL("mixing VMs and PMs is not supported"); DIE_IMPOSSIBLE; @@ -504,7 +499,7 @@ void SIMIX_execution_finish(smx_synchro_t synchro) (int)synchro->state); } /* check if the host is down */ - if (surf_host_get_state(surf_host_resource_priv(simcall->issuer->host)) != SURF_RESOURCE_ON) { + if (simcall->issuer->host->getState() != SURF_RESOURCE_ON) { simcall->issuer->context->iwannadie = 1; } @@ -522,7 +517,7 @@ void SIMIX_post_host_execute(smx_synchro_t synchro) { if (synchro->type == SIMIX_SYNC_EXECUTE && /* FIMXE: handle resource failure * for parallel tasks too */ - surf_host_get_state(surf_host_resource_priv(synchro->execution.host)) == SURF_RESOURCE_OFF) { + synchro->execution.host->getState() == SURF_RESOURCE_OFF) { /* If the host running the synchro failed, notice it so that the asking * process can be killed if it runs on that host itself */ synchro->state = SIMIX_FAILED;