Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move VM into their namespace, and greatly reduce the amount of sg_host_get_name ...
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 22 Nov 2016 23:24:20 +0000 (00:24 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 22 Nov 2016 23:24:20 +0000 (00:24 +0100)
29 files changed:
examples/msg/platform-failures/platform-failures.tesh
include/simgrid/s4u/VirtualMachine.hpp
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/lua/lua_host.cpp
src/include/surf/surf.h
src/mc/mc_smx.cpp
src/msg/instr_msg_process.cpp
src/msg/msg_io.cpp
src/msg/msg_process.cpp
src/msg/msg_vm.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/VirtualMachineImpl.hpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/simgrid/host.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/smx_deployment.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/simix/smx_vm.cpp
src/smpi/smpi_pmpi.cpp
src/surf/HostImpl.cpp
src/surf/sg_platf.cpp
teshsuite/simdag/flatifier/flatifier.cpp

index bfa2aa4..7cc23e6 100644 (file)
@@ -10,10 +10,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  0.010309] (2:worker@Tremblay) Received "Task"
 > [  0.010309] (2:worker@Tremblay) Communication time : "0.010309"
 > [  0.010309] (2:worker@Tremblay) Processing "Task"
 > [  0.010309] (2:worker@Tremblay) Received "Task"
 > [  0.010309] (2:worker@Tremblay) Communication time : "0.010309"
 > [  0.010309] (2:worker@Tremblay) Processing "Task"
-> [  1.000000] (0:maestro@) Restart processes on host: Fafard
+> [  1.000000] (0:maestro@) Restart processes on host Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
-> [  2.000000] (0:maestro@) Restart processes on host: Jupiter
+> [  2.000000] (0:maestro@) Restart processes on host Jupiter
 > [  2.010309] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.030928] (1:master@Tremblay) Send completed
 > [  2.010309] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.030928] (1:master@Tremblay) Send completed
@@ -105,10 +105,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  0.010825] (2:worker@Tremblay) Received "Task"
 > [  0.010825] (2:worker@Tremblay) Communication time : "0.010825"
 > [  0.010825] (2:worker@Tremblay) Processing "Task"
 > [  0.010825] (2:worker@Tremblay) Received "Task"
 > [  0.010825] (2:worker@Tremblay) Communication time : "0.010825"
 > [  0.010825] (2:worker@Tremblay) Processing "Task"
-> [  1.000000] (0:maestro@) Restart processes on host: Fafard
+> [  1.000000] (0:maestro@) Restart processes on host Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
-> [  2.000000] (0:maestro@) Restart processes on host: Jupiter
+> [  2.000000] (0:maestro@) Restart processes on host Jupiter
 > [  2.010825] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
 > [  2.010825] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
@@ -200,10 +200,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  0.010825] (2:worker@Tremblay) Received "Task"
 > [  0.010825] (2:worker@Tremblay) Communication time : "0.010825"
 > [  0.010825] (2:worker@Tremblay) Processing "Task"
 > [  0.010825] (2:worker@Tremblay) Received "Task"
 > [  0.010825] (2:worker@Tremblay) Communication time : "0.010825"
 > [  0.010825] (2:worker@Tremblay) Processing "Task"
-> [  1.000000] (0:maestro@) Restart processes on host: Fafard
+> [  1.000000] (0:maestro@) Restart processes on host Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
 > [  1.000000] (3:worker@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
-> [  2.000000] (0:maestro@) Restart processes on host: Jupiter
+> [  2.000000] (0:maestro@) Restart processes on host Jupiter
 > [  2.010825] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
 > [  2.010825] (2:worker@Tremblay) "Task" done
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
index b603af4..de3ecc0 100644 (file)
@@ -21,7 +21,7 @@ typedef enum {
 } e_surf_vm_state_t;
 
 namespace simgrid {
 } e_surf_vm_state_t;
 
 namespace simgrid {
-namespace surf {
+namespace vm {
 class VirtualMachineImpl;
 };
 namespace s4u {
 class VirtualMachineImpl;
 };
 namespace s4u {
@@ -55,7 +55,7 @@ public:
   double getRamsize();
 
   /* FIXME: protect me */
   double getRamsize();
 
   /* FIXME: protect me */
-  simgrid::surf::VirtualMachineImpl* pimpl_vm_ = nullptr;
+  simgrid::vm::VirtualMachineImpl* pimpl_vm_ = nullptr;
 };
 }
 } // namespace simgrid::s4u
 };
 }
 } // namespace simgrid::s4u
index 7598c39..0bb97c3 100644 (file)
@@ -303,7 +303,7 @@ static int java_main(int argc, char *argv[])
   for (int i = 1; i < argc; i++)
       env->SetObjectArrayElement(args,i - 1, env->NewStringUTF(argv[i]));
   //Retrieve the host for the process.
   for (int i = 1; i < argc; i++)
       env->SetObjectArrayElement(args,i - 1, env->NewStringUTF(argv[i]));
   //Retrieve the host for the process.
-  jstring jhostName = env->NewStringUTF(MSG_host_get_name(MSG_host_self()));
+  jstring jhostName = env->NewStringUTF(MSG_host_self()->cname());
   jobject jhost = Java_org_simgrid_msg_Host_getByName(env, nullptr, jhostName);
   //creates the process
   jobject jprocess = env->NewObject(class_Process, constructor_Process, jhost, jname, args);
   jobject jhost = Java_org_simgrid_msg_Host_getByName(env, nullptr, jhostName);
   //creates the process
   jobject jprocess = env->NewObject(class_Process, constructor_Process, jhost, jname, args);
