Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rewrite the platform_script.lua used by the test for lua console.
[simgrid.git] / examples / msg / masterslave / platform_script.lua
1 -- Copyright (c) 2010-2012. The SimGrid Team. All rights reserved.
2
3 -- This program is free software; you can redistribute it and/or modify it
4 -- under the terms of the license (GNU LGPL) which comes with this package.
5
6
7 -- This file describes a platform very similar to the small_platform.xml, but in lua
8 -- It is naturally to be used with the MSG_load_platform_script function
9
10 -- Of course, such a flat file is maybe not very interesting wrt xml.
11 -- The full power of lua reveals when you describe your platform programatically. 
12
13 require "simgrid"
14
15 simgrid.platf.open();
16
17 simgrid.platf.AS_open{id="AS0",mode="Full"};
18
19 simgrid.platf.host_new{id="Tremblay",power=98095000};
20 simgrid.platf.host_new{id="Jupiter",power=76296000};
21 simgrid.platf.host_new{id="Fafard",power=76296000};
22 simgrid.platf.host_new{id="Ginette",power=48492000};
23 simgrid.platf.host_new{id="Bourassa",power=48492000};
24
25 -- create Links
26 for i=10,0,-1 do
27     simgrid.platf.link_new{id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};
28 end
29
30 simgrid.platf.route_new{src="Tremblay",dest="Jupiter",links="1",symmetrical=0};
31 simgrid.platf.route_new{src="Tremblay",dest="Fafard",links="0,1,2,3,4,8",symmetrical=0};
32 simgrid.platf.route_new{src="Tremblay",dest="Ginette",links="3,4,5",symmetrical=0};
33 simgrid.platf.route_new{src="Tremblay",dest="Bourassa",links="0,1,3,2,4,6,7",symmetrical=0};
34
35 simgrid.platf.route_new{src="Jupiter",dest="Tremblay",links="1",symmetrical=0};
36 simgrid.platf.route_new{src="Jupiter",dest="Fafard",links="0,1,2,3,4,8,9",symmetrical=0};
37 simgrid.platf.route_new{src="Jupiter",dest="Ginette",links="3,4,5,9",symmetrical=0};
38 simgrid.platf.route_new{src="Jupiter",dest="Bourassa",links="0,1,2,3,4,6,7,9",symmetrical=0};
39
40 simgrid.platf.route_new{src="Fafard",dest="Tremblay",links="0,1,2,3,4,8",symmetrical=0};
41 simgrid.platf.route_new{src="Fafard",dest="Jupiter",links="0,1,2,3,4,8,9",symmetrical=0};
42 simgrid.platf.route_new{src="Fafard",dest="Ginette",links="0,1,2,5,8",symmetrical=0};
43 simgrid.platf.route_new{src="Fafard",dest="Bourassa",links="6,7,8",symmetrical=0};
44
45 simgrid.platf.route_new{src="Ginette",dest="Tremblay",links="3,4,5",symmetrical=0};
46 simgrid.platf.route_new{src="Ginette",dest="Jupiter",links="3,4,5,9",symmetrical=0};
47 simgrid.platf.route_new{src="Ginette",dest="Fafard",links="0,1,2,5,8",symmetrical=0};
48 simgrid.platf.route_new{src="Ginette",dest="Bourassa",links="0,1,2,5,6,7",symmetrical=0};
49
50 simgrid.platf.route_new{src="Bourassa",dest="Tremblay",links="0,1,3,2,4,6,7",symmetrical=0};
51 simgrid.platf.route_new{src="Bourassa",dest="Jupiter",links="0,1,2,3,4,6,7,9",symmetrical=0};
52 simgrid.platf.route_new{src="Bourassa",dest="Fafard",links="6,7,8",symmetrical=0};
53 simgrid.platf.route_new{src="Bourassa",dest="Ginette",links="0,1,2,5,6,7",symmetrical=0};
54 simgrid.platf.AS_close();
55
56 simgrid.platf.close();
57 simgrid.msg_register_platform();
58
59 --Set Application
60 simgrid.host.set_function{host="Tremblay",fct="master",args="20,550000000,1000000,4"};
61 simgrid.host.set_function{host="Bourassa",fct="slave",args="0"};
62 simgrid.host.set_function{host="Jupiter",fct="slave",args="1"};
63 simgrid.host.set_function{host="Fafard",fct="slave",args="2"};
64 simgrid.host.set_function{host="Ginette",fct="slave",args="3"};
65
66 --Save Application
67 simgrid.msg_register_application();