Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert GRAS pid from long int to int; setup a virtualization layer in XBT to choose...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 2 Jul 2007 16:31:29 +0000 (16:31 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 2 Jul 2007 16:31:29 +0000 (16:31 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3643 48e7efb5-ca39-0410-a469-dd3cf9ba447f

30 files changed:
configure
examples/gras/all2all/Makefile.in
examples/gras/chrono/Makefile.in
examples/gras/mmrpc/Makefile.in
examples/gras/mutual_exclusion/simple_token/Makefile.in
examples/gras/mutual_exclusion/simple_token/simple_token.c
examples/gras/ping/Makefile.in
examples/gras/pmm/Makefile.in
examples/gras/rpc/Makefile.in
examples/gras/timer/Makefile.in
include/Makefile.am
include/Makefile.in
include/gras/virtu.h
include/xbt/ex.h
include/xbt/function_types.h
include/xbt/virtu.h [new file with mode: 0644]
libtool
src/Makefile.am
src/Makefile.in
src/gras/Transport/transport_plugin_sg.c
src/gras/Virtu/rl_process.c
src/gras/Virtu/sg_process.c
src/gras/Virtu/virtu_private.h
src/gras/gras.c
src/msg/global.c
src/xbt/ex.c
src/xbt/log.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_virtu.c [new file with mode: 0644]

index 305bd02..77a4513 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.159 .
+# From configure.ac Revision: 1.161 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for simgrid 3.3-cvs.
 #
@@ -27603,6 +27603,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27612,6 +27614,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27621,6 +27625,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27630,6 +27636,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27639,6 +27647,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27648,6 +27658,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27657,6 +27669,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27666,6 +27680,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27675,6 +27691,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27684,6 +27702,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27693,6 +27713,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27702,6 +27724,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27711,6 +27735,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27720,6 +27746,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27729,6 +27757,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27738,6 +27768,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27747,6 +27779,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27756,6 +27790,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27765,6 +27801,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27774,6 +27812,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27783,6 +27823,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27792,6 +27834,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27801,6 +27845,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
@@ -27810,6 +27856,8 @@ done
      \
      examples/msg/run_msg_test                                  \
      examples/simdag/test_simdag                               \
+     examples/amok/bandwidth/test_sg examples/amok/bandwidth/test_rl \
+     examples/amok/saturate/test_sg  examples/amok/saturate/test_rl \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
index 89e2a6c..c772f57 100644 (file)
@@ -603,9 +603,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -613,7 +613,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 17e1506..a51d2f6 100644 (file)
@@ -591,9 +591,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -601,7 +601,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index b60e582..c6a00fe 100644 (file)
@@ -606,9 +606,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -616,7 +616,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 746bcb0..845e4a3 100644 (file)
@@ -594,9 +594,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -604,7 +604,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 7931730..5f0db69 100644 (file)
@@ -129,7 +129,7 @@ int node (int argc,char *argv[]) {
   globals->tosuccessor = NULL;
 
   if (!gras_os_getpid() % 100)
-  INFO4("Launch node %ld (successor on %s:%d; listening on %d)",
+  INFO4("Launch node %d (successor on %s:%d; listening on %d)",
        gras_os_getpid(), host,peerport, myport);
 
   /* 4. Create my master socket for listening */
index 41131b5..510e9e7 100644 (file)
@@ -606,9 +606,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -616,7 +616,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 252e238..c396286 100644 (file)
@@ -600,9 +600,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -610,7 +610,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 746f1b5..9464f7b 100644 (file)
@@ -609,9 +609,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -619,7 +619,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index d75d546..602a3ef 100644 (file)
@@ -589,9 +589,9 @@ uninstall-am: uninstall-info-am
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-info-am
 
-@GRAS_ARCH_32_BITS_TRUE@test-sg: force
+@GRAS_ARCH_32_BITS_TRUE@test-sg: 
 @GRAS_ARCH_32_BITS_TRUE@       $(TESTS_ENVIRONMENT) test_sg_32
-@GRAS_ARCH_32_BITS_FALSE@test-sg: force
+@GRAS_ARCH_32_BITS_FALSE@test-sg: 
 @GRAS_ARCH_32_BITS_FALSE@      $(TESTS_ENVIRONMENT) test_sg_64
 
 test-rl: force
@@ -599,7 +599,7 @@ test-rl: force
 
 force:
 
-.PHONY: test_sg_32 test_SG_64 test_rl force
+.PHONY: test_sg_32 test_SG_64 test_rl 
 
 $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME).xml $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@
        [ x@EXEEXT@ = x ] || exenv=wine; $$exenv $(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME).xml
index 0aabfe1..bbc1893 100644 (file)
@@ -2,6 +2,7 @@ include_HEADERS = gras.h xbt.h
 nobase_include_HEADERS = \
        xbt/misc.h \
        xbt/sysdep.h \
+       xbt/virtu.h \
        xbt/str.h \
        xbt/function_types.h \
        xbt/asserts.h xbt/ex.h \
index d301b2b..de1d575 100644 (file)
@@ -221,6 +221,7 @@ include_HEADERS = gras.h xbt.h
 nobase_include_HEADERS = \
        xbt/misc.h \
        xbt/sysdep.h \
+       xbt/virtu.h \
        xbt/str.h \
        xbt/function_types.h \
        xbt/asserts.h xbt/ex.h \
index 81d5bb0..78fe16f 100644 (file)
@@ -49,7 +49,7 @@ XBT_PUBLIC(int) gras_os_myport(void);
  * Returns the process ID of the current process.  (This is often used
    by routines that generate unique temporary file names.)
  */
-XBT_PUBLIC(long int) gras_os_getpid(void);
+XBT_PUBLIC(int) gras_os_getpid(void);
 
 /** @} */
 SG_END_DECL()
index 9684a8c..3d72283 100644 (file)
@@ -14,8 +14,9 @@
 #ifndef __XBT_EX_H__
 #define __XBT_EX_H__
 
-#include <xbt/sysdep.h>
-#include <xbt/misc.h>
+#include "xbt/sysdep.h"
+#include "xbt/misc.h"
+#include "xbt/virtu.h"
 
 /* do not include execinfo.h directly since it's not always available. 
    Instead, copy the parts we need (and fake when it's not there) */
@@ -29,17 +30,16 @@ XBT_PUBLIC(int) backtrace (void **__array, int __size);
 # include <stdio.h>
 #include <errno.h>
 
-XBT_PUBLIC(int) gras_os_getpid(void);
 #  define MAYDAY_SAVE(m)    printf("%d %s:%d save %p\n",                \
-                                   gras_os_getpid(),__FILE__,__LINE__,  \
+                                   (*xbt_getpid)(),__FILE__,__LINE__,  \
                                    (m)->jb                              \
                                   ),
 #  define MAYDAY_RESTORE(m) printf("%d %s:%d restore %p\n",             \
-                                   gras_os_getpid(),__FILE__,__LINE__,  \
+                                   (*xbt_getpid)(),__FILE__,__LINE__,  \
                                    (m)->jb                              \
                                   ),
 #  define MAYDAY_CATCH(e)   printf("%d %s:%d Catched '%s'\n",           \
-                                   gras_os_getpid(),__FILE__,__LINE__,  \
+                                   (*xbt_getpid)(),__FILE__,__LINE__,  \
                                    e.msg                                \
                                  ),
 #else
