Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename some symbols around Link::isShared to make their purpose clear
[simgrid.git] / src / surf / host_ptask_L07.cpp
index c092c28..ec97d10 100644 (file)
@@ -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);
@@ -420,31 +408,6 @@ HostL07::HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEd
 {
 }
 
-double HostL07::getPowerPeakAt(int /*pstate_index*/)
-{
-       THROW_UNIMPLEMENTED;
-}
-
-int HostL07::getNbPstates()
-{
-       THROW_UNIMPLEMENTED;
-}
-
-void HostL07::setPstate(int /*pstate_index*/)
-{
-       THROW_UNIMPLEMENTED;
-}
-
-int HostL07::getPstate()
-{
-       THROW_UNIMPLEMENTED;
-}
-
-double HostL07::getConsumedEnergy()
-{
-       THROW_UNIMPLEMENTED;
-}
-
 CpuL07::CpuL07(CpuL07Model *model, const char* name, xbt_dict_t props,
                     double power_initial, double power_scale, tmgr_trace_t power_trace,
                           int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
@@ -603,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());
 }
 
 /**********