Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'vmtrace'
authorJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Thu, 17 Jan 2013 10:29:37 +0000 (11:29 +0100)
committerJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Thu, 17 Jan 2013 10:29:37 +0000 (11:29 +0100)
36 files changed:
CMakeLists.txt
COPYING [new file with mode: 0644]
ChangeLog
FindJavaSG.cmake
MANIFEST.MF [new file with mode: 0644]
doc/install.doc
examples/async/async.tesh
examples/bittorrent/bittorrent.tesh
examples/chord/chord.tesh
examples/cloud/cloud.tesh
examples/commTime/commtime.tesh
examples/kademlia/kademlia.tesh
examples/master_slave_bypass/bypass.tesh
examples/master_slave_kill/kill.tesh
examples/masterslave/masterslave.tesh
examples/migration/migration.tesh
examples/mutualExclusion/mutualexclusion.tesh
examples/pingPong/pingpong.tesh
examples/priority/priority.tesh
examples/startKillTime/startKillTime.tesh
examples/suspend/suspend.tesh
examples/tracing/tracingPingPong.tesh
org/simgrid/msg/Comm.java
org/simgrid/msg/File.java
org/simgrid/msg/Host.java
org/simgrid/msg/JniException.java
org/simgrid/msg/Msg.java
org/simgrid/msg/Mutex.java
org/simgrid/msg/Process.java
org/simgrid/msg/RngStream.java
org/simgrid/msg/Task.java
org/simgrid/trace/Trace.java
src/jmsg.c
src/jmsg_process.c
src/jmsg_process.h
src/smx_context_cojava.c

index dd56933..e1cf067 100644 (file)
@@ -7,7 +7,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib")
 set(soversion 1)
 
 set(SIMGRID_JAVA_VERSION_MAJOR "3")
-set(SIMGRID_JAVA_VERSION_MINOR "8")
+set(SIMGRID_JAVA_VERSION_MINOR "9")
 set(SIMGRID_JAVA_VERSION_PATCH "0")
 set(DIST_NAME ${PROJECT_NAME}-${SIMGRID_JAVA_VERSION_MAJOR}.${SIMGRID_JAVA_VERSION_MINOR}.${SIMGRID_JAVA_VERSION_PATCH})
 
@@ -156,6 +156,7 @@ set(JAVA_EXAMPLES
   ${CMAKE_HOME_DIRECTORY}/examples/chord/FindSuccessorAnswerTask.java
   ${CMAKE_HOME_DIRECTORY}/examples/chord/FindSuccessorTask.java
   ${CMAKE_HOME_DIRECTORY}/examples/chord/GetPredecessorAnswerTask.java
+  ${CMAKE_HOME_DIRECTORY}/examples/chord/GetPredecessorTask.java
   ${CMAKE_HOME_DIRECTORY}/examples/chord/NotifyTask.java
   ${CMAKE_HOME_DIRECTORY}/examples/cloud/Cloud.java
   ${CMAKE_HOME_DIRECTORY}/examples/cloud/FinalizeTask.java
@@ -221,6 +222,8 @@ set(JAVA_TRACING_EXAMPLES
 
 set(CMAKE_SRC
   ${CMAKE_HOME_DIRECTORY}/ChangeLog
+  ${CMAKE_HOME_DIRECTORY}/MANIFEST.MF
+  ${CMAKE_HOME_DIRECTORY}/COPYING
   ${CMAKE_HOME_DIRECTORY}/CMakeLists.txt
   ${CMAKE_HOME_DIRECTORY}/doxygen_postprocesser.pl
   ${CMAKE_HOME_DIRECTORY}/FindJavaSG.cmake
@@ -370,6 +373,17 @@ if(HAVE_TRACING)
   )
 endif(HAVE_TRACING)
 
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
+  IF(${ARCH_32_BITS})
+      set(JSG_BUNDLE NATIVE/${CMAKE_SYSTEM_NAME}/x86/)
+  ELSE()
+      set(JSG_BUNDLE NATIVE/${CMAKE_SYSTEM_NAME}/amd64/)
+  ENDIF()
+ELSE() 
+  error("Unknown system type. Processor: ${CMAKE_SYSTEM_PROCESSOR}; System: ${CMAKE_SYSTEM_NAME}")
+ENDIF()
+message("Native libraries bundeled into: ${JSG_BUNDLE}")
+
 # java_classes
 add_custom_command(
   OUTPUT  ${JAVA_SRC_CLASS}
@@ -377,6 +391,13 @@ add_custom_command(
   COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_HOME_DIRECTORY}/classes/"
   COMMAND ${JAVA_COMPILE} -d ${CMAKE_HOME_DIRECTORY}/classes/
     -cp ${CMAKE_HOME_DIRECTORY}/classes/ ${JAVA_SRC}
+  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}
+  COMMAND ${CMAKE_COMMAND} -E copy ${SIMGRID_LIB_PATH}/libsimgrid.so ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}
+  COMMAND strip --strip-debug ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}/libsimgrid.so
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/lib/libSG_java.so ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}
+  COMMAND strip --strip-debug ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}/libSG_java.so
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/ChangeLog ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/COPYING ${CMAKE_HOME_DIRECTORY}/classes/${JSG_BUNDLE}
   COMMENT "Compiling java sources of core library..."                                  
 )
 
