X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b3677b425b9cc6949c1573d59ac772540cbf4b2..40ffa837924e30c9aa35eefef1711601419d8de7:/src/simix/smx_host.c diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index 2ff44aa9a1..0ee1ee8c48 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -28,7 +28,6 @@ smx_host_t SIMIX_host_create(const char *name, s_smx_process_t proc; /* Host structure */ - smx_host->data = data; smx_host->process_list = xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup)); @@ -54,7 +53,7 @@ void SIMIX_host_on(smx_host_t h) xbt_assert((host != NULL), "Invalid parameters"); if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) { - surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON); + surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON); unsigned int cpt; smx_process_arg_t arg; xbt_dynar_foreach(host->boot_processes,cpt,arg) { @@ -71,19 +70,19 @@ void SIMIX_host_on(smx_host_t h) arg->argc, arg->argv, arg->properties, - arg->auto_restart); - } - else { + arg->auto_restart, + NULL); + } else { simcall_process_create(&process, - arg->argv[0], - arg->code, - NULL, - arg->hostname, - arg->kill_time, - arg->argc, - arg->argv, - arg->properties, - arg->auto_restart); + arg->argv[0], + arg->code, + NULL, + arg->hostname, + arg->kill_time, + arg->argc, + arg->argv, + arg->properties, + arg->auto_restart); } } } @@ -104,8 +103,8 @@ void SIMIX_host_off(smx_host_t h, smx_process_t issuer) xbt_assert((host != NULL), "Invalid parameters"); - if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) { - surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON); + if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_ON) { + surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_OFF); /* Clean Simulator data */ if (xbt_swag_size(host->process_list) != 0) { @@ -310,30 +309,6 @@ int SIMIX_host_get_state(smx_host_t host){ return surf_resource_get_state(surf_workstation_resource_priv(host)); } -void* SIMIX_pre_host_self_get_data(smx_simcall_t simcall){ - return SIMIX_host_self_get_data(); -} -void* SIMIX_host_self_get_data(void) -{ - smx_host_t self = SIMIX_host_self(); - return SIMIX_host_get_data(self); -} - -void SIMIX_host_self_set_data(void *data) -{ - smx_host_t self = SIMIX_host_self(); - SIMIX_host_set_data(self, data); -} - -void* SIMIX_pre_host_get_data(smx_simcall_t simcall,smx_host_t host){ - return SIMIX_host_get_data(host); -} -void* SIMIX_host_get_data(smx_host_t host){ - xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - - return SIMIX_host_priv(host)->data; -} - void _SIMIX_host_free_process_arg(void *data) { smx_process_arg_t arg = *(void**)data; @@ -416,7 +391,8 @@ void SIMIX_host_restart_processes(smx_host_t host) arg->argc, arg->argv, arg->properties, - arg->auto_restart); + arg->auto_restart, + NULL); } else { simcall_process_create(&process, arg->argv[0], @@ -447,16 +423,6 @@ void SIMIX_host_autorestart(smx_host_t host) xbt_die("No function for simix_global->autorestart"); } -void SIMIX_pre_host_set_data(smx_simcall_t simcall, smx_host_t host, void *data) { - SIMIX_host_set_data(host, data); -} -void SIMIX_host_set_data(smx_host_t host, void *data){ - xbt_assert((host != NULL), "Invalid parameters"); - xbt_assert((SIMIX_host_priv(host)->data == NULL), "Data already set"); - - SIMIX_host_priv(host)->data = data; -} - smx_action_t SIMIX_pre_host_execute(smx_simcall_t simcall,const char *name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask){ return SIMIX_host_execute(name, host, computation_amount, priority, bound, affinity_mask); @@ -559,15 +525,6 @@ smx_action_t SIMIX_host_parallel_execute(const char *name, return action; } -//FIXME: REMOVE not used -static surf_model_t get_ws_model_from_action(smx_action_t action) -{ - xbt_assert(action->type == SIMIX_ACTION_EXECUTE); - smx_host_t host = action->execution.host; - surf_model_t model = surf_resource_model(host, SURF_WKS_LEVEL); - return model; -} - void SIMIX_pre_host_execution_destroy(smx_simcall_t simcall, smx_action_t action){ SIMIX_host_execution_destroy(action); } @@ -793,12 +750,22 @@ void SIMIX_pre_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_para SIMIX_host_set_params(ind_vm, params); } -xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t simcall, smx_host_t host){ - return SIMIX_host_get_storage_list(host); +xbt_dict_t SIMIX_pre_host_get_mounted_storage_list(smx_simcall_t simcall, smx_host_t host){ + return SIMIX_host_get_mounted_storage_list(host); +} + +xbt_dict_t SIMIX_host_get_mounted_storage_list(smx_host_t host){ + xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); + + return surf_workstation_get_mounted_storage_list(host); +} + +xbt_dynar_t SIMIX_pre_host_get_attached_storage_list(smx_simcall_t simcall, smx_host_t host){ + return SIMIX_host_get_attached_storage_list(host); } -xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host){ +xbt_dynar_t SIMIX_host_get_attached_storage_list(smx_host_t host){ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); - return surf_workstation_get_storage_list(host); + return surf_workstation_get_attached_storage_list(host); }