Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix private host variable after a migration - Adrien
authoralebre <adrien.lebre@inria.fr>
Tue, 8 Oct 2013 12:50:29 +0000 (14:50 +0200)
committeralebre <adrien.lebre@inria.fr>
Tue, 8 Oct 2013 12:50:29 +0000 (14:50 +0200)
src/bindings/java/jmsg_task.c
src/bindings/java/org/simgrid/msg/Task.java
src/bindings/java/org/simgrid/msg/VM.java

index 3ad8167..1e60bfb 100644 (file)
@@ -225,6 +225,18 @@ Java_org_simgrid_msg_Task_execute(JNIEnv * env, jobject jtask)
   }
 }
 
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Task_setBound(JNIEnv * env, jobject jtask, jdouble load)
+{
+  msg_task_t task = jtask_to_native_task(jtask, env);
+
+  if (!task) {
+    jxbt_throw_notbound(env, "task", jtask);
+    return;
+  }
+  MSG_task_set_bound(task, load);
+}
+
 JNIEXPORT jstring JNICALL
 Java_org_simgrid_msg_Task_getName(JNIEnv * env,
                                        jobject jtask) {
index 95ab081..2b7b2dd 100644 (file)
@@ -168,6 +168,11 @@ public class Task {
      * @throws TaskCancelledException
      */
        public native void execute() throws HostFailureException,TaskCancelledException;
+       /**
+        * Bound a computation to a certain load
+        *
+        */
+       public native void setBound(double load); 
        /**
         * Cancels a task.
         *
index 238ed6a..68c92a4 100644 (file)
@@ -84,6 +84,7 @@ public class VM extends Host{
        
 
        /* JNI / Native code */
+
        /* get/set property methods are inherited from the Host class. */
        
        /** Returns whether the given VM is currently suspended
@@ -157,6 +158,7 @@ public class VM extends Host{
         */     
        public void migrate(Host destination){
                this.internalmig(destination);
+               this.currentHost = destination; 
        }
        
        /** Immediately suspend the execution of all processes within the given VM