index cd18404..ea41349 100644 (file)
@@ -153,7 +153,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
 
     jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
     if (!jhost) {
 
     jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
     if (!jhost) {
-      jname = env->NewStringUTF(MSG_host_get_name(host));
+      jname = env->NewStringUTF(host->cname());
 
       jhost = Java_org_simgrid_msg_Host_getByName(env, cls, jname);
 
 
       jhost = Java_org_simgrid_msg_Host_getByName(env, cls, jname);
 
index 9e16cc0..85ad9cb 100644 (file)
@@ -50,7 +50,7 @@ msg_host_t jhost_get_native(JNIEnv * env, jobject jhost) {
 
 const char *jhost_get_name(jobject jhost, JNIEnv * env) {
   msg_host_t host = jhost_get_native(env, jhost);
 
 const char *jhost_get_name(jobject jhost, JNIEnv * env) {
   msg_host_t host = jhost_get_native(env, jhost);
-  return MSG_host_get_name(host);
+  return host->cname();
 }
 
 jboolean jhost_is_valid(jobject jhost, JNIEnv * env) {
 }
 
 jboolean jhost_is_valid(jobject jhost, JNIEnv * env) {
@@ -144,8 +144,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost(JNIEnv * env, jc
       return nullptr;
     }
     /* Sets the host name */
       return nullptr;
     }
     /* Sets the host name */
-    const char *name = MSG_host_get_name(host);
-    jobject jname = env->NewStringUTF(name);
+    jobject jname = env->NewStringUTF(host->cname());
     env->SetObjectField(jhost, jhost_field_Host_name, jname);
     /* Bind & store it */
     jhost_bind(jhost, host, env);
     env->SetObjectField(jhost, jhost_field_Host_name, jname);
     /* Bind & store it */
     jhost_bind(jhost, host, env);
@@ -351,7 +350,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_all(JNIEnv * env, jclas
     jhost = (jobject) host->extension(JAVA_HOST_LEVEL);
 
     if (!jhost) {
     jhost = (jobject) host->extension(JAVA_HOST_LEVEL);
 
     if (!jhost) {
-      jname = env->NewStringUTF(MSG_host_get_name(host));
+      jname = env->NewStringUTF(host->cname());
 
       jhost = Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
       /* FIXME: leak of jname ? */
 
       jhost = Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
       /* FIXME: leak of jname ? */
index 74d4f82..a89c19a 100644 (file)
@@ -78,7 +78,7 @@ static int l_host_get_by_name(lua_State * L)
 static int l_host_get_name(lua_State * L)
 {
   sg_host_t ht = sglua_check_host(L, 1);
 static int l_host_get_name(lua_State * L)
 {
   sg_host_t ht = sglua_check_host(L, 1);
-  lua_pushstring(L, sg_host_get_name(ht));
+  lua_pushstring(L, ht->cname());
   return 1;
 }
 
   return 1;
 }
 
index c8d7398..9ad9cc9 100644 (file)
@@ -41,7 +41,6 @@ namespace surf {
 class Model;
 class CpuModel;
 class HostModel;
 class Model;
 class CpuModel;
 class HostModel;
-class VMModel;
 class NetworkModel;
 class StorageModel;
 class Resource;
 class NetworkModel;
 class StorageModel;
 class Resource;
@@ -52,6 +51,9 @@ class Action;
 class ActionLmm;
 class StorageActionLmm;
 }
 class ActionLmm;
 class StorageActionLmm;
 }
+namespace vm {
+class VMModel; // FIXME: KILLME
+}
 namespace kernel {     
 namespace routing {
 class RoutingPlatf;
 namespace kernel {     
 namespace routing {
 class RoutingPlatf;
@@ -62,7 +64,7 @@ class RoutingPlatf;
 typedef simgrid::surf::Model surf_Model;
 typedef simgrid::surf::CpuModel surf_CpuModel;
 typedef simgrid::surf::HostModel surf_HostModel;
 typedef simgrid::surf::Model surf_Model;
 typedef simgrid::surf::CpuModel surf_CpuModel;
 typedef simgrid::surf::HostModel surf_HostModel;
-typedef simgrid::surf::VMModel surf_VMModel;
+typedef simgrid::vm::VMModel surf_VMModel;
 typedef simgrid::surf::NetworkModel surf_NetworkModel;
 typedef simgrid::surf::StorageModel surf_StorageModel;
 typedef simgrid::surf::Resource surf_Resource;
 typedef simgrid::surf::NetworkModel surf_NetworkModel;
 typedef simgrid::surf::StorageModel surf_StorageModel;
 typedef simgrid::surf::Resource surf_Resource;
index 69a1e87..e4c41fa 100644 (file)
@@ -143,7 +143,7 @@ smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req)
 const char* MC_smx_process_get_host_name(smx_actor_t p)
 {
   if (mc_model_checker == nullptr)
 const char* MC_smx_process_get_host_name(smx_actor_t p)
 {
   if (mc_model_checker == nullptr)
-    return sg_host_get_name(p->host);
+    return p->host->cname();
 
   simgrid::mc::Process* process = &mc_model_checker->process();
 
 
   simgrid::mc::Process* process = &mc_model_checker->process();
 
index bcdb775..c1c7ea8 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/simix/ActorImpl.hpp"
 #include "msg_private.h"
 #include "msg_private.h"
+#include "src/simix/ActorImpl.hpp"
+#include <simgrid/s4u/host.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
 
@@ -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 (sg_host_get_name(host));
+    container_t host_container = PJ_container_get(host->cname());
     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 510ac65..a27f879 100644 (file)
@@ -103,7 +103,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
   read_size = simcall_file_read(file_priv->simdata->smx_file, size, attached_host);
 
   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
   read_size = simcall_file_read(file_priv->simdata->smx_file, size, attached_host);
 
-  if(strcmp(storage_priv_src->hostname, MSG_host_get_name(MSG_host_self()))){
+  if (strcmp(storage_priv_src->hostname, MSG_host_self()->cname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, read_size);
     msg_host_t *m_host_list = nullptr;
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, read_size);
     msg_host_t *m_host_list = nullptr;
@@ -121,7 +121,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
     xbt_free(m_host_list);
     if(transfer != MSG_OK){
       if (transfer == MSG_HOST_FAILURE)
     xbt_free(m_host_list);
     if(transfer != MSG_OK){
       if (transfer == MSG_HOST_FAILURE)
-        XBT_WARN("Transfer error, %s remote host just turned off!", MSG_host_get_name(attached_host));
+        XBT_WARN("Transfer error, %s remote host just turned off!", attached_host->cname());
       if (transfer == MSG_TASK_CANCELED)
         XBT_WARN("Transfer error, task has been canceled!");
 
       if (transfer == MSG_TASK_CANCELED)
         XBT_WARN("Transfer error, task has been canceled!");
 
@@ -150,7 +150,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
 
   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
 
-  if(strcmp(storage_priv_src->hostname, MSG_host_get_name(MSG_host_self()))){
+  if (strcmp(storage_priv_src->hostname, MSG_host_self()->cname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, size);
     msg_host_t *m_host_list = nullptr;
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, size);
     msg_host_t *m_host_list = nullptr;
@@ -168,7 +168,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
     free(m_host_list);
     if(transfer != MSG_OK){
       if (transfer == MSG_HOST_FAILURE)
     free(m_host_list);
     if(transfer != MSG_OK){
       if (transfer == MSG_HOST_FAILURE)
-        XBT_WARN("Transfer error, %s remote host just turned off!", MSG_host_get_name(attached_host));
+        XBT_WARN("Transfer error, %s remote host just turned off!", attached_host->cname());
       if (transfer == MSG_TASK_CANCELED)
         XBT_WARN("Transfer error, task has been canceled!");
 
       if (transfer == MSG_TASK_CANCELED)
         XBT_WARN("Transfer error, task has been canceled!");
 
@@ -201,7 +201,7 @@ msg_file_t MSG_file_open(const char* fullpath, void* data)
   priv->simdata->smx_file = simcall_file_open(fullpath, MSG_host_self());
   priv->desc_id = __MSG_host_get_file_descriptor_id(MSG_host_self());
 
   priv->simdata->smx_file = simcall_file_open(fullpath, MSG_host_self());
   priv->desc_id = __MSG_host_get_file_descriptor_id(MSG_host_self());
 
-  name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_get_name(MSG_host_self()), priv->desc_id);
+  name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_self()->cname(), priv->desc_id);
 
   xbt_lib_set(file_lib, name, MSG_FILE_LEVEL, priv);
   msg_file_t fd = static_cast<msg_file_t>(xbt_lib_get_elm_or_null(file_lib, name));
 
   xbt_lib_set(file_lib, name, MSG_FILE_LEVEL, priv);
   msg_file_t fd = static_cast<msg_file_t>(xbt_lib_get_elm_or_null(file_lib, name));
@@ -225,7 +225,7 @@ int MSG_file_close(msg_file_t fd)
     xbt_free(priv->data);
 
   int res = simcall_file_close(priv->simdata->smx_file, MSG_host_self());
     xbt_free(priv->data);
 
   int res = simcall_file_close(priv->simdata->smx_file, MSG_host_self());
-  name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_get_name(MSG_host_self()), priv->desc_id);
+  name    = bprintf("%s:%s:%d", priv->fullpath, MSG_host_self()->cname(), priv->desc_id);
   __MSG_host_release_file_descriptor_id(MSG_host_self(), priv->desc_id);
   xbt_lib_unset(file_lib, name, MSG_FILE_LEVEL, 1);
   xbt_free(name);
   __MSG_host_release_file_descriptor_id(MSG_host_self(), priv->desc_id);
   xbt_lib_unset(file_lib, name, MSG_FILE_LEVEL, 1);
   xbt_free(name);
@@ -359,7 +359,7 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa
     host_name_dest = (char*)storage_dest_priv->hostname;
     host_dest = MSG_host_by_name(host_name_dest);
   }else{
     host_name_dest = (char*)storage_dest_priv->hostname;
     host_dest = MSG_host_by_name(host_name_dest);
   }else{
-    XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, sg_host_get_name(host));
+    XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->cname());
     return MSG_TASK_CANCELED;
   }
 
     return MSG_TASK_CANCELED;
   }
 
index 866d533..6189fe7 100644 (file)
@@ -199,7 +199,7 @@ msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host,
   simdata->last_errno = MSG_OK;
 
   /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
   simdata->last_errno = MSG_OK;
 
   /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
-  process = SIMIX_process_attach(name, simdata, sg_host_get_name(host), properties, nullptr);
+  process = SIMIX_process_attach(name, simdata, host->cname(), properties, nullptr);
   if (!process)
     xbt_die("Could not attach");
   simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
   if (!process)
     xbt_die("Could not attach");
   simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
index 417e55a..12a577e 100644 (file)
@@ -215,13 +215,13 @@ void MSG_vm_start(msg_vm_t vm)
     if (pm_ramsize && !pm_overcommit) { /* Only verify that we don't overcommit on need */
       /* Retrieve the memory occupied by the VMs on that host. Yep, we have to traverse all VMs of all hosts for that */
       long total_ramsize_of_vms = 0;
     if (pm_ramsize && !pm_overcommit) { /* Only verify that we don't overcommit on need */
       /* Retrieve the memory occupied by the VMs on that host. Yep, we have to traverse all VMs of all hosts for that */
       long total_ramsize_of_vms = 0;
-      for (simgrid::s4u::VirtualMachine* ws_vm : simgrid::surf::VirtualMachineImpl::allVms_)
+      for (simgrid::s4u::VirtualMachine* ws_vm : simgrid::vm::VirtualMachineImpl::allVms_)
         if (pm == ws_vm->pimpl_vm_->getPm())
           total_ramsize_of_vms += ws_vm->pimpl_vm_->getRamsize();
 
       if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
         XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
         if (pm == ws_vm->pimpl_vm_->getPm())
           total_ramsize_of_vms += ws_vm->pimpl_vm_->getRamsize();
 
       if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
         XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
-                 sg_host_get_name(vm), sg_host_get_name(pm), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
+                 vm->cname(), pm->cname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
         THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->cname(), vm->cname());
       }
     }
         THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->cname(), vm->cname());
       }
     }
@@ -341,17 +341,17 @@ static int migration_rx_fun(int argc, char *argv[])
       snprintf(key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
 
       // start link
       snprintf(key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
 
       // start link
-      container_t msg = PJ_container_get(vm->name().c_str());
+      container_t msg = PJ_container_get(vm->cname());
       type_t type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
       new_pajeStartLink(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
       // destroy existing container of this vm
       type_t type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
       new_pajeStartLink(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
       // destroy existing container of this vm
-      container_t existing_container = PJ_container_get(vm->name().c_str());
+      container_t existing_container = PJ_container_get(vm->cname());
       PJ_container_remove_from_parent(existing_container);
       PJ_container_free(existing_container);
 
       // create new container on the new_host location
       PJ_container_remove_from_parent(existing_container);
       PJ_container_free(existing_container);
 
       // create new container on the new_host location
-      PJ_container_new(vm->cname(), INSTR_MSG_VM, PJ_container_get(sg_host_get_name(ms->dst_pm)));
+      PJ_container_new(vm->cname(), INSTR_MSG_VM, PJ_container_get(ms->dst_pm->cname()));
 
       // end link
       msg  = PJ_container_get(vm->name().c_str());
 
       // end link
       msg  = PJ_container_get(vm->name().c_str());
@@ -383,7 +383,7 @@ static int migration_rx_fun(int argc, char *argv[])
 
 static void start_dirty_page_tracking(msg_vm_t vm)
 {
 
 static void start_dirty_page_tracking(msg_vm_t vm)
 {
-  simgrid::surf::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
+  simgrid::vm::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
 
   pimpl->dp_enabled = 1;
   if (!pimpl->dp_objs)
 
   pimpl->dp_enabled = 1;
   if (!pimpl->dp_objs)
@@ -411,15 +411,15 @@ static double get_computed(char *key, msg_vm_t vm, dirty_page_t dp, double remai
   double computed = dp->prev_remaining - remaining;
   double duration = clock - dp->prev_clock;
 
   double computed = dp->prev_remaining - remaining;
   double duration = clock - dp->prev_clock;
 
-  XBT_DEBUG("%s@%s: computed %f ops (remaining %f -> %f) in %f secs (%f -> %f)",
-      key, sg_host_get_name(vm), computed, dp->prev_remaining, remaining, duration, dp->prev_clock, clock);
+  XBT_DEBUG("%s@%s: computed %f ops (remaining %f -> %f) in %f secs (%f -> %f)", key, vm->cname(), computed,
+            dp->prev_remaining, remaining, duration, dp->prev_clock, clock);
 
   return computed;
 }
 
 static double lookup_computed_flop_counts(msg_vm_t vm, int stage_for_fancy_debug, int stage2_round_for_fancy_debug)
 {
 
   return computed;
 }
 
 static double lookup_computed_flop_counts(msg_vm_t vm, int stage_for_fancy_debug, int stage2_round_for_fancy_debug)
 {
-  simgrid::surf::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
+  simgrid::vm::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
   double total = 0;
 
   char *key = nullptr;
   double total = 0;
 
   char *key = nullptr;
@@ -455,7 +455,7 @@ void MSG_host_add_task(msg_host_t host, msg_task_t task)
   simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
   if (vm == nullptr)
     return;
   simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
   if (vm == nullptr)
     return;
-  simgrid::surf::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
+  simgrid::vm::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
 
   double remaining = MSG_task_get_flops_amount(task);
   char *key = bprintf("%s-%p", task->name, task);
 
   double remaining = MSG_task_get_flops_amount(task);
   char *key = bprintf("%s-%p", task->name, task);
@@ -470,7 +470,7 @@ void MSG_host_add_task(msg_host_t host, msg_task_t task)
     pimpl->dp_objs = xbt_dict_new();
   xbt_assert(xbt_dict_get_or_null(pimpl->dp_objs, key) == nullptr);
   xbt_dict_set(pimpl->dp_objs, key, dp, nullptr);
     pimpl->dp_objs = xbt_dict_new();
   xbt_assert(xbt_dict_get_or_null(pimpl->dp_objs, key) == nullptr);
   xbt_dict_set(pimpl->dp_objs, key, dp, nullptr);
-  XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key, sg_host_get_name(host), remaining, pimpl->dp_enabled);
+  XBT_DEBUG("add %s on %s (remaining %f, dp_enabled %d)", key, host->cname(), remaining, pimpl->dp_enabled);
 
   xbt_free(key);
 }
 
   xbt_free(key);
 }
@@ -480,7 +480,7 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
   simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
   if (vm == nullptr)
     return;
   simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
   if (vm == nullptr)
     return;
-  simgrid::surf::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
+  simgrid::vm::VirtualMachineImpl* pimpl = static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_;
 
   char *key = bprintf("%s-%p", task->name, task);
   dirty_page_t dp = (dirty_page_t)(pimpl->dp_objs ? xbt_dict_get_or_null(pimpl->dp_objs, key) : NULL);
 
   char *key = bprintf("%s-%p", task->name, task);
   dirty_page_t dp = (dirty_page_t)(pimpl->dp_objs ? xbt_dict_get_or_null(pimpl->dp_objs, key) : NULL);
@@ -500,7 +500,7 @@ void MSG_host_del_task(msg_host_t host, msg_task_t task)
     xbt_dict_remove(pimpl->dp_objs, key);
   xbt_free(dp);
 
     xbt_dict_remove(pimpl->dp_objs, key);
   xbt_free(dp);
 
-  XBT_DEBUG("del %s on %s", key, sg_host_get_name(host));
+  XBT_DEBUG("del %s on %s", key, host->cname());
   xbt_free(key);
 }
 
   xbt_free(key);
 }
 
@@ -535,11 +535,11 @@ static sg_size_t send_migration_data(msg_vm_t vm, msg_host_t src_pm, msg_host_t
   if(ret == MSG_HOST_FAILURE){
     //XBT_DEBUG("SRC host failed during migration of %s (stage %d)", sg_host_name(vm), stage);
     MSG_task_destroy(task);
   if(ret == MSG_HOST_FAILURE){
     //XBT_DEBUG("SRC host failed during migration of %s (stage %d)", sg_host_name(vm), stage);
     MSG_task_destroy(task);
-    THROWF(host_error, 0, "SRC host failed during migration of %s (stage %d)", sg_host_get_name(vm), stage);
+    THROWF(host_error, 0, "SRC host failed during migration of %s (stage %d)", vm->cname(), stage);
   }else if(ret == MSG_TRANSFER_FAILURE){
     //XBT_DEBUG("DST host failed during migration of %s (stage %d)", sg_host_name(vm), stage);
     MSG_task_destroy(task);
   }else if(ret == MSG_TRANSFER_FAILURE){
     //XBT_DEBUG("DST host failed during migration of %s (stage %d)", sg_host_name(vm), stage);
     MSG_task_destroy(task);
-    THROWF(host_error, 0, "DST host failed during migration of %s (stage %d)", sg_host_get_name(vm), stage);
+    THROWF(host_error, 0, "DST host failed during migration of %s (stage %d)", vm->cname(), stage);
   }
 
   double clock_end = MSG_get_clock();
   }
 
   double clock_end = MSG_get_clock();
@@ -755,9 +755,9 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
    * The second one would be easier.
    */
 
    * The second one would be easier.
    */
 
-  simgrid::s4u::VirtualMachine* typedVm    = static_cast<simgrid::s4u::VirtualMachine*>(vm);
-  simgrid::surf::VirtualMachineImpl* pimpl = typedVm->pimpl_vm_;
-  msg_host_t src_pm                        = pimpl->getPm();
+  simgrid::s4u::VirtualMachine* typedVm  = static_cast<simgrid::s4u::VirtualMachine*>(vm);
+  simgrid::vm::VirtualMachineImpl* pimpl = typedVm->pimpl_vm_;
+  msg_host_t src_pm                      = pimpl->getPm();
 
   if (src_pm->isOff())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->cname(), src_pm->cname());
 
   if (src_pm->isOff())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->cname(), src_pm->cname());
index b01ab0a..8f9c116 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
-simgrid::surf::VMModel* surf_vm_model = nullptr;
+simgrid::vm::VMModel* surf_vm_model = nullptr;
 
 void surf_vm_model_init_HL13()
 {
   if (surf_cpu_model_vm) {
 
 void surf_vm_model_init_HL13()
 {
   if (surf_cpu_model_vm) {
-    surf_vm_model = new simgrid::surf::VMModel();
+    surf_vm_model = new simgrid::vm::VMModel();
     all_existing_models->push_back(surf_vm_model);
   }
 }
 
 namespace simgrid {
     all_existing_models->push_back(surf_vm_model);
   }
 }
 
 namespace simgrid {
-namespace surf {
+namespace vm {
 
 /*************
  * Callbacks *
  *************/
 
 
 /*************
  * Callbacks *
  *************/
 
-simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmCreation;
-simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmDestruction;
-simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmStateChange;
+simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmCreation;
+simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmDestruction;
+simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmStateChange;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -73,7 +73,7 @@ double VMModel::nextOccuringEvent(double now)
 
   /* iterate for all virtual machines */
   for (s4u::VirtualMachine* ws_vm : VirtualMachineImpl::allVms_) {
 
   /* iterate for all virtual machines */
   for (s4u::VirtualMachine* ws_vm : VirtualMachineImpl::allVms_) {
-    Cpu* cpu = ws_vm->pimpl_cpu;
+    surf::Cpu* cpu = ws_vm->pimpl_cpu;
     xbt_assert(cpu, "cpu-less host");
 
     double solved_value = ws_vm->pimpl_vm_->action_->getVariable()->value;
     xbt_assert(cpu, "cpu-less host");
 
     double solved_value = ws_vm->pimpl_vm_->action_->getVariable()->value;
@@ -199,10 +199,10 @@ void VirtualMachineImpl::migrate(s4u::Host* host_dest)
 
   /* Update vcpu's action for the new pm */
   /* create a cpu action bound to the pm model at the destination. */
 
   /* Update vcpu's action for the new pm */
   /* create a cpu action bound to the pm model at the destination. */
-  CpuAction* new_cpu_action = static_cast<CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
+  surf::CpuAction* new_cpu_action = static_cast<surf::CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
 
 
-  Action::State state = action_->getState();
-  if (state != Action::State::done)
+  surf::Action::State state = action_->getState();
+  if (state != surf::Action::State::done)
     XBT_CRITICAL("FIXME: may need a proper handling, %d", static_cast<int>(state));
   if (action_->getRemainsNoUpdate() > 0)
     XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
     XBT_CRITICAL("FIXME: may need a proper handling, %d", static_cast<int>(state));
   if (action_->getRemainsNoUpdate() > 0)
     XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
index 4df8c25..6f33984 100644 (file)
@@ -19,7 +19,7 @@
                           // It corresponds to the cost of a VM running no tasks.
 
 namespace simgrid {
                           // It corresponds to the cost of a VM running no tasks.
 
 namespace simgrid {
-namespace surf {
+namespace vm {
 
 /***********
  * Classes *
 
 /***********
  * Classes *
@@ -35,17 +35,17 @@ class XBT_PRIVATE VirtualMachineImpl;
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
  */
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM creation. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmCreation;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmCreation;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks fired after VM destruction. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmDestruction;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmDestruction;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
  */
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks after VM State changes. Signature: `void(VirtualMachine*)`
  */
-extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)> onVmStateChange;
+extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::vm::VirtualMachineImpl*)> onVmStateChange;
 
 /************
  * Resource *
 
 /************
  * Resource *
@@ -55,7 +55,7 @@ extern XBT_PRIVATE simgrid::xbt::signal<void(simgrid::surf::VirtualMachineImpl*)
  * @brief SURF VM interface class
  * @details A VM represent a virtual machine
  */
  * @brief SURF VM interface class
  * @details A VM represent a virtual machine
  */
-class VirtualMachineImpl : public HostImpl {
+class VirtualMachineImpl : public surf::HostImpl {
   friend simgrid::s4u::VirtualMachine;
 
 public:
   friend simgrid::s4u::VirtualMachine;
 
 public:
@@ -88,7 +88,7 @@ public:
   void setParams(vm_params_t params);
 
   /* The vm object of the lower layer */
   void setParams(vm_params_t params);
 
   /* The vm object of the lower layer */
-  Action* action_ = nullptr;
+  surf::Action* action_ = nullptr;
 
   /* Dirty pages stuff */
   int dp_enabled                     = 0;
 
   /* Dirty pages stuff */
   int dp_enabled                     = 0;
@@ -119,7 +119,7 @@ protected:
  * @brief SURF VM model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
  */
  * @brief SURF VM model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
  */
-class VMModel : public HostModel {
+class VMModel : public surf::HostModel {
 public:
   void adjustWeightOfDummyCpuActions() override{};
 
 public:
   void adjustWeightOfDummyCpuActions() override{};
 
index ba9c167..d648250 100644 (file)
@@ -23,7 +23,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name)
 {
   XBT_DEBUG("Create VM %s", name);
 
 {
   XBT_DEBUG("Create VM %s", name);
 
-  pimpl_vm_ = new surf::VirtualMachineImpl(this, pm);
+  pimpl_vm_ = new vm::VirtualMachineImpl(this, pm);
   /* Currently, a VM uses the network resource of its physical host */
   pimpl_netcard = pm->pimpl_netcard;
   // Create a VCPU for this VM
   /* Currently, a VM uses the network resource of its physical host */
   pimpl_netcard = pm->pimpl_netcard;
   // Create a VCPU for this VM
@@ -37,7 +37,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name)
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
   if (TRACE_msg_vm_is_enabled()) {
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t host_container = PJ_container_get(sg_host_get_name(pm));
+    container_t host_container = PJ_container_get(pm->cname());
     PJ_container_new(name, INSTR_MSG_VM, host_container);
   }
 }
     PJ_container_new(name, INSTR_MSG_VM, host_container);
   }
 }
index 9ccb263..77e84c3 100644 (file)
@@ -198,10 +198,10 @@ void sg_host_dump(sg_host_t host)
   xbt_dict_cursor_t cursor=nullptr;
   char *key,*data;
 
   xbt_dict_cursor_t cursor=nullptr;
   char *key,*data;
 
-  XBT_INFO("Displaying host %s", sg_host_get_name(host));
+  XBT_INFO("Displaying host %s", host->cname());
   XBT_INFO("  - speed: %.0f", host->speed());
   XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(host));
   XBT_INFO("  - speed: %.0f", host->speed());
   XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(host));
-  props = sg_host_get_properties(host);
+  props = host->properties();
 
   if (!xbt_dict_is_empty(props)){
     XBT_INFO("  - properties:");
 
   if (!xbt_dict_is_empty(props)){
     XBT_INFO("  - properties:");
index 2329d65..99b2569 100644 (file)
@@ -222,8 +222,7 @@ void SIMIX_process_stop(smx_actor_t arg) {
                                         arg->properties,
                                         arg->auto_restart);
   }
                                         arg->properties,
                                         arg->auto_restart);
   }
-  XBT_DEBUG("Process %s (%s) is dead",
-    arg->name.c_str(), sg_host_get_name(arg->host));
+  XBT_DEBUG("Process %s@%s is dead", arg->cname(), arg->host->cname());
   arg->context->stop();
 }
 
   arg->context->stop();
 }
 
@@ -303,20 +302,18 @@ smx_actor_t SIMIX_process_create(
 
     /* Now insert it in the global process list and in the process to run list */
     xbt_swag_insert(process, simix_global->process_list);
 
     /* Now insert it in the global process list and in the process to run list */
     xbt_swag_insert(process, simix_global->process_list);
-    XBT_DEBUG("Inserting %s(%s) in the to_run list",
-      process->name.c_str(), sg_host_get_name(host));
+    XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->cname());
     xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
 
     if (kill_time > SIMIX_get_clock() && simix_global->kill_process_function) {
     xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
 
     if (kill_time > SIMIX_get_clock() && simix_global->kill_process_function) {
-      XBT_DEBUG("Process %s(%s) will be kill at time %f",
-        process->name.c_str(), sg_host_get_name(process->host), kill_time);
+      XBT_DEBUG("Process %s(%s) will be kill at time %f", process->cname(), process->host->cname(), kill_time);
       process->kill_timer = SIMIX_timer_set(kill_time, [=]() {
         simix_global->kill_process_function(process);
       });
     }
 
     /* Tracing the process creation */
       process->kill_timer = SIMIX_timer_set(kill_time, [=]() {
         simix_global->kill_process_function(process);
       });
     }
 
     /* Tracing the process creation */
-    TRACE_msg_process_create(process->name.c_str(), process->pid, process->host);
+    TRACE_msg_process_create(process->cname(), process->pid, process->host);
   }
   return process;
 }
   }
   return process;
 }
@@ -383,12 +380,11 @@ smx_actor_t SIMIX_process_attach(
 
   /* Now insert it in the global process list and in the process to run list */
   xbt_swag_insert(process, simix_global->process_list);
 
   /* Now insert it in the global process list and in the process to run list */
   xbt_swag_insert(process, simix_global->process_list);
-  XBT_DEBUG("Inserting %s(%s) in the to_run list",
-    process->name.c_str(), sg_host_get_name(host));
+  XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->cname());
   xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
 
   /* Tracing the process creation */
   xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
 
   /* Tracing the process creation */
-  TRACE_msg_process_create(process->name.c_str(), process->pid, process->host);
+  TRACE_msg_process_create(process->cname(), process->pid, process->host);
 
   auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (!context)
 
   auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (!context)
@@ -449,8 +445,7 @@ void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process) {
  */
 void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 
  */
 void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 
-  XBT_DEBUG("Killing process %s on %s",
-    process->name.c_str(), sg_host_get_name(process->host));
+  XBT_DEBUG("Killing process %s@%s", process->cname(), process->host->cname());
 
   process->context->iwannadie = 1;
   process->blocked = 0;
 
   process->context->iwannadie = 1;
   process->blocked = 0;
@@ -789,9 +784,8 @@ smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration)
 {
   sg_host_t host = process->host;
 
 {
   sg_host_t host = process->host;
 
-  /* check if the host is active */
   if (host->isOff())
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
+    THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->cname());
 
   simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep();
   synchro->host = host;
 
   simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep();
   synchro->host = host;
@@ -942,7 +936,7 @@ smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t p
 }
 /** @brief Restart a process, starting it again from the beginning. */
 smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer) {
 }
 /** @brief Restart a process, starting it again from the beginning. */
 smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer) {
-  XBT_DEBUG("Restarting process %s on %s", process->name.c_str(), sg_host_get_name(process->host));
+  XBT_DEBUG("Restarting process %s on %s", process->cname(), process->host->cname());
 
   //retrieve the arguments of the old process
   //FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
 
   //retrieve the arguments of the old process
   //FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
index ff1073c..f9623d1 100644 (file)
@@ -51,6 +51,7 @@ public:
   unsigned long pid  = 0;
   unsigned long ppid = 0;
   simgrid::xbt::string name;
   unsigned long pid  = 0;
   unsigned long ppid = 0;
   simgrid::xbt::string name;
+  const char* cname() { return name.c_str(); }
   sg_host_t host        = nullptr; /* the host on which the process is running */
   smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
 
   sg_host_t host        = nullptr; /* the host on which the process is running */
   smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
 
index 1322fcd..7ccc835 100644 (file)
@@ -342,8 +342,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 
   if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
     return;
 
   if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
     return;
-  XBT_DEBUG("Set kill time %f for process %s(%s)",
-    kill_time, process->name.c_str(), sg_host_get_name(process->host));
+  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->cname(), process->host->cname());
   process->kill_timer = SIMIX_timer_set(kill_time, [=] {
     simix_global->kill_process_function(process);
     process->kill_timer=nullptr;
   process->kill_timer = SIMIX_timer_set(kill_time, [=] {
     simix_global->kill_process_function(process);
     process->kill_timer=nullptr;
index b34c5bb..ffc3d90 100644 (file)
@@ -129,7 +129,7 @@ void SIMIX_process_set_function(const char *process_host,
   sg_host_t host = sg_host_by_name(process_host);
   if (!host)
     THROWF(arg_error, 0, "Host '%s' unknown", process_host);
   sg_host_t host = sg_host_by_name(process_host);
   if (!host)
     THROWF(arg_error, 0, "Host '%s' unknown", process_host);
-  process.host = sg_host_get_name(host);
+  process.host = host->cname();
 
   process.argc = 1 + xbt_dynar_length(arguments);
   process.argv = (const char**)xbt_new(char *, process.argc + 1);
 
   process.argc = 1 + xbt_dynar_length(arguments);
   process.argv = (const char**)xbt_new(char *, process.argc + 1);
index dd161f1..6ed45ba 100644 (file)
@@ -535,7 +535,7 @@ void SIMIX_run()
 
     /* Autorestart all process */
     for (auto host: host_that_restart) {
 
     /* Autorestart all process */
     for (auto host: host_that_restart) {
-      XBT_INFO("Restart processes on host: %s", sg_host_get_name(host));
+      XBT_INFO("Restart processes on host %s", host->cname());
       SIMIX_host_autorestart(host);
     }
     host_that_restart.clear();
       SIMIX_host_autorestart(host);
     }
     host_that_restart.clear();
@@ -678,13 +678,12 @@ void SIMIX_display_process_status()
         break;
 */
 
         break;
 */
 
-      XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish",
-          process->pid, process->name.c_str(), sg_host_get_name(process->host),
-          synchro_description, process->waiting_synchro,
-          process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
+      XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
+               process->cname(), process->host->cname(), synchro_description, process->waiting_synchro,
+               process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
     }
     else {
     }
     else {
-      XBT_INFO("Process %lu (%s@%s)", process->pid, process->name.c_str(), sg_host_get_name(process->host));
+      XBT_INFO("Process %lu (%s@%s)", process->pid, process->cname(), process->host->cname());
     }
   }
 }
     }
   }
 }
index 014a49d..6904369 100644 (file)
@@ -91,12 +91,11 @@ void SIMIX_host_off(sg_host_t h, smx_actor_t issuer)
       smx_actor_t process = nullptr;
       xbt_swag_foreach(process, host->process_list) {
         SIMIX_process_kill(process, issuer);
       smx_actor_t process = nullptr;
       xbt_swag_foreach(process, host->process_list) {
         SIMIX_process_kill(process, issuer);
-        XBT_DEBUG("Killing %s@%s on behalf of %s", process->name.c_str(), sg_host_get_name(process->host),
-                  issuer->name.c_str());
+        XBT_DEBUG("Killing %s@%s on behalf of %s", process->cname(), process->host->cname(), issuer->cname());
       }
     }
   } else {
       }
     }
   } else {
-    XBT_INFO("Host %s is already off", h->name().c_str());
+    XBT_INFO("Host %s is already off", h->cname());
   }
 }
 
   }
 }
 
