surf_host_model = NULL;
surf_network_model = new NetworkL07Model();
surf_cpu_model_pm = new CpuL07Model();
- routing_model_create(surf_network_model->createNetworkLink("__loopback__",
+ routing_model_create(surf_network_model->createLink("__loopback__",
498000000, NULL,
0.000015, NULL,
SURF_RESOURCE_ON, NULL,
HostPtr HostL07Model::createHost(const char *name)
{
HostL07Ptr wk = NULL;
- xbt_assert(!surf_host_resource_priv(surf_host_resource_by_name(name)),
+ sg_host_t sg_host = sg_host_by_name(name);
+
+ xbt_assert(!surf_host_resource_priv(sg_host),
"Host '%s' declared several times in the platform file.",
name);
wk = new HostL07(this, name, NULL,
- static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL)),
- static_cast<CpuPtr>(xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL)));
+ sg_host_edge(sg_host),
+ sg_host_surfcpu(sg_host));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk);
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
xbt_dynar_free(&powerPeak); // kill memory leak
+ sg_host_t sg_host = sg_host_by_name(name);
- xbt_assert(!surf_host_resource_priv(surf_host_resource_by_name(name)),
+ xbt_assert(!surf_host_resource_priv(sg_host),
"Host '%s' declared several times in the platform file.",
name);
power_initial, power_scale, power_trace,
core, state_initial, state_trace);
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+ sg_host_surfcpu_set(sg_host, cpu);
return cpu;
}
-NetworkLinkPtr NetworkL07Model::createNetworkLink(const char *name,
+LinkPtr NetworkL07Model::createLink(const char *name,
double bw_initial,
tmgr_trace_t bw_trace,
double lat_initial,
/* Connect traces relative to cpu */
xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuL07Ptr host = static_cast<CpuL07Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuL07Ptr host = static_cast<CpuL07Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
e_surf_link_sharing_policy_t policy)
- : NetworkLink(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, bw_initial), history, state_trace)
+ : Link(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, bw_initial), history, state_trace)
{
m_bwCurrent = bw_initial;
if (bw_trace)