Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill a deprecated function, deprecate another one, and inline a simcall
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jan 2016 08:55:08 +0000 (09:55 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jan 2016 08:55:08 +0000 (09:55 +0100)
- SIMIX_host_get_name is replaced by sg_host_get_name
- One day, MSG_host_get_name will die
- the host_off simcall now use the closure simcall

17 files changed:
include/simgrid/msg.h
include/simgrid/simix.h
src/msg/instr_msg_process.cpp
src/msg/instr_msg_vm.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/s4u/s4u_host.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/simcalls.py
src/simix/smx_host.cpp
src/simix/smx_network.cpp
src/simix/smx_vm.cpp
src/smpi/smpi_pmpi.c

index de9e014..52e382b 100644 (file)
@@ -296,7 +296,10 @@ XBT_PUBLIC(msg_host_t) MSG_host_by_name(const char *name);
 #define MSG_get_host_by_name(n) MSG_host_by_name(n) /* Rewrite the old name into the new one transparently */
 XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data);
 XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
 #define MSG_get_host_by_name(n) MSG_host_by_name(n) /* Rewrite the old name into the new one transparently */
 XBT_PUBLIC(msg_error_t) MSG_host_set_data(msg_host_t host, void *data);
 XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
-XBT_PUBLIC(const char *) MSG_host_get_name(msg_host_t host);
+/** \ingroup m_host_management
+ *
+ * \brief Return the name of the #msg_host_t. */
+#define MSG_host_get_name(host) sg_host_get_name(host)
 XBT_PUBLIC(void) MSG_host_on(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_off(msg_host_t host);
 XBT_PUBLIC(msg_host_t) MSG_host_self(void);
 XBT_PUBLIC(void) MSG_host_on(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_off(msg_host_t host);
 XBT_PUBLIC(msg_host_t) MSG_host_self(void);
index 12e805b..d28e29c 100644 (file)
@@ -213,7 +213,6 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host,
 /*********************************** Host *************************************/
 XBT_PUBLIC(sg_host_t) SIMIX_host_self(void);
 XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
 /*********************************** Host *************************************/
 XBT_PUBLIC(sg_host_t) SIMIX_host_self(void);
 XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
-#define SIMIX_host_get_name(h) sg_host_get_name(h)  /* DEPRECATED: SIMIX_host_get_name */
 XBT_PUBLIC(void) SIMIX_host_on(sg_host_t host);
 XBT_PUBLIC(void) SIMIX_host_off(sg_host_t host, smx_process_t issuer);
 XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
 XBT_PUBLIC(void) SIMIX_host_on(sg_host_t host);
 XBT_PUBLIC(void) SIMIX_host_off(sg_host_t host, smx_process_t issuer);
 XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
index db86216..c784fa4 100644 (file)
@@ -58,7 +58,7 @@ void TRACE_msg_process_create (const char *process_name, int process_pid, msg_ho
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t host_container = PJ_container_get (SIMIX_host_get_name(host));
+    container_t host_container = PJ_container_get (sg_host_get_name(host));
     PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
   }
 }
     PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
   }
 }
index cf8fa35..c002413 100644 (file)
@@ -45,7 +45,7 @@ void TRACE_msg_vm_change_host(msg_vm_t vm, msg_host_t old_host, msg_host_t new_h
     PJ_container_free(existing_container);
 
     //create new container on the new_host location
     PJ_container_free(existing_container);
 
     //create new container on the new_host location
-    PJ_container_new(instr_vm_id(vm, str, len), INSTR_MSG_VM, PJ_container_get(SIMIX_host_get_name(new_host)));
+    PJ_container_new(instr_vm_id(vm, str, len), INSTR_MSG_VM, PJ_container_get(sg_host_get_name(new_host)));
 
     //end link
     msg = PJ_container_get(instr_vm_id(vm, str, len));
 
     //end link
     msg = PJ_container_get(instr_vm_id(vm, str, len));
@@ -60,7 +60,7 @@ void TRACE_msg_vm_create(const char *vm_name, msg_host_t host)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t host_container = PJ_container_get (SIMIX_host_get_name(host));
+    container_t host_container = PJ_container_get (sg_host_get_name(host));
     PJ_container_new(instr_vm_id_2(vm_name, str, len), INSTR_MSG_VM, host_container);
   }
 }
     PJ_container_new(instr_vm_id_2(vm_name, str, len), INSTR_MSG_VM, host_container);
   }
 }
