X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2a6c6f62af5b4823e5737e58f17150ce8dab1a95..19759270d7d4b85df2dd599fe8936278d840780a:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 6bea3c18af..a47fa092ed 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -44,7 +44,7 @@ void SIMIX_host_on(sg_host_t h) xbt_assert((host != NULL), "Invalid parameters"); - if (h->isOff()) { + if (h->is_off()) { simgrid::surf::Host* surf_host = h->extension(); surf_host->turnOn(); @@ -83,11 +83,6 @@ void SIMIX_host_on(sg_host_t h) } } -void simcall_HANDLER_host_off(smx_simcall_t simcall, sg_host_t h) -{ - SIMIX_host_off(h, simcall->issuer); -} - /** * \brief Stop the host if it is on * @@ -98,7 +93,7 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) xbt_assert((host != NULL), "Invalid parameters"); - if (h->isOn()) { + if (h->is_on()) { simgrid::surf::Host* surf_host = h->extension(); surf_host->turnOff(); @@ -111,7 +106,7 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) } } } else { - XBT_INFO("Host %s is already off",h->getName().c_str()); + XBT_INFO("Host %s is already off",h->name().c_str()); } } @@ -163,7 +158,7 @@ const char* SIMIX_host_self_get_name(void) if (host == NULL || SIMIX_process_self() == simix_global->maestro_process) return ""; - return SIMIX_host_get_name(host); + return sg_host_get_name(host); } void _SIMIX_host_free_process_arg(void *data) @@ -339,9 +334,11 @@ 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_host_model_t ws_model = surf_host_get_model(host_list[0]); + surf_host_model_t ws_model = + host_list[0]->extension()->getModel(); for (i = 1; i < host_nb; i++) { - surf_host_model_t ws_model_tmp = surf_host_get_model(host_list[0]); + surf_host_model_t ws_model_tmp = + host_list[i]->extension()->getModel(); if (ws_model_tmp != ws_model) { XBT_CRITICAL("mixing VMs and PMs is not supported"); DIE_IMPOSSIBLE; @@ -351,7 +348,7 @@ smx_synchro_t SIMIX_process_parallel_execute(const char *name, /* set surf's synchro */ if (!MC_is_active() && !MC_record_replay_is_active()) { synchro->execution.surf_exec = - surf_host_model_execute_parallel_task(surf_host_model, + surf_host_model->executeParallelTask( host_nb, host_list_cpy, flops_amount, bytes_amount, rate); synchro->execution.surf_exec->setData(synchro); @@ -478,7 +475,7 @@ void SIMIX_execution_finish(smx_synchro_t synchro) (int)synchro->state); } /* check if the host is down */ - if (simcall->issuer->host->isOff()) { + if (simcall->issuer->host->is_off()) { simcall->issuer->context->iwannadie = 1; } @@ -496,7 +493,7 @@ void SIMIX_post_host_execute(smx_synchro_t synchro) { if (synchro->type == SIMIX_SYNC_EXECUTE && /* FIMXE: handle resource failure * for parallel tasks too */ - synchro->execution.host->isOff()) { + synchro->execution.host->is_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; @@ -529,31 +526,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(); -}