@@ -113,7 +112,7 @@ const char* SIMIX_host_self_get_name()
   if (host == nullptr || SIMIX_process_self() == simix_global->maestro_process)
     return "";
 
   if (host == nullptr || SIMIX_process_self() == simix_global->maestro_process)
     return "";
 
-  return sg_host_get_name(host);
+  return host->cname();
 }
 
 void _SIMIX_host_free_process_arg(void *data)
 }
 
 void _SIMIX_host_free_process_arg(void *data)
@@ -141,9 +140,9 @@ void SIMIX_host_add_auto_restart_process(
   arg->properties = properties;
   arg->auto_restart = auto_restart;
 
   arg->properties = properties;
   arg->auto_restart = auto_restart;
 
-  if( host->isOff() && !xbt_dict_get_or_null(watched_hosts_lib,sg_host_get_name(host))){
-    xbt_dict_set(watched_hosts_lib,sg_host_get_name(host),host,nullptr);
-    XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_get_name(host));
+  if (host->isOff() && !xbt_dict_get_or_null(watched_hosts_lib, host->cname())) {
+    xbt_dict_set(watched_hosts_lib, host->cname(), host, nullptr);
+    XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF", host->cname());
   }
   sg_host_simix(host)->auto_restart_processes.push_back(arg);
 }
   }
   sg_host_simix(host)->auto_restart_processes.push_back(arg);
 }
