#include "portable.h"
#include "workstation_private.h"
#include "cpu_private.h"
-#include "network_private.h"
+#include "network_common.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
+ "Logging specific to the SURF workstation module");
surf_workstation_model_t surf_workstation_model = NULL;
xbt_dict_t workstation_set = NULL;
free(workstation);
}
-static void create_workstations(void)
+void create_workstations(void)
{
xbt_dict_cursor_t cursor = NULL;
char *name = NULL;
static void update_resource_state(void *id,
tmgr_trace_event_t event_type,
- double value)
+ double value, double date)
{
THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */
}
get_available_speed(((workstation_CLM03_t) workstation)->cpu);
}
+static xbt_dict_t get_properties(void *workstation)
+{
+ return surf_cpu_model->common_public->
+ get_properties(((workstation_CLM03_t) workstation)->cpu);
+}
+
static surf_action_t execute_parallel_task(int workstation_nb,
void **workstation_list,
double *computation_amount,
return surf_network_model->extension_public->get_link_latency(link);
}
+static int link_shared(const void *link)
+{
+ return surf_network_model->extension_public->get_link_latency(link);
+}
+
static void finalize(void)
{
xbt_dict_free(&workstation_set);
surf_workstation_model->extension_public->get_speed = get_speed;
surf_workstation_model->extension_public->get_available_speed =
get_available_speed;
+
+ /*manage the properties of the workstation*/
+ surf_workstation_model->common_public->get_properties = get_properties;
+
surf_workstation_model->extension_public->communicate = communicate;
surf_workstation_model->extension_public->execute_parallel_task =
execute_parallel_task;
get_link_bandwidth;
surf_workstation_model->extension_public->get_link_latency =
get_link_latency;
+ surf_workstation_model->extension_public->link_shared =
+ link_shared;
+
workstation_set = xbt_dict_new();
}
surf_workstation_model_init_internal();
surf_cpu_model_init_Cas01(filename);
surf_network_model_init_CM02(filename);
- create_workstations();
update_model_description(surf_workstation_model_description,
- surf_workstation_model_description_size,
- "CLM03",
- (surf_model_t) surf_workstation_model);
+ "CLM03",
+ (surf_model_t) surf_workstation_model);
xbt_dynar_push(model_list, &surf_workstation_model);
}
xbt_assert0(surf_cpu_model, "No CPU model defined yet!");
xbt_assert0(surf_network_model, "No network model defined yet!");
surf_workstation_model_init_internal();
- create_workstations();
update_model_description(surf_workstation_model_description,
- surf_workstation_model_description_size,
- "compound",
- (surf_model_t) surf_workstation_model);
+ "compound",
+ (surf_model_t) surf_workstation_model);
xbt_dynar_push(model_list, &surf_workstation_model);
}