@@ -228,9 +228,6 @@ typedef struct { __ex_mctx_struct } __ex_mctx_t;
  * @{
  */
 
-/* we need this symbol here, even if it breaks a bit the module separation */
-XBT_PUBLIC(long) int gras_os_getpid(void);
-
 /** @brief different kind of errors */
 typedef enum {
   unknown_error=0,  /**< unknown error */
@@ -257,7 +254,7 @@ typedef struct {
   char *host;     /**< NULL locally thrown exceptions; full hostname if remote ones */
   /* FIXME: host should be hostname:port[#thread] */
   char *procname; /**< Name of the process who thrown this */
-  long int pid;   /**< PID of the process who thrown this */
+  int pid;        /**< PID of the process who thrown this */
   char *file;     /**< Thrown point */
   int   line;     /**< Thrown point */
   char *func;     /**< Thrown point */
@@ -411,7 +408,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
      __xbt_ex_ctx()->ctx_ex.remote   = 0;                                     \
      __xbt_ex_ctx()->ctx_ex.host     = (char*)NULL;                           \
      __xbt_ex_ctx()->ctx_ex.procname = (char*)xbt_procname();                 \
-     __xbt_ex_ctx()->ctx_ex.pid      = gras_os_getpid();                      \
+     __xbt_ex_ctx()->ctx_ex.pid      = (*xbt_getpid)();                       \
      __xbt_ex_ctx()->ctx_ex.file     = (char*)__FILE__;                       \
      __xbt_ex_ctx()->ctx_ex.line     = __LINE__;                              \
      __xbt_ex_ctx()->ctx_ex.func     = (char*)_XBT_FUNCTION;                  \
index 7e476a7..0994fef 100644 (file)
@@ -28,4 +28,4 @@ SG_BEGIN_DECL()
 
 SG_END_DECL()
 
-#endif /* XBT_MISC_H */
+#endif /* XBT_FUNCTION_TYPE_H */
diff --git a/include/xbt/virtu.h b/include/xbt/virtu.h
new file mode 100644 (file)
index 0000000..e5e12c4
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+/* virtu - virtualization layer for XBT to choose between GRAS and MSG implementation */
+
+/*  Copyright (c) 2007 Martin Quinson                                       */
+/*  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. */
+
+#ifndef __XBT_VIRTU_H__
+#define __XBT_VIRTU_H__
+
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
+#include "xbt/function_types.h"
+
+SG_BEGIN_DECL()
+
+     /* Get the PID of the current process */
+     XBT_PUBLIC_DATA(int_f_void_t*) xbt_getpid;
+
+SG_END_DECL()
+
+#endif /* __XBT_VIRTU_H__ */
diff --git a/libtool b/libtool
index ce9db56..7cfbd4f 100755 (executable)
--- a/libtool
+++ b/libtool
@@ -325,7 +325,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=no
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../ /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /usr/lib/"
+sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../ /lib/i486-linux-gnu/4.1.3/ /lib/ /usr/lib/i486-linux-gnu/4.1.3/ /usr/lib/"
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu "
@@ -7405,11 +7405,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginS.o"
+predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.3/crtbeginS.o"
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o"
+postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crtn.o"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -7421,7 +7421,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
+compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -7501,7 +7501,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=no
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../i486-linux-gnu/4.1.2/ /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../ /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /usr/lib/"
+sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../i486-linux-gnu/4.1.3/ /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../ /lib/i486-linux-gnu/4.1.3/ /lib/ /usr/lib/i486-linux-gnu/4.1.3/ /usr/lib/"
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu "
index e87f858..2cce60c 100644 (file)
@@ -108,6 +108,7 @@ COMMON_SRC=\
   xbt/ex.c                                                                   \
   \
   xbt_modinter.h    gras_modinter.h                                          \
+  xbt/xbt_virtu.c                                                            \
   \
   xbt/sysdep.c                                                               \
   xbt/asserts.c                                                              \
@@ -251,6 +252,7 @@ BUILT_SOURCES=../include/surf/surfxml.h surf/surfxml.c \
 testall_SOURCES= $(TEST_UNITS) simgrid_units_main.c
 testall_LDADD=libgras.la
 TESTS=testall
+TESTS_ENVIRONMENT=$(SG_TEST_EXENV)
 
 EXTRA_DIST+=$(testall_SOURCES)
 
index 1384c6e..085091d 100644 (file)
@@ -77,15 +77,16 @@ am__installdirs = "$(DESTDIR)$(libdir)"
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libgras_la_LIBADD =
-am__objects_1 = snprintf.lo xbt_str.lo ex.lo sysdep.lo asserts.lo \
-       log.lo xbt_log_appender_file.lo xbt_log_layout_simple.lo \
-       xbt_log_layout_format.lo mallocator.lo dynar.lo dict.lo \
-       dict_elm.lo dict_cursor.lo dict_multi.lo heap.lo fifo.lo \
-       swag.lo graph.lo set.lo xbt_matrix.lo xbt_peer.lo xbt_main.lo \
-       config.lo cunit.lo graphxml_parse.lo gras.lo transport.lo \
-       msg.lo rpc.lo timer.lo process.lo gras_module.lo ddt_create.lo \
-       ddt_convert.lo ddt_exchange.lo cbps.lo datadesc.lo \
-       ddt_parse.lo ddt_parse.yy.lo
+am__objects_1 = snprintf.lo xbt_str.lo ex.lo xbt_virtu.lo sysdep.lo \
+       asserts.lo log.lo xbt_log_appender_file.lo \
+       xbt_log_layout_simple.lo xbt_log_layout_format.lo \
+       mallocator.lo dynar.lo dict.lo dict_elm.lo dict_cursor.lo \
+       dict_multi.lo heap.lo fifo.lo swag.lo graph.lo set.lo \
+       xbt_matrix.lo xbt_peer.lo xbt_main.lo config.lo cunit.lo \
+       graphxml_parse.lo gras.lo transport.lo msg.lo rpc.lo timer.lo \
+       process.lo gras_module.lo ddt_create.lo ddt_convert.lo \
+       ddt_exchange.lo cbps.lo datadesc.lo ddt_parse.lo \
+       ddt_parse.yy.lo
 am__objects_2 = rl_stubs.lo xbt_thread.lo rl_transport.lo \
        transport_plugin_file.lo transport_plugin_tcp.lo rl_emul.lo \
        rl_process.lo rl_time.lo rl_dns.lo rl_msg.lo
@@ -96,8 +97,8 @@ am_libgras_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
 libgras_la_OBJECTS = $(am_libgras_la_OBJECTS)
 libsimgrid_la_LIBADD =
 am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/xbt_str.c xbt/ex.c \
-       xbt_modinter.h gras_modinter.h xbt/sysdep.c xbt/asserts.c \
-       xbt/log.c xbt/xbt_log_appender_file.c \
+       xbt_modinter.h gras_modinter.h xbt/xbt_virtu.c xbt/sysdep.c \
+       xbt/asserts.c xbt/log.c xbt/xbt_log_appender_file.c \
        xbt/xbt_log_layout_simple.c xbt/xbt_log_layout_format.c \
        xbt/mallocator.c xbt/dynar.c xbt/dict.c xbt/dict_elm.c \
        xbt/dict_cursor.c xbt/dict_multi.c xbt/heap.c xbt/fifo.c \
@@ -399,20 +400,21 @@ VERSION_INFO = -version-info 2:0:0
 #   using this trick is ready for a "stable" release (say, in Debian).
 lib_LTLIBRARIES = libsimgrid.la libgras.la
 COMMON_SRC = xbt/snprintf.c xbt/xbt_str.c xbt/ex.c xbt_modinter.h \
-       gras_modinter.h xbt/sysdep.c xbt/asserts.c xbt/log.c \
-       xbt/xbt_log_appender_file.c xbt/xbt_log_layout_simple.c \
-       xbt/xbt_log_layout_format.c xbt/mallocator.c xbt/dynar.c \
-       xbt/dict.c xbt/dict_elm.c xbt/dict_cursor.c xbt/dict_multi.c \
-       xbt/heap.c xbt/fifo.c xbt/swag.c xbt/graph.c xbt/set.c \
-       xbt/xbt_matrix.c xbt/xbt_peer.c xbt/xbt_main.c xbt/config.c \
-       xbt/cunit.c xbt/graphxml_parse.c gras/gras.c \
-       gras/Transport/transport.c gras/Transport/transport_private.h \
-       gras/Msg/msg.c gras/Msg/rpc.c gras/Msg/timer.c \
-       gras/Msg/msg_interface.h gras/Msg/msg_private.h \
-       gras/Virtu/process.c gras/Virtu/gras_module.c \
-       gras/DataDesc/ddt_create.c gras/DataDesc/ddt_convert.c \
-       gras/DataDesc/ddt_exchange.c gras/DataDesc/cbps.c \
-       gras/DataDesc/datadesc.c gras/DataDesc/datadesc_interface.h \
+       gras_modinter.h xbt/xbt_virtu.c xbt/sysdep.c xbt/asserts.c \
+       xbt/log.c xbt/xbt_log_appender_file.c \
+       xbt/xbt_log_layout_simple.c xbt/xbt_log_layout_format.c \
+       xbt/mallocator.c xbt/dynar.c xbt/dict.c xbt/dict_elm.c \
+       xbt/dict_cursor.c xbt/dict_multi.c xbt/heap.c xbt/fifo.c \
+       xbt/swag.c xbt/graph.c xbt/set.c xbt/xbt_matrix.c \
+       xbt/xbt_peer.c xbt/xbt_main.c xbt/config.c xbt/cunit.c \
+       xbt/graphxml_parse.c gras/gras.c gras/Transport/transport.c \
+       gras/Transport/transport_private.h gras/Msg/msg.c \
+       gras/Msg/rpc.c gras/Msg/timer.c gras/Msg/msg_interface.h \
+       gras/Msg/msg_private.h gras/Virtu/process.c \
+       gras/Virtu/gras_module.c gras/DataDesc/ddt_create.c \
+       gras/DataDesc/ddt_convert.c gras/DataDesc/ddt_exchange.c \
+       gras/DataDesc/cbps.c gras/DataDesc/datadesc.c \
+       gras/DataDesc/datadesc_interface.h \
        gras/DataDesc/datadesc_private.h gras/DataDesc/ddt_parse.c \
        gras/DataDesc/ddt_parse.yy.c gras/DataDesc/ddt_parse.yy.h
 RL_SRC = \
@@ -486,6 +488,7 @@ AMOK_SRC = \
 @GRAMINE_MODE_FALSE@testall_SOURCES = $(TEST_UNITS) simgrid_units_main.c
 @GRAMINE_MODE_FALSE@testall_LDADD = libgras.la
 @GRAMINE_MODE_FALSE@TESTS = testall
+@GRAMINE_MODE_FALSE@TESTS_ENVIRONMENT = $(SG_TEST_EXENV)
 
 ###
 ### Declare the library content
@@ -703,6 +706,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_str.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_str_unit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_thread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_virtu.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -746,6 +750,13 @@ ex.lo: xbt/ex.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex.lo `test -f 'xbt/ex.c' || echo '$(srcdir)/'`xbt/ex.c
 
+xbt_virtu.lo: xbt/xbt_virtu.c
+@am__fastdepCC_TRUE@   if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_virtu.lo -MD -MP -MF "$(DEPDIR)/xbt_virtu.Tpo" -c -o xbt_virtu.lo `test -f 'xbt/xbt_virtu.c' || echo '$(srcdir)/'`xbt/xbt_virtu.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xbt_virtu.Tpo" "$(DEPDIR)/xbt_virtu.Plo"; else rm -f "$(DEPDIR)/xbt_virtu.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xbt/xbt_virtu.c' object='xbt_virtu.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_virtu.lo `test -f 'xbt/xbt_virtu.c' || echo '$(srcdir)/'`xbt/xbt_virtu.c
+
 sysdep.lo: xbt/sysdep.c
 @am__fastdepCC_TRUE@   if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sysdep.lo -MD -MP -MF "$(DEPDIR)/sysdep.Tpo" -c -o sysdep.lo `test -f 'xbt/sysdep.c' || echo '$(srcdir)/'`xbt/sysdep.c; \
 @am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/sysdep.Tpo" "$(DEPDIR)/sysdep.Plo"; else rm -f "$(DEPDIR)/sysdep.Tpo"; exit 1; fi
index e7b59a4..32134a9 100644 (file)
@@ -145,7 +145,7 @@ void gras_trp_sg_socket_client(gras_trp_plugin_t self,
   sock->data = data;
   sock->incoming = 1;
 
-  DEBUG5("%s (PID %ld) connects in %s mode to %s:%d",
+  DEBUG5("%s (PID %d) connects in %s mode to %s:%d",
          SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid(),
          sock->meas?"meas":"regular",
         sock->peer_name,sock->peer_port);
@@ -199,7 +199,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self,
 
   sock->data = data;
 
-  VERB6("'%s' (%ld) ears on %s:%d%s (%p)",
+  VERB6("'%s' (%d) ears on %s:%d%s (%p)",
     SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid(),
     host,sock->port,sock->meas? " (mode meas)":"",sock);
 
index d044831..7219c9a 100644 (file)
@@ -29,7 +29,7 @@ const char *xbt_procname(void) {
   else return "";
 }
 
-long int gras_os_getpid(void) {
+int gras_os_getpid(void) {
        #ifdef _WIN32
        return (long int) GetCurrentProcess();
        #else
index 017d860..ff44d66 100644 (file)
@@ -50,7 +50,7 @@ gras_process_init() {
        trp_pd->cond = SIMIX_cond_init();
        trp_pd->active_socket = xbt_fifo_new();
 
-  VERB2("Creating process '%s' (%ld)",
+  VERB2("Creating process '%s' (%d)",
           SIMIX_process_get_name(SIMIX_process_self()),
           gras_os_getpid());
 }
@@ -75,11 +75,11 @@ gras_process_exit() {
 
   xbt_assert0(hd,"Run gras_process_init (ie, gras_init)!!");
 
-  VERB2("GRAS: Finalizing process '%s' (%ld)",
+  VERB2("GRAS: Finalizing process '%s' (%d)",
        SIMIX_process_get_name(SIMIX_process_self()),gras_os_getpid());
 
   if (xbt_dynar_length(msg_pd->msg_queue))
-    WARN1("process %ld terminated, but some messages are still queued",
+    WARN1("process %d terminated, but some messages are still queued",
          gras_os_getpid());
 
        /* if each process has its sockets list, we need to close them when the process finish */
@@ -130,7 +130,7 @@ const char* xbt_procname(void) {
     return "";
 }
 
-long int gras_os_getpid(void) {
+int gras_os_getpid(void) {
 
   smx_process_t process = SIMIX_process_self();
        
index 275e2ec..394012c 100644 (file)
@@ -34,8 +34,8 @@ typedef struct {
    */
   xbt_dynar_t moddata;
        
-       long int pid; /* pid of process, only for SG */
-       long int ppid; /* ppid of process, only for SG */
+  int pid; /* pid of process, only for SG */
+  int ppid; /* ppid of process, only for SG */
 } gras_procdata_t;
 
 gras_procdata_t *gras_procdata_get(void);
index 5368343..4ab3eea 100644 (file)
@@ -9,6 +9,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/log.h"
+#include "xbt/virtu.h" /* set the XBT virtualization to use GRAS */
 #include "xbt/module.h" /* xbt_init/exit */
 
 #include "Virtu/virtu_interface.h" /* Module mechanism FIXME: deplace&rename */
@@ -44,7 +45,8 @@ static void gras_sigint_handler(int sig) {
 void gras_init(int *argc,char **argv) {
 
   VERB0("Initialize GRAS");
-  
+
+  xbt_getpid = &gras_os_getpid;
   /* First initialize the XBT */
   xbt_init(argc,argv);
    
index a09b97c..9f9fcea 100644 (file)
@@ -10,6 +10,7 @@
 #include "msg/private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
+#include "xbt/virtu.h"
 #include "xbt/ex.h" /* ex_backtrace_display */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");    
@@ -41,6 +42,7 @@ void MSG_global_init_args(int *argc, char **argv)
  */
 void MSG_global_init(int *argc, char **argv)
 {
+  xbt_getpid = & MSG_process_self_PID;
   if (!msg_global) {
     SIMIX_global_init(argc, argv);
      
index 075ab29..645acba 100644 (file)
@@ -245,13 +245,13 @@ void xbt_ex_display(xbt_ex_t *e)  {
   char *thrower=NULL;
 
   if (e->remote)
-    bprintf(" on host %s(%ld)",e->host,e->pid);
+    bprintf(" on host %s(%d)",e->host,e->pid);
 
   fprintf(stderr,
-         "** SimGrid: UNCAUGHT EXCEPTION received on %s(%ld): category: %s; value: %d\n"
+         "** SimGrid: UNCAUGHT EXCEPTION received on %s(%d): category: %s; value: %d\n"
          "** %s\n"
          "** Thrown by %s()%s\n",
-         gras_os_myname(),gras_os_getpid(),
+         gras_os_myname(),(*xbt_getpid)(),
          xbt_ex_catname(e->category), e->value, e->msg,
          e->procname,thrower?thrower:" in this process");
   CRITICAL1("%s",e->msg);
index 9a8f413..390208d 100644 (file)
 #include "xbt/misc.h"
 #include "xbt/ex.h"
 #include "xbt/sysdep.h"
-#include <xbt/log.h>
+#include "xbt/log.h"
 #include "xbt/dynar.h"
 
+XBT_PUBLIC_DATA(int) (*xbt_pid)();
+
 /** \addtogroup XBT_log
  *
  *  This section describes the API to the log functions used 
index 3321e5a..27ac36b 100644 (file)
@@ -89,9 +89,9 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l,
        break;
       case 'i': /* process PID name; SimGrid extension */
        if (precision == -1)
-          p += sprintf(p, "%ld", gras_os_getpid());
+          p += sprintf(p, "%d", (*xbt_getpid)());
         else {       
-          p += sprintf(p, "%.*ld", precision, gras_os_getpid());
+          p += sprintf(p, "%.*d", precision, (*xbt_getpid)());
           precision = -1;
        }        
        break;
index f13017d..5933bf9 100644 (file)
@@ -35,8 +35,8 @@ static char *xbt_log_layout_simple_doit(xbt_log_layout_t l,
   p += sprintf(res,"[");;
   /* Display the proc info if available */
   if(strlen(xbt_procname()))
-    p += sprintf(p,"%s:%s:(%ld) ", 
-                gras_os_myname(), xbt_procname(),gras_os_getpid());
+    p += sprintf(p,"%s:%s:(%d) ", 
+                gras_os_myname(), xbt_procname(),(*xbt_getpid)());
 
   /* Display the date */
   p += sprintf(p,"%f] ", gras_os_time()-begin_of_time);
diff --git a/src/xbt/xbt_virtu.c b/src/xbt/xbt_virtu.c
new file mode 100644 (file)
index 0000000..0e05bd3
--- /dev/null
@@ -0,0 +1,19 @@
+/* $Id$ */
+
+/* virtu - virtualization layer for XBT to choose between GRAS and MSG implementation */
+
+/* Copyright (c) 2007 Martin Quinson. 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. */
+
+#include "xbt/misc.h"
+#include "xbt/virtu.h"
+#include "xbt/function_types.h"
+
+static int xbt_fake_pid(void) {
+   return 0;
+}
+
+int_f_void_t *xbt_getpid=&xbt_fake_pid;
+