Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorAdrien Lebre <alebre@dhcp-3-69.rech172-28.emn.fr>
Thu, 24 Jul 2014 13:49:43 +0000 (15:49 +0200)
committerAdrien Lebre <alebre@dhcp-3-69.rech172-28.emn.fr>
Thu, 24 Jul 2014 13:49:43 +0000 (15:49 +0200)
examples/java/cloud/migration/Test.java
src/bindings/java/jmsg.c
src/bindings/java/jmsg_host.c
src/bindings/java/org/simgrid/msg/Process.java
src/bindings/java/smx_context_java.c
src/msg/msg_vm.c

index f1b5936..7edd538 100644 (file)
@@ -129,6 +129,7 @@ public class Test extends Process{
         endTime = Msg.getClock();
         Msg.info("     - End of Migration from host 1 to host 0 (duration:"+(endTime-startTime)+")");
 
+
         Msg.info("\n \n \nRound trip of VM1 (load "+load2+"%)");
         vm1.setLoad(load2);
         Msg.info("     - Launch migration from host 0 to host 1");
index ecb2108..c11ba91 100644 (file)
@@ -67,8 +67,11 @@ void jmsg_throw_status(JNIEnv *env, msg_error_t status) {
     case MSG_HOST_FAILURE:
         jxbt_throw_host_failure(env,NULL);
     break;
+    case MSG_TASK_CANCELED:
+        jxbt_throw_task_cancelled(env,NULL);
+    break;
     default:
-        jxbt_throw_native(env,xbt_strdup("communication failed"));
+        jxbt_throw_native(env,xbt_strdup("undefined message failed (please see jmsg_throw_status function in jmsg.c)"));
   }
 }
 
index 9cf9977..279130a 100644 (file)
@@ -165,7 +165,7 @@ Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost) {
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost) {
   msg_host_t host = jhost_get_native(env, jhost);
-  MSG_host_off(host);
+  MSG_host_off(host); 
 }
 
 JNIEXPORT jint JNICALL
index 2fe319e..5791ccd 100644 (file)
@@ -378,8 +378,7 @@ public abstract class Process implements Runnable {
                        System.exit(1);
                }
                 catch(ProcessKilledError pk) {
-                        
-                }      
+               }       
                exit();
        }
 
index de35188..2e94604 100644 (file)
@@ -153,8 +153,11 @@ void smx_ctx_java_stop(smx_context_t context)
   if (context->iwannadie) {
     context->iwannadie = 0;
     JNIEnv *env = get_current_thread_env();
+    XBT_DEBUG("Gonnal launch Killed Error");
     jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", xbt_strdup("Process killed :)"));
-    THROWF(cancel_error, 0, "process cancelled");
+    // TODO emptty/adsein, comment the following line. This avoid to raise process cancelled exception at the Java level but 
+    // it impacts the shutdown of VMs :( see java-cloud example
+    //THROWF(cancel_error, 0, "process cancelled");
   } else {
     smx_ctx_base_stop(context);
     /* detach the thread and kills it */
index 4539a93..bc400f4 100644 (file)
@@ -391,10 +391,13 @@ static int migration_rx_fun(int argc, char *argv[])
   }
 
 
-  /* deinstall the current affinity setting */
+  /* deinstall the current affinity setting for the CPU */
   simcall_vm_set_affinity(ms->vm, ms->src_pm, 0);
 
+  /* Update the vm location */
   simcall_vm_migrate(ms->vm, ms->dst_pm);
+  
+  /* Resume the VM */
   simcall_vm_resume(ms->vm);
 
   /* install the affinity setting of the VM on the destination pm */