@@ -156,7 +155,7 @@ void SIMIX_host_autorestart(sg_host_t host)
 
   for (auto arg : process_list) {
 
 
   for (auto arg : process_list) {
 
-    XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->name().c_str());
+    XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->cname());
     simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->kill_time,
         arg->properties, arg->auto_restart, nullptr);
   }
     simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->kill_time,
         arg->properties, arg->auto_restart, nullptr);
   }
@@ -278,7 +277,7 @@ void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec)
         break;
 
       case SIMIX_FAILED:
         break;
 
       case SIMIX_FAILED:
-        XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", sg_host_get_name(simcall->issuer->host));
+        XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->cname());
         simcall->issuer->context->iwannadie = 1;
         SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
         break;
         simcall->issuer->context->iwannadie = 1;
         SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
         break;
index 1485d59..44b42f3 100644 (file)
@@ -67,8 +67,7 @@ smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
 {
   /* check if the host is active */
   if (host->isOff())
 {
   /* check if the host is active */
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
-
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
@@ -91,7 +90,7 @@ void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t
 smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
 {
   if (host->isOff())
 smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
 {
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
@@ -113,7 +112,7 @@ void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_h
 smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host)
 {
   if (host->isOff())
 smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host)
 {
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
@@ -135,7 +134,7 @@ void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t
 smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
 {
   if (host->isOff())
 smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
 {
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
 
   simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
   synchro->host = host;
@@ -150,7 +149,7 @@ smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
 int SIMIX_file_unlink(smx_file_t fd, sg_host_t host)
 {
   if (host->isOff())
 int SIMIX_file_unlink(smx_file_t fd, sg_host_t host)
 {
   if (host->isOff())
-    THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
+    THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
 
   int res = surf_host_unlink(host, fd->surf_file);
   xbt_free(fd);
 
   int res = surf_host_unlink(host, fd->surf_file);
   xbt_free(fd);
index 3999fe7..1c168bc 100644 (file)
@@ -545,7 +545,7 @@ static inline void SIMIX_comm_start(smx_activity_t synchro)
     simgrid::s4u::Host* sender   = comm->src_proc->host;
     simgrid::s4u::Host* receiver = comm->dst_proc->host;
 
     simgrid::s4u::Host* sender   = comm->src_proc->host;
     simgrid::s4u::Host* receiver = comm->dst_proc->host;
 
-    XBT_DEBUG("Starting communication %p from '%s' to '%s'", synchro, sg_host_get_name(sender), sg_host_get_name(receiver));
+    XBT_DEBUG("Starting communication %p from '%s' to '%s'", synchro, sender->cname(), receiver->cname());
 
     comm->surf_comm = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
     comm->surf_comm->setData(synchro);
 
     comm->surf_comm = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
     comm->surf_comm->setData(synchro);
@@ -553,8 +553,8 @@ static inline void SIMIX_comm_start(smx_activity_t synchro)
 
     /* If a link is failed, detect it immediately */
     if (comm->surf_comm->getState() == simgrid::surf::Action::State::failed) {
 
     /* If a link is failed, detect it immediately */
     if (comm->surf_comm->getState() == simgrid::surf::Action::State::failed) {
-      XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
-                sg_host_get_name(sender), sg_host_get_name(receiver));
+      XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->cname(),
+                receiver->cname());
       comm->state = SIMIX_LINK_FAILURE;
       comm->cleanupSurf();
     }
       comm->state = SIMIX_LINK_FAILURE;
       comm->cleanupSurf();
     }
@@ -563,11 +563,13 @@ static inline void SIMIX_comm_start(smx_activity_t synchro)
        it will be restarted when the sender process resume */
     if (SIMIX_process_is_suspended(comm->src_proc) || SIMIX_process_is_suspended(comm->dst_proc)) {
       if (SIMIX_process_is_suspended(comm->src_proc))
        it will be restarted when the sender process resume */
     if (SIMIX_process_is_suspended(comm->src_proc) || SIMIX_process_is_suspended(comm->dst_proc)) {
       if (SIMIX_process_is_suspended(comm->src_proc))
-        XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the communication",
-            comm->src_proc->name.c_str(), sg_host_get_name(comm->src_proc->host));
+        XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the "
+                  "communication",
+                  comm->src_proc->cname(), comm->src_proc->host->cname());
       else
       else
-        XBT_DEBUG("The communication is suspended on startup because dst (%s@%s) was suspended since it initiated the communication",
-            comm->dst_proc->name.c_str(), sg_host_get_name(comm->dst_proc->host));
+        XBT_DEBUG("The communication is suspended on startup because dst (%s@%s) was suspended since it initiated the "
+                  "communication",
+                  comm->dst_proc->cname(), comm->dst_proc->host->cname());
 
       comm->surf_comm->suspend();
     }
 
       comm->surf_comm->suspend();
     }
@@ -649,11 +651,11 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
       case SIMIX_LINK_FAILURE:
 
 
       case SIMIX_LINK_FAILURE:
 
-        XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) detached:%d",
-                  synchro,
-                  comm->src_proc ? sg_host_get_name(comm->src_proc->host) : nullptr,
-                  comm->dst_proc ? sg_host_get_name(comm->dst_proc->host) : nullptr,
-                  simcall->issuer->name.c_str(), simcall->issuer, comm->detached);
+        XBT_DEBUG(
+            "Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) detached:%d",
+            synchro, comm->src_proc ? comm->src_proc->host->cname() : nullptr,
+            comm->dst_proc ? comm->dst_proc->host->cname() : nullptr, simcall->issuer->cname(), simcall->issuer,
+            comm->detached);
         if (comm->src_proc == simcall->issuer) {
           XBT_DEBUG("I'm source");
         } else if (comm->dst_proc == simcall->issuer) {
         if (comm->src_proc == simcall->issuer) {
           XBT_DEBUG("I'm source");
         } else if (comm->dst_proc == simcall->issuer) {
@@ -773,12 +775,9 @@ void SIMIX_comm_copy_data(smx_activity_t synchro)
   if (!comm->src_buff || !comm->dst_buff || comm->copied)
     return;
 
   if (!comm->src_buff || !comm->dst_buff || comm->copied)
     return;
 
-  XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)",
-            comm,
-            comm->src_proc ? sg_host_get_name(comm->src_proc->host) : "a finished process",
-            comm->src_buff,
-            comm->dst_proc ? sg_host_get_name(comm->dst_proc->host) : "a finished process",
-            comm->dst_buff, buff_size);
+  XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm,
+            comm->src_proc ? comm->src_proc->host->cname() : "a finished process", comm->src_buff,
+            comm->dst_proc ? comm->dst_proc->host->cname() : "a finished process", comm->dst_buff, buff_size);
 
   /* Copy at most dst_buff_size bytes of the message to receiver's buffer */
   if (comm->dst_buff_size)
 
   /* Copy at most dst_buff_size bytes of the message to receiver's buffer */
   if (comm->dst_buff_size)
index 10def72..12a0406 100644 (file)
@@ -81,19 +81,16 @@ void SIMIX_vm_resume(sg_host_t vm)
  */
 void SIMIX_vm_save(sg_host_t vm, smx_actor_t issuer)
 {
  */
 void SIMIX_vm_save(sg_host_t vm, smx_actor_t issuer)
 {
-  const char *name = sg_host_get_name(vm);
-
   if (static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() != SURF_VM_STATE_RUNNING)
   if (static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() != SURF_VM_STATE_RUNNING)
-    THROWF(vm_error, 0, "VM(%s) is not running", name);
+    THROWF(vm_error, 0, "VM(%s) is not running", vm->cname());
 
 
-  XBT_DEBUG("save VM(%s), where %d processes exist", name, xbt_swag_size(sg_host_simix(vm)->process_list));
+  XBT_DEBUG("save VM(%s), where %d processes exist", vm->cname(), xbt_swag_size(sg_host_simix(vm)->process_list));
 
 
-  /* jump to vm_ws_save() */
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->save();
 
   smx_actor_t smx_process, smx_process_safe;
   xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) {
   static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->save();
 
   smx_actor_t smx_process, smx_process_safe;
   xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) {
-    XBT_DEBUG("suspend %s", smx_process->name.c_str());
+    XBT_DEBUG("suspend %s", smx_process->cname());
     SIMIX_process_suspend(smx_process, issuer);
   }
 }
     SIMIX_process_suspend(smx_process, issuer);
   }
 }
