Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
VM.setBound(int load) is now VM.setBound(double bound) to meet the MSG semantics...
authorJulien Gossa <julien.gossa@unistra.fr>
Fri, 4 Mar 2016 17:01:55 +0000 (18:01 +0100)
committerJulien Gossa <julien.gossa@unistra.fr>
Fri, 4 Mar 2016 17:01:55 +0000 (18:01 +0100)
ChangeLog.SimGrid-java
examples/java/cloud/migration/XVM.java
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jmsg_vm.h
src/bindings/java/org/simgrid/msg/VM.java

index d66e6b7..5500d4f 100644 (file)
@@ -1,5 +1,11 @@
 ChangeLog for SimGrid-java, before its integration into the main source tree.
 
+SimGrid (3.13) UNRELEASED; urgency=low
+
+ Backwards Compatibility breaks
+   - VM.setBound(int load) is now VM.setBound(double bound) to meet the MSG semantics. Use VM.getSpeed()*load/100 for the legacy behavior.
+
+
 SimGrid-java (3.9) stable; urgency=low
 
  -- 2013-01-30 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
index f34da08..b62529e 100644 (file)
@@ -32,7 +32,7 @@ public class XVM extends VM {
 
   public void setLoad(int load){  
     if (load >0) {
-      this.setBound(load);
+      this.setBound(this.getSpeed()*load/100);
       //    this.getDaemon().setLoad(load);
       daemon.resume();
     } else{
index 8de5b98..60c6609 100644 (file)
@@ -77,11 +77,10 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv * env, jobject jvm) {
 }
 
 JNIEXPORT void JNICALL
-Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load) { 
+Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jdouble bound) { 
 
   msg_vm_t vm = jvm_get_native(env,jvm);
-  double bound = MSG_get_host_speed(vm) * load / 100;
-  MSG_vm_set_bound(vm, bound); 
+  MSG_vm_set_bound(vm, bound);
 }
 
 JNIEXPORT void JNICALL
index 04c02f9..12de5fd 100644 (file)
@@ -87,7 +87,7 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm);
  * Signature  (D)B
  */
 JNIEXPORT void JNICALL
-Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load); 
+Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jdouble bound); 
 
 /**
  * Class            org_simgrid_msg_VM
index 77cdaee..6752b0b 100644 (file)
@@ -131,10 +131,10 @@ public class VM extends Host{
 
 
        /**
-        * Bound the VM to a certain % of its vcpu capability (e.g. 75% of vm.getSpeed())
-        * @param load percentage (between [0,100]
+        * Set a CPU bound for a given VM.
+        * @param bound in flops/s
         */
-       public native void setBound(int load);
+       public native void setBound(double bound);
 
        /**
         * start the VM