Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tracing -> trace/pingpong
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Apr 2016 08:28:42 +0000 (10:28 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Apr 2016 08:28:42 +0000 (10:28 +0200)
.gitignore
examples/java/CMakeLists.txt
examples/java/trace/pingpong/Main.java [moved from examples/java/tracing/TracingTest.java with 65% similarity]
examples/java/trace/pingpong/PingPongTask.java [moved from examples/java/tracing/PingPongTask.java with 97% similarity]
examples/java/trace/pingpong/Receiver.java [moved from examples/java/tracing/Receiver.java with 87% similarity]
examples/java/trace/pingpong/Sender.java [moved from examples/java/tracing/Sender.java with 91% similarity]
examples/java/trace/pingpong/trace_pingpong.tesh [new file with mode: 0644]
examples/java/tracing/CMakeLists.txt [deleted file]
examples/java/tracing/tracingPingPong.tesh [deleted file]
examples/java/tracing/tracingPingPongDeployment.xml [deleted file]
tools/cmake/DefinePackages.cmake

index b1d21db..5242aee 100644 (file)
@@ -988,7 +988,7 @@ examples/java/process/migration/java_process_migration_compiled
 examples/java/process/suspend/java_process_suspend_compiled
 examples/java/process/startkilltime/java_process_startkilltime_compiled
 examples/java/task/priority/java_task_priority_compiled
-examples/java/tracing/java_tracing_compiled
+examples/java/trace/pingpong/java_trace_pingpong_compiled
 /CMakeCache.txt
 examples/smpi/mc/smpi_bugged1
 examples/smpi/mc/smpi_bugged1_liveness
index 3e96ee8..5cb858a 100644 (file)
@@ -33,6 +33,10 @@ set(dht_kademlia_sources       ${srcdir}/Main.java  ${srcdir}/Answer.java  ${src
                                ${srcdir}/KademliaTask.java  ${srcdir}/Node.java  ${srcdir}/PingAnswerTask.java
                                ${srcdir}/PingTask.java  ${srcdir}/RoutingTable.java)
 
+set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/trace/pingpong)
+set(trace_pingpong_sources     ${srcdir}/Main.java  ${srcdir}/PingPongTask.java ${srcdir}/Receiver.java 
+                               ${srcdir}/Sender.java) 
+
 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/consumption)
 set(energy_consumption_sources ${srcdir}/Main.java  ${srcdir}/EnergyConsumer.java)
 
@@ -62,7 +66,7 @@ set(task_priority_sources      ${srcdir}/Main.java  ${srcdir}/Test.java)
 
 foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong cloud_migration cloud_masterworker 
          dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
