typedef struct workstation_CLM03 {
s_surf_resource_t generic_resource; /* Must remain first to add this to a trace */
typedef struct workstation_CLM03 {
s_surf_resource_t generic_resource; /* Must remain first to add this to a trace */
workstation->generic_resource.model = surf_workstation_model;
workstation->generic_resource.name = xbt_strdup(host->id);
workstation->generic_resource.model = surf_workstation_model;
workstation->generic_resource.name = xbt_strdup(host->id);
workstation->storage = xbt_lib_get_or_null(storage_lib,host->id,ROUTING_STORAGE_HOST_LEVEL);
workstation->net_elm = xbt_lib_get_or_null(host_lib,host->id,ROUTING_HOST_LEVEL);
XBT_DEBUG("Create workstation %s with %ld mounted disks",host->id,xbt_dynar_length(workstation->storage));
workstation->storage = xbt_lib_get_or_null(storage_lib,host->id,ROUTING_STORAGE_HOST_LEVEL);
workstation->net_elm = xbt_lib_get_or_null(host_lib,host->id,ROUTING_HOST_LEVEL);
XBT_DEBUG("Create workstation %s with %ld mounted disks",host->id,xbt_dynar_length(workstation->storage));
- void *cpu = ((workstation_CLM03_t) workstation)->cpu;
- return ((surf_resource_t) cpu)->model->extension.cpu.execute(cpu, size);
+ surf_resource_t cpu = ((surf_resource_t) surf_cpu_resource_priv(workstation));
+ return cpu->model->extension.cpu.execute(workstation, size);
}
static surf_action_t ws_action_sleep(void *workstation, double duration)
{
return surf_cpu_model->extension.cpu.
}
static surf_action_t ws_action_sleep(void *workstation, double duration)
{
return surf_cpu_model->extension.cpu.
- workstation_CLM03_t src = (workstation_CLM03_t) workstation_src;
- workstation_CLM03_t dst = (workstation_CLM03_t) workstation_dst;
+ workstation_CLM03_t src = surf_workstation_resource_priv(workstation_src);
+ workstation_CLM03_t dst = surf_workstation_resource_priv(workstation_dst);
return surf_network_model->extension.network.
communicate(src->net_elm,
dst->net_elm, size, rate);
return surf_network_model->extension.network.
communicate(src->net_elm,
dst->net_elm, size, rate);
}
static double ws_get_speed(void *workstation, double load)
{
return surf_cpu_model->extension.cpu.
}
static double ws_get_speed(void *workstation, double load)
{
return surf_cpu_model->extension.cpu.
static xbt_dynar_t ws_get_route(void *workstation_src, void *workstation_dst)
{
XBT_DEBUG("ws_get_route");
static xbt_dynar_t ws_get_route(void *workstation_src, void *workstation_dst)
{
XBT_DEBUG("ws_get_route");
- workstation_CLM03_t src = (workstation_CLM03_t) workstation_src;
- workstation_CLM03_t dst = (workstation_CLM03_t) workstation_dst;
+ workstation_CLM03_t src = surf_workstation_resource_priv(workstation_src);
+ workstation_CLM03_t dst = surf_workstation_resource_priv(workstation_dst);
return surf_network_model->extension.
network.get_route(src->net_elm,
dst->net_elm);
return surf_network_model->extension.
network.get_route(src->net_elm,
dst->net_elm);
- XBT_DEBUG("Search for storage name '%s' on '%s'",storage,((workstation_CLM03_t) workstation)->generic_resource.name);
+ XBT_DEBUG("Search for storage name '%s' on '%s'",storage,ws->generic_resource.name);
xbt_dynar_foreach(storage_list,cursor,mnt)
{
XBT_DEBUG("See '%s'",mnt.name);
xbt_dynar_foreach(storage_list,cursor,mnt)
{
XBT_DEBUG("See '%s'",mnt.name);
- if(!st) xbt_die("Can't find mount '%s' for '%s'",storage,((workstation_CLM03_t) workstation)->generic_resource.name);
+ if(!st) xbt_die("Can't find mount '%s' for '%s'",storage,ws->generic_resource.name);
-static surf_action_t ws_action_open(void *workstation, const char* mount, const char* path, const char* mode)
+static surf_action_t ws_action_open(void *workstation, const char* mount,
+ const char* path)
{
storage_t st = find_storage_on_mount_list(workstation, mount);
XBT_DEBUG("OPEN on disk '%s'",st->generic_resource.name);
surf_model_t model = st->generic_resource.model;
{
storage_t st = find_storage_on_mount_list(workstation, mount);
XBT_DEBUG("OPEN on disk '%s'",st->generic_resource.name);
surf_model_t model = st->generic_resource.model;
- return model->extension.storage.open(st, mount, path, mode);
+ return model->extension.storage.open(st, mount, path);
XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
surf_model_t model = st->generic_resource.model;
XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
surf_model_t model = st->generic_resource.model;
}
static surf_action_t ws_action_read(void *workstation, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
}
static surf_action_t ws_action_read(void *workstation, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
surf_workstation_model->extension.workstation.stat = ws_action_stat;
surf_workstation_model->extension.workstation.unlink = ws_action_unlink;
surf_workstation_model->extension.workstation.ls = ws_action_ls;
surf_workstation_model->extension.workstation.stat = ws_action_stat;
surf_workstation_model->extension.workstation.unlink = ws_action_unlink;
surf_workstation_model->extension.workstation.ls = ws_action_ls;
surf_cpu_model_init_Cas01();
surf_network_model_init_LegrandVelho();
xbt_dynar_push(model_list, &surf_workstation_model);
sg_platf_host_add_cb(workstation_new);
surf_cpu_model_init_Cas01();
surf_network_model_init_LegrandVelho();
xbt_dynar_push(model_list, &surf_workstation_model);
sg_platf_host_add_cb(workstation_new);
surf_workstation_model_init_internal();
xbt_dynar_push(model_list, &surf_workstation_model);
sg_platf_host_add_cb(workstation_new);
surf_workstation_model_init_internal();
xbt_dynar_push(model_list, &surf_workstation_model);
sg_platf_host_add_cb(workstation_new);