Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove vms from MSG_Global and msg_host_priv
authorTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Thu, 7 Feb 2013 15:37:32 +0000 (16:37 +0100)
committerTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Thu, 7 Feb 2013 15:37:32 +0000 (16:37 +0100)
Remove the vms entry from the structures. It is not used anymore.
The surf layer keeps these information.

include/msg/datatypes.h
include/msg/msg.h
src/msg/msg_global.c
src/msg/msg_host.c
src/msg/msg_private.h

index 2738847..b4ea945 100644 (file)
@@ -46,10 +46,6 @@ typedef xbt_dictelm_t msg_host_t;
 typedef s_xbt_dictelm_t s_msg_host_t;
 
 typedef struct msg_host_priv {
-
-       // TODO Warning keeping such vms attribut may lead to some complexity at the SURF Level.
-       // Please check with Arnaud
-       xbt_dynar_t vms;
 #ifdef MSG_USE_DEPRECATED
   msg_mailbox_t *mailboxes;     /**< the channels  */
 #endif
@@ -84,24 +80,7 @@ typedef struct msg_task {
  */
 typedef struct msg_task *msg_task_t;
 
-/* ******************************** Hypervisor ************************************* */
-typedef struct msg_hypervisor *msg_hypervisor_t;
-
-typedef struct msg_hypervisor {
-       const char *name;
-       s_xbt_swag_hookup_t all_hypervisor_hookup;
-       xbt_dynar_t vms;   // vms on this hypervisor
-       msg_host_t host;  // physical host of this hypervisor
-
-/* The hypervisor object does not have parameters like the number of CPU
-* cores and the size of memory. These parameters come from those of the
-* physical host.
-**/
-       int overcommit;
-
-} s_msg_hypervisor_t;
-
-/* ********************************  VM ************************************* */
+/* ******************************** VM ************************************* */
 typedef msg_host_t msg_vm_t;
 typedef msg_host_priv_t msg_vm_priv_t;
 
index b120765..22117aa 100644 (file)
@@ -368,7 +368,8 @@ XBT_PUBLIC(void) MSG_vm_shutdown(msg_vm_t vm);
 
 XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
 
-XBT_PUBLIC(xbt_dynar_t) MSG_vms_as_dynar(void);
+/* TODO: do we need this? */
+// XBT_PUBLIC(xbt_dynar_t) MSG_vms_as_dynar(void);
 
 /*
 void* MSG_process_get_property(msg_process_t, char* key)
index de97107..f28d3e6 100644 (file)
@@ -37,7 +37,6 @@ void MSG_init_nocheck(int *argc, char **argv) {
 
   xbt_getpid = MSG_process_self_PID;
   if (!msg_global) {
- //   s_msg_vm_t vm; // to compute the offset
 
     SIMIX_global_init(argc, argv);
     
@@ -49,7 +48,6 @@ void MSG_init_nocheck(int *argc, char **argv) {
     msg_global->sent_msg = 0;
     msg_global->task_copy_callback = NULL;
     msg_global->process_data_cleanup = NULL;
-//    msg_global->vms = xbt_swag_new(xbt_swag_offset(vm,all_vms_hookup));
 
     /* initialization of the action module */
     _MSG_action_init();
@@ -175,7 +173,6 @@ static void MSG_exit(void) {
   TRACE_end();
 #endif
 
-  xbt_swag_free(msg_global->vms);
   free(msg_global);
   msg_global = NULL;
 }
index 1e245b5..5a0de0d 100644 (file)
@@ -31,8 +31,6 @@ msg_host_t __MSG_host_create(smx_host_t workstation)
   const char *name = SIMIX_host_get_name(workstation);
   msg_host_priv_t host = xbt_new0(s_msg_host_priv_t, 1);
 
-  host->vms = xbt_dynar_new(sizeof(msg_vm_t),NULL);
-
 #ifdef MSG_USE_DEPRECATED
   int i;
   char alias[MAX_ALIAS_NAME + 1] = { 0 };       /* buffer used to build the key of the mailbox */
@@ -122,10 +120,12 @@ void __MSG_host_destroy(msg_host_priv_t host) {
   if (msg_global->max_channel > 0)
     free(host->mailboxes);
 #endif
-  if (xbt_dynar_length(host->vms) > 0 ) {
-    XBT_VERB("Host shut down, but it still hosts %d VMs. They will be leaked.", xbt_dynar_length(host->vms));
-  }
-  xbt_dynar_free(&host->vms);
+
+  /* TODO:
+   * What happens if VMs still remain on this host?
+   * Revisit here after the surf layer gets stable.
+   **/
+
   free(host);
 }
 
index cfc2121..a44834c 100644 (file)
@@ -87,21 +87,8 @@ typedef struct msg_comm {
   msg_task_t *task_received;      /* where the task will be received (NULL for the sender) */
   msg_error_t status;           /* status of the communication once finished */
 } s_msg_comm_t;
-/*
-typedef enum {
-  msg_vm_state_suspended, msg_vm_state_running, msg_vm_state_migrating
-} e_msg_vm_state_t;
 
-typedef struct msg_vm {
-  const char *name;
-  s_xbt_swag_hookup_t all_vms_hookup;
-  s_xbt_swag_hookup_t host_vms_hookup;
-  xbt_dynar_t processes;
-  e_msg_vm_state_t state;
-  msg_host_t location;
-  int coreAmount;
-} s_msg_vm_t;
-*/
+
 /************************** Global variables ********************************/
 typedef struct MSG_Global {
   xbt_fifo_t host;
@@ -112,7 +99,6 @@ typedef struct MSG_Global {
   unsigned long int sent_msg;   /* Total amount of messages sent during the simulation */
   void (*task_copy_callback) (msg_task_t task, msg_process_t src, msg_process_t dst);
   void_f_pvoid_t process_data_cleanup;
-  xbt_swag_t vms;
 } s_MSG_Global_t, *MSG_Global_t;
 
 /*extern MSG_Global_t msg_global;*/