From: Martin Quinson Date: Wed, 5 Jul 2017 22:39:17 +0000 (+0200) Subject: all actors are unified, no need to virtualize between APIs X-Git-Tag: v3_17~454 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0dda9bcd2d7df2c8141a8170a7cb8fe20746b4a9 all actors are unified, no need to virtualize between APIs In addition, the virtualization was not done in s4u, so the %i formatter of the logs was broken. (fix #195). --- diff --git a/include/xbt/virtu.h b/include/xbt/virtu.h index 6c1569643b..4438e17213 100644 --- a/include/xbt/virtu.h +++ b/include/xbt/virtu.h @@ -1,6 +1,6 @@ /* 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. */ @@ -15,8 +15,7 @@ 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; diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index 7c2e367bf1..011f6f6669 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -34,7 +34,6 @@ void MSG_init_nocheck(int *argc, char **argv) { TRACE_global_init(argc, argv); - xbt_getpid = &MSG_process_self_PID; if (not msg_global) { msg_global = new s_MSG_Global_t(); diff --git a/src/xbt/xbt_virtu.c b/src/xbt/xbt_virtu.c index b4d2cb5546..573c94724c 100644 --- a/src/xbt/xbt_virtu.c +++ b/src/xbt/xbt_virtu.c @@ -10,13 +10,11 @@ #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();