Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reindent function.
[simgrid.git] / src / msg / msg_vm.c
index 240d299..cfdd947 100644 (file)
@@ -171,30 +171,32 @@ int MSG_vm_is_restoring(msg_vm_t vm)
  *  All parameters are in MBytes
  *
  */
-msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name, int ncpus, int ramsize,
-                                            int net_cap, char *disk_path, int disksize,
-                                                int mig_netspeed, int dp_intensity)
+msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name,
+                       int ncpus, int ramsize,
+                       int net_cap, char *disk_path, int disksize,
+                       int mig_netspeed, int dp_intensity)
 {
-       /* For the moment, intensity_rate is the percentage against the migration bandwidth */
-       double host_speed = MSG_get_host_speed(ind_pm);
-       double update_speed = ((double)dp_intensity/100) * mig_netspeed;
+  /* For the moment, intensity_rate is the percentage against the migration
+   * bandwidth */
+  double host_speed = MSG_get_host_speed(ind_pm);
+  double update_speed = ((double)dp_intensity/100) * mig_netspeed;
        
-       msg_vm_t vm = MSG_vm_create_core(ind_pm, name);
-       s_ws_params_t params;
-       memset(&params, 0, sizeof(params));
-       params.ramsize = 1L * 1024 * 1024 * ramsize;
-       //params.overcommit = 0;
-       params.devsize = 0;
-       params.skip_stage2 = 0;
-       params.max_downtime = 0.03;
-       params.dp_rate = (update_speed * 1L * 1024 * 1024 ) / host_speed; 
-       params.dp_cap = params.ramsize / 0.9; // working set memory is 90%
-       params.mig_speed = 1L * 1024 * 1024 * mig_netspeed; // mig_speed
-
-   //XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate, params.mig_speed, dp_intensity, update_speed, host_speed);
-       simcall_host_set_params(vm, &params);
-
-       return vm;
+  msg_vm_t vm = MSG_vm_create_core(ind_pm, name);
+  s_ws_params_t params;
+  memset(&params, 0, sizeof(params));
+  params.ramsize = 1L * 1024 * 1024 * ramsize;
+  //params.overcommit = 0;
+  params.devsize = 0;
+  params.skip_stage2 = 0;
+  params.max_downtime = 0.03;
+  params.dp_rate = (update_speed * 1L * 1024 * 1024 ) / host_speed;
+  params.dp_cap = params.ramsize / 0.9; // working set memory is 90%
+  params.mig_speed = 1L * 1024 * 1024 * mig_netspeed; // mig_speed
+
+  //XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate, params.mig_speed, dp_intensity, update_speed, host_speed);
+  simcall_host_set_params(vm, &params);
+
+  return vm;
 }
 
 
@@ -578,8 +580,8 @@ static void launch_deferred_exec_process(msg_host_t host, double computation, do
   int nargvs = 4;
   char **argv = xbt_new(char *, nargvs);
   argv[0] = pr_name;
-  argv[1] = bprintf("%lf", computation);
-  argv[2] = bprintf("%lf", prio);
+  argv[1] = bprintf("%f", computation);
+  argv[2] = bprintf("%f", prio);
   argv[3] = NULL;
 
   MSG_process_create_with_arguments(pr_name, deferred_exec_fun, NULL, host, nargvs - 1, argv);