From 9d86882c3a4661111f289a034783ab36f5c32d92 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Tue, 24 Feb 2015 09:53:22 +0100 Subject: [PATCH] LUA: Added new (converted) platform file and started teshsuite - Not sure whether we will move these tests to the msg testsuite, as those tests are (at the moment) only MSG tests with a .lua file. It would be nice to have testfactory for this, i.e., means and ways to generate the tests for both lua and xml and still make all the lua tests being run by 'ctest -R lua'. --- examples/platforms/routing_cluster.lua | 51 ++++++++++++++++++++++++++ teshsuite/lua/lua_platforms.tesh | 18 +++++++-- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 examples/platforms/routing_cluster.lua diff --git a/examples/platforms/routing_cluster.lua b/examples/platforms/routing_cluster.lua new file mode 100644 index 0000000000..ee73d90a3a --- /dev/null +++ b/examples/platforms/routing_cluster.lua @@ -0,0 +1,51 @@ +-- See routing_cluster.xml for description. +-- + +require "simgrid" +simgrid.platf.open() +simgrid.platf.AS_open{id="AS0",mode="Full"} + simgrid.platf.AS_open{id="my_cluster1",mode="Cluster"} + simgrid.platf.router_new{id="router1"} + + simgrid.platf.host_new{id="host1",power="1Gf"}; + simgrid.platf.link_new{id="l1_UP",bandwidth="125MBps",latency="100us"}; + simgrid.platf.link_new{id="l1_DOWN",bandwidth="125MBps",latency="100us"}; + simgrid.platf.host_link_new{id="host1",up="l1_UP",down="l1_DOWN"}; + + simgrid.platf.host_new{id="host2",power="1Gf"}; + simgrid.platf.link_new{id="l2",bandwidth="125MBps",latency="100us",policy="FULLDUPLEX"}; + simgrid.platf.host_link_new{id="host2",up="l2_UP",down="l2_DOWN"}; + + simgrid.platf.host_new{id="host3",power="1Gf"}; + simgrid.platf.link_new{id="l3",bandwidth="125MBps",latency="100us"}; + simgrid.platf.host_link_new{id="host3",up="l3",down="l3"}; + + simgrid.platf.backbone_new{id="backbone1",bandwidth="2.25GBps",latency="500us"}; + + simgrid.platf.AS_close() + simgrid.platf.AS_open{id="my_cluster2",mode="Cluster"} + simgrid.platf.router_new{id="router2"} + + simgrid.platf.host_new{id="host4",power="1Gf"}; + simgrid.platf.link_new{id="l4_UP",bandwidth="125MBps",latency="100us"}; + simgrid.platf.link_new{id="l4_DOWN",bandwidth="125MBps",latency="100us"}; + simgrid.platf.host_link_new{id="host4",up="l4_UP",down="l4_DOWN"}; + + simgrid.platf.host_new{id="host5",power="1Gf"}; + simgrid.platf.link_new{id="l5",bandwidth="125MBps",latency="100us",policy="FULLDUPLEX"}; + simgrid.platf.host_link_new{id="host5",up="l5_UP",down="l5_DOWN"}; + + simgrid.platf.host_new{id="host6",power="1Gf"}; + simgrid.platf.link_new{id="l6",bandwidth="125MBps",latency="100us"}; + simgrid.platf.host_link_new{id="host6",up="l6",down="l6"}; + + simgrid.platf.backbone_new{id="backbone2",bandwidth="2.25GBps",latency="500us"} + + simgrid.platf.AS_close() + simgrid.platf.link_new{id="link1-2",bandwidth="2.25GBps",latency="500us"}; + + simgrid.platf.ASroute_new{src="my_cluster1", dst="my_cluster2", + gw_src="router1", gw_dst="router2", links="link1-2",symmetrical="YES"} + +simgrid.platf.AS_close() +simgrid.platf.close() diff --git a/teshsuite/lua/lua_platforms.tesh b/teshsuite/lua/lua_platforms.tesh index 0a66578442..16ce6e27af 100644 --- a/teshsuite/lua/lua_platforms.tesh +++ b/teshsuite/lua/lua_platforms.tesh @@ -2,6 +2,18 @@ $ ${srcdir:=.}/../../examples/msg/masterslave/masterslave_arg ${srcdir:=.}/../.. > [0.000000] [msg_test/INFO] Got 5 slaves, 4 tasks to process, and 5 hosts > [3.095754] [msg_test/INFO] Simulation time 3.09575 -$ ${srcdir:=.}/../../examples/msg/masterslave/masterslave_arg ${srcdir:=.}/../../examples/platforms/small_platform.xml 4 5 -> [0.000000] [msg_test/INFO] Got 5 slaves, 4 tasks to process, and 5 hosts -> [3.095754] [msg_test/INFO] Simulation time 3.09575 +$ $SG_TEST_EXENV ${bindir:=.}/../../examples/msg/token_ring/token_ring ${srcdir:=.}/../../examples/platforms/routing_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:@) Number of host '6' +> [ 0.000000] (1:0@host1) Host "0" send 'Token' to Host "1" +> [ 0.017354] (2:1@host2) Host "1" received "Token" +> [ 0.017354] (2:1@host2) Host "1" send 'Token' to Host "2" +> [ 0.035121] (3:2@host3) Host "2" received "Token" +> [ 0.035121] (3:2@host3) Host "2" send 'Token' to Host "3" +> [ 0.065898] (4:3@host4) Host "3" received "Token" +> [ 0.065898] (4:3@host4) Host "3" send 'Token' to Host "4" +> [ 0.083252] (5:4@host5) Host "4" received "Token" +> [ 0.083252] (5:4@host5) Host "4" send 'Token' to Host "5" +> [ 0.101019] (6:5@host6) Host "5" received "Token" +> [ 0.101019] (6:5@host6) Host "5" send 'Token' to Host "0" +> [ 0.131796] (1:0@host1) Host "0" received "Token" +> [ 0.131796] (0:@) Simulation time 0.131796 -- 2.20.1