Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics and documentation around VM parameters
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 23:06:25 +0000 (01:06 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 20 Jul 2015 23:06:25 +0000 (01:06 +0200)
22 files changed:
examples/msg/cloud/bound.c
examples/msg/cloud/master_worker_vm.c
examples/msg/cloud/migrate_vm.c
examples/msg/cloud/multicore.c
examples/msg/cloud/simple_vm.c
include/simgrid/datatypes.h
include/simgrid/msg.h
include/simgrid/simix.h
src/include/surf/surf.h
src/msg/msg_host.c
src/msg/msg_vm.c
src/simix/libsmx.c
src/simix/popping_accessors.h
src/simix/popping_bodies.c
src/simix/popping_generated.c
src/simix/simcalls.in
src/simix/smx_host.c
src/simix/smx_host_private.h
src/simix/smx_vm.c
src/surf/host_interface.cpp
src/surf/host_interface.hpp
src/surf/surf_c_bindings.cpp

index d9c6adc..0c471b0 100644 (file)
@@ -344,7 +344,7 @@ static int master_main(int argc, char *argv[])
   {
     msg_host_t vm0 = MSG_vm_create_core(pm0, "VM0");
 
-    s_ws_params_t params;
+    s_vm_params_t params;
     memset(&params, 0, sizeof(params));
     params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
     MSG_host_set_params(vm0, &params);
index 3d1fb4c..77617dd 100644 (file)
@@ -70,7 +70,7 @@ int master_fun(int argc, char *argv[])
     XBT_INFO("create %s on PM(%s)", vm_name, MSG_host_get_name(pm));
     msg_vm_t vm = MSG_vm_create_core(pm, vm_name);
 
-    s_ws_params_t params;
+    s_vm_params_t params;
     memset(&params, 0, sizeof(params));
     params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
     MSG_host_set_params(vm, &params);
index 13cce2f..9bd4b36 100644 (file)
@@ -64,7 +64,7 @@ static int master_main(int argc, char *argv[])
   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_vm_t vm0, vm1;
-  s_ws_params_t params;
+  s_vm_params_t params;
   memset(&params, 0, sizeof(params));
 
 
index 8fb26bf..28c409b 100644 (file)
@@ -177,7 +177,7 @@ static void test_vm_pin(void)
   msg_vm_t vm2 = MSG_vm_create_core(pm2, "VM2");
   msg_vm_t vm3 = MSG_vm_create_core(pm2, "VM3");
 
-  s_ws_params_t params;
+  s_vm_params_t params;
   memset(&params, 0, sizeof(params));
   params.ramsize = 1L * 1024 * 1024;
   params.skip_stage1 = 1;
index 3d10a25..b1f1220 100644 (file)
@@ -255,7 +255,7 @@ static int master_main(int argc, char *argv[])
   XBT_INFO("### Relocate VM0 between PM0 and PM1");
   vm0 = MSG_vm_create_core(pm0, "VM0");
   {
-    s_ws_params_t params;
+    s_vm_params_t params;
     memset(&params, 0, sizeof(params));
     params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
     MSG_host_set_params(vm0, &params);
index e46e72b..3a407d8 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef SIMGRID_DATATYPES_H_
 #define SIMGRID_DATATYPES_H_
 
-typedef struct ws_params {
+typedef struct vm_params {
   int ncpus;
   sg_size_t ramsize;
   int overcommit;
@@ -24,6 +24,6 @@ typedef struct ws_params {
 
   /* set migration speed */
   double mig_speed;
-} s_ws_params_t, *ws_params_t;
+} s_vm_params_t, *vm_params_t;
 
 #endif /* SIMGRID_DATATYPES_H_ */
index 72baeeb..f5e1144 100644 (file)
@@ -321,8 +321,8 @@ XBT_PUBLIC(void)   MSG_host_set_pstate(msg_host_t h, int pstate);
 XBT_PUBLIC(int)    MSG_host_get_pstate(msg_host_t host);
 XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void);
 XBT_PUBLIC(int) MSG_get_host_number(void);
-XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, ws_params_t params);
-XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, ws_params_t params);
+XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, vm_params_t params);
+XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, vm_params_t params);
 XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host);
 XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host);
 XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host);
