Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix in Comm (GC didn't like it.). Add "debug" logging
authorSamuel Lepetit <samuel.lepetit@inria.fr>
Fri, 18 May 2012 12:37:54 +0000 (14:37 +0200)
committerSamuel Lepetit <samuel.lepetit@inria.fr>
Fri, 18 May 2012 12:37:54 +0000 (14:37 +0200)
org/simgrid/msg/Comm.java
org/simgrid/msg/Msg.java
src/jmsg.c
src/jmsg.h

index 3ef08e3..d3d9799 100644 (file)
@@ -46,7 +46,7 @@ public class Comm {
        /**
         * Unbind the communication object
         */
-       public native void destroy() throws NativeException;
+       protected native void destroy() throws NativeException;
        /**
         * Returns if the communication is finished or not.
         * If the communication has finished and there was an error,
index c9dcc48..a4db8be 100644 (file)
@@ -50,7 +50,11 @@ public final class Msg {
      * @return
      */
        public final static native double getClock();
-
+       /**
+        * Issue an "debug" logging message.
+        * @param s message to log.
+        */
+       public final static native void debug(String s);
     /** Issue an information logging message
      * @param s
      */
index ee091f2..7ace464 100644 (file)
@@ -167,7 +167,13 @@ Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls,
 
   (*env)->ReleaseStringUTFChars(env, jplatformFile, platformFile);
 }
-
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Msg_debug(JNIEnv * env, jclass cls, jstring js)
+{
+  const char *s = (*env)->GetStringUTFChars(env, js, 0);
+  XBT_DEBUG("%s", s);
+  (*env)->ReleaseStringUTFChars(env, js, s);
+}
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Msg_info(JNIEnv * env, jclass cls, jstring js)
 {
index da58d25..c8a3f15 100644 (file)
@@ -42,6 +42,10 @@ JNIEXPORT void JNICALL
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs);
 
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv *, jclass,
+                                                 jstring);
+
+
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv *, jclass,
                                                  jstring);