X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e0412698e7573cf44491b46234b335bf400859e6..6270ece7967b322385bbff766ee5f882ba1ef2a2:/src/surf/host_ptask_L07.cpp diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 3dcb404e8d..ec97d10308 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -263,22 +263,14 @@ Action *HostL07Model::executeParallelTask(int host_nb, return action; } -Host *HostL07Model::createHost(const char *name) +Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu) { - HostL07 *wk = NULL; - 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); + HostL07 *host = new HostL07(this, name, NULL, netElm, cpu); - wk = new HostL07(this, name, NULL, - sg_host_edge(sg_host), - sg_host_surfcpu(sg_host)); - surf_callback_emit(hostCreatedCallbacks, wk); - xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk); + surf_callback_emit(hostCreatedCallbacks, host); + xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host); - return wk; + return host; } Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst, @@ -317,10 +309,6 @@ Cpu *CpuL07Model::createCpu(const char *name, xbt_dynar_t powerPeak, double power_initial = xbt_dynar_get_as(powerPeak, pstate, double); 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); - CpuL07 *cpu = new CpuL07(this, name, cpu_properties, power_initial, power_scale, power_trace, core, state_initial, state_trace); @@ -578,9 +566,9 @@ void LinkL07::updateLatency(double value, double date) } -bool LinkL07::isShared() +int LinkL07::sharingPolicy() { - return lmm_constraint_is_shared(getConstraint()); + return lmm_constraint_sharing_policy(getConstraint()); } /**********