Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://github.com/mpoquet/simgrid
[simgrid.git] / examples / platforms / routing_cluster.lua
1 -- See routing_cluster.xml for description.
2 --
3
4 require "simgrid"
5 simgrid.engine.open()
6 simgrid.engine.AS_open{id="AS0",mode="Full"}
7   simgrid.engine.AS_open{id="my_cluster1",mode="Cluster"}
8     simgrid.engine.router_new{id="router1"}
9
10     simgrid.engine.host_new{id="host1",speed="1Gf"};
11     simgrid.engine.link_new{id="l1_UP",bandwidth="125MBps",lat="100us"};
12     simgrid.engine.link_new{id="l1_DOWN",bandwidth="125MBps",lat="100us"};
13     simgrid.engine.host_link_new{id="host1",up="l1_UP",down="l1_DOWN"};
14
15     simgrid.engine.host_new{id="host2",speed="1Gf"};
16     simgrid.engine.link_new{id="l2",bandwidth="125MBps",lat="100us",sharing_policy="FULLDUPLEX"};
17     simgrid.engine.host_link_new{id="host2",up="l2_UP",down="l2_DOWN"};
18
19     simgrid.engine.host_new{id="host3",speed="1Gf"};
20     simgrid.engine.link_new{id="l3",bandwidth="125MBps",lat="100us"};
21     simgrid.engine.host_link_new{id="host3",up="l3",down="l3"};
22
23     simgrid.engine.backbone_new{id="backbone1",bandwidth="2.25GBps",lat="500us"};
24
25   simgrid.engine.AS_seal()
26   simgrid.engine.AS_open{id="my_cluster2",mode="Cluster"}
27     simgrid.engine.router_new{id="router2"}
28
29     simgrid.engine.host_new{id="host4",speed="1Gf"};
30     simgrid.engine.link_new{id="l4_UP",bandwidth="125MBps",lat="100us"};
31     simgrid.engine.link_new{id="l4_DOWN",bandwidth="125MBps",lat="100us"};
32     simgrid.engine.host_link_new{id="host4",up="l4_UP",down="l4_DOWN"};
33
34     simgrid.engine.host_new{id="host5",speed="1Gf"};
35     simgrid.engine.link_new{id="l5",bandwidth="125MBps",lat="100us",sharing_policy="FULLDUPLEX"};
36     simgrid.engine.host_link_new{id="host5",up="l5_UP",down="l5_DOWN"};
37
38     simgrid.engine.host_new{id="host6",speed="1Gf"};
39     simgrid.engine.link_new{id="l6",bandwidth="125MBps",lat="100us"};
40     simgrid.engine.host_link_new{id="host6",up="l6",down="l6"};
41
42     simgrid.engine.backbone_new{id="backbone2",bandwidth="2.25GBps",lat="500us"}
43
44   simgrid.engine.AS_seal()
45   simgrid.engine.link_new{id="link1-2",bandwidth="2.25GBps",lat="500us"};
46
47   simgrid.engine.ASroute_new{src="my_cluster1", dst="my_cluster2",
48                             gw_src="router1", gw_dst="router2", links="link1-2"}
49
50 simgrid.engine.AS_seal()
51 simgrid.engine.close()