index 46bb0c8..22fc307 100644 (file)
@@ -99,17 +99,6 @@ void *MSG_host_get_data(msg_host_t host) {
   return sg_host_user(host);
 }
 
   return sg_host_user(host);
 }
 
-/** \ingroup m_host_management
- *
- * \brief Return the name of the #msg_host_t.
- *
- * This functions checks whether \a host is a valid pointer or not and return
-   its name.
- */
-const char *MSG_host_get_name(msg_host_t host) {
-  return SIMIX_host_get_name(host);
-}
-
 /** \ingroup m_host_management
  *
  * \brief Return the location on which the current process is executed.
 /** \ingroup m_host_management
  *
  * \brief Return the location on which the current process is executed.
index 479f935..959fb1f 100644 (file)
@@ -365,7 +365,7 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa
     host_dest = MSG_host_by_name(host_name_dest);
 
   }else{
     host_dest = MSG_host_by_name(host_name_dest);
 
   }else{
-    XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, SIMIX_host_get_name(host));
+    XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, sg_host_get_name(host));
     return MSG_TASK_CANCELED;
   }
 
     return MSG_TASK_CANCELED;
   }
 
index 48b5176..8944cba 100644 (file)
@@ -65,7 +65,7 @@ void Host::turn_on() {
 }
 
 void Host::turn_off() {
 }
 
 void Host::turn_off() {
-       simgrid::simix::simcall<void>(SIMCALL_HOST_OFF, this);
+  simgrid::simix::kernel(std::bind(SIMIX_host_off, this, SIMIX_process_self()));
 }
 
 bool Host::is_on() {
 }
 
 bool Host::is_on() {
index cb9bc39..ec53b81 100644 (file)
  */
 
 
  */
 
 
-static inline sg_host_t simcall_host_off__get__host(smx_simcall_t simcall) {
-  return (sg_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_off__set__host(smx_simcall_t simcall, void* arg) {
-    simcall->args[0].dp = arg;
-}
-
 static inline sg_host_t simcall_vm_suspend__get__ind_vm(smx_simcall_t simcall) {
   return (sg_host_t) simcall->args[0].dp;
 }
 static inline sg_host_t simcall_vm_suspend__get__ind_vm(smx_simcall_t simcall) {
   return (sg_host_t) simcall->args[0].dp;
 }
@@ -1456,7 +1449,6 @@ static inline void simcall_mc_compare_snapshots__set__result(smx_simcall_t simca
 
 /* The prototype of all simcall handlers, automatically generated for you */
 
 
 /* The prototype of all simcall handlers, automatically generated for you */
 
-XBT_PRIVATE void simcall_HANDLER_host_off(smx_simcall_t simcall, sg_host_t host);
 XBT_PRIVATE void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm);
 XBT_PRIVATE void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm);
 XBT_PRIVATE void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm);
 XBT_PRIVATE void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm);
 XBT_PRIVATE void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm);
 XBT_PRIVATE void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm);
index 99643d6..b72a2ad 100644 (file)
 #include "xbt/ex.h"
 #include <simgrid/simix.hpp>
   
 #include "xbt/ex.h"
 #include <simgrid/simix.hpp>
   
