1 /* Copyright (c) 2007-2013. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "smx_private.h"
8 #include "xbt/sysdep.h"
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
14 "Logging specific to SIMIX (hosts)");
16 static void SIMIX_execution_finish(smx_action_t action);
19 * \brief Internal function to create a SIMIX host.
20 * \param name name of the host to create
21 * \param workstation the SURF workstation to encapsulate
22 * \param data some user data (may be NULL)
24 smx_host_t SIMIX_host_create(const char *name,
25 void *workstation, void *data)
27 smx_host_priv_t smx_host = xbt_new0(s_smx_host_priv_t, 1);
31 smx_host->data = data;
32 smx_host->process_list =
33 xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
35 /* Update global variables */
36 xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
38 return xbt_lib_get_or_null(host_lib, name, SIMIX_HOST_LEVEL);
41 void SIMIX_pre_host_on(smx_simcall_t simcall, smx_host_t h)
47 * \brief Start the host if it is off
50 void SIMIX_host_on(smx_host_t h)
52 smx_host_priv_t host = SIMIX_host_priv(h);
54 xbt_assert((host != NULL), "Invalid parameters");
56 if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
57 surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
59 smx_process_arg_t arg;
60 xbt_dynar_foreach(host->boot_processes,cpt,arg) {
61 smx_process_t process;
63 XBT_DEBUG("Booting Process %s(%s) right now", arg->argv[0], arg->hostname);
64 if (simix_global->create_process_function) {
65 simix_global->create_process_function(&process,
77 simcall_process_create(&process,
92 void SIMIX_pre_host_off(smx_simcall_t simcall, smx_host_t h)
94 SIMIX_host_off(h, simcall->issuer);
98 * \brief Stop the host if it is on
101 void SIMIX_host_off(smx_host_t h, smx_process_t issuer)
103 smx_host_priv_t host = SIMIX_host_priv(h);
105 xbt_assert((host != NULL), "Invalid parameters");
107 if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
108 surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
110 /* Clean Simulator data */
111 if (xbt_swag_size(host->process_list) != 0) {
112 smx_process_t process = NULL;
113 xbt_swag_foreach(process, host->process_list) {
114 SIMIX_process_kill(process, issuer);
115 XBT_DEBUG("Killing %s on %s by %s", process->name, sg_host_name(process->smx_host), issuer->name);
122 * \brief Internal function to destroy a SIMIX host.
124 * \param h the host to destroy (a smx_host_t)
126 void SIMIX_host_destroy(void *h)
128 smx_host_priv_t host = (smx_host_priv_t) h;
130 xbt_assert((host != NULL), "Invalid parameters");
132 /* Clean Simulator data */
133 if (xbt_swag_size(host->process_list) != 0) {
134 char *msg = xbt_strdup("Shutting down host, but it's not empty:");
136 smx_process_t process = NULL;
138 xbt_swag_foreach(process, host->process_list) {
139 tmp = bprintf("%s\n\t%s", msg, process->name);
143 SIMIX_display_process_status();
144 THROWF(arg_error, 0, "%s", msg);
146 xbt_dynar_free(&host->auto_restart_processes);
147 xbt_dynar_free(&host->boot_processes);
148 xbt_swag_free(host->process_list);
150 /* Clean host structure */
156 // * \brief Returns a dict of all hosts.
158 // * \return List of all hosts (as a #xbt_dict_t)
160 //xbt_dict_t SIMIX_host_get_dict(void)
162 // xbt_dict_t host_dict = xbt_dict_new_homogeneous(NULL);
163 // xbt_lib_cursor_t cursor = NULL;
164 // char *name = NULL;
165 // void **host = NULL;
167 // xbt_lib_foreach(host_lib, cursor, name, host){
168 // if(host[SIMIX_HOST_LEVEL])
169 // xbt_dict_set(host_dict,name,host[SIMIX_HOST_LEVEL], NULL);
173 smx_host_t SIMIX_pre_host_get_by_name(smx_simcall_t simcall, const char *name){
174 return SIMIX_host_get_by_name(name);
176 smx_host_t SIMIX_host_get_by_name(const char *name){
177 xbt_assert(((simix_global != NULL)
178 && (host_lib != NULL)),
179 "Environment not set yet");
181 return xbt_lib_get_elm_or_null(host_lib, name);
184 smx_host_t SIMIX_host_self(void)
186 smx_process_t process = SIMIX_process_self();
187 return (process == NULL) ? NULL : SIMIX_process_get_host(process);
190 const char* SIMIX_pre_host_self_get_name(smx_simcall_t simcall){
191 return SIMIX_host_self_get_name();
193 /* needs to be public and without simcall because it is called
194 by exceptions and logging events */
195 const char* SIMIX_host_self_get_name(void)
197 smx_host_t host = SIMIX_host_self();
198 if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
201 return SIMIX_host_get_name(host);
204 const char* SIMIX_pre_host_get_name(smx_simcall_t simcall, smx_host_t host){
205 return SIMIX_host_get_name(host);
207 const char* SIMIX_host_get_name(smx_host_t host){
208 xbt_assert((host != NULL), "Invalid parameters");
210 return sg_host_name(host);
213 xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t simcall, smx_host_t host){
214 return SIMIX_host_get_properties(host);
216 xbt_dict_t SIMIX_host_get_properties(smx_host_t host){
217 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
219 return surf_resource_get_properties(surf_workstation_resource_priv(host));
222 double SIMIX_pre_host_get_speed(smx_simcall_t simcall, smx_host_t host){
223 return SIMIX_host_get_speed(host);
225 double SIMIX_host_get_speed(smx_host_t host){
226 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
227 return surf_workstation_get_speed(host, 1.0);
230 int SIMIX_pre_host_get_core(smx_simcall_t simcall, smx_host_t host){
231 return SIMIX_host_get_core(host);
233 int SIMIX_host_get_core(smx_host_t host){
234 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
236 return surf_workstation_get_core(host);
239 xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t simcall, smx_host_t host){
240 return SIMIX_host_get_process_list(host);
243 xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
244 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
245 smx_host_priv_t host_priv = SIMIX_host_priv(host);
247 return host_priv->process_list;
251 double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
252 return SIMIX_host_get_available_speed(host);
254 double SIMIX_host_get_available_speed(smx_host_t host){
255 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
257 return surf_workstation_get_available_speed(host);
260 double SIMIX_pre_host_get_current_power_peak(smx_simcall_t simcall, smx_host_t host){
261 return SIMIX_host_get_current_power_peak(host);
263 double SIMIX_host_get_current_power_peak(smx_host_t host) {
264 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
265 return surf_workstation_get_current_power_peak(host);
268 double SIMIX_pre_host_get_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index){
269 return SIMIX_host_get_power_peak_at(host, pstate_index);
271 double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index) {
272 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
274 return surf_workstation_get_power_peak_at(host, pstate_index);
277 int SIMIX_pre_host_get_nb_pstates(smx_simcall_t simcall, smx_host_t host){
278 return SIMIX_host_get_nb_pstates(host);
280 int SIMIX_host_get_nb_pstates(smx_host_t host) {
281 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
283 return surf_workstation_get_nb_pstates(host);
287 void SIMIX_pre_host_set_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index){
288 SIMIX_host_set_power_peak_at(host, pstate_index);
290 void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index) {
291 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
293 surf_workstation_set_power_peak_at(host, pstate_index);
296 double SIMIX_pre_host_get_consumed_energy(smx_simcall_t simcall, smx_host_t host){
297 return SIMIX_host_get_consumed_energy(host);
299 double SIMIX_host_get_consumed_energy(smx_host_t host) {
300 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
301 return surf_workstation_get_consumed_energy(host);
304 int SIMIX_pre_host_get_state(smx_simcall_t simcall, smx_host_t host){
305 return SIMIX_host_get_state(host);
307 int SIMIX_host_get_state(smx_host_t host){
308 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
310 return surf_resource_get_state(surf_workstation_resource_priv(host));
313 void* SIMIX_pre_host_self_get_data(smx_simcall_t simcall){
314 return SIMIX_host_self_get_data();
316 void* SIMIX_host_self_get_data(void)
318 smx_host_t self = SIMIX_host_self();
319 return SIMIX_host_get_data(self);
322 void SIMIX_host_self_set_data(void *data)
324 smx_host_t self = SIMIX_host_self();
325 SIMIX_host_set_data(self, data);
328 void* SIMIX_pre_host_get_data(smx_simcall_t simcall,smx_host_t host){
329 return SIMIX_host_get_data(host);
331 void* SIMIX_host_get_data(smx_host_t host){
332 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
334 return SIMIX_host_priv(host)->data;
337 void _SIMIX_host_free_process_arg(void *data)
339 smx_process_arg_t arg = *(void**)data;
341 for (i = 0; i < arg->argc; i++)
342 xbt_free(arg->argv[i]);
348 * \brief Add a process to the list of the processes that the host will restart when it comes back
349 * This function add a process to the list of the processes that will be restarted when the host comes
350 * back. It is expected that this function is called when the host is down.
351 * The processes will only be restarted once, meaning that you will have to register the process
352 * again to restart the process again.
354 void SIMIX_host_add_auto_restart_process(smx_host_t host,
356 xbt_main_func_t code,
358 const char *hostname,
360 int argc, char **argv,
361 xbt_dict_t properties,
364 if (!SIMIX_host_priv(host)->auto_restart_processes) {
365 SIMIX_host_priv(host)->auto_restart_processes = xbt_dynar_new(sizeof(smx_process_arg_t),_SIMIX_host_free_process_arg);
367 smx_process_arg_t arg = xbt_new(s_smx_process_arg_t,1);
368 arg->name = xbt_strdup(name);
371 arg->hostname = hostname;
372 arg->kill_time = kill_time;
375 arg->argv = xbt_new(char*,argc + 1);
378 for (i = 0; i < argc; i++) {
379 arg->argv[i] = xbt_strdup(argv[i]);
381 arg->argv[argc] = NULL;
383 arg->properties = properties;
384 arg->auto_restart = auto_restart;
386 if( SIMIX_host_get_state(host) == SURF_RESOURCE_OFF
387 && !xbt_dict_get_or_null(watched_hosts_lib,sg_host_name(host))){
388 xbt_dict_set(watched_hosts_lib,sg_host_name(host),host,NULL);
389 XBT_DEBUG("Have pushed host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_name(host));
391 xbt_dynar_push_as(SIMIX_host_priv(host)->auto_restart_processes,smx_process_arg_t,arg);
394 * \brief Restart the list of processes that have been registered to the host
396 void SIMIX_host_restart_processes(smx_host_t host)
399 smx_process_arg_t arg;
400 xbt_dynar_t process_list = SIMIX_host_priv(host)->auto_restart_processes;
404 xbt_dynar_foreach (process_list, cpt, arg) {
406 smx_process_t process;
408 XBT_DEBUG("Restarting Process %s(%s) right now", arg->argv[0], arg->hostname);
409 if (simix_global->create_process_function) {
410 simix_global->create_process_function(&process,
421 simcall_process_create(&process,
433 /* arg->argv is used by the process created above. Hide it to
434 * _SIMIX_host_free_process_arg() which is called by xbt_dynar_reset()
439 xbt_dynar_reset(process_list);
442 void SIMIX_host_autorestart(smx_host_t host)
444 if(simix_global->autorestart)
445 simix_global->autorestart(host);
447 xbt_die("No function for simix_global->autorestart");
450 void SIMIX_pre_host_set_data(smx_simcall_t simcall, smx_host_t host, void *data) {
451 SIMIX_host_set_data(host, data);
453 void SIMIX_host_set_data(smx_host_t host, void *data){
454 xbt_assert((host != NULL), "Invalid parameters");
455 xbt_assert((SIMIX_host_priv(host)->data == NULL), "Data already set");
457 SIMIX_host_priv(host)->data = data;
460 smx_action_t SIMIX_pre_host_execute(smx_simcall_t simcall,const char *name,
461 smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask){
462 return SIMIX_host_execute(name, host, computation_amount, priority, bound, affinity_mask);
464 smx_action_t SIMIX_host_execute(const char *name,
465 smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask){
467 /* alloc structures and initialize */
468 smx_action_t action = xbt_mallocator_get(simix_global->action_mallocator);
469 action->type = SIMIX_ACTION_EXECUTE;
470 action->name = xbt_strdup(name);
471 action->state = SIMIX_RUNNING;
472 action->execution.host = host;
475 action->category = NULL;
478 /* set surf's action */
479 if (!MC_is_active()) {
481 action->execution.surf_exec = surf_workstation_execute(host, computation_amount);
482 surf_action_set_data(action->execution.surf_exec, action);
483 surf_action_set_priority(action->execution.surf_exec, priority);
485 /* Note (hypervisor): for multicore, the bound value being passed to the
486 * surf layer should not be zero (i.e., unlimited). It should be the
487 * capacity of a CPU core. */
489 surf_cpu_action_set_bound(action->execution.surf_exec, SIMIX_host_get_speed(host));
491 surf_cpu_action_set_bound(action->execution.surf_exec, bound);
493 if (affinity_mask != 0) {
494 /* just a double check to confirm that this host is the host where this task is running. */
495 xbt_assert(action->execution.host == host);
496 surf_cpu_action_set_affinity(action->execution.surf_exec, host, affinity_mask);
500 XBT_DEBUG("Create execute action %p", action);
505 smx_action_t SIMIX_pre_host_parallel_execute(smx_simcall_t simcall, const char *name,
506 int host_nb, smx_host_t *host_list,
507 double *computation_amount, double *communication_amount,
508 double amount, double rate){
509 return SIMIX_host_parallel_execute(name, host_nb, host_list, computation_amount,
510 communication_amount, amount, rate);
512 smx_action_t SIMIX_host_parallel_execute(const char *name,
513 int host_nb, smx_host_t *host_list,
514 double *computation_amount, double *communication_amount,
515 double amount, double rate){
517 void **workstation_list = NULL;
520 /* alloc structures and initialize */
521 smx_action_t action = xbt_mallocator_get(simix_global->action_mallocator);
522 action->type = SIMIX_ACTION_PARALLEL_EXECUTE;
523 action->name = xbt_strdup(name);
524 action->state = SIMIX_RUNNING;
525 action->execution.host = NULL; /* FIXME: do we need the list of hosts? */
528 action->category = NULL;
531 /* set surf's action */
532 workstation_list = xbt_new0(void *, host_nb);
533 for (i = 0; i < host_nb; i++)
534 workstation_list[i] = surf_workstation_resource_priv(host_list[i]);
537 /* FIXME: what happens if host_list contains VMs and PMs. If
538 * execute_parallel_task() does not change the state of the model, we can mix
540 surf_model_t ws_model = surf_resource_model(host_list[0], SURF_WKS_LEVEL);
541 for (i = 1; i < host_nb; i++) {
542 surf_model_t ws_model_tmp = surf_resource_model(host_list[i], SURF_WKS_LEVEL);
543 if (ws_model_tmp != ws_model) {
544 XBT_CRITICAL("mixing VMs and PMs is not supported");
549 /* set surf's action */
550 if (!MC_is_active()) {
551 action->execution.surf_exec =
552 surf_workstation_model_execute_parallel_task((surf_workstation_model_t)surf_workstation_model,
553 host_nb, workstation_list, computation_amount, communication_amount, rate);
555 surf_action_set_data(action->execution.surf_exec, action);
557 XBT_DEBUG("Create parallel execute action %p", action);
562 //FIXME: REMOVE not used
563 static surf_model_t get_ws_model_from_action(smx_action_t action)
565 xbt_assert(action->type == SIMIX_ACTION_EXECUTE);
566 smx_host_t host = action->execution.host;
567 surf_model_t model = surf_resource_model(host, SURF_WKS_LEVEL);
571 void SIMIX_pre_host_execution_destroy(smx_simcall_t simcall, smx_action_t action){
572 SIMIX_host_execution_destroy(action);
574 void SIMIX_host_execution_destroy(smx_action_t action){
575 XBT_DEBUG("Destroy action %p", action);
577 if (action->execution.surf_exec) {
578 surf_action_unref(action->execution.surf_exec);
579 action->execution.surf_exec = NULL;
581 xbt_free(action->name);
582 xbt_mallocator_release(simix_global->action_mallocator, action);
585 void SIMIX_pre_host_execution_cancel(smx_simcall_t simcall, smx_action_t action){
586 SIMIX_host_execution_cancel(action);
588 void SIMIX_host_execution_cancel(smx_action_t action){
589 XBT_DEBUG("Cancel action %p", action);
591 if (action->execution.surf_exec)
592 surf_action_cancel(action->execution.surf_exec);
595 double SIMIX_pre_host_execution_get_remains(smx_simcall_t simcall, smx_action_t action){
596 return SIMIX_host_execution_get_remains(action);
598 double SIMIX_host_execution_get_remains(smx_action_t action){
601 if (action->state == SIMIX_RUNNING)
602 result = surf_action_get_remains(action->execution.surf_exec);
607 e_smx_state_t SIMIX_pre_host_execution_get_state(smx_simcall_t simcall, smx_action_t action){
608 return SIMIX_host_execution_get_state(action);
610 e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action){
611 return action->state;
614 void SIMIX_pre_host_execution_set_priority(smx_simcall_t simcall, smx_action_t action,
616 SIMIX_host_execution_set_priority(action, priority);
618 void SIMIX_host_execution_set_priority(smx_action_t action, double priority){
620 if(action->execution.surf_exec)
621 surf_action_set_priority(action->execution.surf_exec, priority);
624 void SIMIX_pre_host_execution_set_bound(smx_simcall_t simcall, smx_action_t action,
626 SIMIX_host_execution_set_bound(action, bound);
628 void SIMIX_host_execution_set_bound(smx_action_t action, double bound){
630 if(action->execution.surf_exec)
631 surf_cpu_action_set_bound(action->execution.surf_exec, bound);
634 void SIMIX_pre_host_execution_set_affinity(smx_simcall_t simcall,
635 smx_action_t action, smx_host_t host, unsigned long mask){
636 SIMIX_host_execution_set_affinity(action, host, mask);
638 void SIMIX_host_execution_set_affinity(smx_action_t action, smx_host_t host, unsigned long mask){
639 xbt_assert(action->type == SIMIX_ACTION_EXECUTE);
641 if (action->execution.surf_exec) {
642 /* just a double check to confirm that this host is the host where this task is running. */
643 xbt_assert(action->execution.host == host);
644 surf_cpu_action_set_affinity(action->execution.surf_exec, host, mask);
648 void SIMIX_pre_host_execution_wait(smx_simcall_t simcall, smx_action_t action){
650 XBT_DEBUG("Wait for execution of action %p, state %d", action, (int)action->state);
652 /* Associate this simcall to the action */
653 xbt_fifo_push(action->simcalls, simcall);
654 simcall->issuer->waiting_action = action;
656 /* set surf's action */
657 if (MC_is_active()) {
658 action->state = SIMIX_DONE;
659 SIMIX_execution_finish(action);
663 /* If the action is already finished then perform the error handling */
664 if (action->state != SIMIX_RUNNING)
665 SIMIX_execution_finish(action);
668 void SIMIX_host_execution_suspend(smx_action_t action)
670 if(action->execution.surf_exec)
671 surf_action_suspend(action->execution.surf_exec);
674 void SIMIX_host_execution_resume(smx_action_t action)
676 if(action->execution.surf_exec)
677 surf_action_resume(action->execution.surf_exec);
680 void SIMIX_execution_finish(smx_action_t action)
682 xbt_fifo_item_t item;
683 smx_simcall_t simcall;
685 xbt_fifo_foreach(action->simcalls, item, simcall, smx_simcall_t) {
687 switch (action->state) {
690 /* do nothing, action done */
691 XBT_DEBUG("SIMIX_execution_finished: execution successful");
695 XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", sg_host_name(simcall->issuer->smx_host));
696 simcall->issuer->context->iwannadie = 1;
697 SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
701 XBT_DEBUG("SIMIX_execution_finished: execution canceled");
702 SMX_EXCEPTION(simcall->issuer, cancel_error, 0, "Canceled");
706 xbt_die("Internal error in SIMIX_execution_finish: unexpected action state %d",
709 /* check if the host is down */
710 if (surf_resource_get_state(surf_workstation_resource_priv(simcall->issuer->smx_host)) != SURF_RESOURCE_ON) {
711 simcall->issuer->context->iwannadie = 1;
714 simcall->issuer->waiting_action = NULL;
715 simcall_host_execution_wait__set__result(simcall, action->state);
716 SIMIX_simcall_answer(simcall);
719 /* We no longer need it */
720 SIMIX_host_execution_destroy(action);
724 void SIMIX_post_host_execute(smx_action_t action)
726 if (action->type == SIMIX_ACTION_EXECUTE && /* FIMXE: handle resource failure
727 * for parallel tasks too */
728 surf_resource_get_state(surf_workstation_resource_priv(action->execution.host)) == SURF_RESOURCE_OFF) {
729 /* If the host running the action failed, notice it so that the asking
730 * process can be killed if it runs on that host itself */
731 action->state = SIMIX_FAILED;
732 } else if (surf_action_get_state(action->execution.surf_exec) == SURF_ACTION_FAILED) {
733 /* If the host running the action didn't fail, then the action was
735 action->state = SIMIX_CANCELED;
737 action->state = SIMIX_DONE;
740 if (action->execution.surf_exec) {
741 surf_action_unref(action->execution.surf_exec);
742 action->execution.surf_exec = NULL;
745 /* If there are simcalls associated with the action, then answer them */
746 if (xbt_fifo_size(action->simcalls)) {
747 SIMIX_execution_finish(action);
753 void SIMIX_pre_set_category(smx_simcall_t simcall, smx_action_t action,
754 const char *category){
755 SIMIX_set_category(action, category);
757 void SIMIX_set_category(smx_action_t action, const char *category)
759 if (action->state != SIMIX_RUNNING) return;
760 if (action->type == SIMIX_ACTION_EXECUTE){
761 surf_action_set_category(action->execution.surf_exec, category);
762 }else if (action->type == SIMIX_ACTION_COMMUNICATE){
763 surf_action_set_category(action->comm.surf_comm, category);
769 * \brief Function to get the parameters of the given the SIMIX host.
771 * \param host the host to get_phys_host (a smx_host_t)
772 * \param param the parameter object space to be overwritten (a ws_params_t)
774 void SIMIX_host_get_params(smx_host_t ind_vm, ws_params_t params)
776 /* jump to ws_get_params(). */
777 surf_workstation_get_params(ind_vm, params);
780 void SIMIX_pre_host_get_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params)
782 SIMIX_host_get_params(ind_vm, params);
785 void SIMIX_host_set_params(smx_host_t ind_vm, ws_params_t params)
787 /* jump to ws_set_params(). */
788 surf_workstation_set_params(ind_vm, params);
791 void SIMIX_pre_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params)
793 SIMIX_host_set_params(ind_vm, params);
796 xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t simcall, smx_host_t host){
797 return SIMIX_host_get_storage_list(host);
800 xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host){
801 xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
803 return surf_workstation_get_storage_list(host);