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
[surf] simgrid::surf::Host, add backlink and attach() method
[simgrid.git]
/
src
/
surf
/
sg_platf.cpp
diff --git
a/src/surf/sg_platf.cpp
b/src/surf/sg_platf.cpp
index
8efd18d
..
bc674ce
100644
(file)
--- a/
src/surf/sg_platf.cpp
+++ b/
src/surf/sg_platf.cpp
@@
-60,6
+60,7
@@
void sg_platf_new_host(sg_platf_host_cbarg_t host)
if (current_routing)
net = routing_add_host(current_routing, host);
if (current_routing)
net = routing_add_host(current_routing, host);
+ sg_host_t h = simgrid::Host::by_name_or_create(host->id);
simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu(
host->id,
host->speed_peak,
simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu(
host->id,
host->speed_peak,
@@
-70,9
+71,8
@@
void sg_platf_new_host(sg_platf_host_cbarg_t host)
host->initial_state,
host->state_trace,
host->properties);
host->initial_state,
host->state_trace,
host->properties);
- sg_host_surfcpu_register(sg_host_by_name(host->id), cpu);
- surf_host_model->createHost(host->id, net, cpu);
-
+ cpu->plug(h);
+ surf_host_model->createHost(host->id, net, cpu)->attach(h);
if (TRACE_is_enabled() && TRACE_needs_platform())
sg_instr_new_host(host);
}
if (TRACE_is_enabled() && TRACE_needs_platform())
sg_instr_new_host(host);
}