Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename MSG_host_(get/set)_params into MSG_vm_(get/set)_params
[simgrid.git] / examples / msg / cloud-migration / cloud-migration.c
index 1c92fb5..32015e7 100644 (file)
@@ -52,17 +52,16 @@ static void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
 
 static int master_main(int argc, char *argv[])
 {
-  xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
-  msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
-  msg_host_t pm1 = xbt_dynar_get_as(hosts_dynar, 1, msg_host_t);
-  msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t);
+  msg_host_t pm0 = MSG_host_by_name("Fafard");
+  msg_host_t pm1 = MSG_host_by_name("Tremblay");
+  msg_host_t pm2 = MSG_host_by_name("Bourassa");
   msg_vm_t vm0, vm1;
   s_vm_params_t params;
   memset(&params, 0, sizeof(params));
 
   vm0 = MSG_vm_create_core(pm0, "VM0");
   params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
-  MSG_host_set_params(vm0, &params);
+  MSG_vm_set_params(vm0, &params);
   MSG_vm_start(vm0);
 
   XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
@@ -72,7 +71,7 @@ static int master_main(int argc, char *argv[])
 
   vm0 = MSG_vm_create_core(pm0, "VM0");
   params.ramsize = 1L * 1000 * 1000 * 100; // 100Mbytes
-  MSG_host_set_params(vm0, &params);
+  MSG_vm_set_params(vm0, &params);
   MSG_vm_start(vm0);
 
   XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
@@ -84,8 +83,8 @@ static int master_main(int argc, char *argv[])
   vm1 = MSG_vm_create_core(pm0, "VM1");
 
   params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
-  MSG_host_set_params(vm0, &params);
-  MSG_host_set_params(vm1, &params);
+  MSG_vm_set_params(vm0, &params);
+  MSG_vm_set_params(vm1, &params);
   MSG_vm_start(vm0);
   MSG_vm_start(vm1);
 
@@ -101,8 +100,8 @@ static int master_main(int argc, char *argv[])
   vm1 = MSG_vm_create_core(pm0, "VM1");
 
   params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
-  MSG_host_set_params(vm0, &params);
-  MSG_host_set_params(vm1, &params);
+  MSG_vm_set_params(vm0, &params);
+  MSG_vm_set_params(vm1, &params);
   MSG_vm_start(vm0);
   MSG_vm_start(vm1);
 
@@ -135,8 +134,7 @@ int main(int argc, char *argv[])
   /* load the platform file */
   MSG_create_environment(argv[1]);
 
-  xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
-  msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
+  msg_host_t pm0 =  MSG_host_by_name("Fafard");
   launch_master(pm0);
 
   int res = MSG_main();