A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kill the surf::Host subclasses (surf::HostModel remain subclassed)
[simgrid.git]
/
src
/
surf
/
host_ptask_L07.cpp
diff --git
a/src/surf/host_ptask_L07.cpp
b/src/surf/host_ptask_L07.cpp
index
d6d022a
..
f8e7b04
100644
(file)
--- a/
src/surf/host_ptask_L07.cpp
+++ b/
src/surf/host_ptask_L07.cpp
@@
-270,14
+270,11
@@
Action *HostL07Model::executeParallelTask(int host_nb,
return action;
}
return action;
}
-Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu)
+Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu
, xbt_dict_t props
)
{
{
- HostL07 *host = new HostL07(this, name, NULL, netElm, cpu);
-
- surf_callback_emit(hostCreatedCallbacks, host);
- xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host);
-
- return host;
+ return new simgrid::surf::Host(this, name, props,
+ (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
+ netElm, cpu);
}
Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
}
Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
@@
-299,27
+296,15
@@
Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
return res;
}
return res;
}
-xbt_dynar_t HostL07Model::getRoute(Host *src, Host *dst)
-{
- xbt_dynar_t route=NULL;
- routing_platf->getRouteAndLatency(src->p_netElm, dst->p_netElm, &route, NULL);
- return route;
-}
-
Cpu *CpuL07Model::createCpu(const char *name, xbt_dynar_t powerPeak,
int pstate, double power_scale,
tmgr_trace_t power_trace, int core,
e_surf_resource_state_t state_initial,
Cpu *CpuL07Model::createCpu(const char *name, xbt_dynar_t powerPeak,
int pstate, double power_scale,
tmgr_trace_t power_trace, int core,
e_surf_resource_state_t state_initial,
- tmgr_trace_t state_trace,
- xbt_dict_t cpu_properties)
+ tmgr_trace_t state_trace)
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
- sg_host_t sg_host = sg_host_by_name(name);
-
- CpuL07 *cpu = new CpuL07(this, name, cpu_properties,
- power_initial, power_scale, power_trace,
+ CpuL07 *cpu = new CpuL07(this, name, power_initial, power_scale, power_trace,
core, state_initial, state_trace);
core, state_initial, state_trace);
- sg_host_surfcpu_register(sg_host, cpu);
return cpu;
}
return cpu;
}
@@
-341,7
+326,7
@@
Link* NetworkL07Model::createLink(const char *name,
lat_initial, lat_trace,
state_initial, state_trace,
policy);
lat_initial, lat_trace,
state_initial, state_trace,
policy);
-
surf_callback_emit(networkLinkCreatedCallbacks,
link);
+
networkLinkCreatedCallbacks(
link);
return link;
}
return link;
}
@@
-409,16
+394,10
@@
void HostL07Model::addTraces()
/************
* Resource *
************/
/************
* Resource *
************/
-
-HostL07::HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu)
- : Host(model, name, props, NULL, netElm, cpu)
-{
-}
-
-CpuL07::CpuL07(CpuL07Model *model, const char* name, xbt_dict_t props,
+CpuL07::CpuL07(CpuL07Model *model, const char* name,
double speedInitial, double speedScale, tmgr_trace_t speedTrace,
int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
double speedInitial, double speedScale, tmgr_trace_t speedTrace,
int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
- : Cpu(model, name,
props,
lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
+ : Cpu(model, name, lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
core, speedInitial, speedScale, state_initial)
{
xbt_assert(m_speedScale > 0, "Power has to be >0");
core, speedInitial, speedScale, state_initial)
{
xbt_assert(m_speedScale > 0, "Power has to be >0");
@@
-432,6
+411,10
@@
CpuL07::CpuL07(CpuL07Model *model, const char* name, xbt_dict_t props,
p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
}
p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
}
+CpuL07::~CpuL07()
+{
+}
+
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
double bw_initial,
tmgr_trace_t bw_trace,
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
double bw_initial,
tmgr_trace_t bw_trace,
@@
-462,12
+445,12
@@
Action *CpuL07::execute(double size)
double *flops_amount = xbt_new0(double, 1);
double *bytes_amount = xbt_new0(double, 1);
double *flops_amount = xbt_new0(double, 1);
double *bytes_amount = xbt_new0(double, 1);
- host_list[0] =
sg_host_by_name(getName()
);
+ host_list[0] =
getHost(
);
flops_amount[0] = size;
flops_amount[0] = size;
- return static_cast<
HostL07Model*>(getModel())->executeParallelTask(1, host_list,
- flops_amount,
-
bytes_amount, -1);
+ return static_cast<
CpuL07Model*>(getModel())
+ ->p_hostModel
+
->executeParallelTask( 1, host_list, flops_amount,
bytes_amount, -1);
}
Action *CpuL07::sleep(double duration)
}
Action *CpuL07::sleep(double duration)
@@
-538,11
+521,6
@@
void LinkL07::updateState(tmgr_trace_event_t event_type, double value, double da
return;
}
return;
}
-e_surf_resource_state_t HostL07::getState() {
- return p_cpu->getState();
-}
-
-
double LinkL07::getBandwidth()
{
return m_bwCurrent;
double LinkL07::getBandwidth()
{
return m_bwCurrent;