+///**
+// * \brief Returns a dict of all hosts.
+// *
+// * \return List of all hosts (as a #xbt_dict_t)
+// */
+//xbt_dict_t SIMIX_host_get_dict(void)
+//{
+// xbt_dict_t host_dict = xbt_dict_new_homogeneous(NULL);
+// xbt_lib_cursor_t cursor = NULL;
+// char *name = NULL;
+// void **host = NULL;
+//
+// xbt_lib_foreach(host_lib, cursor, name, host){
+// if(host[SIMIX_HOST_LEVEL])
+// xbt_dict_set(host_dict,name,host[SIMIX_HOST_LEVEL], NULL);
+// }
+// return host_dict;
+//}
+smx_host_t SIMIX_pre_host_get_by_name(smx_simcall_t simcall, const char *name){
+ return SIMIX_host_get_by_name(name);
+}
+smx_host_t SIMIX_host_get_by_name(const char *name){
+ xbt_assert(((simix_global != NULL)
+ && (host_lib != NULL)),
+ "Environment not set yet");
+
+ return xbt_lib_get_elm_or_null(host_lib, name);
+}
+
+smx_host_t SIMIX_host_self(void)
+{
+ smx_process_t process = SIMIX_process_self();
+ return (process == NULL) ? NULL : SIMIX_process_get_host(process);
+}
+
+const char* SIMIX_pre_host_self_get_name(smx_simcall_t simcall){
+ return SIMIX_host_self_get_name();
+}
+/* needs to be public and without simcall because it is called
+ by exceptions and logging events */
+const char* SIMIX_host_self_get_name(void)
+{
+ smx_host_t host = SIMIX_host_self();
+ if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
+ return "";
+
+ return SIMIX_host_get_name(host);
+}
+
+const char* SIMIX_pre_host_get_name(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_name(host);
+}
+const char* SIMIX_host_get_name(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters");
+
+ return sg_host_name(host);
+}
+
+xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_properties(host);
+}
+xbt_dict_t SIMIX_host_get_properties(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+ surf_model_t ws_model = surf_resource_model(host, SURF_WKS_LEVEL);
+ return ws_model->extension.workstation.get_properties(host);
+}
+
+double SIMIX_pre_host_get_speed(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_speed(host);
+}
+double SIMIX_host_get_speed(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+ surf_model_t ws_model = surf_resource_model(host, SURF_WKS_LEVEL);
+ return ws_model->extension.workstation.get_speed(host, 1.0);
+}
+
+double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_available_speed(host);
+}
+double SIMIX_host_get_available_speed(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+ surf_model_t ws_model = surf_resource_model(host, SURF_WKS_LEVEL);
+ return ws_model->extension.workstation.get_available_speed(host);
+}
+
+int SIMIX_pre_host_get_state(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_state(host);
+}
+int SIMIX_host_get_state(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+ surf_model_t ws_model = surf_resource_model(host, SURF_WKS_LEVEL);
+ return ws_model->extension.workstation.get_state(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)