-         process_startkilltime process_suspend task_priority)
+         process_startkilltime process_suspend task_priority trace_pingpong)
   string (REPLACE "_" "/" example_dir ${example})
   if(enable_java)
     add_custom_command(
@@ -96,7 +100,7 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bi
 if(enable_java)
   foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong cloud_migration cloud_masterworker 
            dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
-           process_startkilltime process_suspend task_priority)
+           process_startkilltime process_suspend task_priority trace_pingpong)
     string (REPLACE "_" "/" example_dir ${example})
     ADD_TESH(java-${example}  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
   endforeach()
similarity index 65%
rename from examples/java/tracing/TracingTest.java
rename to examples/java/trace/pingpong/Main.java
index 5a033e3..1e82ea8 100644 (file)
@@ -4,23 +4,26 @@
 /* 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. */
 
-package tracing;
+package trace.pingpong;
 import org.simgrid.msg.Msg;
 import org.simgrid.trace.Trace;
+import org.simgrid.msg.MsgException;
 import org.simgrid.msg.NativeException;
 
-public class TracingTest  {
-  public static void main(String[] args) throws NativeException {      
+public class Main  {
+  public static void main(String[] args) throws MsgException, NativeException {
     Msg.init(args);
-    if(args.length < 2) {
-      Msg.info("Usage   : TracingTest platform_file deployment_file");
-      Msg.info("example : TracingTest ../platforms/platform.xml tracingPingPongDeployment.xml");
+    if(args.length < 1) {
+      Msg.info("Usage   : TracingTest platform_file");
+      Msg.info("example : TracingTest ../platforms/platform.xml");
       System.exit(1);
     }
 
     /* construct the platform and deploy the application */
     Msg.createEnvironment(args[0]);
-    Msg.deployApplication(args[1]);
+    new Sender("Jacquelin", "Sender", new String[] {"Boivin", "Marcel"}).start();
+    new Receiver ("Boivin", "Receiver", null).start();
+    new Receiver ("Marcel", "Receiver", null).start();
 
     /* Initialize some state for the hosts */
     Trace.hostStateDeclare ("PM_STATE"); 
similarity index 97%
rename from examples/java/tracing/PingPongTask.java
rename to examples/java/trace/pingpong/PingPongTask.java
index 22ee817..e6ea4bb 100644 (file)
@@ -4,7 +4,7 @@
 /* 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. */
 
-package tracing;
+package trace.pingpong;
 import org.simgrid.msg.NativeException;
 import org.simgrid.msg.Task;
 
similarity index 87%
rename from examples/java/tracing/Receiver.java
rename to examples/java/trace/pingpong/Receiver.java
index 725d9cf..0a57d52 100644 (file)
@@ -4,10 +4,12 @@
 /* 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. */
 
-package tracing;
+package trace.pingpong;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
+import org.simgrid.msg.NativeException;
+import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Task;
 import org.simgrid.msg.Process;
 import org.simgrid.trace.Trace;
@@ -16,8 +18,8 @@ public class Receiver extends Process {
   private  final double commSizeLat = 1;
   private final double commSizeBw = 100000000;
 
-  public Receiver(Host host, String name, String[]args) {
-    super(host,name,args);
+  public Receiver(String hostname, String name, String[]args) throws HostNotFoundException, NativeException{
+    super(hostname,name,args);
   }
 
   public void main(String[] args) throws MsgException {
similarity index 91%
rename from examples/java/tracing/Sender.java
rename to examples/java/trace/pingpong/Sender.java
index 8d9206b..f17cabd 100644 (file)
@@ -4,12 +4,13 @@
 /* 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. */
 
-package tracing;
+package trace.pingpong;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Task;
 import org.simgrid.msg.Process;
 import org.simgrid.msg.MsgException;
+import org.simgrid.msg.NativeException;
 import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.trace.Trace;
 
@@ -17,8 +18,8 @@ public class Sender extends Process {
   private final double commSizeLat = 1;
   private final double commSizeBw = 100000000;
 
-  public Sender(Host host, String name, String[] args) {
-    super(host,name,args);
+  public Sender(String hostname, String name, String[] args) throws HostNotFoundException, NativeException {
+    super(hostname,name,args);
   }
 
   public void main(String[] args) throws MsgException {
diff --git a/examples/java/trace/pingpong/trace_pingpong.tesh b/examples/java/trace/pingpong/trace_pingpong.tesh
new file mode 100644 (file)
index 0000000..e302f26
--- /dev/null
@@ -0,0 +1,39 @@
+#! tesh
+
+! output sort 19
+
+$ java -classpath ${classpath:=.} trace/pingpong/Main ${srcdir:=.}/../platforms/platform.xml --cfg=tracing:yes  --cfg=tracing/filename:simulation.trace --cfg=tracing/platform:yes
+> [0.000000] [jmsg/INFO] Using regular java threads.
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'simulation.trace'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/platform' to 'yes'
+> [4.474401] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
+> [Boivin:Receiver:(2) 0.000000] [jmsg/INFO] hello!
+> [Boivin:Receiver:(2) 0.000000] [jmsg/INFO] try to get a task
+> [Boivin:Receiver:(2) 1.048882] [jmsg/INFO] Got at time 1.0488818628325232
+> [Boivin:Receiver:(2) 1.048882] [jmsg/INFO] Was sent at time 0.0
+> [Boivin:Receiver:(2) 1.048882] [jmsg/INFO] Communication time : 1.0488818628325232
+> [Boivin:Receiver:(2) 1.048882] [jmsg/INFO]  --- bw 9.533962169004269E7 ----
+> [Boivin:Receiver:(2) 2.097764] [jmsg/INFO] goodbye!
+> [Jacquelin:Sender:(1) 0.000000] [jmsg/INFO] hello !
+> [Jacquelin:Sender:(1) 0.000000] [jmsg/INFO] host count: 2
+> [Jacquelin:Sender:(1) 0.000000] [jmsg/INFO] sender time: 0.0
+> [Jacquelin:Sender:(1) 2.097764] [jmsg/INFO] Got at time 2.0977637256650463
+> [Jacquelin:Sender:(1) 2.097764] [jmsg/INFO] Was sent at time 0.0
+> [Jacquelin:Sender:(1) 2.097764] [jmsg/INFO] Communication time : 2.0977637256650463
+> [Jacquelin:Sender:(1) 2.097764] [jmsg/INFO]  --- bw 4.7669810845021345E7 ----
+> [Jacquelin:Sender:(1) 2.097764] [jmsg/INFO] sender time: 2.0977637256650463
+> [Jacquelin:Sender:(1) 4.474401] [jmsg/INFO] Got at time 4.47440072325564
+> [Jacquelin:Sender:(1) 4.474401] [jmsg/INFO] Was sent at time 2.0977637256650463
+> [Jacquelin:Sender:(1) 4.474401] [jmsg/INFO] Communication time : 2.376636997590594
+> [Jacquelin:Sender:(1) 4.474401] [jmsg/INFO]  --- bw 4.2076261583648995E7 ----
+> [Jacquelin:Sender:(1) 4.474401] [jmsg/INFO] goodbye!
+> [Marcel:Receiver:(3) 0.000000] [jmsg/INFO] hello!
+> [Marcel:Receiver:(3) 0.000000] [jmsg/INFO] try to get a task
+> [Marcel:Receiver:(3) 3.057925] [jmsg/INFO] Got at time 3.0579254576553434
+> [Marcel:Receiver:(3) 3.057925] [jmsg/INFO] Was sent at time 2.0977637256650463
+> [Marcel:Receiver:(3) 3.057925] [jmsg/INFO] Communication time : 0.9601617319902971
+> [Marcel:Receiver:(3) 3.057925] [jmsg/INFO]  --- bw 1.0414912057858452E8 ----
+> [Marcel:Receiver:(3) 4.474401] [jmsg/INFO] goodbye!
+
+$ rm -rf simulation.trace
diff --git a/examples/java/tracing/CMakeLists.txt b/examples/java/tracing/CMakeLists.txt
deleted file mode 100644 (file)
index 1bb938c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-set(example java_tracing)
-set(sources ${CMAKE_CURRENT_SOURCE_DIR}/PingPongTask.java ${CMAKE_CURRENT_SOURCE_DIR}/Receiver.java
-            ${CMAKE_CURRENT_SOURCE_DIR}/Sender.java       ${CMAKE_CURRENT_SOURCE_DIR}/TracingTest.java)
-
-if(enable_java)
-  add_custom_command(
-    COMMENT "Building ${example}..."
-    OUTPUT ${example}_compiled
-    DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
-    COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}
-    COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled
-    COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled
-    )
-  add_custom_target(${example} ALL DEPENDS ${example}_compiled)
-  ADD_TESH(java-tracing --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/tracingPingPong.tesh           PARENT_SCOPE)
-set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/tracingPingPongDeployment.xml  PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${sources}                                                 PARENT_SCOPE)
diff --git a/examples/java/tracing/tracingPingPong.tesh b/examples/java/tracing/tracingPingPong.tesh
deleted file mode 100644 (file)
index 4b0937c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#! tesh
-
-! output sort 19
-
-$ java -classpath ${classpath:=.} tracing/TracingTest ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/tracing/tracingPingPongDeployment.xml --cfg=tracing:yes  --cfg=tracing/filename:simulation.trace --cfg=tracing/platform:yes
-> [0.000000] [jmsg/INFO] Using regular java threads.
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'simulation.trace'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/platform' to 'yes'
-> [4.474401] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Boivin:tracing.Receiver:(2) 0.000000] [jmsg/INFO] hello!
-> [Boivin:tracing.Receiver:(2) 0.000000] [jmsg/INFO] try to get a task
-> [Boivin:tracing.Receiver:(2) 1.048882] [jmsg/INFO] Got at time 1.0488818628325232
-> [Boivin:tracing.Receiver:(2) 1.048882] [jmsg/INFO] Was sent at time 0.0
-> [Boivin:tracing.Receiver:(2) 1.048882] [jmsg/INFO] Communication time : 1.0488818628325232
-> [Boivin:tracing.Receiver:(2) 1.048882] [jmsg/INFO]  --- bw 9.533962169004269E7 ----
-> [Boivin:tracing.Receiver:(2) 2.097764] [jmsg/INFO] goodbye!
-> [Jacquelin:tracing.Sender:(1) 0.000000] [jmsg/INFO] hello !
-> [Jacquelin:tracing.Sender:(1) 0.000000] [jmsg/INFO] host count: 2
-> [Jacquelin:tracing.Sender:(1) 0.000000] [jmsg/INFO] sender time: 0.0
-> [Jacquelin:tracing.Sender:(1) 2.097764] [jmsg/INFO] Got at time 2.0977637256650463
-> [Jacquelin:tracing.Sender:(1) 2.097764] [jmsg/INFO] Was sent at time 0.0
-> [Jacquelin:tracing.Sender:(1) 2.097764] [jmsg/INFO] Communication time : 2.0977637256650463
-> [Jacquelin:tracing.Sender:(1) 2.097764] [jmsg/INFO]  --- bw 4.7669810845021345E7 ----
-> [Jacquelin:tracing.Sender:(1) 2.097764] [jmsg/INFO] sender time: 2.0977637256650463
-> [Jacquelin:tracing.Sender:(1) 4.474401] [jmsg/INFO] Got at time 4.47440072325564
-> [Jacquelin:tracing.Sender:(1) 4.474401] [jmsg/INFO] Was sent at time 2.0977637256650463
-> [Jacquelin:tracing.Sender:(1) 4.474401] [jmsg/INFO] Communication time : 2.376636997590594
-> [Jacquelin:tracing.Sender:(1) 4.474401] [jmsg/INFO]  --- bw 4.2076261583648995E7 ----
-> [Jacquelin:tracing.Sender:(1) 4.474401] [jmsg/INFO] goodbye!
-> [Marcel:tracing.Receiver:(3) 0.000000] [jmsg/INFO] hello!
-> [Marcel:tracing.Receiver:(3) 0.000000] [jmsg/INFO] try to get a task
-> [Marcel:tracing.Receiver:(3) 3.057925] [jmsg/INFO] Got at time 3.0579254576553434
-> [Marcel:tracing.Receiver:(3) 3.057925] [jmsg/INFO] Was sent at time 2.0977637256650463
-> [Marcel:tracing.Receiver:(3) 3.057925] [jmsg/INFO] Communication time : 0.9601617319902971
-> [Marcel:tracing.Receiver:(3) 3.057925] [jmsg/INFO]  --- bw 1.0414912057858452E8 ----
-> [Marcel:tracing.Receiver:(3) 4.474401] [jmsg/INFO] goodbye!
-
-$ rm -rf simulation.trace
diff --git a/examples/java/tracing/tracingPingPongDeployment.xml b/examples/java/tracing/tracingPingPongDeployment.xml
deleted file mode 100644 (file)
index ed7db68..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
-  <process host="Jacquelin" function="tracing.Sender">
-    <argument value="Boivin"/>
-    <argument value="Marcel"/>
-  </process>
-  <process host="Boivin" function="tracing.Receiver"/>
-  <process host="Marcel" function="tracing.Receiver"/>
-</platform>
index 33debbe..eee8900 100644 (file)
@@ -925,7 +925,6 @@ set(txt_files
 set(CMAKEFILES_TXT
   examples/java/CMakeLists.txt
     examples/java/async/CMakeLists.txt
-    examples/java/tracing/CMakeLists.txt
   examples/msg/CMakeLists.txt
     examples/msg/cloud/CMakeLists.txt
     examples/msg/mc/CMakeLists.txt