Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
all actors are unified, no need to virtualize between APIs
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 5 Jul 2017 22:39:17 +0000 (00:39 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 5 Jul 2017 22:39:23 +0000 (00:39 +0200)
In addition, the virtualization was not done in s4u, so the %i
formatter of the logs was broken. (fix #195).

include/xbt/virtu.h
src/msg/msg_global.cpp
src/xbt/xbt_virtu.c

index 6c15696..4438e17 100644 (file)
@@ -1,6 +1,6 @@
 /* virtu - virtualization layer for the logging to know about the actors    */
 
 /* virtu - virtualization layer for the logging to know about the actors    */
 
-/* Copyright (c) 2007-2014. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. 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. */
@@ -15,8 +15,7 @@
 
 SG_BEGIN_DECL()
 
 
 SG_BEGIN_DECL()
 
-/* Get the PID of the current (simulated) process */
-XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid;
+XBT_PUBLIC(int) xbt_getpid(void);
 
 /* Get the name of the UNIX process englobing the world */
 XBT_PUBLIC_DATA(char*) xbt_binary_name;
 
 /* Get the name of the UNIX process englobing the world */
 XBT_PUBLIC_DATA(char*) xbt_binary_name;
index 7c2e367..011f6f6 100644 (file)
@@ -34,7 +34,6 @@ void MSG_init_nocheck(int *argc, char **argv) {
 
   TRACE_global_init(argc, argv);
 
 
   TRACE_global_init(argc, argv);
 
-  xbt_getpid = &MSG_process_self_PID;
   if (not msg_global) {
 
     msg_global = new s_MSG_Global_t();
   if (not msg_global) {
 
     msg_global = new s_MSG_Global_t();
index b4d2cb5..573c947 100644 (file)
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 
-static int xbt_fake_pid(void)
+int xbt_getpid()
 {
 {
-  return 0;
+  return MSG_process_self_PID();
 }
 
 }
 
-int_f_void_t xbt_getpid = &xbt_fake_pid;
-
 const char *xbt_procname(void)
 {
   return MSG_process_self_name();
 const char *xbt_procname(void)
 {
   return MSG_process_self_name();