Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix an example after the recent change to hosts_as_dynar modifying its order
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 28 Oct 2016 16:46:44 +0000 (18:46 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 28 Oct 2016 16:46:44 +0000 (18:46 +0200)
examples/java/io/file/Node.java
examples/java/io/file/io_file.tesh

index 8339064..ff16438 100644 (file)
@@ -31,22 +31,22 @@ public class Node extends Process {
   private static String FILENAME3 = "/doc/simgrid/examples/platforms/g5k_cabinets.xml";
   private static String FILENAME4 = "/doc/simgrid/examples/platforms/nancy.xml";
 
   private static String FILENAME3 = "/doc/simgrid/examples/platforms/g5k_cabinets.xml";
   private static String FILENAME4 = "/doc/simgrid/examples/platforms/nancy.xml";
 
-  protected int number;
+  protected int rank;
 
   public Node(Host host, int number) throws HostNotFoundException {
     super(host, Integer.toString(number), null);
 
   public Node(Host host, int number) throws HostNotFoundException {
     super(host, Integer.toString(number), null);
-    this.number = number;
+    this.rank = number;
   }
 
   public void main(String[] args) throws MsgException {
     String mount;
     String filename;
   }
 
   public void main(String[] args) throws MsgException {
     String mount;
     String filename;
-    switch (number) {
-      case 0:
+    switch (rank) {
+      case 4:
         mount = "/home";
         filename = mount + FILENAME1;
       break;
         mount = "/home";
         filename = mount + FILENAME1;
       break;
-      case 1:
+      case 0:
         mount = "c:";
         filename = mount + FILENAME2;
       break;
         mount = "c:";
         filename = mount + FILENAME2;
       break;
@@ -54,7 +54,7 @@ public class Node extends Process {
         mount = "/home";
         filename = mount + FILENAME3;
       break;
         mount = "/home";
         filename = mount + FILENAME3;
       break;
-      case 3:
+      case 1:
         mount = "/home";
         filename = mount + FILENAME4;
       break;
         mount = "/home";
         filename = mount + FILENAME4;
       break;
index a03eed5..9c88942 100644 (file)
@@ -3,24 +3,24 @@
 $ java -classpath ${classpath:=.} io/file/Main ${srcdir:=.}/../platforms/storage/storage.xml
 > [0.000000] [jmsg/INFO] Using regular java threads.
 > [0.000000] [jmsg/INFO] Number of hosts:4
 $ java -classpath ${classpath:=.} io/file/Main ${srcdir:=.}/../platforms/storage/storage.xml
 > [0.000000] [jmsg/INFO] Using regular java threads.
 > [0.000000] [jmsg/INFO] Number of hosts:4
-> [denise:0:(1) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/g5k.xml
-> [alice:1:(2) 0.000000] [jmsg/INFO] Open file c:\Windows\setupact.log
+> [alice:0:(1) 0.000000] [jmsg/INFO] Open file c:\Windows\setupact.log
+> [bob:1:(2) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/nancy.xml
 > [carl:2:(3) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [carl:2:(3) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
-> [bob:3:(4) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/nancy.xml
-> [bob:3:(4) 0.000040] [jmsg/INFO] Having read 4028 on /home/doc/simgrid/examples/platforms/nancy.xml
-> [denise:0:(1) 0.000050] [jmsg/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k.xml
-> [alice:1:(2) 0.000050] [jmsg/INFO] Having read 10000 on c:\Windows\setupact.log
+> [denise:3:(4) 0.000000] [jmsg/INFO] Open file /home/doc/simgrid/examples/platforms/g5k.xml
+> [bob:1:(2) 0.000040] [jmsg/INFO] Having read 4028 on /home/doc/simgrid/examples/platforms/nancy.xml
+> [alice:0:(1) 0.000050] [jmsg/INFO] Having read 10000 on c:\Windows\setupact.log
+> [denise:3:(4) 0.000050] [jmsg/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k.xml
 > [carl:2:(3) 0.000100] [jmsg/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [carl:2:(3) 0.000100] [jmsg/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
-> [denise:0:(1) 0.001717] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/g5k.xml
-> [denise:0:(1) 0.001717] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/g5k.xml
-> [alice:1:(2) 0.001717] [jmsg/INFO] Having write 100000 on c:\Windows\setupact.log
-> [alice:1:(2) 0.001717] [jmsg/INFO] Seek back to the beginning of c:\Windows\setupact.log
-> [denise:0:(1) 0.002267] [jmsg/INFO] Having read 110000 on /home/doc/simgrid/examples/platforms/g5k.xml
-> [alice:1:(2) 0.002267] [jmsg/INFO] Having read 110000 on c:\Windows\setupact.log
-> [bob:3:(4) 0.003374] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/nancy.xml
-> [bob:3:(4) 0.003374] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/nancy.xml
+> [alice:0:(1) 0.001717] [jmsg/INFO] Having write 100000 on c:\Windows\setupact.log
+> [alice:0:(1) 0.001717] [jmsg/INFO] Seek back to the beginning of c:\Windows\setupact.log
+> [denise:3:(4) 0.001717] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/g5k.xml
+> [denise:3:(4) 0.001717] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/g5k.xml
+> [alice:0:(1) 0.002267] [jmsg/INFO] Having read 110000 on c:\Windows\setupact.log
+> [denise:3:(4) 0.002267] [jmsg/INFO] Having read 110000 on /home/doc/simgrid/examples/platforms/g5k.xml
+> [bob:1:(2) 0.003374] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/nancy.xml
+> [bob:1:(2) 0.003374] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/nancy.xml
 > [carl:2:(3) 0.003433] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [carl:2:(3) 0.003433] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [carl:2:(3) 0.003433] [jmsg/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [carl:2:(3) 0.003433] [jmsg/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
-> [bob:3:(4) 0.004414] [jmsg/INFO] Having read 104028 on /home/doc/simgrid/examples/platforms/nancy.xml
+> [bob:1:(2) 0.004414] [jmsg/INFO] Having read 104028 on /home/doc/simgrid/examples/platforms/nancy.xml
 > [carl:2:(3) 0.004533] [jmsg/INFO] Having read 110000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [0.004533] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [carl:2:(3) 0.004533] [jmsg/INFO] Having read 110000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [0.004533] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...