index 90bd6cb..dc58971 100644 (file)
@@ -1,10 +1,9 @@
-
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <simgrid/s4u/host.hpp>
 #include <xbt/ex.hpp>
 
 #include "private.h"
 #include <xbt/ex.hpp>
 
 #include "private.h"
@@ -2328,9 +2327,9 @@ int PMPI_Get_processor_name(char *name, int *resultlen)
 {
   int retval = MPI_SUCCESS;
 
 {
   int retval = MPI_SUCCESS;
 
-  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 );
+  strncpy(name, SIMIX_host_self()->cname(), strlen(SIMIX_host_self()->cname()) < MPI_MAX_PROCESSOR_NAME - 1
+                                                ? strlen(SIMIX_host_self()->cname()) + 1
+                                                : MPI_MAX_PROCESSOR_NAME - 1);
   *resultlen = strlen(name) > MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
 
   return retval;
   *resultlen = strlen(name) > MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
 
   return retval;
index bda7540..bc39f8f 100644 (file)
@@ -35,7 +35,7 @@ namespace surf {
 void HostModel::adjustWeightOfDummyCpuActions()
 {
   /* iterate for all virtual machines */
 void HostModel::adjustWeightOfDummyCpuActions()
 {
   /* iterate for all virtual machines */
-  for (s4u::VirtualMachine* ws_vm : VirtualMachineImpl::allVms_) {
+  for (s4u::VirtualMachine* ws_vm : vm::VirtualMachineImpl::allVms_) {
 
     Cpu* cpu = ws_vm->pimpl_cpu;
 
 
     Cpu* cpu = ws_vm->pimpl_cpu;
 
index cb5a0d4..6d6ba0c 100644 (file)
@@ -567,8 +567,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
       delete arg;
     });
   } else {                      // start_time <= SIMIX_get_clock()
       delete arg;
     });
   } else {                      // start_time <= SIMIX_get_clock()
-    XBT_DEBUG("Starting Process %s(%s) right now",
-      arg->name.c_str(), sg_host_get_name(host));
+    XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->cname());
 
     process_created = simix_global->create_process_function(
         arg->name.c_str(), std::move(code), nullptr,
 
     process_created = simix_global->create_process_function(
         arg->name.c_str(), std::move(code), nullptr,
index 96b7ded..6035034 100644 (file)
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
     std::qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
 
     for (i = 0; i < totalHosts; i++) {
     std::qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
 
     for (i = 0; i < totalHosts; i++) {
-      std::printf("  <host id=\"%s\" speed=\"%.0f\"", sg_host_get_name(hosts[i]), sg_host_speed(hosts[i]));
+      std::printf("  <host id=\"%s\" speed=\"%.0f\"", hosts[i]->cname(), sg_host_speed(hosts[i]));
       props = sg_host_get_properties(hosts[i]);
       if (hosts[i]->coreCount()>1) {
         std::printf(" core=\"%d\"", hosts[i]->coreCount());
       props = sg_host_get_properties(hosts[i]);
       if (hosts[i]->coreCount()>1) {
         std::printf(" core=\"%d\"", hosts[i]->coreCount());