Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use XBT_INFO only after MSG_init, so that log parameters given on the command line...
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 12 Feb 2014 15:35:19 +0000 (16:35 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 12 Feb 2014 16:26:01 +0000 (17:26 +0100)
examples/java/async/async.tesh
examples/java/masterslave/masterslave.tesh
examples/java/migration/migration.tesh
examples/java/priority/priority.tesh
examples/java/suspend/suspend.tesh
examples/scala/masterslave/masterslave.tesh
src/bindings/java/jmsg.c

index 72c3ab7..1a1321d 100644 (file)
@@ -3,6 +3,7 @@
 ! output sort
 ! timeout 30
 $ java -classpath ${classpath:=.} async/AsyncTest ${srcdir:=.}/platform.xml ${srcdir:=.}/async/asyncDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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,4 +54,3 @@ $ java -classpath ${classpath:=.} async/AsyncTest ${srcdir:=.}/platform.xml ${sr
 > [ 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:@) MSG_main finished; Cleaning up the simulation...
-> [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
index ee1d207..81be5cf 100644 (file)
@@ -3,6 +3,7 @@
 ! output sort
 
 $ java -classpath ${classpath:=.} masterslave/Masterslave ${srcdir:=.}/platform.xml ${srcdir:=.}/masterslave/masterslaveDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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'
@@ -29,4 +30,3 @@ $ java -classpath ${classpath:=.} masterslave/Masterslave ${srcdir:=.}/platform.
 > [ 17.251680] (0:@) MSG_main finished; Cleaning up the simulation...
 > [ 17.251680] (1:masterslave.Master@Jacquelin) Goodbye now!
 > [ 17.251680] (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 131e9a3..a954e42 100644 (file)
@@ -3,6 +3,7 @@
 ! output sort
 
 $ java -classpath ${classpath:=.} migration/Migration ${srcdir:=.}/platform.xml ${srcdir:=.}/migration/migrationDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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.
@@ -11,5 +12,3 @@ $ java -classpath ${classpath:=.} migration/Migration ${srcdir:=.}/platform.xml
 > [  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
-> [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-
index 1a0b8ad..35646ab 100644 (file)
@@ -3,9 +3,9 @@
 ! output sort
 
 $ java -classpath ${classpath:=.} priority/Priority ${srcdir:=.}/platform.xml ${srcdir:=.}/priority/priorityDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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:@) 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 897db64..8230392 100644 (file)
@@ -2,6 +2,7 @@
 
 ! output sort
 $ java -classpath ${classpath:=.} suspend/Suspend ${srcdir:=.}/platform.xml ${srcdir:=.}/suspend/suspendDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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,5 +11,3 @@ $ java -classpath ${classpath:=.} suspend/Suspend ${srcdir:=.}/platform.xml ${sr
 > [ 10.000000] (1:suspend.DreamMaster@Jacquelin) OK, goodbye now.
 > [ 10.000000] (2:Lazy@Jacquelin) Uuuh ? Did somebody call me ?
 > [ 10.000000] (2:Lazy@Jacquelin) Mmmh, goodbye now.
-> [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
-
index ee1d207..81be5cf 100644 (file)
@@ -3,6 +3,7 @@
 ! output sort
 
 $ java -classpath ${classpath:=.} masterslave/Masterslave ${srcdir:=.}/platform.xml ${srcdir:=.}/masterslave/masterslaveDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:@) Using regular java threads. Coroutines could speed your simulation up.
 > [  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'
@@ -29,4 +30,3 @@ $ java -classpath ${classpath:=.} masterslave/Masterslave ${srcdir:=.}/platform.
 > [ 17.251680] (0:@) MSG_main finished; Cleaning up the simulation...
 > [ 17.251680] (1:masterslave.Master@Jacquelin) Goodbye now!
 > [ 17.251680] (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 4f87f63..b3ec27c 100644 (file)
@@ -95,14 +95,10 @@ Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
 
   (*env)->GetJavaVM(env, &__java_vm);
 
-  if ((*env)->FindClass(env, "java/dyn/Coroutine")) {
-       XBT_INFO("Using Coroutines. Your simulation is on steroid.");
-       smx_factory_initializer_to_use = SIMIX_ctx_cojava_factory_init;
-  }
-  else {
-       XBT_INFO("Using regular java threads. Coroutines could speed your simulation up.");
-       smx_factory_initializer_to_use = SIMIX_ctx_java_factory_init;
-  }
+  if ((*env)->FindClass(env, "java/dyn/Coroutine"))
+    smx_factory_initializer_to_use = SIMIX_ctx_cojava_factory_init;
+  else
+    smx_factory_initializer_to_use = SIMIX_ctx_java_factory_init;
   jthrowable exc = (*env)->ExceptionOccurred(env);
   if (exc) {
     (*env)->ExceptionClear(env);
@@ -131,6 +127,13 @@ Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
     free(argv[index]);
 
   free(argv);
+
+  if (smx_factory_initializer_to_use == SIMIX_ctx_cojava_factory_init)
+    XBT_INFO("Using Coroutines. Your simulation is on steroid.");
+  else if (smx_factory_initializer_to_use == SIMIX_ctx_java_factory_init)
+    XBT_INFO("Using regular java threads. Coroutines could speed your simulation up.");
+  else
+    xbt_die("Unknown context factory. Please report bug.");
 }
 
 JNIEXPORT void JNICALL