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
Update python/clusters-multicpu to the new API.
[simgrid.git]
/
examples
/
python
/
clusters-multicpu
/
clusters-multicpu.py
diff --git
a/examples/python/clusters-multicpu/clusters-multicpu.py
b/examples/python/clusters-multicpu/clusters-multicpu.py
index
b48cb38
..
6a4d783
100644
(file)
--- a/
examples/python/clusters-multicpu/clusters-multicpu.py
+++ b/
examples/python/clusters-multicpu/clusters-multicpu.py
@@
-58,8
+58,7
@@
class Receiver:
#####################################################################################################
#####################################################################################################
-def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], ident: int) -> typing.Tuple[simgrid.NetPoint,
- simgrid.NetPoint]:
+def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], ident: int) -> simgrid.NetZone:
r"""
Callback to set a cluster leaf/element
r"""
Callback to set a cluster leaf/element
@@
-94,24
+93,22
@@
def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], ident: int)
# setting my Torus parent zone
host_zone.set_parent(zone)
# setting my Torus parent zone
host_zone.set_parent(zone)
- gateway = None
# create CPUs
for i in range(num_cpus):
cpu_name = hostname + "-cpu" + str(i)
host = host_zone.create_host(cpu_name, speed).seal()
# the first CPU is the gateway
if i == 0:
# create CPUs
for i in range(num_cpus):
cpu_name = hostname + "-cpu" + str(i)
host = host_zone.create_host(cpu_name, speed).seal()
# the first CPU is the gateway
if i == 0:
- gateway = host.netpoint
+ host_zone.set_gateway(host.netpoint)
# create split-duplex link
link = host_zone.create_split_duplex_link("link-" + cpu_name, link_bw)
link.set_latency(link_lat).seal()
# connecting CPU to outer world
# create split-duplex link
link = host_zone.create_split_duplex_link("link-" + cpu_name, link_bw)
link.set_latency(link_lat).seal()
# connecting CPU to outer world
- host_zone.add_route(host.netpoint, None, None, None,
- [simgrid.LinkInRoute(link, simgrid.LinkInRoute.Direction.UP)], True)
+ host_zone.add_route(host, None, [simgrid.LinkInRoute(link, simgrid.LinkInRoute.Direction.UP)], True)
# seal newly created netzone
host_zone.seal()
# seal newly created netzone
host_zone.seal()
- return host_zone
.netpoint, gateway
+ return host_zone
#####################################################################################################
#####################################################################################################