-inline static void simcall_BODY_host_off(sg_host_t host) {
-    smx_process_t self = SIMIX_process_self();
-
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_host_off(&self->simcall, host);
-    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
-    self->simcall.call = SIMCALL_HOST_OFF;
-    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
-    memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) host;
-    if (self != simix_global->maestro_process) {
-      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
-                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
-      SIMIX_process_yield(self);
-    } else {
-      SIMIX_simcall_handle(&self->simcall, 0);
-    }    
-    
-  }
-  
 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
     smx_process_t self = SIMIX_process_self();
 
 inline static void simcall_BODY_vm_suspend(sg_host_t ind_vm) {
     smx_process_t self = SIMIX_process_self();
 
index 1b0676a..4f71766 100644 (file)
@@ -18,7 +18,6 @@
  */
 typedef enum {
   SIMCALL_NONE,
  */
 typedef enum {
   SIMCALL_NONE,
-  SIMCALL_HOST_OFF,
   SIMCALL_VM_SUSPEND,
   SIMCALL_VM_RESUME,
   SIMCALL_VM_SHUTDOWN,
   SIMCALL_VM_SUSPEND,
   SIMCALL_VM_RESUME,
   SIMCALL_VM_SHUTDOWN,
index b9f26ad..3d42aab 100644 (file)
@@ -23,8 +23,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
 const char* simcall_names[] = {
 
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
 const char* simcall_names[] = {
-   "SIMCALL_NONE",  "SIMCALL_HOST_OFF",
-  "SIMCALL_VM_SUSPEND",
+   "SIMCALL_NONE",  "SIMCALL_VM_SUSPEND",
   "SIMCALL_VM_RESUME",
   "SIMCALL_VM_SHUTDOWN",
   "SIMCALL_VM_SAVE",
   "SIMCALL_VM_RESUME",
   "SIMCALL_VM_SHUTDOWN",
   "SIMCALL_VM_SAVE",
@@ -131,11 +130,6 @@ void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
     return;
   switch (simcall->call) {
   if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
     return;
   switch (simcall->call) {
-case SIMCALL_HOST_OFF:
-       simcall_HANDLER_host_off(simcall , (sg_host_t) simcall->args[0].dp);
-      SIMIX_simcall_answer(simcall);
-      break;  
-
 case SIMCALL_VM_SUSPEND:
        simcall_HANDLER_vm_suspend(simcall , (sg_host_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
 case SIMCALL_VM_SUSPEND:
        simcall_HANDLER_vm_suspend(simcall , (sg_host_t) simcall->args[0].dp);
       SIMIX_simcall_answer(simcall);
@@ -572,7 +566,7 @@ case SIMCALL_MC_COMPARE_SNAPSHOTS:
     case SIMCALL_NONE:
       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
           SIMIX_process_get_name(simcall->issuer),
     case SIMCALL_NONE:
       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
           SIMIX_process_get_name(simcall->issuer),
-          SIMIX_host_get_name(SIMIX_process_get_host(simcall->issuer))
+          sg_host_get_name(SIMIX_process_get_host(simcall->issuer))
           );
       break;
 
           );
       break;
 
index 469b171..094b82d 100644 (file)
@@ -46,8 +46,6 @@
 # ./include/simgrid/simix.h (otherwise you will get a warning at the
 # compilation time)
 
 # ./include/simgrid/simix.h (otherwise you will get a warning at the
 # compilation time)
 
-Proc H host_off (void) (host, void*, sg_host_t)
-
 Proc H vm_suspend (void) (ind_vm, void*, sg_host_t)
 Proc H vm_resume (void) (ind_vm, void*, sg_host_t)
 Proc H vm_shutdown (void) (ind_vm, void*, sg_host_t)
 Proc H vm_suspend (void) (ind_vm, void*, sg_host_t)
 Proc H vm_resume (void) (ind_vm, void*, sg_host_t)
 Proc H vm_shutdown (void) (ind_vm, void*, sg_host_t)
index c249a21..815bb2f 100755 (executable)
@@ -316,7 +316,7 @@ if __name__=='__main__':
   fd.write('    case SIMCALL_NONE:\n');
   fd.write('      THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n');
   fd.write('          SIMIX_process_get_name(simcall->issuer),\n');
   fd.write('    case SIMCALL_NONE:\n');
   fd.write('      THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n');
   fd.write('          SIMIX_process_get_name(simcall->issuer),\n');
-  fd.write('          SIMIX_host_get_name(SIMIX_process_get_host(simcall->issuer))\n');
+  fd.write('          sg_host_get_name(SIMIX_process_get_host(simcall->issuer))\n');
   fd.write('          );\n');
   fd.write('      break;\n');
   fd.write('\n');
   fd.write('          );\n');
   fd.write('      break;\n');
   fd.write('\n');
index ad2f258..a47fa09 100644 (file)
@@ -83,11 +83,6 @@ void SIMIX_host_on(sg_host_t h)
   }
 }
 
   }
 }
 
-void simcall_HANDLER_host_off(smx_simcall_t simcall, sg_host_t h)
-{
- SIMIX_host_off(h, simcall->issuer);
-}
-
 /**
  * \brief Stop the host if it is on
  *
 /**
  * \brief Stop the host if it is on
  *
@@ -163,7 +158,7 @@ const char* SIMIX_host_self_get_name(void)
   if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
     return "";
 
   if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
     return "";
 
-  return SIMIX_host_get_name(host);
+  return sg_host_get_name(host);
 }
 
 void _SIMIX_host_free_process_arg(void *data)
 }
 
 void _SIMIX_host_free_process_arg(void *data)
index 1cfc466..f613c30 100644 (file)
@@ -724,7 +724,7 @@ static inline void SIMIX_comm_start(smx_synchro_t synchro)
     sg_host_t receiver = synchro->comm.dst_proc->host;
 
     XBT_DEBUG("Starting communication %p from '%s' to '%s'", synchro,
     sg_host_t receiver = synchro->comm.dst_proc->host;
 
     XBT_DEBUG("Starting communication %p from '%s' to '%s'", synchro,
-              SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
+              sg_host_get_name(sender), sg_host_get_name(receiver));
 
     synchro->comm.surf_comm = surf_network_model_communicate(surf_network_model,
                                                                    sender, receiver,
 
     synchro->comm.surf_comm = surf_network_model_communicate(surf_network_model,
                                                                    sender, receiver,
@@ -737,7 +737,7 @@ static inline void SIMIX_comm_start(smx_synchro_t synchro)
     /* If a link is failed, detect it immediately */
     if (synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
       XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
     /* If a link is failed, detect it immediately */
     if (synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
       XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
-                SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
+                sg_host_get_name(sender), sg_host_get_name(receiver));
       synchro->state = SIMIX_LINK_FAILURE;
       SIMIX_comm_destroy_internal_actions(synchro);
     }
       synchro->state = SIMIX_LINK_FAILURE;
       SIMIX_comm_destroy_internal_actions(synchro);
     }
@@ -750,10 +750,10 @@ static inline void SIMIX_comm_start(smx_synchro_t synchro)
 
       if (SIMIX_process_is_suspended(synchro->comm.src_proc))
         XBT_DEBUG("The communication is suspended on startup because src (%s:%s) were suspended since it initiated the communication",
 
       if (SIMIX_process_is_suspended(synchro->comm.src_proc))
         XBT_DEBUG("The communication is suspended on startup because src (%s:%s) were suspended since it initiated the communication",
-                  SIMIX_host_get_name(synchro->comm.src_proc->host), synchro->comm.src_proc->name);
+                  sg_host_get_name(synchro->comm.src_proc->host), synchro->comm.src_proc->name);
       else
         XBT_DEBUG("The communication is suspended on startup because dst (%s:%s) were suspended since it initiated the communication",
       else
         XBT_DEBUG("The communication is suspended on startup because dst (%s:%s) were suspended since it initiated the communication",
-                  SIMIX_host_get_name(synchro->comm.dst_proc->host), synchro->comm.dst_proc->name);
+                  sg_host_get_name(synchro->comm.dst_proc->host), synchro->comm.dst_proc->name);
 
       synchro->comm.surf_comm->suspend();
 
 
       synchro->comm.surf_comm->suspend();
 
index 6be0a15..6b32988 100644 (file)
@@ -97,7 +97,7 @@ void SIMIX_vm_start(sg_host_t ind_vm)
       ind_vm->extension<simgrid::surf::Host>()
     )->setState(SURF_VM_STATE_RUNNING);
   else
       ind_vm->extension<simgrid::surf::Host>()
     )->setState(SURF_VM_STATE_RUNNING);
   else
