Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rearrange lua example in separate simulation component files
[simgrid.git] / examples / lua / masterslave / platform.lua
1  
2   --create new routing model
3   --simgrid.AS.new(AS_id,AS_mode)
4   simgrid.AS.new{id="AS0",mode="Full"}; 
5   --simgrid.Host.new(host_id,power)
6   simgrid.AS.addHost{AS="AS0",id="Tremblay",power=98095000};
7   simgrid.AS.addHost{AS="AS0",id="Jupiter",power=76296000};
8   simgrid.AS.addHost{AS="AS0",id="Fafard",power=76296000};
9   simgrid.AS.addHost{AS="AS0",id="Ginette",power=48492000};
10   simgrid.AS.addHost{AS="AS0",id="Bourassa",power=48492000};
11
12     -- create Links
13   for i=10,0,-1 do
14     simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};  
15   end
16   -- simgrid.Route.new(src_id,des_id,links_nb,links_list)
17    simgrid.AS.addRoute{AS="AS0",src="Tremblay",dest="Jupiter",links="1"};
18    simgrid.AS.addRoute{AS="AS0",src="Tremblay",dest="Fafard",links="0,1,2,3,4,8"};
19    simgrid.AS.addRoute{AS="AS0",src="Tremblay",dest="Ginette",links="3,4,5"};
20    simgrid.AS.addRoute{AS="AS0",src="Tremblay",dest="Bourassa",links="0,1,3,2,4,6,7"};
21
22    simgrid.AS.addRoute{AS="AS0",src="Jupiter",dest="Tremblay",links="1"};
23    simgrid.AS.addRoute{AS="AS0",src="Jupiter",dest="Fafard",links="0,1,2,3,4,8,9"};
24    simgrid.AS.addRoute{AS="AS0",src="Jupiter",dest="Ginette",links="3,4,5,9"};
25    simgrid.AS.addRoute{AS="AS0",src="Jupiter",dest="Bourassa",links="0,1,2,3,4,6,7,9"};
26  
27    simgrid.AS.addRoute{AS="AS0",src="Fafard",dest="Tremblay",links="0,1,2,3,4,8"};
28    simgrid.AS.addRoute{AS="AS0",src="Fafard",dest="Jupiter",links="0,1,2,3,4,8,9"};
29    simgrid.AS.addRoute{AS="AS0",src="Fafard",dest="Ginette",links="0,1,2,5,8"};
30    simgrid.AS.addRoute{AS="AS0",src="Fafard",dest="Bourassa",links="6,7,8"};
31   
32    simgrid.AS.addRoute{AS="AS0",src="Ginette",dest="Tremblay",links="3,4,5"};
33    simgrid.AS.addRoute{AS="AS0",src="Ginette",dest="Jupiter",links="3,4,5,9"};
34    simgrid.AS.addRoute{AS="AS0",src="Ginette",dest="Fafard",links="0,1,2,5,8"};
35    simgrid.AS.addRoute{AS="AS0",src="Ginette",dest="Bourassa",links="0,1,2,5,6,7"};
36
37    simgrid.AS.addRoute{AS="AS0",src="Bourassa",dest="Tremblay",links="0,1,3,2,4,6,7"};
38    simgrid.AS.addRoute{AS="AS0",src="Bourassa",dest="Jupiter",links="0,1,2,3,4,6,7,9"};
39    simgrid.AS.addRoute{AS="AS0",src="Bourassa",dest="Fafard",links="6,7,8"};
40    simgrid.AS.addRoute{AS="AS0",src="Bourassa",dest="Ginette",links="0,1,2,5,6,7"};
41   
42    --Save Platform
43    --simgrid.info("start registering platform");
44    simgrid.msg_register_platform();
45    --simgrid.info("platform registered");