index 3fca936..aa16226 100644 (file)
@@ -341,8 +341,8 @@ XBT_PUBLIC(void) simcall_host_execution_set_affinity(smx_synchro_t execution, sg
 XBT_PUBLIC(e_smx_state_t) simcall_host_execution_wait(smx_synchro_t execution);
 XBT_PUBLIC(xbt_dict_t) simcall_host_get_mounted_storage_list(sg_host_t host);
 XBT_PUBLIC(xbt_dynar_t) simcall_host_get_attached_storage_list(sg_host_t host);
-XBT_PUBLIC(void) simcall_host_get_params(sg_host_t vm, ws_params_t param);
-XBT_PUBLIC(void) simcall_host_set_params(sg_host_t vm, ws_params_t param);
+XBT_PUBLIC(void) simcall_host_get_params(sg_host_t vm, vm_params_t param);
+XBT_PUBLIC(void) simcall_host_set_params(sg_host_t vm, vm_params_t param);
 
 /******************************* VM simcalls ********************************/
 // Create the vm_workstation at the SURF level
index 04111ff..d0f362e 100644 (file)
@@ -387,23 +387,15 @@ XBT_PUBLIC(sg_size_t) surf_host_get_used_size(surf_resource_t resource, const ch
 /** @brief Get the list of VMs hosted on the host */
 XBT_PUBLIC(xbt_dynar_t) surf_host_get_vms(surf_resource_t resource);
 
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param resource [description]
- * @param params [description]
+/** @brief Retrieve the params of that VM
+ * @details You can use fields ramsize and overcommit on a PM, too.
  */
-XBT_PUBLIC(void) surf_host_get_params(surf_resource_t resource, ws_params_t params);
+XBT_PUBLIC(void) surf_host_get_params(surf_resource_t resource, vm_params_t params);
 
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param resource [description]
- * @param params [description]
+/** @brief Sets the params of that VM/PM
+ * @details You can use fields ramsize and overcommit on a PM, too.
  */
-XBT_PUBLIC(void) surf_host_set_params(surf_resource_t resource, ws_params_t params);
+XBT_PUBLIC(void) surf_host_set_params(surf_resource_t resource, vm_params_t params);
 
 /**
  * @brief Destroy a VM
@@ -412,18 +404,10 @@ XBT_PUBLIC(void) surf_host_set_params(surf_resource_t resource, ws_params_t para
  */
 XBT_PUBLIC(void) surf_vm_destroy(surf_resource_t resource);
 
-/**
- * @brief Suspend a VM
- *
- * @param resource The surf vm
- */
+/** @brief Suspend a VM */
 XBT_PUBLIC(void) surf_vm_suspend(surf_resource_t resource);
 
-/**
- * @brief Resume a VM
- *
- * @param resource The surf vm
- */
+/** @brief Resume a VM */
 XBT_PUBLIC(void) surf_vm_resume(surf_resource_t resource);
 
 /**
index feab850..cf97815 100644 (file)
@@ -334,7 +334,7 @@ int MSG_host_is_off(msg_host_t host)
  * \param host a host
  * \param params a prameter object
  */
-void MSG_host_set_params(msg_host_t host, ws_params_t params)
+void MSG_host_set_params(msg_host_t host, vm_params_t params)
 {
   simcall_host_set_params(host, params);
 }
@@ -345,7 +345,7 @@ void MSG_host_set_params(msg_host_t host, ws_params_t params)
  * \param host a host
  * \param params a prameter object
  */
-void MSG_host_get_params(msg_host_t host, ws_params_t params)
+void MSG_host_get_params(msg_host_t host, vm_params_t params)
 {
   simcall_host_get_params(host, params);
 }
index e68d1dd..6da50ee 100644 (file)
@@ -178,7 +178,7 @@ msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name,
   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;
+  s_vm_params_t params;
   memset(&params, 0, sizeof(params));
   params.ramsize = (sg_size_t)ramsize * 1024 * 1024;
   //params.overcommit = 0;
@@ -354,7 +354,7 @@ static int migration_rx_fun(int argc, char *argv[])
   // The structure has been created in the do_migration function and should only be freed in the same place ;)
   struct migration_session *ms = MSG_process_get_data(MSG_process_self());
 
-  s_ws_params_t params;
+  s_vm_params_t params;
   simcall_host_get_params(ms->vm, &params);
 
   int need_exit = 0;
@@ -699,7 +699,7 @@ static int migration_tx_fun(int argc, char *argv[])
   // Note that the ms structure has been allocated in do_migration and hence should be freed in the same function ;)
   struct migration_session *ms = MSG_process_get_data(MSG_process_self());
 
-  s_ws_params_t params;
+  s_vm_params_t params;
   simcall_host_get_params(ms->vm, &params);
   const sg_size_t ramsize   = params.ramsize;
   const sg_size_t devsize   = params.devsize;
index 8fe404a..5bbfc58 100644 (file)
@@ -457,12 +457,12 @@ void simcall_vm_set_affinity(sg_host_t vm, sg_host_t pm, unsigned long mask)
   simcall_BODY_vm_set_affinity(vm, pm, mask);
 }
 
-void simcall_host_get_params(sg_host_t vm, ws_params_t params)
+void simcall_host_get_params(sg_host_t vm, vm_params_t params)
 {
   simcall_BODY_host_get_params(vm, params);
 }
 
-void simcall_host_set_params(sg_host_t vm, ws_params_t params)
+void simcall_host_set_params(sg_host_t vm, vm_params_t params)
 {
   simcall_BODY_host_set_params(vm, params);
 }
index 24514ae..78fbb22 100644 (file)
@@ -463,8 +463,8 @@ static inline sg_host_t simcall_host_get_params__get__ind_vm(smx_simcall_t simca
 static inline void simcall_host_get_params__set__ind_vm(smx_simcall_t simcall, void* arg) {
     simcall->args[0].dp = arg;
 }
-static inline ws_params_t simcall_host_get_params__get__params(smx_simcall_t simcall) {
-  return (ws_params_t) simcall->args[1].dp;
+static inline vm_params_t simcall_host_get_params__get__params(smx_simcall_t simcall) {
+  return (vm_params_t) simcall->args[1].dp;
 }
 static inline void simcall_host_get_params__set__params(smx_simcall_t simcall, void* arg) {
     simcall->args[1].dp = arg;
@@ -476,8 +476,8 @@ static inline sg_host_t simcall_host_set_params__get__ind_vm(smx_simcall_t simca
 static inline void simcall_host_set_params__set__ind_vm(smx_simcall_t simcall, void* arg) {
     simcall->args[0].dp = arg;
 }
-static inline ws_params_t simcall_host_set_params__get__params(smx_simcall_t simcall) {
-  return (ws_params_t) simcall->args[1].dp;
+static inline vm_params_t simcall_host_set_params__get__params(smx_simcall_t simcall) {
+  return (vm_params_t) simcall->args[1].dp;
 }
 static inline void simcall_host_set_params__set__params(smx_simcall_t simcall, void* arg) {
     simcall->args[1].dp = arg;
index a4a28c8..4384ea1 100644 (file)
@@ -645,7 +645,7 @@ inline static xbt_dynar_t simcall_BODY_host_get_attached_storage_list(sg_host_t
     return self->simcall.result.dp;
   }
   
-inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, ws_params_t params) {
+inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, vm_params_t params) {
     smx_process_t self = SIMIX_process_self();
 
     /* Go to that function to follow the code flow through the simcall barrier */
@@ -667,7 +667,7 @@ inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, ws_params_t pa
     
   }
   
-inline static void simcall_BODY_host_set_params(sg_host_t ind_vm, ws_params_t params) {
+inline static void simcall_BODY_host_set_params(sg_host_t ind_vm, vm_params_t params) {
     smx_process_t self = SIMIX_process_self();
 
     /* Go to that function to follow the code flow through the simcall barrier */
index 084a236..be4dc47 100644 (file)
@@ -312,12 +312,12 @@ case SIMCALL_HOST_GET_ATTACHED_STORAGE_LIST:
       break;  
 
 case SIMCALL_HOST_GET_PARAMS:
-       SIMIX_host_get_params((sg_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
+       SIMIX_host_get_params((sg_host_t) simcall->args[0].dp,(vm_params_t) simcall->args[1].dp);
       SIMIX_simcall_answer(simcall);
       break;  
 
 case SIMCALL_HOST_SET_PARAMS:
-       SIMIX_host_set_params((sg_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
+       SIMIX_host_set_params((sg_host_t) simcall->args[0].dp,(vm_params_t) simcall->args[1].dp);
       SIMIX_simcall_answer(simcall);
       break;  
 
index 3649ebf..83044b4 100644 (file)
@@ -76,8 +76,8 @@ Proc - host_execution_set_affinity (void) (execution, void*, smx_synchro_t) (ws,
 Blck H host_execution_wait (int) (execution, void*, smx_synchro_t)
 Func - host_get_mounted_storage_list (void*, xbt_dict_t) (host, void*, sg_host_t)
 Func - host_get_attached_storage_list (void*, xbt_dynar_t) (host, void*, sg_host_t)
-Proc - host_get_params (void) (ind_vm, void*, sg_host_t) (params, void*, ws_params_t)
-Proc - host_set_params (void) (ind_vm, void*, sg_host_t) (params, void*, ws_params_t)
+Proc - host_get_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
+Proc - host_set_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
 Func - vm_create (void*, sg_host_t) (name, const char*) (ind_pm, void*, sg_host_t)
 Proc - vm_start (void) (ind_vm, void*, sg_host_t)
 Func - vm_get_state (int) (ind_vm, void*, sg_host_t)
index da124c7..6a367b2 100644 (file)
@@ -594,13 +594,13 @@ void SIMIX_set_category(smx_synchro_t synchro, const char *category)
  * \param host the host to get_phys_host (a sg_host_t)
  * \param param the parameter object space to be overwritten (a ws_params_t)
  */
-void SIMIX_host_get_params(sg_host_t ind_vm, ws_params_t params)
+void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params)
 {
   /* jump to ws_get_params(). */
   surf_host_get_params(ind_vm, params);
 }
 
-void SIMIX_host_set_params(sg_host_t ind_vm, ws_params_t params)
+void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params)
 {
   /* jump to ws_set_params(). */
   surf_host_set_params(ind_vm, params);
index 17d0ec1..e780746 100644 (file)
@@ -103,9 +103,9 @@ void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mas
 
 void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
 
-void SIMIX_host_get_params(sg_host_t ind_vm, ws_params_t params);
+void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params);
 
-void SIMIX_host_set_params(sg_host_t ind_vm, ws_params_t params);
+void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params);
 
 SG_END_DECL()
 
index 2f4ddbc..a2e9831 100644 (file)
@@ -37,7 +37,7 @@ sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host)
 /* works for VMs and PMs */
 static long host_get_ramsize(sg_host_t vm, int *overcommit)
 {
-  s_ws_params_t params;
+  s_vm_params_t params;
   surf_host_get_params(vm, &params);
 
   if (overcommit)
index 5c6903f..4382e94 100644 (file)
@@ -373,12 +373,12 @@ xbt_dynar_t Host::getVms()
   return dyn;
 }
 
-void Host::getParams(ws_params_t params)
+void Host::getParams(vm_params_t params)
 {
   *params = p_params;
 }
 
-void Host::setParams(ws_params_t params)
+void Host::setParams(vm_params_t params)
 {
   /* may check something here. */
   p_params = *params;
index 685925d..5f3f64f 100644 (file)
@@ -315,22 +315,13 @@ public:
   xbt_dynar_t getVms();
 
   /* common with vm */
-  /**
-   * @brief [brief description]
-   * @details [long description]
-   *
-   * @param params [description]
-   */
-  void getParams(ws_params_t params);
-
-  /**
-   * @brief [brief description]
-   * @details [long description]
-   *
-   * @param params [description]
-   */
-  void setParams(ws_params_t params);
-  s_ws_params_t p_params;
+  /** @brief Retrieve a copy of the parameters of that VM/PM
+   *  @details The ramsize and overcommit fields are used on the PM too */
+  void getParams(vm_params_t params);
+  /** @brief Sets the params of that VM/PM */
+  void setParams(vm_params_t params);
+private:
+  s_vm_params_t p_params;
 };
 
 /**********
index 260984f..9c172d4 100644 (file)
@@ -383,11 +383,11 @@ xbt_dynar_t surf_host_get_vms(surf_resource_t host){
   return vms_;
 }
 
-void surf_host_get_params(surf_resource_t host, ws_params_t params){
+void surf_host_get_params(surf_resource_t host, vm_params_t params){
   get_casted_host(host)->getParams(params);
 }
 
-void surf_host_set_params(surf_resource_t host, ws_params_t params){
+void surf_host_set_params(surf_resource_t host, vm_params_t params){
   get_casted_host(host)->setParams(params);
 }