-    THROWF(vm_error, 0, "The VM %s cannot be started", SIMIX_host_get_name(ind_vm));
+    THROWF(vm_error, 0, "The VM %s cannot be started", sg_host_get_name(ind_vm));
 }
 
 
 }
 
 
@@ -197,7 +197,7 @@ void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mas
  */
 void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer)
 {
  */
 void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer)
 {
-  const char *name = SIMIX_host_get_name(ind_vm);
+  const char *name = sg_host_get_name(ind_vm);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
@@ -237,7 +237,7 @@ void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm)
  */
 void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer)
 {
  */
 void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer)
 {
-  const char *name = SIMIX_host_get_name(ind_vm);
+  const char *name = sg_host_get_name(ind_vm);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SUSPENDED)
     THROWF(vm_error, 0, "VM(%s) was not suspended", name);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SUSPENDED)
     THROWF(vm_error, 0, "VM(%s) was not suspended", name);
@@ -269,7 +269,7 @@ void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm)
  */
 void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer)
 {
  */
 void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer)
 {
-  const char *name = SIMIX_host_get_name(ind_vm);
+  const char *name = sg_host_get_name(ind_vm);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
@@ -301,7 +301,7 @@ void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t ind_vm)
  */
 void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer)
 {
  */
 void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer)
 {
-  const char *name = SIMIX_host_get_name(ind_vm);
+  const char *name = sg_host_get_name(ind_vm);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SAVED)
     THROWF(vm_error, 0, "VM(%s) was not saved", name);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SAVED)
     THROWF(vm_error, 0, "VM(%s) was not saved", name);
