msg_vm_t vm = jvm_get_native(env,jvm);
return (jint) MSG_vm_is_restoring(vm);
}
+
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load) {
+
+ msg_vm_t vm = jvm_get_native(env,jvm);
+ double bound = MSG_get_host_speed(vm) * load / 100;
+ MSG_vm_set_bound(vm, bound);
+}
+
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) {
Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost) {
msg_vm_t vm = jvm_get_native(env,jvm);
msg_host_t host = jhost_get_native(env, jhost);
-
- XBT_INFO("Start migration of %s to %s", MSG_host_get_name(vm), MSG_host_get_name(host));
MSG_vm_migrate(vm,host);
- XBT_INFO("Migration done");
}
JNIEXPORT void JNICALL
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm);
+/**
+ * Class org_simgrid_msg_VM
+ * Method setBound
+ * Signature ()B
+ */
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load);
/**
* Class org_simgrid_msg_VM
private static VM[] vms=null;
private Host currentHost;
-
+ private int dpIntensity = 0 ;
+
/* Constructors / destructors */
/**
* Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account).
super();
super.name = name;
this.currentHost = host;
+ this.dpIntensity = dpIntensity;
create(host, name, nCore, ramSize, netCap, diskPath, diskSize, migNetSpeed, dpIntensity);
VM.addVM(this);
}
*/
private native void create(Host host, String name, int nCore, int ramSize,
int netCap, String diskPath, int diskSize, int migNetSpeed, int dpIntensity);
-
+
+
+ /**
+ * Bound the VM to a certain % of its vcpu capability (e.g. 75% of vm.getSpeed())
+ * @param load, percentage (between [0,100]
+ */
+ public native void setBound(int load);
+
/**
* start the VM
*/
* (pre-copy is implemented)
*/
public void migrate(Host destination){
-// String[] argsRx = new String[5];
-// argsRx[1] = this.getName();
-// argsRx[2] = this.currentHost.getName();
-// argsRx[3] = destination.getName();
-// argsRx[0] = "__pr_mig_rx:"+argsRx[1]+"("+argsRx[2]+"-"+argsRx[3]+")";
-// argsRx[4] = null; // TODO: Why ?
-//
-// //Process rx = new Process(destination, argsRx[0], argsRx );
-//
-// String[] argsTx = new String[5];
-// argsTx[1] = this.getName();
-// argsTx[2] = this.currentHost.getName();
-// argsTx[3] = destination.getName();
-// argsTx[0] = "__pr_mig_tx:"+argsTx[1]+"("+argsTx[2]+"-"+argsTx[3]+")";
-// argsTx[4] = null; // TODO: Why ?
-//
-// //Process tx = new Process(this.currentHost, argsTx[0], argsRx );
-//
+ Msg.info("Start migration of VM "+this.getName()+" to node "+destination.getName());
+ Msg.info(" dpIntensity:"+this.dpIntensity);
+
this.internalmig(destination);
+ Msg.info("End of migration of VM "+this.getName()+" to node "+destination.getName());
}
/** Immediately suspend the execution of all processes within the given VM
total += priv->dp_updated_by_deleted_tasks;
- XBT_INFO("mig-stage%d.%d: computed %f flop_counts (including %f by deleted tasks)",
+ XBT_DEBUG("mig-stage%d.%d: computed %f flop_counts (including %f by deleted tasks)",
stage_for_fancy_debug,
stage2_round_for_fancy_debug,
total, priv->dp_updated_by_deleted_tasks);
- if (stage == 2)
- XBT_INFO("mig-stage%d.%d: sent %f duration %f actual_speed %f (target %f) cpu %f", stage, stage2_round, size, duration, actual_speed, mig_speed, cpu_utilization);
- else
- XBT_INFO("mig-stage%d: sent %f duration %f actual_speed %f (target %f) cpu %f", stage, size, duration, actual_speed, mig_speed, cpu_utilization);
+ if (stage == 2){
+ XBT_DEBUG("mig-stage%d.%d: sent %f duration %f actual_speed %f (target %f) cpu %f", stage, stage2_round, size, duration, actual_speed, mig_speed, cpu_utilization);}
+ else{
+ XBT_DEBUG("mig-stage%d: sent %f duration %f actual_speed %f (target %f) cpu %f", stage, size, duration, actual_speed, mig_speed, cpu_utilization);
+ }
xbt_free(task_name);
static double get_updated_size(double computed, double dp_rate, double dp_cap)
{
double updated_size = computed * dp_rate;
- XBT_INFO("updated_size %f dp_rate %f", updated_size, dp_rate);
+ XBT_DEBUG("updated_size %f dp_rate %f", updated_size, dp_rate);
if (updated_size > dp_cap) {
// XBT_INFO("mig-stage2.%d: %f bytes updated, but cap it with the working set size %f", stage2_round, updated_size, dp_cap);
updated_size = dp_cap;
updated_size = get_updated_size(computed, dp_rate, dp_cap);
}
- XBT_INFO("%d updated_size %f computed_during_stage1 %f dp_rate %f dp_cap %f",
+ XBT_INFO("mig-stage 2:%d updated_size %f computed_during_stage1 %f dp_rate %f dp_cap %f",
stage2_round, updated_size, computed_during_stage1, dp_rate, dp_cap);
if (stage2_round != 0) {
/* during stage1, we have already created overhead tasks */
double overhead = dpt_cpu_overhead * updated_size;
- XBT_INFO("updated %f overhead %f", updated_size, overhead);
+ XBT_DEBUG("updated %f overhead %f", updated_size, overhead);
launch_deferred_exec_process(vm, overhead, 10000);
}
{
remaining_size += updated_size;
- XBT_INFO("mig-stage2.%d: remaining_size %f (%s threshold %f)", stage2_round,
+ XBT_DEBUG("mig-stage2.%d: remaining_size %f (%s threshold %f)", stage2_round,
remaining_size, (remaining_size < threshold) ? "<" : ">", threshold);
if (remaining_size < threshold)