@@ -386,7 +407,7 @@ add_custom_target(java_classes ALL
 
 # simgrid_jar
 add_custom_target(simgrid_jar ALL
-  COMMAND ${JAVA_ARCHIVE} -cvf ${CMAKE_HOME_DIRECTORY}/simgrid.jar .
+  COMMAND ${JAVA_ARCHIVE} -cmvf ${CMAKE_HOME_DIRECTORY}/MANIFEST.MF ${CMAKE_HOME_DIRECTORY}/simgrid.jar .
   COMMENT "Building simgrid.jar..."
   WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/classes 
 )
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..a13f68b
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,9 @@
+All of the Java bindings to the SimGrid software was written
+internally by the team. This software is distributed under the GNU
+lesser general public license version 2.1, which you can find in the
+archive under the name LICENSE-LGPL-2.1.
+
+For any copyright year range specified as YYYY-ZZZZ in this package
+note that the range specifies every single year in that closed interval.
+
+The SimGrid logo is distributed under the CC-BY-SA license.
index 7562757..2ef1989 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-SimGrid-java (3.8) unstable; urgency=low
+SimGrid-java (3.8.1) unstable; urgency=low
 
  * New module: org.simgrid.trace.Trace (SimGrid trace bindings)
    Warning: all methods are visible, but only some of them are 
@@ -13,11 +13,15 @@ SimGrid-java (3.8) unstable; urgency=low
  * Add Process.getProperty, Host.getProperty, Host.getProperty: allows
    you to retrieve the properties of the processes/hosts
  * Deprecate Msg.clean(): you can just forget about it now.
+ * New function Process.getCount(), that only works when compiling
+   with the not yet released version 3.9 of the C library.
  
  * New context factory based on Coroutines. It mandates a modified JVM
    but then, the simulations run about five times faster, and there is
    no limit to the amount of processes (beside of the available memory).
+
+ -- 2012-12-04 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+
 SimGrid-java (3.7.1) stable; urgency=low
   
  The "Java aint got to be bloated and slow" release
index 92d254d..47bddfd 100644 (file)
@@ -1,6 +1,9 @@
+set(JAVA_INCLUDE_PATH "$ENV{JAVA_INCLUDE_PATH}")
+set(JAVA_INCLUDE_PATH2 "$ENV{JAVA_INCLUDE_PATH}")
+
 include(FindJava)
 include(FindJNI)
-       
+
 message(STATUS "Looking for jni.h")
 if(JAVA_INCLUDE_PATH)
  message(STATUS "Looking for jni.h - found")
diff --git a/MANIFEST.MF b/MANIFEST.MF
new file mode 100644 (file)
index 0000000..8d2c039
--- /dev/null
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Built-By: Da SimGrid team
+Main-Class: org.simgrid.msg.Msg
+Class-Path: .
+
index 0d88aff..0dc293c 100644 (file)
@@ -3,13 +3,13 @@
 \section bindings_binding_java_install How to install Simgrid-java
 
 To use java with Simgrid you have to install some dependencies:
- \li Simgrid (see <a href="http://simgrid.gforge.inria.fr/simgrid/3.7/doc/install.html">install
+ \li Simgrid (see <a href="http://simgrid.gforge.inria.fr/simgrid/latest/doc/install.html">install
      Simgrid</a>). You should set the SIMGRID_ROOT environment
      variable to the path where you installed SimGrid.
- \li Java JDK packages, such as sun-java6-jdk (with libgcj10-dev or
-another version of gcj) or openjdk6. For maximal performance and
-scalability, use a coroutine-enabled JVM (see
-\ref bindings_binding_java_coroutines).
+ \li Java JDK packages, such as openjdk7 or sun-java6-jdk (with
+     libgcj10-dev or another version of gcj). For maximal performance
+     and scalability, use a coroutine-enabled JVM (see
+     \ref bindings_binding_java_coroutines).
  
 Then Download and install package Simgrid-java:
 \verbatim
@@ -25,7 +25,7 @@ Cmake output
 -- BUILDNAME   : Simgrid-Java
 -- Looking for lib SimGrid
 -- Looking for lib SimGrid - found
--- Simgrid version : 3.6
+-- Simgrid version : 3.8.1
 -- Looking for gras.h
 -- Looking for gras.h - found
 -- Found Tesh: /home/user/Bureau/simgrid/git/bin/tesh
@@ -43,6 +43,27 @@ Cmake output
 -- Build files have been written to: /home/user/workspace/simgrid-java/build
 \endverbatim
 
+If cmake complains that <b>jni could not be found</b>, you need to
+tell it where JNI header files are located. the following command
+should tell you:
+
+\verbatim
+$ locate jni.h
+/usr/lib/jvm/java-6-openjdk-amd64/include/jni.h
+/usr/lib/jvm/java-7-openjdk-amd64/include/jni.h
+\endverbatim
+
+If you have several version of jni installed (as in the example
+above), you need to check the version of java that is used by default
+on your machine (using javac -version), and pick the right one. Then
+set the JAVA_INCLUDE_PATH environment variable to the right path (note
+that we remove the filename jni.h from that path), and relaunch cmake.
+
+\verbatim
+$ export JAVA_INCLUDE_PATH=/usr/lib/jvm/java-6-openjdk-amd64/include/
+$ cmake .
+\endverbatim
+
 \section bindings_binding_java_use How to use Simgrid-java
 
 To execute the examples you need to add the path where you installed
@@ -53,16 +74,15 @@ Be careful on Mac, this variable is called DYLD_LIBRARY_PATH and not
 LD_LIBRARY_PATH.
 
 \verbatim
-$ export SIMGRID_ROOT="$HOME/Install/simgrid/"
-$ export SIMGRID_JAVA_ROOT="$HOME/Install/simgrid-java"
-$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMGRID_ROOT/lib:$SIMGRID_JAVA_ROOT/java
+$ export SIMGRID_ROOT="$HOME/Install/simgrid/" # change it to the path where you installed the SimGrid library
+$ export SIMGRID_JAVA_ROOT="$HOME/Install/simgrid-java" # change it to the path where you installed the java bindings of SimGrid 
+$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$SIMGRID_ROOT/lib:$SIMGRID_JAVA_ROOT/java
 $ cd examples
 $ java -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
 \endverbatim
 
-
-
-
+If you want to make these settings permanent even after a reboot, you
+need to add the export lines into your ~/.bashrc file, or equivalent.
 
 
 
@@ -87,6 +107,10 @@ migrate stacks in SimGrid. You should be able to follow the README.txt
 that you'll get in the repository, but here is how we did it, just in
 case. The instructions are given for a debian or Ubuntu box, but I
 think you should manage to convert it to your system quite easily.
+Finally, if you're really stuck, you can get the version compiled by
+Jonathan Rouzaud-Cornabas from his web page. This version is known to
+work with SimGrid for sure!
+http://graal.ens-lyon.fr/~jrouzaud/files/corosimple-linux-amd64-20120914.tgz
  
  -# Install mercurial and some dependencies
 \verbatim 
@@ -179,9 +203,23 @@ you want to increase it to run more processes.
 $ $PATH_TO_COROUTINE_JVM/java -Dcoro.stacksPerThread=$STACKS_NUMBER -cp .:../simgrid.jar basic/BasicTest platform.xml basic/basicDeployment.xml
 \endverbatim
 
-If you feel limited in the amount of processes you can run, give a try
-to this command:
+If you reach the point where the creation of new simulated processes
+fail with the message "Can't create coroutine object", you may need to
+increase the relevant system limit with the following command.
 \verbatim 
 sysctl -w vm.max_map_count = 131072
 \endverbatim
+
+The full story is that each coroutine requires two memory maps, and
+that Linux puts a limit on the total amount of memory maps that each
+process can manage (by default, this limit is often at 65535). Since
+the JVM needs a few dozen of such maps on its own (three maps per
+dynamic library -- check /proc/the_pid/maps if you don't believe it),
+this is enough to create over 30,000 simulated processes. But to go
+futher, that limit must be modified. 
+
+If you want to make this change permanent on your machine, edit your
+/etc/sysctl.conf file. Otherwise, you have to redo it by calling
+sysctl after each reboot.
+
  */
index 8782d07..2efb017 100644 (file)
@@ -3,7 +3,6 @@
 ! output sort
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar async/AsyncTest ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/async/asyncDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (10:async.Slave@Robert) Receiving on 'slave_8'
 > [  0.000000] (11:async.Slave@Sirois) Receiving on 'slave_9'
 > [  0.000000] (12:async.Slave@Monique) Receiving on 'slave_10'
@@ -53,8 +52,5 @@ $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar async/AsyncTest ${sr
 > [ 25.000000] (1:async.Master@Jacquelin) Goodbye now!
 > [ 25.851463] (2:async.Forwarder@Jackson) I'm done. See you!
 > [ 26.357007] (3:async.Forwarder@Casavant) I'm done. See you!
-> [ 29.000728] (0:@) Done running MSG_MAIN
-> [ 29.000728] (0:@) MSG_main finished
-> [ 29.000728] (0:@) Clean java world
-> [ 29.000728] (0:@) Clean native world
+> [ 29.000728] (0:@) MSG_main finished; Cleaning up the simulation...
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
index e45857a..1e170eb 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar bittorrent/Bittorrent ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/bittorrent/bittorrent.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [5000.832370] [jmsg/INFO] Done running MSG_MAIN
-> [5000.832370] [jmsg/INFO] MSG_main finished
-> [5000.832370] [jmsg/INFO] Clean java world
-> [5000.832370] [jmsg/INFO] Clean native world
+> [5000.832370] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Boivin:bittorrent.Peer:(2) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 2
 > [Boivin:bittorrent.Peer:(2) 5000.048882] [jmsg/INFO] Here is my current status: 1111111111
 > [Disney:bittorrent.Peer:(6) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 6
index 9e21e8a..ba3f52e 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar chord/Chord ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/chord/chord.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [652.548539] [jmsg/INFO] Done running MSG_MAIN
-> [652.548539] [jmsg/INFO] MSG_main finished
-> [652.548539] [jmsg/INFO] Clean java world
-> [652.548539] [jmsg/INFO] Clean native world
+> [652.548539] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Boivin:chord.Node:(7) 0.000000] [jmsg/INFO] Joining the ring with id 8 knowing node 1
 > [Gatien:chord.Node:(1) 0.000000] [jmsg/INFO] Joining the ring with id 48 knowing node 1
 > [Geoff:chord.Node:(4) 0.000000] [jmsg/INFO] Joining the ring with id 32 knowing node 1
index 9b191bd..bdb2c12 100644 (file)
@@ -3,7 +3,6 @@
 ! output sort
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar cloud/Cloud ${srcdir:=.}/examples/platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (10:Slave 8@Jean_Yves) Receiving on slave_8
 > [  0.000000] (11:Slave 9@Fafard) Receiving on slave_9
 > [  0.000000] (1:Master@Jacquelin) Launched 10 VMs
@@ -151,10 +150,7 @@ $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar cloud/Cloud ${srcdir
 > [1021.445768] (20:Slave 18@Provost) Received "Task_18". Processing it.
 > [1021.445768] (20:Slave 18@Provost) "Task_18" done 
 > [1021.445768] (20:Slave 18@Provost) Receiving on slave_18
-> [1023.430577] (0:@) Done running MSG_MAIN
-> [1023.430577] (0:@) MSG_main finished
-> [1023.430577] (0:@) Clean java world
-> [1023.430577] (0:@) Clean native world
+> [1023.430577] (0:@) MSG_main finished; Cleaning up the simulation...
 > [1023.430577] (1:Master@Jacquelin) Let's shut down the simulation and kill everyone.
 > [1023.430577] (1:Master@Jacquelin) Master done.
 > [1023.430577] (21:Slave 19@Provost) Received "Task_19". Processing it.
index 0847b8b..c7bf972 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar commTime/CommTimeTest ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/commTime/commTimeDeployment.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [7016.935689] [jmsg/INFO] Done running MSG_MAIN
-> [7016.935689] [jmsg/INFO] MSG_main finished
-> [7016.935689] [jmsg/INFO] Clean java world
-> [7016.935689] [jmsg/INFO] Clean native world
+> [7016.935689] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Bellemarre:commTime.Slave:(15) 0.000000] [jmsg/INFO] Receiving on 'slave_13'
 > [Bellemarre:commTime.Slave:(15) 7006.824050] [jmsg/INFO] Received Finalize. I'm done. See you!
 > [Boucherville:commTime.Slave:(18) 0.000000] [jmsg/INFO] Receiving on 'slave_16'
index d2b2d3f..7396956 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar kademlia/Kademlia ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/kademlia/kademlia.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [900.000000] [jmsg/INFO] Done running MSG_MAIN
-> [900.000000] [jmsg/INFO] MSG_main finished
-> [900.000000] [jmsg/INFO] Clean java world
-> [900.000000] [jmsg/INFO] Clean native world
+> [900.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Boivin:kademlia.Node:(2) 0.000000] [jmsg/INFO] Hi, I'm going to join the network with the id 1!
 > [Boivin:kademlia.Node:(2) 900.000000] [jmsg/INFO] 8/8 FIND_NODE have succedded.
 > [Jacquelin:kademlia.Node:(1) 0.000000] [jmsg/INFO] Hi, I'm going to create the network with the id 0!
index aedfdd0..dfcc347 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar master_slave_bypass/MsBypass ${srcdir:=.}/examples/master_slave_bypass/platform.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [0.013010] [jmsg/INFO] Done running MSG_MAIN
-> [0.013010] [jmsg/INFO] MSG_main finished
-> [0.013010] [jmsg/INFO] Clean java world
-> [0.013010] [jmsg/INFO] Clean native world
+> [0.013010] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [alice:process2:(2) 0.000000] [jmsg/INFO] Slave Hello!
 > [alice:process2:(2) 0.000000] [jmsg/INFO] Send finalize!
 > [bob:process1:(1) 0.000000] [jmsg/INFO] Master Hello!
index 29de2cc..2c7179a 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar master_slave_kill/MsKill ${srcdir:=.}/examples/master_slave_kill/platform.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [0.013010] [jmsg/INFO] Done running MSG_MAIN
-> [0.013010] [jmsg/INFO] MSG_main finished
-> [0.013010] [jmsg/INFO] Clean java world
-> [0.013010] [jmsg/INFO] Clean native world
+> [0.013010] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [alice:slave:(2) 0.000000] [jmsg/INFO] Slave Hello!
 > [alice:slave:(2) 0.000000] [jmsg/INFO] Send Mail1!
 > [bob:master:(1) 0.000000] [jmsg/INFO] Master Hello!
index 9c7509d..243f4c4 100644 (file)
@@ -3,7 +3,6 @@
 ! output sort
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar masterslave/Masterslave ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/masterslave/masterslaveDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (1:masterslave.Master@Jacquelin) Hello! Got 7 slaves and 5 tasks to process
 > [  0.000000] (2:masterslave.Forwarder@Jackson) Receiving on 'slave_0'
 > [  0.000000] (3:masterslave.Forwarder@Casavant) Receiving on 'slave_1'
@@ -27,10 +26,7 @@ $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar masterslave/Mastersl
 > [ 13.977892] (5:masterslave.Slave@Bousquet) Received Finalize. I'm done. See you!
 > [ 15.421578] (6:masterslave.Slave@Soucy) Received Finalize. I'm done. See you!
 > [ 16.278886] (7:masterslave.Slave@Kuenning) Received Finalize. I'm done. See you!
-> [ 17.252217] (0:@) Done running MSG_MAIN
-> [ 17.252217] (0:@) MSG_main finished
-> [ 17.252217] (0:@) Clean java world
-> [ 17.252217] (0:@) Clean native world
+> [ 17.252217] (0:@) MSG_main finished; Cleaning up the simulation...
 > [ 17.252217] (1:masterslave.Master@Jacquelin) Goodbye now!
 > [ 17.252217] (8:masterslave.Slave@Browne) Received Finalize. I'm done. See you!
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
index dc4c0cf..e40cb50 100644 (file)
@@ -3,15 +3,11 @@
 ! output sort
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar migration/Migration ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/migration/migrationDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (1:migration.Emigrant@Jacquelin) I'll look for a new job on another machine where the grass is greener.
 > [  0.000000] (1:migration.Emigrant@Boivin) Yeah, found something to do
 > [  1.000000] (2:migration.Policeman@Boivin) Wait a bit before migrating the emigrant.
 > [  3.000000] (1:migration.Emigrant@Boivin) Moving back to home after work
-> [  7.000000] (0:@) Done running MSG_MAIN
-> [  7.000000] (0:@) MSG_main finished
-> [  7.000000] (0:@) Clean java world
-> [  7.000000] (0:@) Clean native world
+> [  7.000000] (0:@) MSG_main finished; Cleaning up the simulation...
 > [  7.000000] (1:migration.Emigrant@Jacquelin) I've been moved on this new host:Jacquelin
 > [  7.000000] (1:migration.Emigrant@Jacquelin) Uh, nothing to do here. Stopping now
 > [  7.000000] (2:migration.Policeman@Boivin) I moved the emigrant
index 0ad11ff..a8ca174 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar mutualExclusion/centralized/MutexCentral ${srcdir:=.}/examples/mutualExclusion/ring3.xml ${srcdir:=.}/examples/mutualExclusion/centralized/mutex_centralized_deployment.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [0.007806] [jmsg/INFO] Done running MSG_MAIN
-> [0.007806] [jmsg/INFO] MSG_main finished
-> [0.007806] [jmsg/INFO] Clean java world
-> [0.007806] [jmsg/INFO] Clean native world
+> [0.007806] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.001301] [jmsg/INFO] Got a request from mutualExclusion.centralized.Node. Queue empty: grant it
 > [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.003903] [jmsg/INFO] Got a request from mutualExclusion.centralized.Node. Queue empty: grant it
 > [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.007806] [jmsg/INFO] we should shutdown the simulation now
index f8f28c3..cd4a7bf 100644 (file)
@@ -4,11 +4,7 @@
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar pingPong/PingPongTest ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/pingPong/pingPongDeployment.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
-> [1.048890] [jmsg/INFO] Done running MSG_MAIN
-> [1.048890] [jmsg/INFO] MSG_main finished
-> [1.048890] [jmsg/INFO] Clean java world
-> [1.048890] [jmsg/INFO] Clean native world
+> [1.048890] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
 > [Boivin:pingPong.Receiver:(2) 0.000000] [jmsg/INFO] hello!
 > [Boivin:pingPong.Receiver:(2) 0.000000] [jmsg/INFO] try to get a task
 > [Boivin:pingPong.Receiver:(2) 1.048890] [jmsg/INFO] Got at time 1.0488895059341703
index 9d06d4e..f7ff99b 100644 (file)
@@ -3,13 +3,9 @@
 ! output sort
 
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar priority/Priority ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/priority/priorityDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (1:priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 1.0
 > [  0.000000] (2:priority.Test@Fafard) Hello! Running a task of size 7.6296E7 with priority 2.0
 > [  0.833332] (2:priority.Test@Fafard) Goodbye now!
-> [  1.111109] (0:@) Done running MSG_MAIN
-> [  1.111109] (0:@) MSG_main finished
-> [  1.111109] (0:@) Clean java world
-> [  1.111109] (0:@) Clean native world
+> [  1.111109] (0:@) MSG_main finished; Cleaning up the simulation...
 > [  1.111109] (1:priority.Test@Fafard) Goodbye now!
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
index c2e5816..edbe382 100644 (file)
@@ -1,7 +1,6 @@
 #! ./tesh
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar startKillTime/StartKillTime ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/startKillTime/deployment_start_kill.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-> [0.000000] [jmsg/INFO] Ready to run MSG_MAIN
 > [Jacquelin:startKillTime.Master:(1) 0.000000] [jmsg/INFO] Hello!
 > [Boivin:startKillTime.Slave:(2) 1.000000] [jmsg/INFO] Hello!
 > [Jean_Yves:startKillTime.Slave:(3) 2.000000] [jmsg/INFO] Hello!
@@ -9,7 +8,4 @@ $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar startKillTime/StartK
 > [Geoff:startKillTime.Slave:(5) 4.000000] [jmsg/INFO] Hello!
 > [Disney:startKillTime.Slave:(6) 5.000000] [jmsg/INFO] Hello!
 > [Jacquelin:startKillTime.Master:(1) 10.000000] [jmsg/INFO] OK, goodbye now.
-> [10.000000] [jmsg/INFO] Done running MSG_MAIN
-> [10.000000] [jmsg/INFO] MSG_main finished
-> [10.000000] [jmsg/INFO] Clean java world
-> [10.000000] [jmsg/INFO] Clean native world
+> [10.000000] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
index fce16e6..c6ec5f7 100644 (file)
@@ -2,14 +2,10 @@
 
 ! output sort
 $ java -cp .:${srcdir:=.}/examples:${srcdir:=.}/simgrid.jar suspend/Suspend ${srcdir:=.}/examples/platform.xml ${srcdir:=.}/examples/suspend/suspendDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Ready to run MSG_MAIN
 > [  0.000000] (1:suspend.DreamMaster@Jacquelin) Let's create a lazy guy.
 > [  0.000000] (1:suspend.DreamMaster@Jacquelin) Let's wait a little bit...
 > [  0.000000] (2:Lazy@Jacquelin) Nobody's watching me ? Let's go to sleep.
-> [ 10.000000] (0:@) Done running MSG_MAIN
-> [ 10.000000] (0:@) MSG_main finished
-> [ 10.000000] (0:@) Clean java world
-> [ 10.000000] (0:@) Clean native world
+> [ 10.000000] (0:@) MSG_main finished; Cleaning up the simulation...
 > [ 10.000000] (1:suspend.DreamMaster@Jacquelin) Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!
 > [ 10.000000] (1:suspend.DreamMaster@Jacquelin) OK, goodbye now.
 > [ 10.000000] (2:Lazy@Jacquelin) Uuuh ? Did somebody call me ?
index 850caa6..50b5660 100644 (file)
@@ -4,14 +4,10 @@
 
 $ 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] Using regular java threads. Coroutines could speed your simulation up.
-> [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
+> [4.474433] [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.048890] [jmsg/INFO] Got at time 1.0488895059341703
index 66d264c..63e6d1e 100644 (file)
@@ -83,6 +83,7 @@ public class Comm {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }       
 }
index fa42c6d..9076bcf 100644 (file)
@@ -61,6 +61,7 @@ public class File {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }       
 }
\ No newline at end of file
index 136f4b2..4683f5d 100644 (file)
@@ -83,7 +83,6 @@ public class Host {
         * This static method returns the count of the installed hosts.
         *
         * @return                      The count of the installed hosts.
-        * FIXME: Not implemented.
         */ 
        public native static int getCount();
 
index 9edada6..d9333a2 100644 (file)
@@ -32,4 +32,7 @@ public class JniException extends RuntimeException {
         */ public JniException(String s) {
                 super(s);
         }
+       public JniException(String string, Exception e) {
+               super(string,e);
+       }
 }
index 4cbf037..895fadf 100644 (file)
 
 package org.simgrid.msg;
 
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.File;
+
+
 public final class Msg {
        /* Statically load the library which contains all native functions used in here */
-       static {
+       static private boolean isNativeInited = false;
+       public static void nativeInit() {
+               if (isNativeInited)
+                       return;
                try {
+                       /* prefer the version on disk, if existing */
                        System.loadLibrary("SG_java");
-               } catch(UnsatisfiedLinkError e) {
+               } catch (UnsatisfiedLinkError e) {
+                       /* If not found, unpack the one bundled into the jar file and use it */
+                       loadLib("simgrid");
+                       loadLib("SG_java");
+               }
+               isNativeInited = true;
+       }
+       static {
+               nativeInit();
+       }
+       private static void loadLib (String name) {
+               String Path = "NATIVE/"+System.getProperty("os.name")+"/"+System.getProperty("os.arch")+"/";
+               String filename=name;
+               InputStream in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
+               
+               if (in == null) {
+                       filename = "lib"+name+".so";
+                       in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
+               } 
+               if (in == null) {
+                       filename = name+".dll";
+                       in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
+               }  
+               if (in == null) {
+                       filename = "lib"+name+".dll";
+                       in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
+               }  
+               if (in == null) {
+                       filename = "lib"+name+".dylib";
+                       in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
+               }  
+               if (in == null) {
+                       throw new RuntimeException("Cannot find library "+name+" in path "+Path+". Sorry, but this jar does not seem to be usable on your machine.");
+               }
+// Caching the file on disk: desactivated because it could fool the users              
+//             if (new File(filename).isFile()) {
+//                     // file was already unpacked -- use it directly
+//                     System.load(new File(".").getAbsolutePath()+File.separator+filename);
+//                     return;
+//             }
+               try {
+                       // We must write the lib onto the disk before loading it -- stupid operating systems
+                       File fileOut = new File(filename);
+//                     if (!new File(".").canWrite()) {
+//                             System.out.println("Cannot write in ."+File.separator+filename+"; unpacking the library into a temporary file instead");
+                               fileOut = File.createTempFile("simgrid-", ".tmp");
+                               // don't leak the file on disk, but remove it on JVM shutdown
+                               Runtime.getRuntime().addShutdownHook(new Thread(new FileCleaner(fileOut.getAbsolutePath())));
+//                     }
+//                     System.out.println("Unpacking SimGrid native library to " + fileOut.getAbsolutePath());
+                       OutputStream out = new FileOutputStream(fileOut);
+                       
+                       /* copy the library in position */  
+                       byte[] buffer = new byte[4096]; 
+                       int bytes_read; 
+                       while ((bytes_read = in.read(buffer)) != -1)     // Read until EOF
+                               out.write(buffer, 0, bytes_read); 
+                     
+                       /* close all file descriptors, and load that shit */
+                       in.close();
+                       out.close();
+                       System.load(fileOut.getAbsolutePath());
+               } catch (Exception 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 libraries to the current directory");
+                       System.err.println("This jar file does not seem to fit your system, sorry");
                        System.exit(1);
                }
+       }               
+       /* A hackish mechanism used to remove the file containing our library when the JVM shuts down */
+       private static class FileCleaner implements Runnable {
+               private String target;
+               public FileCleaner(String name) {
+                       target = name;
+               }
+        public void run() {
+            try {
+                new File(target).delete();
+            } catch(Exception e) {
+                System.out.println("Unable to clean temporary file "+target+" during shutdown.");
+                e.printStackTrace();
+            }
+        }    
        }
+
     /** Retrieve the simulation time
      * @return
      */
index 7032b6e..cb16ffb 100644 (file)
@@ -31,6 +31,7 @@ public class Mutex {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }       
 }
index e8ed072..edde2bf 100644 (file)
 package org.simgrid.msg;
  
 import java.util.Arrays;
-import java.util.Hashtable;
 import java.util.Vector;
-import java.lang.Runnable;
-import java.util.concurrent.Semaphore;
 
 /**
  * A process may be defined as a code, with some private data, executing 
@@ -404,6 +401,14 @@ public abstract class Process implements Runnable {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }
+       /**
+        * This static method returns the current amount of processes running
+        *
+        * @return                      The count of the running processes
+        */ 
+       public native static int getCount();
+
 }
index c9f5471..58b9c9e 100644 (file)
@@ -113,6 +113,7 @@ public class RngStream {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }
 }
\ No newline at end of file
index e5e5fbf..59c103b 100644 (file)
@@ -289,6 +289,7 @@ public class Task {
         */
        public static native void nativeInit();
        static {
+               Msg.nativeInit();
                nativeInit();
        }
 
index ede59a5..7943ed4 100644 (file)
  */
 package org.simgrid.trace;
 
+import org.simgrid.msg.Msg;
+
 public final class Trace {
        /* Statically load the library which contains all native functions used in here */
        static {
+               Msg.nativeInit();
                try {
                        System.loadLibrary("SG_java_tracing");
                } catch(UnsatisfiedLinkError e) {
index 97ba952..41d7f36 100644 (file)
@@ -135,16 +135,14 @@ JNIEXPORT void JNICALL
   jobject jhost;
 
   /* Run everything */
-  XBT_INFO("Ready to run MSG_MAIN");
+  XBT_DEBUG("Ready to run MSG_MAIN");
   rv = MSG_main();
-  XBT_INFO("Done running MSG_MAIN");
+  XBT_DEBUG("Done running MSG_MAIN");
   jxbt_check_res("MSG_main()", rv, MSG_OK,
                  bprintf
                  ("unexpected error : MSG_main() failed .. please report this bug "));
 
-  XBT_INFO("MSG_main finished");
-
-  XBT_INFO("Clean java world");
+  XBT_INFO("MSG_main finished; Cleaning up the simulation...");
   /* Cleanup java hosts */
   hosts = MSG_hosts_as_dynar();
   for (index = 0; index < xbt_dynar_length(hosts) - 1; index++) {
@@ -154,7 +152,6 @@ JNIEXPORT void JNICALL
 
   }
   xbt_dynar_free(&hosts);
-  XBT_INFO("Clean native world");
 }
 
 JNIEXPORT void JNICALL
index 7773eeb..aaa73e7 100644 (file)
@@ -266,7 +266,8 @@ Java_org_simgrid_msg_Process_resume(JNIEnv * env,
   jxbt_check_res("MSG_process_resume()", rv, MSG_OK,
                  bprintf("unexpected error , please report this bug"));
 }
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setAutoRestart
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Process_setAutoRestart
     (JNIEnv *env, jobject jprocess, jboolean jauto_restart) {
   msg_process_t process = jprocess_to_native_process(jprocess, env);
   xbt_ex_t e;
@@ -285,7 +286,8 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setAutoRestart
     xbt_ex_free(e);
   }
 }
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Process_restart
     (JNIEnv *env, jobject jprocess) {
   msg_process_t process = jprocess_to_native_process(jprocess, env);
   xbt_ex_t e;
@@ -318,7 +320,8 @@ Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env,
   return (jboolean) MSG_process_is_suspended(process);
 }
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Process_sleep
        (JNIEnv *env, jclass cls, jlong jmillis, jint jnanos) {
 
        double time =  jmillis / 1000 + jnanos / 1000;
@@ -398,3 +401,15 @@ Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdoubl
        msg_process_t process = jprocess_to_native_process(jprocess, env);
        MSG_process_set_kill_time(process, (double)jkilltime);
 }
+
+JNIEXPORT jint JNICALL
+Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
+       /* FIXME: the next test on SimGrid version is to ensure that this still compiles with SG 3.8 while the C function were added in SG 3.9 only.
+        * This kind of pimple becomes mandatory when you get so slow to release the java version that it begins evolving further after the C release date.
+        */
+#if SIMGRID_VERSION >= 30900
+  return (jint) MSG_process_get_number();
+#else
+  return (jint) -1;
+#endif
+}
index cfc7051..566a877 100644 (file)
@@ -261,4 +261,8 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime
     (JNIEnv *, jobject, jdouble);
 
+JNIEXPORT jint JNICALL
+Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls);
+
+
 #endif                          /* !MSG_JPROCESS_H */
index 4e43ef7..00fe9b5 100644 (file)
@@ -258,7 +258,24 @@ static void smx_ctx_cojava_create_coroutine(smx_ctx_cojava_t context) {
   jclass coclass = (*env)->FindClass(env, "java/dyn/Coroutine");
   xbt_assert((coclass != NULL), "Can't find coroutine class ! :(");
   jobject jcoroutine = (*env)->NewObject(env, coclass, coroutine_init, context->jprocess);
-  xbt_assert((jcoroutine != NULL), "Can't create coroutine object.");
+  if (jcoroutine == NULL) {
+     FILE *conf= fopen("/proc/sys/vm/max_map_count","r");
+     if (conf) {
+       int limit=-1;
+       fscanf(conf,"%d",&limit);
+       fclose(conf);
+       if (limit!=-1 && SIMIX_process_count() > (limit - 100) /2)
+          xbt_die("Error while creating a new coroutine. "
+                  "This seem due to the the vm.max_map_count system limit that is only equal to %d while we already have %d coroutines. "
+                  "Please check the install documentation to see how to increase this limit", limit, SIMIX_process_count());
+       if (limit == -1)
+         xbt_die("Error while creating a new coroutine. "
+                 "This seems to be a non-linux system, disabling the automatic verification that the system limit on the amount of memory maps is high enough.");
+       xbt_die("Error while creating a new coroutine. ");
+     }
+     
+  }
+   
   jcoroutine = (*env)->NewGlobalRef(env, jcoroutine);
   context->jcoroutine = jcoroutine;
 }