@@ -333,7 +333,7 @@ void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm)
  */
 void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer)
 {
  */
 void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer)
 {
-  const char *name = SIMIX_host_get_name(ind_vm);
+  const char *name = sg_host_get_name(ind_vm);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
 
   if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "VM(%s) is not running", name);
@@ -368,8 +368,7 @@ void SIMIX_vm_destroy(sg_host_t ind_vm)
 {
   /* this code basically performs a similar thing like SIMIX_host_destroy() */
 
 {
   /* this code basically performs a similar thing like SIMIX_host_destroy() */
 
-  xbt_assert((ind_vm != NULL), "Invalid parameters");
-  const char *hostname = SIMIX_host_get_name(ind_vm);
+  const char *hostname = sg_host_get_name(ind_vm);
 
   XBT_DEBUG("destroy %s", hostname);
 
 
   XBT_DEBUG("destroy %s", hostname);
 
index 0583cfb..08774f1 100644 (file)
@@ -2410,9 +2410,9 @@ int PMPI_Get_processor_name(char *name, int *resultlen)
 {
   int retval = MPI_SUCCESS;
 
 {
   int retval = MPI_SUCCESS;
 
-  strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
-          strlen(SIMIX_host_get_name(SIMIX_host_self())) < MPI_MAX_PROCESSOR_NAME - 1 ?
-          strlen(SIMIX_host_get_name(SIMIX_host_self())) +1 :
+  strncpy(name, sg_host_get_name(SIMIX_host_self()),
+          strlen(sg_host_get_name(SIMIX_host_self())) < MPI_MAX_PROCESSOR_NAME - 1 ?
+          strlen(sg_host_get_name(SIMIX_host_self())) +1 :
           MPI_MAX_PROCESSOR_NAME - 1 );
   *resultlen =
       strlen(name) >
           MPI_MAX_PROCESSOR_NAME - 1 );
   *resultlen =
       strlen(name) >