Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'hypervisor' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid into hypervisor
authorTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Tue, 22 Oct 2013 11:06:47 +0000 (13:06 +0200)
committerTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Tue, 22 Oct 2013 11:06:47 +0000 (13:06 +0200)
doc/doxygen/platform.doc
src/bindings/java/jmsg_process.c
src/bindings/java/jmsg_task.c
src/bindings/java/org/simgrid/msg/Task.java
src/bindings/java/org/simgrid/msg/VM.java

index 0987ed6..32c08c5 100644 (file)
@@ -371,14 +371,17 @@ router_name = prefix + clusterId + router_ + suffix;
 
 <b>cluster example</b>
 \verbatim
-<cluster id="my_cluster_1" prefix="" suffix=""
-               radical="0-262144"      power="1000000000"    bw="125000000"     lat="5E-5"/>
-<cluster id="my_cluster_1" prefix="c-" suffix=".me"
-               radical="0-99"  power="1000000000"    bw="125000000"     lat="5E-5"
-        bb_bw="2250000000" bb_lat="5E-4"/>
+<cluster id="my_cluster_1" prefix="" suffix="" radical="0-262144"
+         power="1e9" bw="125e6" lat="5E-5"/>
+
+<cluster id="my_cluster_1" prefix="c-" suffix=".me" radical="0-99"
+         power="1e9" bw="125e6" lat="5E-5"
+         bb_bw="2.25e9" bb_lat="5E-4"/>
 \endverbatim
-The second examples creates 100 machines, which names are the following:
+The second examples creates one router and 100 machines, which names 
+are the following:
 \verbatim
+c-my_cluster_1_router.me
 c-0.my_cluster_1.me
 c-1.my_cluster_1.me
 c-2.my_cluster_1.me
index 2f6216e..2edf528 100644 (file)
@@ -335,7 +335,7 @@ Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env,
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
  {
-  double time =  jmillis / 1000 + jnanos / 1000;
+  double time =  ((double)jmillis) / 1000 + ((double)jnanos) / 1000000000;
   msg_error_t rv;
   rv = MSG_process_sleep(time);
   if (rv != MSG_OK) {
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