Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git://scm.gforge.inria.fr/simgrid/simgrid-java
authoralebre <alebre@noname-2.local>
Tue, 12 Jun 2012 20:44:40 +0000 (22:44 +0200)
committeralebre <alebre@noname-2.local>
Tue, 12 Jun 2012 20:44:40 +0000 (22:44 +0200)
12 files changed:
CMakeLists.txt
ChangeLog
examples/tracing/PingPongTask.java [new file with mode: 0644]
examples/tracing/README [new file with mode: 0644]
examples/tracing/Receiver.java [new file with mode: 0644]
examples/tracing/Sender.java [new file with mode: 0644]
examples/tracing/TracingTest.java [new file with mode: 0644]
examples/tracing/tracingPingPong.tesh [new file with mode: 0644]
examples/tracing/tracingPingPongDeployment.xml [new file with mode: 0644]
org/simgrid/trace/Trace.java [new file with mode: 0644]
src/jtrace.c [new file with mode: 0644]
src/jtrace.h [new file with mode: 0644]

index 8f032ed..8d9e3bf 100644 (file)
@@ -96,6 +96,11 @@ set(JMSG_C_SRC
        src/jmsg_task.h
 )
 
+set(JTRACE_C_SRC
+       src/jtrace.c
+       src/jtrace.h
+)      
+
 set(JMSG_JAVA_SRC
        org/simgrid/msg/Host.java
        org/simgrid/msg/HostFailureException.java       
@@ -116,6 +121,9 @@ set(JMSG_JAVA_SRC
        org/simgrid/msg/Comm.java
        org/simgrid/msg/RngStream.java
 )
+set(JTRACE_JAVA_SRC
+       org/simgrid/trace/Trace.java
+)
 
 set(JAVA_EXAMPLES
        examples/async/AsyncTest.java
@@ -173,9 +181,13 @@ set(JAVA_EXAMPLES
        examples/startKillTime/Master.java
        examples/startKillTime/Slave.java
        examples/startKillTime/StartKillTime.java
+       examples/tracing/PingPongTask.java
        examples/suspend/DreamMaster.java
        examples/suspend/LazyGuy.java
        examples/suspend/Suspend.java
+       examples/tracing/Sender.java
+       examples/tracing/Receiver.java
+       examples/tracing/TracingTest.java
 )
 
 set(CMAKE_SRC
@@ -188,6 +200,7 @@ ${CMAKE_HOME_DIRECTORY}/FindSimGrid.cmake
 set(XML_FILES
     examples/platform.xml
     examples/async/asyncDeployment.xml
+    examples/tracing/tracingPingPongDeployment.xml
     examples/bittorrent/bittorrent.xml
     examples/commTime/commTimeDeployment.xml
     examples/masterslave/masterslaveDeployment.xml
@@ -202,14 +215,19 @@ set(XML_FILES
 set(source_to_pack
 ${CMAKE_SRC}
 ${JMSG_C_SRC}
+${JTRACE_C_SRC}
 ${JMSG_JAVA_SRC}
+${JTRACE_JAVA_SRC}
 ${JAVA_EXAMPLES}
 ${XML_FILES}
 )
 
-string(REPLACE "org/" "${CMAKE_HOME_DIRECTORY}/org/" JAVA_FILES "${JMSG_JAVA_SRC}") 
+string(REPLACE "org/" "${CMAKE_HOME_DIRECTORY}/org/" JAVA_FILES_MSG "${JMSG_JAVA_SRC}") 
+string(REPLACE "org/" "${CMAKE_HOME_DIRECTORY}/org/" JAVA_FILES_TRACE "${JTRACE_JAVA_SRC}") 
 string(REPLACE "org/" "${CMAKE_HOME_DIRECTORY}/classes/org/" JMSG_JAVA_SRC_CLASS "${JMSG_JAVA_SRC}")
+string(REPLACE "org/" "${CMAKE_HOME_DIRECTORY}/classes/org/" JTRACE_JAVA_SRC_CLASS "${JTRACE_JAVA_SRC}")
 string(REPLACE ".java" ".class" JMSG_JAVA_SRC_CLASS "${JMSG_JAVA_SRC_CLASS}")
+string(REPLACE ".java" ".class" JTRACE_JAVA_SRC_CLASS "${JTRACE_JAVA_SRC_CLASS}")
 string(REPLACE "examples/" "${CMAKE_HOME_DIRECTORY}/examples/" JAVA_EXAMPLES_CLASS "${JAVA_EXAMPLES}") 
 string(REPLACE ".java" ".class" JAVA_EXAMPLES_CLASS "${JAVA_EXAMPLES_CLASS}")
 
@@ -243,17 +261,43 @@ else(WIN32)
     set_target_properties(SG_java PROPERTIES LINK_FLAGS "-L${SIMGRID_LIB_PATH}")
 endif(WIN32)
 
+# SG_java_tracing
+add_library(SG_java_tracing SHARED ${JTRACE_C_SRC})
+if(WIN32)
+    set_target_properties(SG_java_tracing PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows,--kill-at ${SIMGRID_LIB}" PREFIX "")
+    find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)
+    message(STATUS "pexports: ${PEXPORTS_PATH}")
+    if(PEXPORTS_PATH)
+    add_custom_command(TARGET SG_java_tracing POST_BUILD
+    COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/SG_java_tracing.dll > ${CMAKE_BINARY_DIR}/SG_java_tracing.def)
+    endif(PEXPORTS_PATH)
+else(WIN32)
+    target_link_libraries(SG_java_tracing pcre pthread simgrid)
+    set_target_properties(SG_java_tracing PROPERTIES LINK_FLAGS "-L${SIMGRID_LIB_PATH}")
+endif(WIN32)
+
+
 # java_classes
 add_custom_command(
-       OUTPUT  ${JMSG_JAVA_SRC_CLASS}
+       OUTPUT  ${JMSG_JAVA_SRC_CLASS}
        DEPENDS ${JMSG_JAVA_SRC}
        COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_HOME_DIRECTORY}/classes/"
        COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/classes/
-                                       -cp ${CMAKE_HOME_DIRECTORY}/classes/ ${JAVA_FILES}
-       COMMENT "Compiling java sources of core library..."                                     
+       -cp ${CMAKE_HOME_DIRECTORY}/classes/ ${JAVA_FILES_MSG}
+       COMMENT "Compiling java sources of core libraries..."                                   
 )
+
+add_custom_command(
+       OUTPUT  ${JTRACE_JAVA_SRC_CLASS}
+       DEPENDS ${JTRACE_JAVA_SRC}
+       COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_HOME_DIRECTORY}/classes/"
+       COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/classes/
+       -cp ${CMAKE_HOME_DIRECTORY}/classes/ ${JAVA_FILES_TRACE}
+       COMMENT "Compiling java sources of core libraries..."                                   
+)
+
 add_custom_target(java_classes ALL
-  DEPENDS ${JMSG_JAVA_SRC_CLASS}
+                 DEPENDS ${JMSG_JAVA_SRC_CLASS} ${JTRACE_JAVA_SRC_CLASS}
 )
 
 # simgrid_jar
@@ -281,6 +325,8 @@ add_custom_command(
        COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/pingPong/*.java
        COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/priority/*.java    
        COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/startKillTime/*.java
+       COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/tracing/*.java
+       COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/bittorrent/*.java
        COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/examples -cp ${CMAKE_HOME_DIRECTORY}/simgrid.jar ${CMAKE_HOME_DIRECTORY}/examples/suspend/*.java
 
 )
@@ -293,7 +339,7 @@ add_custom_target(simgrid_java_examples ALL
 # Declare dependencies #
 ########################
 add_dependencies(simgrid_jar java_classes)
-add_dependencies(simgrid_java_examples simgrid_jar SG_java)
+add_dependencies(simgrid_java_examples simgrid_jar SG_java SG_java_tracing)
 
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
 ${CMAKE_HOME_DIRECTORY}/simgrid.jar
@@ -318,8 +364,10 @@ ADD_TEST(pingPong        ${TESH_BIN_PATH} ${TESH_OPTION} --setenv srcdir=${CMAKE
 ADD_TEST(priority        ${TESH_BIN_PATH} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/examples/priority/priority.tesh)
 ADD_TEST(startKillTime   ${TESH_BIN_PATH} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/examples/startKillTime/startKillTime.tesh)
 ADD_TEST(suspend         ${TESH_BIN_PATH} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/examples/suspend/suspend.tesh)
+ADD_TEST(tracing         ${TESH_BIN_PATH} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/examples/tracing/tracingPingPong.tesh)
+#Don't forget to put new test in this list!!!
 #Don't forget to put new test in this list!!!
-set(test_list async bittorrent bypass chord commTime kill masterslave migration mutualExclusion pingPong priority startKillTime)
+set(test_list async bittorrent bypass chord commTime kill masterslave migration mutualExclusion pingPong priority startKillTime tracing)
 
 ##########################################
 # Set the  DYLD_LIBRARY_PATH for mac     #
@@ -350,7 +398,7 @@ endif(APPLE)
 ###########
 # Install #
 ###########
-install(TARGETS SG_java
+install(TARGETS SG_java SG_java_tracing
        DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/java/)
 install(FILES ${CMAKE_HOME_DIRECTORY}/simgrid.jar
        DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/java/)
index 9c2f595..7f6ac28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,15 @@
+SimGrid-java (3.8) unstable; urgency=low
+
+ * Introduce org.simgrid.trace.Trace (partial implementation of JAVA bindings
+   for the TRACE API). 
+   Although all TRACE methods appear in the Trace class, please not that only
+   few of thems are really implemented at the JNI level (see ./src/jtrace.c
+   for further information). 
+
 SimGrid-java (3.7.1) stable; urgency=low
   
  The "Java aint got to be bloated and slow" release
-
  Major cleanups:
  * Various internal cleanups and performance improvement
    Simulations are expected to run up to twice faster or so
diff --git a/examples/tracing/PingPongTask.java b/examples/tracing/PingPongTask.java
new file mode 100644 (file)
index 0000000..7157a7e
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006,2007,2010. 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. 
+ */
+
+package tracing;
+import org.simgrid.msg.NativeException;
+import org.simgrid.msg.Task;
+
+public class PingPongTask extends Task {
+   
+   private double timeVal;
+   
+   public PingPongTask() throws NativeException {
+      this.timeVal = 0;
+   }
+   
+   public PingPongTask(String name, double computeDuration, double messageSize) throws NativeException {      
+      super(name,computeDuration,messageSize);         
+   }
+   
+   public void setTime(double timeVal){
+      this.timeVal = timeVal;
+   }
+   
+   public double getTime() {
+      return this.timeVal;
+   }
+}
+    
diff --git a/examples/tracing/README b/examples/tracing/README
new file mode 100644 (file)
index 0000000..aa16de9
--- /dev/null
@@ -0,0 +1,2 @@
+This is a stupid ping/pong example. The processes exchange a simple
+task and time them.
\ No newline at end of file
diff --git a/examples/tracing/Receiver.java b/examples/tracing/Receiver.java
new file mode 100644 (file)
index 0000000..09da519
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier         
+ * Copyright 2012 The SimGrid Team. All rights reserved. 
+ * 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. 
+ */
+package tracing;
+import org.simgrid.msg.Host;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Task;
+import org.simgrid.msg.Process;
+import org.simgrid.trace.Trace;
+
+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 void main(String[] args) throws MsgException {
+        
+      Msg.info("hello!");
+      Trace.hostPushState (host.getName(), "PM_STATE", "waitingPing");
+                       double communicationTime=0;
+
+      double time = Msg.getClock();
+    
+                       /* Wait for the ping */ 
+      Msg.info("try to get a task");
+        
+      PingPongTask ping = (PingPongTask)Task.receive(getHost().getName());
+      double timeGot = Msg.getClock();
+      double timeSent = ping.getTime();
+            
+      Msg.info("Got at time "+ timeGot);
+      Msg.info("Was sent at time "+timeSent);
+      time=timeSent;
+            
+      communicationTime=timeGot - time;
+      Msg.info("Communication time : " + communicationTime);
+            
+      Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");
+      
+                       /* Send the pong */
+               Trace.hostPushState (host.getName(), "PM_STATE", "sendingPong");
+                       double computeDuration = 0;
+                       PingPongTask pong = new PingPongTask("no name",computeDuration,commSizeLat);
+                       pong.setTime(time);
+                       pong.send(ping.getSource().getName());
+
+               /* Pop the two states */
+      Trace.hostPopState (host.getName(), "PM_STATE");
+      Trace.hostPopState (host.getName(), "PM_STATE");
+  
+               Msg.info("goodbye!");
+    }
+}
diff --git a/examples/tracing/Sender.java b/examples/tracing/Sender.java
new file mode 100644 (file)
index 0000000..9e0765c
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Sender of basic ping/pong example
+ *
+ * Copyright 2006,2007,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. 
+ */
+package tracing;
+import org.simgrid.msg.Host;
+import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.Task;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Process;
+import org.simgrid.trace.Trace;
+
+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 void main(String[] args) throws MsgException {
+                                                               Msg.info("hello !"); 
+                                                               Trace.hostPushState (host.getName(), "PM_STATE", "sendingPing");
+                                                               
+                                                               int hostCount = args.length;
+                                                               Msg.info("host count: " + hostCount);
+                                                               String mailboxes[] = new String[hostCount]; 
+                                                               double time;
+                                                               double computeDuration = 0;
+                                                               PingPongTask ping, pong;
+                                                               
+                                                               for(int pos = 0; pos < args.length ; pos++) {
+                                                                                               try {
+                                                                                                                               mailboxes[pos] = Host.getByName(args[pos]).getName();
+                                                                                               } catch (HostNotFoundException e) {
+                                                                                                                               Msg.info("Invalid deployment file: " + e.toString());
+                                                                                                                               System.exit(1);
+                                                                                               }
+                                                               }
+                                                               
+                                                               for (int pos = 0; pos < hostCount; pos++) { 
+                                                                                               time = Msg.getClock(); 
+                                                                                               Msg.info("sender time: " + time);
+                                                                                               ping = new PingPongTask("no name",computeDuration,commSizeLat);
+                                                                                               ping.setTime(time);
+                                                                                               ping.send(mailboxes[pos]);
+                                                               
+                                                                                               Trace.hostPushState (host.getName(), "PM_STATE", "waitingPong");
+                                                                                               pong = (PingPongTask)Task.receive(getHost().getName());
+                                                                       double timeGot = Msg.getClock();
+                                                                       double timeSent = ping.getTime();
+                                                       double communicationTime=0;
+                                                                       
+                                                                                               Msg.info("Got at time "+ timeGot);
+                                                                       Msg.info("Was sent at time "+timeSent);
+                                                                       time=timeSent;
+            
+                                                                       communicationTime=timeGot - time;
+                                                                       Msg.info("Communication time : " + communicationTime);
+            
+                                                                       Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");
+      
+                                                                                               /* Pop the last state (going back to sending ping) */   
+                                                                                               Trace.hostPopState (host.getName(), "PM_STATE");
+
+                                                               }
+                                                          /* Pop the sendingPong state */      
+                                                               Trace.hostPopState (host.getName(), "PM_STATE");
+                                                               Msg.info("goodbye!");
+                               }
+}
diff --git a/examples/tracing/TracingTest.java b/examples/tracing/TracingTest.java
new file mode 100644 (file)
index 0000000..93b76f3
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * $Id$
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier         
+ * Copyright 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. 
+ */
+package tracing;
+import org.simgrid.msg.Msg;
+import org.simgrid.trace.Trace;
+import org.simgrid.msg.NativeException;
+public class TracingTest  {
+
+   /* This only contains the launcher. If you do nothing more than than you can run 
+    *   java simgrid.msg.Msg
+    * which also contains such a launcher
+    */
+    
+    public static void main(String[] args) throws NativeException {            
+               /* initialize the MSG simulation. Must be done before anything else (even logging). */
+               Msg.init(args);
+               if(args.length < 2) {
+                       Msg.info("Usage   : PingPong platform_file deployment_file");
+               Msg.info("example : PingPong ping_pong_platform.xml ping_pong_deployment.xml");
+               System.exit(1);
+               }
+       
+               /* construct the platform and deploy the application */
+               Msg.createEnvironment(args[0]);
+               Msg.deployApplication(args[1]);
+
+               /* Initialize some state for the hosts */
+               Trace.hostStateDeclare ("PM_STATE"); 
+               Trace.hostStateDeclareValue ("PM_STATE", "waitingPing", "0 0 1");
+               Trace.hostStateDeclareValue ("PM_STATE", "sendingPong", "0 1 0");
+               Trace.hostStateDeclareValue ("PM_STATE", "sendingPing", "0 1 1");
+               Trace.hostStateDeclareValue ("PM_STATE", "waitingPong", "1 0 0");
+
+               /*  execute the simulation. */
+           Msg.run();
+                Msg.clean();
+    }
+}
diff --git a/examples/tracing/tracingPingPong.tesh b/examples/tracing/tracingPingPong.tesh
new file mode 100644 (file)
index 0000000..1098a2a
--- /dev/null
@@ -0,0 +1,40 @@
+#! ./tesh
+
+! output sort
+
+$ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar tracing/TracingTest ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/tracing/tracingPingPongDeployment.xml --cfg=tracing:1  --cfg=tracing/filename:simulation.trace --cfg=tracing/platform:1
+> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'simulation.trace'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/platform' to '1'
+> [4.474433] [jmsg/INFO] Done running MSG_MAIN
+> [4.474433] [jmsg/INFO] MSG_main finished
+> [4.474433] [jmsg/INFO] Clean java world
+> [4.474433] [jmsg/INFO] Clean native world
+> [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.048890] [jmsg/INFO] Got at time 1.0488895059341703
+> [Boivin:tracing.Receiver:(2) 1.048890] [jmsg/INFO] Was sent at time 0.0
+> [Boivin:tracing.Receiver:(2) 1.048890] [jmsg/INFO] Communication time : 1.0488895059341703
+> [Boivin:tracing.Receiver:(2) 1.048890] [jmsg/INFO]  --- bw 9.533892696441577E7 ----
+> [Boivin:tracing.Receiver:(2) 2.097779] [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.097779] [jmsg/INFO] Got at time 2.09777901186834
+> [Jacquelin:tracing.Sender:(1) 2.097779] [jmsg/INFO] Was sent at time 0.0
+> [Jacquelin:tracing.Sender:(1) 2.097779] [jmsg/INFO] Communication time : 2.09777901186834
+> [Jacquelin:tracing.Sender:(1) 2.097779] [jmsg/INFO]  --- bw 4.7669463482207894E7 ----
+> [Jacquelin:tracing.Sender:(1) 2.097779] [jmsg/INFO] sender time: 2.09777901186834
+> [Jacquelin:tracing.Sender:(1) 4.474433] [jmsg/INFO] Got at time 4.47443270471118
+> [Jacquelin:tracing.Sender:(1) 4.474433] [jmsg/INFO] Was sent at time 2.09777901186834
+> [Jacquelin:tracing.Sender:(1) 4.474433] [jmsg/INFO] Communication time : 2.37665369284284
+> [Jacquelin:tracing.Sender:(1) 4.474433] [jmsg/INFO]  --- bw 4.207596601101137E7 ----
+> [Jacquelin:tracing.Sender:(1) 4.474433] [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.057947] [jmsg/INFO] Got at time 3.05794733778171
+> [Marcel:tracing.Receiver:(3) 3.057947] [jmsg/INFO] Was sent at time 2.09777901186834
+> [Marcel:tracing.Receiver:(3) 3.057947] [jmsg/INFO] Communication time : 0.96016832591337
+> [Marcel:tracing.Receiver:(3) 3.057947] [jmsg/INFO]  --- bw 1.0414840533806817E8 ----
+> [Marcel:tracing.Receiver:(3) 4.474433] [jmsg/INFO] goodbye!
diff --git a/examples/tracing/tracingPingPongDeployment.xml b/examples/tracing/tracingPingPongDeployment.xml
new file mode 100644 (file)
index 0000000..c9703f5
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+  <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>
diff --git a/org/simgrid/trace/Trace.java b/org/simgrid/trace/Trace.java
new file mode 100644 (file)
index 0000000..57ea5a2
--- /dev/null
@@ -0,0 +1,301 @@
+package org.simgrid.trace;
+
+/*
+ * JNI interface to C code for the TRACES part of SimGrid.
+ * 
+ * Copyright 2006,2007,2010,2011, 2012 The SimGrid Team.           
+ * All right 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.
+ */
+
+public final class Trace {
+       /* Statically load the library which contains all native functions used in here */
+       static {
+               try {
+                       System.loadLibrary("SG_java_tracing");
+               } catch(UnsatisfiedLinkError e) {
+                       System.err.println("Cannot load the bindings to the simgrid library: ");
+                       e.printStackTrace();
+                       System.err.println(
+                                       "Please check your LD_LIBRARY_PATH, or copy the simgrid and SG_java_tracing libraries to the current directory");
+                       System.exit(1);
+               }
+       }
+
+       // TODO complete the binding of the tracing API 
+       
+       /**
+        * Declare a new user variable associated to hosts. 
+        * 
+        * @param variable
+        */
+       public final static native      void hostVariableDeclare (String variable);
+       /**
+        * Declare a new user variable associated to hosts with a color. 
+        *  
+        * @param variable
+        * @param color
+        */
+       public final static native      void hostVariableDeclareWithColor (String variable, String color);
+       
+       /**
+        * Set the value of a variable of a host. 
+        * 
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableSet (String host, String variable, double value);
+       /**
+        *  Add a value to a variable of a host. 
+        *  
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableAdd (String host, String variable, double value);
+
+       /**
+        * Subtract a value from a variable of a host. 
+        *  
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableSub (String host, String variable, double value);
+
+       /**
+        * Set the value of a variable of a host at a given timestamp. 
+        * 
+        * @param time
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableSetWithTime (double time, String host, String variable, double value);
+
+       /**
+        *      Add a value to a variable of a host at a given timestamp. 
+        * 
+        * @param time
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableAddWithTime (double time, String host, String variable, double value);
+       /**
+        * Subtract a value from a variable of a host at a given timestamp.  
+        * 
+        * @param time
+        * @param host
+        * @param variable
+        * @param value
+        */
+       public final static native      void hostVariableSubWithTime (double time, String host, String variable, double value);
+
+       /**
+        *  Get declared user host variables. 
+        * 
+        */
+       public final static native String[]  getHostVariablesName ();
+
+       /**
+        *  Declare a new user variable associated to links. 
+        *  
+        * @param variable
+        */
+       public final static native      void linkVariableDeclare (String variable);
+
+       /**
+        * Declare a new user variable associated to links with a color. 
+        * @param variable
+        * @param color
+        */
+       public final static native      void linkVariableDeclareWithColor (String variable, String color);
+
+       /**
+        *  Set the value of a variable of a link. 
+        *   
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableSet (String link, String variable, double value);
+
+       /**
+        * Add a value to a variable of a link. 
+        * 
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableAdd (String link, String variable, double value);
+       /**
+        * Subtract a value from a variable of a link. 
+        * 
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableSub (String link, String variable, double value);
+
+       /**
+        *  Set the value of a variable of a link at a given timestamp. 
+        *  
+        * @param time
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableSetWithTime (double time, String link, String variable, double value);
+
+       /**
+        * Add a value to a variable of a link at a given timestamp.
+        * 
+        * @param time
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableAddWithTime (double time, String link, String variable, double value);
+
+       /**
+        * Subtract a value from a variable of a link at a given timestamp. 
+        *   
+        * @param time
+        * @param link
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkVariableSubWithTime (double time, String link, String variable, double value);
+
+       /**
+        * Set the value of the variable present in the links connecting source and destination. 
+        * 
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcDstVariableSet (String src, String dst, String variable, double value);
+       /**
+        * Add a value to the variable present in the links connecting source and destination. 
+        *  
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcDstVariableAdd (String src, String dst, String variable, double value);
+
+       /**
+        * Subtract a value from the variable present in the links connecting source and destination. 
+        *   
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcDstVariableSub (String src, String dst, String variable, double value);
+
+       /**
+        *  Set the value of the variable present in the links connecting source and destination at a given timestamp. 
+        *   
+        * @param time
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcDstVariableSetWithTime (double time, String src, String dst, String variable, double value);
+
+       /**
+        * Add a value to the variable present in the links connecting source and destination at a given timestamp. 
+        * 
+        * @param time
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcdstVariableAddWithTime (double time, String src, String dst, String variable, double value);
+       /**
+        * Subtract a value from the variable present in the links connecting source and destination at a given timestamp. 
+        *  
+        * @param time
+        * @param src
+        * @param dst
+        * @param variable
+        * @param value
+        */
+       public final static native      void linkSrcDstVariableSubWithTime (double time, String src, String dst, String variable, double value);
+
+       /**
+        *  Get declared user link variables.  
+        */
+       public final static native String[] getLinkVariablesName ();
+
+       
+                       /* **** ******** WARNINGS ************** ***** */       
+                       /* Only the following routines have been       */
+                       /* JNI implemented - Adrien May, 22nd          */
+                       /* **** ******************************** ***** */       
+               
+    /**
+     * Declare a user state that will be associated to hosts. 
+     * A user host state can be used to trace application states.
+     * 
+     * @param name The name of the new state to be declared.
+     */
+       public final static native void hostStateDeclare(String name);
+       
+       /**
+        * Declare a new value for a user state associated to hosts.
+        * The color needs to be a string with three numbers separated by spaces in the range [0,1]. 
+        * A light-gray color can be specified using "0.7 0.7 0.7" as color. 
+        * 
+        * @param state The name of the new state to be declared.
+        * @param value The name of the value
+        * @param color The color of the value
+        */
+       public final static native void hostStateDeclareValue (String state, String value, String color);
+
+       /**
+        *      Set the user state to the given value.
+        *  (the queue is totally flushed and reinitialized with the given state).
+        *  
+        * @param host The name of the host to be considered.
+        * @param state The name of the state previously declared.
+        * @param value The new value of the state.
+        */
+       public final static native void hostSetState (String host, String state, String value);
+       /**
+        * Push a new value for a state of a given host. 
+        * 
+        * @param host The name of the host to be considered.
+        * @param state The name of the state previously declared.
+        * @param value The value to be pushed.
+        */
+       public final static native void hostPushState (String host, String state, String value);
+       
+       /**
+        *  Pop the last value of a state of a given host. 
+        *   
+        * @param host The name of the host to be considered.
+        * @param state The name of the state to be popped.
+        */
+       public final static native void hostPopState (String host, String state);
+
+       
+}
diff --git a/src/jtrace.c b/src/jtrace.c
new file mode 100644 (file)
index 0000000..c279a14
--- /dev/null
@@ -0,0 +1,92 @@
+/* Java Wrappers to the TRACE API.                                           */
+
+/* Copyright (c) 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. */
+
+
+// Please note, this file strongly relies on the jmsg.c, 
+// It will be great that a JNI expert gives a look to validate it - Adrien ;)
+
+#include "jtrace.h"
+#include <instr/instr.h>
+
+/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
+#ifndef JNIEXPORT
+#define JNIEXPORT
+#endif
+#ifndef JNICALL
+#define JNICALL
+#endif
+/* end of eclipse-mandated pimple */
+
+// Define a new category
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY (jtrace, bindings, "TRACE for Java(TM)");
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
+{
+  const char *s = (*env)->GetStringUTFChars(env, js, 0);
+  TRACE_host_state_declare(s);  
+  (*env)->ReleaseStringUTFChars(env, js, s);
+}
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_trace_Trace_hostStateDeclareValue
+  (JNIEnv *env, jclass cls, jstring js_state, jstring js_value, jstring js_color)
+{
+  const char *state = (*env)->GetStringUTFChars(env, js_state, 0);
+  const char *value = (*env)->GetStringUTFChars(env, js_value, 0);
+  const char *color = (*env)->GetStringUTFChars(env, js_color, 0);
+
+  TRACE_host_state_declare_value(state, value, color);  
+  
+  (*env)->ReleaseStringUTFChars(env, js_state, state);
+  (*env)->ReleaseStringUTFChars(env, js_value, value);
+  (*env)->ReleaseStringUTFChars(env, js_color, color);
+}
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_trace_Trace_hostSetState
+  (JNIEnv *env, jclass cls, jstring js_host, jstring js_state, jstring js_value)
+{
+  const char *host = (*env)->GetStringUTFChars(env, js_host, 0);
+  const char *state = (*env)->GetStringUTFChars(env, js_state, 0);
+  const char *value = (*env)->GetStringUTFChars(env, js_value, 0);
+
+  TRACE_host_set_state(host, state, value);  
+  
+  (*env)->ReleaseStringUTFChars(env, js_host, host);
+  (*env)->ReleaseStringUTFChars(env, js_state, state);
+  (*env)->ReleaseStringUTFChars(env, js_value, value);
+}
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_trace_Trace_hostPushState
+  (JNIEnv *env, jclass cls, jstring js_host, jstring js_state, jstring js_value)
+{
+  const char *host = (*env)->GetStringUTFChars(env, js_host, 0);
+  const char *state = (*env)->GetStringUTFChars(env, js_state, 0);
+  const char *value = (*env)->GetStringUTFChars(env, js_value, 0);
+
+  TRACE_host_push_state(host, state, value);  
+  
+  (*env)->ReleaseStringUTFChars(env, js_host, host);
+  (*env)->ReleaseStringUTFChars(env, js_state, state);
+  (*env)->ReleaseStringUTFChars(env, js_value, value);
+}
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_trace_Trace_hostPopState
+  (JNIEnv *env, jclass cls, jstring js_host, jstring js_state)
+{
+  const char *host = (*env)->GetStringUTFChars(env, js_host, 0);
+  const char *state = (*env)->GetStringUTFChars(env, js_state, 0);
+
+  TRACE_host_pop_state(host, state);  
+  
+  (*env)->ReleaseStringUTFChars(env, js_host, host);
+  (*env)->ReleaseStringUTFChars(env, js_state, state);
+}
diff --git a/src/jtrace.h b/src/jtrace.h
new file mode 100644 (file)
index 0000000..5c435ed
--- /dev/null
@@ -0,0 +1,245 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_simgrid_trace_Trace */
+
+#ifndef _Included_org_simgrid_trace_Trace
+#define _Included_org_simgrid_trace_Trace
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableDeclare
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableDeclare
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableDeclareWithColor
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableDeclareWithColor
+  (JNIEnv *, jclass, jstring, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableSet
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSet
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableAdd
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableAdd
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableSub
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSub
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableSetWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSetWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableAddWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableAddWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostVariableSubWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostVariableSubWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    getHostVariablesName
+ * Signature: ()[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_org_simgrid_trace_Trace_getHostVariablesName
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableDeclare
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclare
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableDeclareWithColor
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableDeclareWithColor
+  (JNIEnv *, jclass, jstring, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableSet
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSet
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableAdd
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAdd
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableSub
+ * Signature: (Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSub
+  (JNIEnv *, jclass, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableSetWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSetWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableAddWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAddWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkVariableSubWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSubWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcDstVariableSet
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
+  (JNIEnv *, jclass, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcDstVariableAdd
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableAdd
+  (JNIEnv *, jclass, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcDstVariableSub
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSub
+  (JNIEnv *, jclass, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcDstVariableSetWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSetWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcdstVariableAddWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcdstVariableAddWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    linkSrcDstVariableSubWithTime
+ * Signature: (DLjava/lang/String;Ljava/lang/String;Ljava/lang/String;D)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime
+  (JNIEnv *, jclass, jdouble, jstring, jstring, jstring, jdouble);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    getLinkVariablesName
+ * Signature: ()[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_org_simgrid_trace_Trace_getLinkVariablesName
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostStateDeclare
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostStateDeclareValue
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclareValue
+  (JNIEnv *, jclass, jstring, jstring, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostSetState
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostSetState
+  (JNIEnv *, jclass, jstring, jstring, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostPushState
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPushState
+  (JNIEnv *, jclass, jstring, jstring, jstring);
+
+/*
+ * Class:     org_simgrid_trace_Trace
+ * Method:    hostPopState
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPopState
+  (JNIEnv *, jclass, jstring, jstring);
+
+#ifdef __cplusplus
+}
+#endif
+#endif