- return(surf_workstation_resource->
- extension_public->get_speed(h->simdata->host,1.0));
+ return (surf_workstation_model->
+ extension_public->get_available_speed(host->simdata->host));
+}
+
+/**
+ * \brief Return the host by its name
+ *
+ * Finds a smx_host_t using its name.
+ * \param name The name of an host.
+ * \return The corresponding host
+ */
+smx_host_t SIMIX_host_get_by_name(const char *name)
+{
+ xbt_fifo_item_t i = NULL;
+ smx_host_t host = NULL;
+
+ xbt_assert0(((simix_global != NULL)
+ && (simix_global->host != NULL)),
+ "Environment not set yet");
+
+ xbt_fifo_foreach(simix_global->host, i, host, smx_host_t) {
+ if (strcmp(host->name, name) == 0)
+ return host;
+ }
+ return NULL;