Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rewrite the platform_script.lua used by the test for lua console.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 13 Jun 2012 13:01:01 +0000 (15:01 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 13 Jun 2012 13:12:21 +0000 (15:12 +0200)
The lua console is still not fixed, but at least the script should be
syntactically correct.

examples/msg/masterslave/platform_script.lua

index 32215a9..75dac4f 100644 (file)
@@ -1,7 +1,7 @@
 -- Copyright (c) 2010-2012. The SimGrid Team. All rights reserved.
 
 -- This program is free software; you can redistribute it and/or modify it
 -- Copyright (c) 2010-2012. The SimGrid Team. All rights reserved.
 
 -- This program is free software; you can redistribute it and/or modify it
---under the terms of the license (GNU LGPL) which comes with this package.
+-- under the terms of the license (GNU LGPL) which comes with this package.
 
 
 -- This file describes a platform very similar to the small_platform.xml, but in lua
 
 
 -- This file describes a platform very similar to the small_platform.xml, but in lua
 
 require "simgrid"
 
 
 require "simgrid"
 
-  simgrid.AS.new{id="AS0",mode="Full"}; 
-
-  simgrid.AS.addHost{AS="AS0",id="Tremblay",power=98095000};
-  simgrid.AS.addHost{AS="AS0",id="Jupiter",power=76296000};
-  simgrid.AS.addHost{AS="AS0",id="Fafard",power=76296000};
-  simgrid.AS.addHost{AS="AS0",id="Ginette",power=48492000};
-  simgrid.AS.addHost{AS="AS0",id="Bourassa",power=48492000};
-
-    -- create Links
-  for i=10,0,-1 do
-    simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};   
-  end
-  -- simgrid.route.new(src_id,des_id,links_nb,links_list)
-   simgrid.AS.addRoute("AS0","Tremblay","Jupiter",{"1"});
-   simgrid.AS.addRoute("AS0","Tremblay","Fafard",{"0","1","2","3","4","8"});
-   simgrid.AS.addRoute("AS0","Tremblay","Ginette",{"3","4","5"});
-   simgrid.AS.addRoute("AS0","Tremblay","Bourassa",{"0","1","3","2","4","6","7"});
-
-   simgrid.AS.addRoute("AS0","Jupiter","Tremblay",{"1"});
-   simgrid.AS.addRoute("AS0","Jupiter","Fafard",{"0","1","2","3","4","8","9"});
-   simgrid.AS.addRoute("AS0","Jupiter","Ginette",{"3","4","5","9"});
-   simgrid.AS.addRoute("AS0","Jupiter","Bourassa",{"0","1","2","3","4","6","7","9"});
-   simgrid.AS.addRoute("AS0","Fafard","Tremblay",{"0","1","2","3","4","8"});
-   simgrid.AS.addRoute("AS0","Fafard","Jupiter",{"0","1","2","3","4","8","9"});
-   simgrid.AS.addRoute("AS0","Fafard","Ginette",{"0","1","2","5","8"});
-   simgrid.AS.addRoute("AS0","Fafard","Bourassa",{"6","7","8"});
-  
-   simgrid.AS.addRoute("AS0","Ginette","Tremblay",{"3","4","5"});
-   simgrid.AS.addRoute("AS0","Ginette","Jupiter",{"3","4","5","9"});
-   simgrid.AS.addRoute("AS0","Ginette","Fafard",{"0","1","2","5","8"});
-   simgrid.AS.addRoute("AS0","Ginette","Bourassa",{"0","1","2","5","6","7"});
-
-   simgrid.AS.addRoute("AS0","Bourassa","Tremblay",{"0","1","3","2","4","6","7"});
-   simgrid.AS.addRoute("AS0","Bourassa","Jupiter",{"0","1","2","3","4","6","7","9"});
-   simgrid.AS.addRoute("AS0","Bourassa","Fafard",{"6","7","8"});
-   simgrid.AS.addRoute("AS0","Bourassa","Ginette",{"0","1","2","5","6","7"});
-  
-   --Save Platform
-   simgrid.msg_register_platform();
-
-  --Set Application
-   simgrid.host.set_function{host="Tremblay",fct="master",args="20,550000000,1000000,4"};
-   simgrid.host.set_function{host="Bourassa",fct="slave",args="0"};
-   simgrid.host.set_function{host="Jupiter",fct="slave",args="1"};
-   simgrid.host.set_function{host="Fafard",fct="slave",args="2"};
-   simgrid.host.set_function{host="Ginette",fct="slave",args="3"};
-   
-  --Save Application 
-   simgrid.msg_register_application(); 
+simgrid.platf.open();
 
 
+simgrid.platf.AS_open{id="AS0",mode="Full"};
 
 
+simgrid.platf.host_new{id="Tremblay",power=98095000};
+simgrid.platf.host_new{id="Jupiter",power=76296000};
+simgrid.platf.host_new{id="Fafard",power=76296000};
+simgrid.platf.host_new{id="Ginette",power=48492000};
+simgrid.platf.host_new{id="Bourassa",power=48492000};
+
+-- create Links
+for i=10,0,-1 do
+    simgrid.platf.link_new{id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};
+end
+
+simgrid.platf.route_new{src="Tremblay",dest="Jupiter",links="1",symmetrical=0};
+simgrid.platf.route_new{src="Tremblay",dest="Fafard",links="0,1,2,3,4,8",symmetrical=0};
+simgrid.platf.route_new{src="Tremblay",dest="Ginette",links="3,4,5",symmetrical=0};
+simgrid.platf.route_new{src="Tremblay",dest="Bourassa",links="0,1,3,2,4,6,7",symmetrical=0};
+
+simgrid.platf.route_new{src="Jupiter",dest="Tremblay",links="1",symmetrical=0};
+simgrid.platf.route_new{src="Jupiter",dest="Fafard",links="0,1,2,3,4,8,9",symmetrical=0};
+simgrid.platf.route_new{src="Jupiter",dest="Ginette",links="3,4,5,9",symmetrical=0};
+simgrid.platf.route_new{src="Jupiter",dest="Bourassa",links="0,1,2,3,4,6,7,9",symmetrical=0};
+
+simgrid.platf.route_new{src="Fafard",dest="Tremblay",links="0,1,2,3,4,8",symmetrical=0};
+simgrid.platf.route_new{src="Fafard",dest="Jupiter",links="0,1,2,3,4,8,9",symmetrical=0};
+simgrid.platf.route_new{src="Fafard",dest="Ginette",links="0,1,2,5,8",symmetrical=0};
+simgrid.platf.route_new{src="Fafard",dest="Bourassa",links="6,7,8",symmetrical=0};
+
+simgrid.platf.route_new{src="Ginette",dest="Tremblay",links="3,4,5",symmetrical=0};
+simgrid.platf.route_new{src="Ginette",dest="Jupiter",links="3,4,5,9",symmetrical=0};
+simgrid.platf.route_new{src="Ginette",dest="Fafard",links="0,1,2,5,8",symmetrical=0};
+simgrid.platf.route_new{src="Ginette",dest="Bourassa",links="0,1,2,5,6,7",symmetrical=0};
+
+simgrid.platf.route_new{src="Bourassa",dest="Tremblay",links="0,1,3,2,4,6,7",symmetrical=0};
+simgrid.platf.route_new{src="Bourassa",dest="Jupiter",links="0,1,2,3,4,6,7,9",symmetrical=0};
+simgrid.platf.route_new{src="Bourassa",dest="Fafard",links="6,7,8",symmetrical=0};
+simgrid.platf.route_new{src="Bourassa",dest="Ginette",links="0,1,2,5,6,7",symmetrical=0};
+simgrid.platf.AS_close();
+
+simgrid.platf.close();
+simgrid.msg_register_platform();
+
+--Set Application
+simgrid.host.set_function{host="Tremblay",fct="master",args="20,550000000,1000000,4"};
+simgrid.host.set_function{host="Bourassa",fct="slave",args="0"};
+simgrid.host.set_function{host="Jupiter",fct="slave",args="1"};
+simgrid.host.set_function{host="Fafard",fct="slave",args="2"};
+simgrid.host.set_function{host="Ginette",fct="slave",args="3"};
+
+--Save Application
+simgrid.msg_register_application();