Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
first try at killing GRAS -- does not compile yet
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 22 Nov 2012 14:33:49 +0000 (15:33 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 22 Nov 2012 14:33:49 +0000 (15:33 +0100)
318 files changed:
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Distrib.cmake
buildtools/Cmake/MaintainerMode.cmake
buildtools/Cmake/MakeExe.cmake
buildtools/Cmake/MakeLib.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/Supernovae.cmake
buildtools/Cmake/UnitTesting.cmake
buildtools/Cmake/src/simgrid.nsi.in
buildtools/Cmake/test_prog/prog_GRAS_ARCH.c [deleted file]
buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c [deleted file]
doc/gras_comm.png [deleted file]
doc/gtut-files/01-bones.c [deleted file]
doc/gtut-files/01-bones.output [deleted file]
doc/gtut-files/02-simple.c [deleted file]
doc/gtut-files/02-simple.output [deleted file]
doc/gtut-files/03-args.c [deleted file]
doc/gtut-files/03-args.output [deleted file]
doc/gtut-files/03-args.xml [deleted file]
doc/gtut-files/04-callback.c [deleted file]
doc/gtut-files/04-callback.output [deleted file]
doc/gtut-files/05-globals.c [deleted file]
doc/gtut-files/05-globals.output [deleted file]
doc/gtut-files/06-logs.c [deleted file]
doc/gtut-files/06-logs.output [deleted file]
doc/gtut-files/06-logs.output.error [deleted file]
doc/gtut-files/06-logs.output.fmt [deleted file]
doc/gtut-files/06-logs.output.fmt-bt [deleted file]
doc/gtut-files/06-logs.output.verbose [deleted file]
doc/gtut-files/07-timers.c [deleted file]
doc/gtut-files/07-timers.output [deleted file]
doc/gtut-files/08-exceptions.c [deleted file]
doc/gtut-files/08-exceptions.output [deleted file]
doc/gtut-files/09-datatype-dump.c [deleted file]
doc/gtut-files/09-simpledata.c [deleted file]
doc/gtut-files/09-simpledata.output [deleted file]
doc/gtut-files/10-rpc.c [deleted file]
doc/gtut-files/10-rpc.output [deleted file]
doc/gtut-files/11-explicitwait.c [deleted file]
doc/gtut-files/11-explicitwait.output [deleted file]
doc/gtut-files/11-explicitwait.xml [deleted file]
doc/gtut-files/Makefile [deleted file]
doc/gtut-files/README [deleted file]
doc/gtut-files/gtut-howto-design.doc [deleted file]
doc/gtut-files/gtut-howto.doc [deleted file]
doc/gtut-files/gtut-introduction.doc [deleted file]
doc/gtut-files/gtut-main.doc [deleted file]
doc/gtut-files/gtut-platform-3nodes.xml [deleted file]
doc/gtut-files/gtut-platform.xml [deleted file]
doc/gtut-files/gtut-tour-00-install.doc [deleted file]
doc/gtut-files/gtut-tour-01-bones.doc [deleted file]
doc/gtut-files/gtut-tour-02-simple.doc [deleted file]
doc/gtut-files/gtut-tour-03-args.doc [deleted file]
doc/gtut-files/gtut-tour-04-callback.doc [deleted file]
doc/gtut-files/gtut-tour-05-globals.doc [deleted file]
doc/gtut-files/gtut-tour-06-logs.doc [deleted file]
doc/gtut-files/gtut-tour-07-timers.doc [deleted file]
doc/gtut-files/gtut-tour-08-exceptions.doc [deleted file]
doc/gtut-files/gtut-tour-09-simpledata.doc [deleted file]
doc/gtut-files/gtut-tour-10-rpc.doc [deleted file]
doc/gtut-files/gtut-tour-11-explicitwait.doc [deleted file]
doc/gtut-files/gtut-tour-12-staticstruct.doc [deleted file]
doc/gtut-files/gtut-tour-13-pointers.doc [deleted file]
doc/gtut-files/gtut-tour-14-dynar.doc [deleted file]
doc/gtut-files/gtut-tour-15-manualdatadef.doc [deleted file]
doc/gtut-files/gtut-tour-16-exchangecb.doc [deleted file]
doc/gtut-files/gtut-tour-recap-messages.doc [deleted file]
doc/gtut-files/gtut-tour.doc [deleted file]
doc/gtut-files/test.xml [deleted file]
doc/ref_guide/doxygen/module-gras.doc [deleted file]
examples/amok/alnem/alnem.c [deleted file]
examples/amok/alnem/alnem_builder.c [deleted file]
examples/amok/alnem/alnem_deployment.txt [deleted file]
examples/amok/alnem/deploy_WAN3.txt [deleted file]
examples/amok/alnem/interference.dat [deleted file]
examples/amok/bandwidth/CMakeLists.txt [deleted file]
examples/amok/bandwidth/bandwidth.c [deleted file]
examples/amok/bandwidth/bandwidth.xml [deleted file]
examples/amok/bandwidth/bandwidth_rl.tesh [deleted file]
examples/amok/bandwidth/bandwidth_sg_32.tesh [deleted file]
examples/amok/bandwidth/bandwidth_sg_64.tesh [deleted file]
examples/amok/saturate/CMakeLists.txt [deleted file]
examples/amok/saturate/env.c [deleted file]
examples/amok/saturate/medium_deployment.xml [deleted file]
examples/amok/saturate/saturate.c [deleted file]
examples/amok/saturate/saturate.xml [deleted file]
examples/amok/saturate/saturate_rl.tesh [deleted file]
examples/amok/saturate/saturate_sg_32.tesh [deleted file]
examples/amok/saturate/saturate_sg_64.tesh [deleted file]
examples/gras/all2all/CMakeLists.txt [deleted file]
examples/gras/all2all/all2all.c [deleted file]
examples/gras/all2all/all2all.xml [deleted file]
examples/gras/all2all/make_deployment.pl [deleted file]
examples/gras/all2all/run.sh [deleted file]
examples/gras/all2all/test_rl.tesh [deleted file]
examples/gras/all2all/test_sg_32.tesh [deleted file]
examples/gras/all2all/test_sg_64.tesh [deleted file]
examples/gras/chrono/CMakeLists.txt [deleted file]
examples/gras/chrono/chrono.c [deleted file]
examples/gras/chrono/chrono.xml [deleted file]
examples/gras/chrono/chrono2.c [deleted file]
examples/gras/chrono/test_rl.tesh [deleted file]
examples/gras/chrono/test_sg_32.tesh [deleted file]
examples/gras/chrono/test_sg_64.tesh [deleted file]
examples/gras/console/CMakeLists.txt [deleted file]
examples/gras/console/gras_platform_script.lua [deleted file]
examples/gras/console/ping.h [deleted file]
examples/gras/console/ping_client.c [deleted file]
examples/gras/console/ping_common.c [deleted file]
examples/gras/console/ping_generator.lua [deleted file]
examples/gras/console/ping_server.c [deleted file]
examples/gras/mmrpc/CMakeLists.txt [deleted file]
examples/gras/mmrpc/mmrpc.c [deleted file]
examples/gras/mmrpc/mmrpc.h [deleted file]
examples/gras/mmrpc/mmrpc.xml [deleted file]
examples/gras/mmrpc/mmrpc_client.c [deleted file]
examples/gras/mmrpc/mmrpc_common.c [deleted file]
examples/gras/mmrpc/mmrpc_server.c [deleted file]
examples/gras/mmrpc/test_rl.tesh [deleted file]
examples/gras/mmrpc/test_sg_32.tesh [deleted file]
examples/gras/mmrpc/test_sg_64.tesh [deleted file]
examples/gras/mutual_exclusion/simple_token/CMakeLists.txt [deleted file]
examples/gras/mutual_exclusion/simple_token/make_deployment.pl [deleted file]
examples/gras/mutual_exclusion/simple_token/run.sh [deleted file]
examples/gras/mutual_exclusion/simple_token/simple_token.c [deleted file]
examples/gras/mutual_exclusion/simple_token/simple_token.xml [deleted file]
examples/gras/mutual_exclusion/simple_token/test_rl.tesh [deleted file]
examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh [deleted file]
examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh [deleted file]
examples/gras/p2p/can/can.c [deleted file]
examples/gras/p2p/can/can.xml [deleted file]
examples/gras/p2p/can/can_tests.c [deleted file]
examples/gras/p2p/can/test_rl.in [deleted file]
examples/gras/p2p/can/test_sg.in [deleted file]
examples/gras/p2p/can/types.h [deleted file]
examples/gras/p2p/chord/chord.c [deleted file]
examples/gras/p2p/chord/chord.xml [deleted file]
examples/gras/p2p/chord/test_rl.in [deleted file]
examples/gras/p2p/chord/test_sg.in [deleted file]
examples/gras/ping/CMakeLists.txt [deleted file]
examples/gras/ping/ping.h [deleted file]
examples/gras/ping/ping.xml [deleted file]
examples/gras/ping/ping_client.c [deleted file]
examples/gras/ping/ping_common.c [deleted file]
examples/gras/ping/ping_server.c [deleted file]
examples/gras/ping/test_rl.tesh [deleted file]
examples/gras/ping/test_sg_32.tesh [deleted file]
examples/gras/ping/test_sg_64.tesh [deleted file]
examples/gras/pmm/CMakeLists.txt [deleted file]
examples/gras/pmm/make_deployment.pl [deleted file]
examples/gras/pmm/pmm.c [deleted file]
examples/gras/pmm/pmm.xml [deleted file]
examples/gras/pmm/test_rl.tesh [deleted file]
examples/gras/pmm/test_sg_32.tesh [deleted file]
examples/gras/pmm/test_sg_64.tesh [deleted file]
examples/gras/properties/CMakeLists.txt [deleted file]
examples/gras/properties/properties.c [deleted file]
examples/gras/properties/properties.xml [deleted file]
examples/gras/properties/test_rl.tesh [deleted file]
examples/gras/properties/test_sg.tesh [deleted file]
examples/gras/replay/do_simulation.pl [deleted file]
examples/gras/replay/replay.c [deleted file]
examples/gras/replay/replay.xml [deleted file]
examples/gras/replay/workload.h [deleted file]
examples/gras/replay/xbt_workload.c [deleted file]
examples/gras/rpc/CMakeLists.txt [deleted file]
examples/gras/rpc/rpc.c [deleted file]
examples/gras/rpc/rpc.xml [deleted file]
examples/gras/rpc/test_rl.tesh [deleted file]
examples/gras/rpc/test_sg_32.tesh [deleted file]
examples/gras/rpc/test_sg_64.tesh [deleted file]
examples/gras/spawn/CMakeLists.txt [deleted file]
examples/gras/spawn/spawn.c [deleted file]
examples/gras/spawn/spawn.h [deleted file]
examples/gras/spawn/spawn.xml [deleted file]
examples/gras/spawn/test_rl.tesh [deleted file]
examples/gras/spawn/test_sg_32.tesh [deleted file]
examples/gras/spawn/test_sg_64.tesh [deleted file]
examples/gras/synchro/CMakeLists.txt [deleted file]
examples/gras/synchro/philosopher.c [deleted file]
examples/gras/synchro/synchro.xml [deleted file]
examples/gras/synchro/test_rl.tesh [deleted file]
examples/gras/synchro/test_sg_32.tesh [deleted file]
examples/gras/synchro/test_sg_64.tesh [deleted file]
examples/gras/tests.mk [deleted file]
examples/gras/timer/CMakeLists.txt [deleted file]
examples/gras/timer/test_rl.tesh [deleted file]
examples/gras/timer/test_sg_32.tesh [deleted file]
examples/gras/timer/test_sg_64.tesh [deleted file]
examples/gras/timer/timer.c [deleted file]
examples/gras/timer/timer.xml [deleted file]
examples/platforms/content/storage_content.txt
examples/temps-gras-stub.mk [deleted file]
include/amok/bandwidth.h [deleted file]
include/amok/base.h [deleted file]
include/amok/peermanagement.h [deleted file]
include/gras.h [deleted file]
include/gras/emul.h [deleted file]
include/gras/messages.h [deleted file]
include/gras/module.h [deleted file]
include/gras/process.h [deleted file]
include/gras/timer.h [deleted file]
include/gras/transport.h [deleted file]
include/gras/virtu.h [deleted file]
include/xbt/socket.h [deleted file]
include/xbt/time.h [deleted file]
include/xbt/virtu.h
src/amok/Bandwidth/bandwidth.c [deleted file]
src/amok/Bandwidth/bandwidth_private.h [deleted file]
src/amok/Bandwidth/saturate.c [deleted file]
src/amok/PeerManagement/peermanagement.c [deleted file]
src/amok/amok_base.c [deleted file]
src/amok/amok_modinter.h [deleted file]
src/gras/Msg/gras_msg_exchange.c [deleted file]
src/gras/Msg/gras_msg_listener.c [deleted file]
src/gras/Msg/gras_msg_mod.c [deleted file]
src/gras/Msg/gras_msg_types.c [deleted file]
src/gras/Msg/msg_interface.h [deleted file]
src/gras/Msg/msg_private.h [deleted file]
src/gras/Msg/rl_msg.c [deleted file]
src/gras/Msg/rpc.c [deleted file]
src/gras/Msg/sg_msg.c [deleted file]
src/gras/Msg/timer.c [deleted file]
src/gras/Transport/README [deleted file]
src/gras/Transport/rl_transport.c [deleted file]
src/gras/Transport/sg_transport.c [deleted file]
src/gras/Transport/transport.c [deleted file]
src/gras/Transport/transport_interface.h [deleted file]
src/gras/Transport/transport_plugin_file.c [deleted file]
src/gras/Transport/transport_plugin_sg.c [deleted file]
src/gras/Transport/transport_private.h [deleted file]
src/gras/Virtu/gras_module.c [deleted file]
src/gras/Virtu/process.c [deleted file]
src/gras/Virtu/rl_dns.c [deleted file]
src/gras/Virtu/rl_emul.c [deleted file]
src/gras/Virtu/rl_process.c [deleted file]
src/gras/Virtu/sg_dns.c [deleted file]
src/gras/Virtu/sg_emul.c [deleted file]
src/gras/Virtu/sg_process.c [deleted file]
src/gras/Virtu/virtu_interface.h [deleted file]
src/gras/Virtu/virtu_private.h [deleted file]
src/gras/Virtu/virtu_rl.h [deleted file]
src/gras/Virtu/virtu_sg.h [deleted file]
src/gras/gras.c [deleted file]
src/gras/rl_stubs.c [deleted file]
src/smpi/smpi_base.c
src/surf/surf.c
src/xbt/datadesc/cbps.c [deleted file]
src/xbt/datadesc/datadesc.c [deleted file]
src/xbt/datadesc/datadesc_interface.h [deleted file]
src/xbt/datadesc/datadesc_private.h [deleted file]
src/xbt/datadesc/ddt_convert.c [deleted file]
src/xbt/datadesc/ddt_create.c [deleted file]
src/xbt/datadesc/ddt_exchange.c [deleted file]
src/xbt/datadesc/ddt_parse.c [deleted file]
src/xbt/datadesc/ddt_parse.yy.c [deleted file]
src/xbt/datadesc/ddt_parse.yy.h [deleted file]
src/xbt/datadesc/ddt_parse.yy.l [deleted file]
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_queue.c
src/xbt/xbt_rl_time.c [deleted file]
src/xbt/xbt_sg_time.c [deleted file]
src/xbt/xbt_socket.c [deleted file]
src/xbt/xbt_socket_private.h [deleted file]
src/xbt/xbt_trp_plugin_tcp.c [deleted file]
src/xbt/xbt_virtu.c
teshsuite/gras/CMakeLists.txt [deleted file]
teshsuite/gras/README [deleted file]
teshsuite/gras/datadesc/CMakeLists.txt [deleted file]
teshsuite/gras/datadesc/datadesc.big32_8_4 [deleted file]
teshsuite/gras/datadesc/datadesc.big64 [deleted file]
teshsuite/gras/datadesc/datadesc.little32_4 [deleted file]
teshsuite/gras/datadesc/datadesc.little64 [deleted file]
teshsuite/gras/datadesc/datadesc.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_mem.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_r_little32_4.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_r_little64.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_rw.tesh [deleted file]
teshsuite/gras/datadesc/datadesc_structs.c [deleted file]
teshsuite/gras/datadesc/datadesc_usage.c [deleted file]
teshsuite/gras/datadesc/mk_datadesc_structs.pl [deleted file]
teshsuite/gras/empty_main/CMakeLists.txt [deleted file]
teshsuite/gras/empty_main/empty_main.c [deleted file]
teshsuite/gras/empty_main/empty_main.xml [deleted file]
teshsuite/gras/empty_main/test_rl.tesh [deleted file]
teshsuite/gras/empty_main/test_sg.tesh [deleted file]
teshsuite/gras/gras.tesh [deleted file]
teshsuite/gras/msg_handle/CMakeLists.txt [deleted file]
teshsuite/gras/msg_handle/msg_handle.c [deleted file]
teshsuite/gras/msg_handle/msg_handle.xml [deleted file]
teshsuite/gras/msg_handle/test_rl.tesh [deleted file]
teshsuite/gras/msg_handle/test_sg_32.tesh [deleted file]
teshsuite/gras/msg_handle/test_sg_64.tesh [deleted file]
teshsuite/gras/numerous_rpc/CMakeLists.txt [deleted file]
teshsuite/gras/numerous_rpc/numerous_rpc.c [deleted file]
teshsuite/gras/numerous_rpc/numerous_rpc.xml [deleted file]
teshsuite/gras/small_sleep/CMakeLists.txt [deleted file]
teshsuite/gras/small_sleep/small_sleep.c [deleted file]
teshsuite/gras/small_sleep/small_sleep.xml [deleted file]
teshsuite/gras/small_sleep/test_sg_32.tesh [deleted file]
teshsuite/gras/small_sleep/test_sg_64.tesh [deleted file]
teshsuite/xbt/log_large_test.c
tools/gras/CMakeLists.txt [deleted file]
tools/gras/gras_stub_generator.h [deleted file]
tools/gras/s_smx_process_t [deleted file]
tools/gras/s_smx_simcall_t [deleted file]
tools/gras/struct_diff.c [deleted file]
tools/gras/stub_generator.bpf [deleted file]
tools/gras/stub_generator.bpr [deleted file]
tools/gras/stub_generator.c [deleted file]
tools/gras/stub_generator4borland.mak [deleted file]
tools/gras/unix_stub_generator.c [deleted file]
tools/gras/windows_stub_generator.c [deleted file]

index dcf4074..82f8524 100644 (file)
@@ -469,143 +469,6 @@ if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/ AND NOT WIN32)
   endif()
 endif()
 
   endif()
 endif()
 
-###################################
-## SimGrid and GRAS specific checks
-##
-
-IF(NOT CMAKE_CROSSCOMPILING)
-  # Check architecture signature begin
-  try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_GRAS_ARCH.c
-    RUN_OUTPUT_VARIABLE var1
-    )
-  if(BIGENDIAN)
-    set(val_big "B${var1}")
-    set(GRAS_BIGENDIAN 1)
-  else()
-    set(val_big "l${var1}")
-    set(GRAS_BIGENDIAN 0)
-  endif()
-
-  # The syntax of this magic string is given in src/xbt/datadesc/ddt_convert.c
-  # It kinda matches the values that the xbt_arch_desc_t structure can take
-
-  # Basically, the syntax is one char l or B for endianness (little or Big)
-  #   then there is a bunch of blocks separated by _.
-  # C block is for char, I block for integers, P block for pointers and
-  #   D block for floating points
-  # For each block there is an amount of chuncks separated by :, each of
-  #   them describing a data size. For example there is only one chunk
-  #   in the char block, because no architecture provide several sizes
-  #   of chars. In integer block, there is 4 chunks: "short int", "int",
-  #   "long int", "long long int". There is 2 pointer chunks for data
-  #   pointers and pointers on functions (thanks to the AMD64 madness).
-  #   Thee two floating points chuncks are for "float" and "double".
-  # Each chunk is of the form datasize/minimal_alignment_size
-
-  # These informations are used to convert a data stream from one
-  #    formalism to another. Only the GRAS_ARCH is transfered in the
-  #    stream, and it it of cruxial importance to keep these detection
-  #    information here synchronized with the data hardcoded in the
-  #    source in src/xbt/datadesc/ddt_convert.c
-
-  # If you add something here (like a previously unknown architecture),
-  #    please add it to the source code too.
-  # Please do not modify stuff here since it'd break the GRAS protocol.
-  #     If you really need to change stuff, please also bump
-  #    GRAS_PROTOCOL_VERSION in src/gras/Msg/msg_interface.h
-
-  SET(GRAS_THISARCH "none")
-
-  if(val_big MATCHES "l_C:1/1:_I:2/1:4/1:4/1:8/1:_P:4/1:4/1:_D:4/1:8/1:")
-    #gras_arch=0; gras_size=32; gras_arch_name=little32_1;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 0)
-  endif()
-  if(val_big MATCHES "l_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:")
-    #gras_arch=1; gras_size=32; gras_arch_name=little32_2;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 1)
-  endif()
-  if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:")
-    #gras_arch=2; gras_size=32; gras_arch_name=little32_4;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 2)
-  endif()
-  if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:")
-    #gras_arch=3; gras_size=32; gras_arch_name=little32_8;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 3)
-  endif()
-  if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
-    #gras_arch=4; gras_size=64; gras_arch_name=little64;
-    SET(GRAS_ARCH_32_BITS 0)
-    SET(GRAS_THISARCH 4)
-  endif()
-  if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:8/8:8/8:_D:4/4:8/8:")
-    #gras_arch=5; gras_size=64; gras_arch_name=little64_2;
-    SET(GRAS_ARCH_32_BITS 0)
-    SET(GRAS_THISARCH 5)
-  endif()
-
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:")
-    #gras_arch=6; gras_size=32; gras_arch_name=big32_8;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 6)
-  endif()
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:")
-    #gras_arch=7; gras_size=32; gras_arch_name=big32_8_4;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 7)
-  endif()
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:")
-    #gras_arch=8; gras_size=32; gras_arch_name=big32_4;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 8)
-  endif()
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:")
-    #gras_arch=9; gras_size=32; gras_arch_name=big32_2;
-    SET(GRAS_ARCH_32_BITS 1)
-    SET(GRAS_THISARCH 9)
-  endif()
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
-    #gras_arch=10; gras_size=64; gras_arch_name=big64;
-    SET(GRAS_ARCH_32_BITS 0)
-    SET(GRAS_THISARCH 10)
-  endif()
-  if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4:")
-    #gras_arch=11; gras_size=64; gras_arch_name=big64_8_4;
-    SET(GRAS_ARCH_32_BITS 0)
-    SET(GRAS_THISARCH 11)
-  endif()
-
-  if(GRAS_THISARCH MATCHES "none")
-    message(STATUS "architecture: ${val_big}")
-    message(FATAL_ERROR "GRAS_THISARCH is empty: '${GRAS_THISARCH}'")
-  endif()
-
-  # Check architecture signature end
-  try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c
-    RUN_OUTPUT_VARIABLE var2
-    )
-  separate_arguments(var2)
-  foreach(var_tmp ${var2})
-    set(${var_tmp} 1)
-  endforeach(var_tmp ${var2})
-
-  # Check for [SIZEOF_MAX]
-  try_run(RUN_SM_VAR COMPILE_SM_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_max_size.c
-    RUN_OUTPUT_VARIABLE var3
-    )
-  message(STATUS "SIZEOF_MAX ${var3}")
-  SET(SIZEOF_MAX ${var3})
-ENDIF()
-
 #--------------------------------------------------------------------------------------------------
 
 set(makecontext_CPPFLAGS_2 "")
 #--------------------------------------------------------------------------------------------------
 
 set(makecontext_CPPFLAGS_2 "")
@@ -940,7 +803,6 @@ set(generated_files_to_clean
   ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   ${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
   ${CMAKE_BINARY_DIR}/src/supernovae_sg.c
   ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   ${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
   ${CMAKE_BINARY_DIR}/src/supernovae_sg.c
-  ${CMAKE_BINARY_DIR}/src/supernovae_gras.c
   ${CMAKE_BINARY_DIR}/src/supernovae_smpi.c
   )
 
   ${CMAKE_BINARY_DIR}/src/supernovae_smpi.c
   )
 
index da375fb..83ac2b1 100644 (file)
@@ -3,11 +3,6 @@
 set(EXTRA_DIST
   src/amok/Bandwidth/bandwidth_private.h
   src/amok/amok_modinter.h
 set(EXTRA_DIST
   src/amok/Bandwidth/bandwidth_private.h
   src/amok/amok_modinter.h
-  src/gras/Transport/transport_interface.h
-  src/gras/Virtu/virtu_interface.h
-  src/gras/Virtu/virtu_private.h
-  src/gras/Virtu/virtu_rl.h
-  src/gras/Virtu/virtu_sg.h
   src/include/mc/datatypes.h
   src/include/mc/mc.h
   src/include/simgrid/platf_interface.h
   src/include/mc/datatypes.h
   src/include/mc/mc.h
   src/include/simgrid/platf_interface.h
@@ -67,8 +62,6 @@ set(EXTRA_DIST
   src/xbt/backtrace_dummy.c
   src/xbt/backtrace_linux.c
   src/xbt/backtrace_windows.c
   src/xbt/backtrace_dummy.c
   src/xbt/backtrace_linux.c
   src/xbt/backtrace_windows.c
-  src/xbt/datadesc/ddt_parse.yy.h
-  src/xbt/datadesc/ddt_parse.yy.l
   src/xbt/dict_private.h
   src/xbt/ex_interface.h
   src/xbt/fifo_private.h
   src/xbt/dict_private.h
   src/xbt/ex_interface.h
   src/xbt/fifo_private.h
@@ -92,7 +85,6 @@ set(EXTRA_DIST
   src/xbt/mmalloc/mmtrace.awk
   src/xbt/mmalloc/mrealloc.c
   src/xbt/setset_private.h
   src/xbt/mmalloc/mmtrace.awk
   src/xbt/mmalloc/mrealloc.c
   src/xbt/setset_private.h
-  tools/gras/gras_stub_generator.h
   tools/tesh/run_context.h
   tools/tesh/tesh.h
   )
   tools/tesh/run_context.h
   tools/tesh/tesh.h
   )
@@ -133,16 +125,6 @@ else()
   )
 endif()
 
   )
 endif()
 
-set(GRAS_RL_SRC
-  ${XBT_RL_SRC}
-  src/gras/Msg/rl_msg.c
-  src/gras/Transport/rl_transport.c
-  src/gras/Virtu/rl_dns.c
-  src/gras/Virtu/rl_emul.c
-  src/gras/Virtu/rl_process.c
-  src/gras/rl_stubs.c
-  src/xbt/xbt_os_thread.c
-  )
 
 set(XBT_SRC
   src/gras_modinter.h
 
 set(XBT_SRC
   src/gras_modinter.h
@@ -151,15 +133,6 @@ set(XBT_SRC
   src/xbt/automaton/automatonparse_promela.c
   src/xbt/config.c
   src/xbt/cunit.c
   src/xbt/automaton/automatonparse_promela.c
   src/xbt/config.c
   src/xbt/cunit.c
-  src/xbt/datadesc/cbps.c
-  src/xbt/datadesc/datadesc.c
-  src/xbt/datadesc/datadesc_interface.h
-  src/xbt/datadesc/datadesc_private.h
-  src/xbt/datadesc/ddt_convert.c
-  src/xbt/datadesc/ddt_create.c
-  src/xbt/datadesc/ddt_exchange.c
-  src/xbt/datadesc/ddt_parse.c
-  src/xbt/datadesc/ddt_parse.yy.c
   src/xbt/dict.c
   src/xbt/dict_cursor.c
   src/xbt/dict_elm.c
   src/xbt/dict.c
   src/xbt/dict_cursor.c
   src/xbt/dict_elm.c
@@ -188,12 +161,9 @@ set(XBT_SRC
   src/xbt/xbt_queue.c
   src/xbt/xbt_replay.c
   src/xbt/xbt_sha.c
   src/xbt/xbt_queue.c
   src/xbt/xbt_replay.c
   src/xbt/xbt_sha.c
-  src/xbt/xbt_socket.c
-  src/xbt/xbt_socket_private.h
   src/xbt/xbt_str.c
   src/xbt/xbt_strbuff.c
   src/xbt/xbt_synchro.c
   src/xbt/xbt_str.c
   src/xbt/xbt_strbuff.c
   src/xbt/xbt_synchro.c
-  src/xbt/xbt_trp_plugin_tcp.c
   src/xbt/xbt_virtu.c
   src/xbt_modinter.h
   )
   src/xbt/xbt_virtu.c
   src/xbt_modinter.h
   )
@@ -331,40 +301,6 @@ else()
     )
 endif()
 
     )
 endif()
 
-set(GRAS_COMMON_SRC
-  src/gras/Msg/gras_msg_exchange.c
-  src/gras/Msg/gras_msg_listener.c
-  src/gras/Msg/gras_msg_mod.c
-  src/gras/Msg/gras_msg_types.c
-  src/gras/Msg/msg_interface.h
-  src/gras/Msg/msg_private.h
-  src/gras/Msg/rpc.c
-  src/gras/Msg/timer.c
-  src/gras/Transport/transport.c
-  src/gras/Transport/transport_plugin_file.c
-  src/gras/Transport/transport_private.h
-  src/gras/Virtu/gras_module.c
-  src/gras/Virtu/process.c
-  src/gras/gras.c
-  )
-
-set(GRAS_SG_SRC
-  ${XBT_SG_SRC}
-  src/gras/Msg/sg_msg.c
-  src/gras/Transport/sg_transport.c
-  src/gras/Transport/transport_plugin_sg.c
-  src/gras/Virtu/sg_dns.c
-  src/gras/Virtu/sg_emul.c
-  src/gras/Virtu/sg_process.c
-  )
-
-set(AMOK_SRC
-  src/amok/Bandwidth/bandwidth.c
-  src/amok/Bandwidth/saturate.c
-  src/amok/PeerManagement/peermanagement.c
-  src/amok/amok_base.c
-  )
-
 set(BINDINGS_SRC
   src/bindings/bindings_global.c
   src/bindings/lua/lua_private.h
 set(BINDINGS_SRC
   src/bindings/bindings_global.c
   src/bindings/lua/lua_private.h
@@ -429,14 +365,6 @@ set(MC_SRC
 set(headers_to_install
   include/amok/bandwidth.h
   include/amok/peermanagement.h
 set(headers_to_install
   include/amok/bandwidth.h
   include/amok/peermanagement.h
-  include/gras.h
-  include/gras/emul.h
-  include/gras/messages.h
-  include/gras/module.h
-  include/gras/process.h
-  include/gras/timer.h
-  include/gras/transport.h
-  include/gras/virtu.h
   include/instr/instr.h
   include/msg/datatypes.h
   include/msg/msg.h
   include/instr/instr.h
   include/msg/datatypes.h
   include/msg/msg.h
@@ -459,7 +387,6 @@ set(headers_to_install
   include/xbt/automaton.h
   include/xbt/config.h
   include/xbt/cunit.h
   include/xbt/automaton.h
   include/xbt/config.h
   include/xbt/cunit.h
-  include/xbt/datadesc.h
   include/xbt/dict.h
   include/xbt/dynar.h
   include/xbt/ex.h
   include/xbt/dict.h
   include/xbt/dynar.h
   include/xbt/ex.h
@@ -484,7 +411,6 @@ set(headers_to_install
   include/xbt/replay.h
   include/xbt/set.h
   include/xbt/setset.h
   include/xbt/replay.h
   include/xbt/set.h
   include/xbt/setset.h
-  include/xbt/socket.h
   include/xbt/str.h
   include/xbt/strbuff.h
   include/xbt/swag.h
   include/xbt/str.h
   include/xbt/strbuff.h
   include/xbt/swag.h
@@ -543,10 +469,7 @@ endif()
 
 ### Simgrid Lib sources
 set(simgrid_sources
 
 ### Simgrid Lib sources
 set(simgrid_sources
-  ${AMOK_SRC}
   ${BINDINGS_SRC}
   ${BINDINGS_SRC}
-  ${GRAS_COMMON_SRC}
-  ${GRAS_SG_SRC}
   ${GTNETS_USED}
   ${JEDULE_SRC}
   ${MSG_SRC}
   ${GTNETS_USED}
   ${JEDULE_SRC}
   ${MSG_SRC}
@@ -581,14 +504,6 @@ if(WIN32)
     )
 endif()
 
     )
 endif()
 
-### Gras Lib sources
-set(gras_sources
-  ${AMOK_SRC}
-  ${GRAS_COMMON_SRC}
-  ${GRAS_RL_SRC}
-  ${XBT_SRC}
-  )
-
 if(${HAVE_LUA})
   set(simgrid_sources
     ${simgrid_sources}
 if(${HAVE_LUA})
   set(simgrid_sources
     ${simgrid_sources}
@@ -605,7 +520,6 @@ set(DOC_SOURCES
   doc/amok_bw_sat.png
   doc/amok_bw_test.png
   doc/AS_hierarchy.png
   doc/amok_bw_sat.png
   doc/amok_bw_test.png
   doc/AS_hierarchy.png
-  doc/gras_comm.png
   doc/sg_thread_model.fig
   doc/simix.fig
   doc/surf_nutshell.fig
   doc/sg_thread_model.fig
   doc/simix.fig
   doc/surf_nutshell.fig
@@ -746,7 +660,6 @@ set(REF_GUIDE_SOURCES
   doc/ref_guide/doxygen/header.html
   doc/ref_guide/doxygen/main.doc
   doc/ref_guide/doxygen/module-amok.doc
   doc/ref_guide/doxygen/header.html
   doc/ref_guide/doxygen/main.doc
   doc/ref_guide/doxygen/module-amok.doc
-  doc/ref_guide/doxygen/module-gras.doc
   doc/ref_guide/doxygen/module-msg.doc
   doc/ref_guide/doxygen/module-sd.doc
   doc/ref_guide/doxygen/module-simix.doc
   doc/ref_guide/doxygen/module-msg.doc
   doc/ref_guide/doxygen/module-sd.doc
   doc/ref_guide/doxygen/module-simix.doc
@@ -847,18 +760,6 @@ set(txt_files
 set(EXAMPLES_CMAKEFILES_TXT
   examples/amok/bandwidth/CMakeLists.txt
   examples/amok/saturate/CMakeLists.txt
 set(EXAMPLES_CMAKEFILES_TXT
   examples/amok/bandwidth/CMakeLists.txt
   examples/amok/saturate/CMakeLists.txt
-  examples/gras/all2all/CMakeLists.txt
-  examples/gras/chrono/CMakeLists.txt
-  examples/gras/console/CMakeLists.txt
-  examples/gras/mmrpc/CMakeLists.txt
-  examples/gras/mutual_exclusion/simple_token/CMakeLists.txt
-  examples/gras/ping/CMakeLists.txt
-  examples/gras/pmm/CMakeLists.txt
-  examples/gras/properties/CMakeLists.txt
-  examples/gras/rpc/CMakeLists.txt
-  examples/gras/spawn/CMakeLists.txt
-  examples/gras/synchro/CMakeLists.txt
-  examples/gras/timer/CMakeLists.txt
   examples/lua/CMakeLists.txt
   examples/msg/CMakeLists.txt
   examples/msg/actions/CMakeLists.txt
   examples/lua/CMakeLists.txt
   examples/msg/CMakeLists.txt
   examples/msg/actions/CMakeLists.txt
@@ -897,11 +798,6 @@ set(EXAMPLES_CMAKEFILES_TXT
 
 set(TESHSUITE_CMAKEFILES_TXT
   teshsuite/CMakeLists.txt
 
 set(TESHSUITE_CMAKEFILES_TXT
   teshsuite/CMakeLists.txt
-  teshsuite/gras/CMakeLists.txt
-  teshsuite/gras/datadesc/CMakeLists.txt
-  teshsuite/gras/empty_main/CMakeLists.txt
-  teshsuite/gras/msg_handle/CMakeLists.txt
-  teshsuite/gras/small_sleep/CMakeLists.txt
   teshsuite/msg/CMakeLists.txt
   teshsuite/msg/trace/CMakeLists.txt
   teshsuite/simdag/CMakeLists.txt
   teshsuite/msg/CMakeLists.txt
   teshsuite/msg/trace/CMakeLists.txt
   teshsuite/simdag/CMakeLists.txt
@@ -922,7 +818,6 @@ set(TESHSUITE_CMAKEFILES_TXT
 set(TOOLS_CMAKEFILES_TXT
   tools/CMakeLists.txt
   tools/graphicator/CMakeLists.txt
 set(TOOLS_CMAKEFILES_TXT
   tools/CMakeLists.txt
   tools/graphicator/CMakeLists.txt
-  tools/gras/CMakeLists.txt
   tools/tesh/CMakeLists.txt
   )
 
   tools/tesh/CMakeLists.txt
   )
 
@@ -976,11 +871,8 @@ set(CMAKE_SOURCE_FILES
   buildtools/Cmake/Scripts/update_tesh.pl
   buildtools/Cmake/Supernovae.cmake
   buildtools/Cmake/UnitTesting.cmake
   buildtools/Cmake/Scripts/update_tesh.pl
   buildtools/Cmake/Supernovae.cmake
   buildtools/Cmake/UnitTesting.cmake
-  buildtools/Cmake/src/gras_config.h.in
   buildtools/Cmake/src/simgrid.nsi.in
   buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
   buildtools/Cmake/src/simgrid.nsi.in
   buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
-  buildtools/Cmake/test_prog/prog_GRAS_ARCH.c
-  buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c
   buildtools/Cmake/test_prog/prog_getline.c
   buildtools/Cmake/test_prog/prog_max_size.c
   buildtools/Cmake/test_prog/prog_mutex_timedlock.c
   buildtools/Cmake/test_prog/prog_getline.c
   buildtools/Cmake/test_prog/prog_max_size.c
   buildtools/Cmake/test_prog/prog_mutex_timedlock.c
@@ -1036,7 +928,6 @@ set(PLATFORMS_EXAMPLES
   )
 
 set(generated_src_files
   )
 
 set(generated_src_files
-  ${CMAKE_HOME_DIRECTORY}/src/xbt/datadesc/ddt_parse.yy.c
   src/xbt/automaton/automaton_lexer.yy.c
   src/xbt/automaton/parserPromela.tab.cacc
   src/xbt/automaton/parserPromela.tab.hacc
   src/xbt/automaton/automaton_lexer.yy.c
   src/xbt/automaton/parserPromela.tab.cacc
   src/xbt/automaton/parserPromela.tab.hacc
index 5e3e0c2..99baeb9 100644 (file)
@@ -70,11 +70,8 @@ add_custom_target(simgrid_update_xml ALL
   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   )
 
   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   )
 
-install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/gras_stub_generator
-  DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
-
 # libraries
 # libraries
-install(TARGETS simgrid gras
+install(TARGETS simgrid 
   DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
 
 if(enable_smpi)
   DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
 
 if(enable_smpi)
@@ -135,7 +132,6 @@ endif()
 add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/doc/simgrid
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall doc ok"
 add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/doc/simgrid
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall doc ok"
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libgras*
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsimgrid*
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsmpi*
   COMMAND ${CMAKE_COMMAND} -E   remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid*
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsimgrid*
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsmpi*
   COMMAND ${CMAKE_COMMAND} -E   remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid*
@@ -147,11 +143,9 @@ add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/tesh
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid-colorizer
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid_update_xml
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/tesh
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid-colorizer
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid_update_xml
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/gras_stub_generator
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/graphicator
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall bin ok"
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/amok
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/graphicator
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall bin ok"
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/amok
-  COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/gras
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/instr
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/msg
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simdag
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/instr
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/msg
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simdag
@@ -162,7 +156,6 @@ add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/mc
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simgrid
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/simgrid_config.h
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/mc
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simgrid
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/simgrid_config.h
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/gras.h
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/xbt.h
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall include ok"
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/simgrid_update_xml.1
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/xbt.h
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall include ok"
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/simgrid_update_xml.1
@@ -191,9 +184,6 @@ set(source_to_pack
   ${source_of_generated_headers}
   ${AMOK_SRC}
   ${BINDINGS_SRC}
   ${source_of_generated_headers}
   ${AMOK_SRC}
   ${BINDINGS_SRC}
-  ${GRAS_COMMON_SRC}
-  ${GRAS_RL_SRC}
-  ${GRAS_SG_SRC}
   ${GTNETS_SRC}
   ${JEDULE_SRC}
   ${LUA_SRC}
   ${GTNETS_SRC}
   ${JEDULE_SRC}
   ${LUA_SRC}
@@ -388,7 +378,6 @@ add_custom_target(maintainer-clean
   )
 
 add_custom_target(supernovae-clean
   )
 
 add_custom_target(supernovae-clean
-  COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_gras.c
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_sg.c
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c
   WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_sg.c
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c
   WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
index be667ea..985d093 100644 (file)
@@ -86,12 +86,10 @@ if(enable_maintainer_mode AND NOT WIN32)
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
       ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
       ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
-      ${CMAKE_HOME_DIRECTORY}/src/xbt/datadesc/ddt_parse.yy.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
       DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
       DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
-      ${CMAKE_HOME_DIRECTORY}/src/xbt/datadesc/ddt_parse.yy.l
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
 
       #${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
 
       #${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
@@ -151,10 +149,6 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${SED_EXE} -i ${string11} src/xbt/graphxml.c
       COMMAND ${CMAKE_COMMAND} -E echo "xbt/graphxml.c"
 
       COMMAND ${SED_EXE} -i ${string11} src/xbt/graphxml.c
       COMMAND ${CMAKE_COMMAND} -E echo "xbt/graphxml.c"
 
-      # src/xbt/datadesc/ddt_parse.yy.c: src/xbt/datadesc/ddt_parse.yy.l
-      COMMAND ${FLEX_EXE} -o src/xbt/datadesc/ddt_parse.yy.c -Pxbt_ddt_parse_ --noline src/xbt/datadesc/ddt_parse.yy.l
-      COMMAND ${CMAKE_COMMAND} -E echo "xbt/datadesc/ddt_parse.yy.c"
-
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
       COMMAND ${SED_EXE} -i ${string12} src/simdag/dax_dtd.l
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
       COMMAND ${SED_EXE} -i ${string12} src/simdag/dax_dtd.l
@@ -173,7 +167,6 @@ if(enable_maintainer_mode AND NOT WIN32)
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
       ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
       ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
-      ${CMAKE_HOME_DIRECTORY}/src/xbt/datadesc/ddt_parse.yy.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
       )
 
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
       )
 
index cde9e16..8c1c4f7 100644 (file)
@@ -7,22 +7,15 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/lua)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools)
 ##################################################################
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools)
 ##################################################################
 
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/gras)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/tesh)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/graphicator/)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/xbt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/surf)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/tesh)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/graphicator/)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/xbt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/surf)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras/msg_handle)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras/empty_main)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras/small_sleep)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/gras/numerous_rpc)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p)
@@ -38,18 +31,6 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/pt2pt)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace)
 
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/ping)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/rpc)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/spawn)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/timer)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/chrono)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/all2all)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/pmm)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/synchro)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/properties)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/gras/console)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/properties)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/actions)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/migration)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/properties)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/actions)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/migration)
@@ -74,9 +55,6 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/mc)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/ns3)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/ns3)
 
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/amok/saturate)
-
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)
index b848846..92ebff7 100644 (file)
@@ -11,9 +11,6 @@ include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Supernovae.cmake)
 add_library(simgrid SHARED ${simgrid_sources})
 set_target_properties(simgrid PROPERTIES VERSION ${libsimgrid_version})
 
 add_library(simgrid SHARED ${simgrid_sources})
 set_target_properties(simgrid PROPERTIES VERSION ${libsimgrid_version})
 
-add_library(gras SHARED ${gras_sources})
-set_target_properties(gras PROPERTIES VERSION ${libgras_version})
-
 if(enable_lib_static)
   add_library(simgrid_static STATIC ${simgrid_sources})
 endif()
 if(enable_lib_static)
   add_library(simgrid_static STATIC ${simgrid_sources})
 endif()
@@ -26,7 +23,6 @@ if(enable_smpi)
   endif()
 endif()
 
   endif()
 endif()
 
-add_dependencies(gras maintainer_files)
 add_dependencies(simgrid maintainer_files)
 
 # if supernovaeing, we need some depends to make sure that the source gets generated
 add_dependencies(simgrid maintainer_files)
 
 # if supernovaeing, we need some depends to make sure that the source gets generated
@@ -35,7 +31,6 @@ if (enable_supernovae)
   if(enable_lib_static)
     add_dependencies(simgrid_static ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c)
   endif()
   if(enable_lib_static)
     add_dependencies(simgrid_static ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c)
   endif()
-  add_dependencies(gras ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_gras.c)
 
   if(enable_smpi)
     add_dependencies(smpi ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
 
   if(enable_smpi)
     add_dependencies(smpi ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
@@ -45,25 +40,6 @@ if (enable_supernovae)
   endif()
 endif()
 
   endif()
 endif()
 
-# Compute the dependencies of GRAS
-##################################
-set(GRAS_DEP "-lm -pthread")
-
-if(HAVE_POSIX_GETTIME)
-  SET(GRAS_DEP "${GRAS_DEP} -lrt")
-endif()
-
-# the following is probably unneed since it kills the previous
-# GRAS_DEP (and is thus probably invalid).
-# My guess is that pthread is never true [Mt]
-# FIXME: KILLME if we get a working windows with that?
-if(with_context MATCHES windows)
-  if(pthread)
-    SET(GRAS_DEP "msg")
-  endif()
-endif()
-target_link_libraries(gras     ${GRAS_DEP})
-
 # Compute the dependencies of SimGrid
 #####################################
 set(SIMGRID_DEP "-lm -lpcre")
 # Compute the dependencies of SimGrid
 #####################################
 set(SIMGRID_DEP "-lm -lpcre")
index 2af50ae..861388f 100644 (file)
@@ -11,9 +11,6 @@ if(enable_print_message)
   message("need_vasprintf ..............: ${simgrid_need_vasprintf}")
   message("PREFER_PORTABLE_SNPRINTF ....: ${PREFER_PORTABLE_SNPRINTF}")
   message("HAVE_VA_COPY ................: ${HAVE_VA_COPY}")
   message("need_vasprintf ..............: ${simgrid_need_vasprintf}")
   message("PREFER_PORTABLE_SNPRINTF ....: ${PREFER_PORTABLE_SNPRINTF}")
   message("HAVE_VA_COPY ................: ${HAVE_VA_COPY}")
-  message("GRAS_BIGENDIAN ..............: ${GRAS_BIGENDIAN}")
-  message("GRAS_ARCH val ...............: ${val_big}")
-  message("GRAS_ARCH_32_BITS ...........: ${GRAS_ARCH_32_BITS}")
   message("PRINTF_NULL_WORKING .........: ${PRINTF_NULL_WORKING}")
   message("")
   message("\#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
   message("PRINTF_NULL_WORKING .........: ${PRINTF_NULL_WORKING}")
   message("")
   message("\#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
@@ -74,7 +71,7 @@ if(enable_print_message)
   message("")
 endif()
 
   message("")
 endif()
 
-message("\nConfiguration of package `simgrid' on arch (=${GRAS_THISARCH}):")
+message("\nConfiguration of package `simgrid':")
 message("        BUILDNAME ...........: ${BUILDNAME}")
 message("        SITE ................: ${SITE}")
 message("        Release .............: simgrid-${release_version}")
 message("        BUILDNAME ...........: ${BUILDNAME}")
 message("        SITE ................: ${SITE}")
 message("        Release .............: simgrid-${release_version}")
@@ -116,7 +113,6 @@ message("        Graphviz mode .......: ${HAVE_GRAPHVIZ}")
 message("        Mallocators .........: ${enable_mallocators}")
 message("")
 message("        Simgrid dependencies : ${SIMGRID_DEP}")
 message("        Mallocators .........: ${enable_mallocators}")
 message("")
 message("        Simgrid dependencies : ${SIMGRID_DEP}")
-message("        Gras dependencies ...: ${GRAS_DEP}")
 message("        Smpi dependencies ...: ${SMPI_DEP}")
 message("")
 message("        INSTALL_PREFIX ......: ${CMAKE_INSTALL_PREFIX}")
 message("        Smpi dependencies ...: ${SMPI_DEP}")
 message("")
 message("        INSTALL_PREFIX ......: ${CMAKE_INSTALL_PREFIX}")
index ec68d3c..f56228a 100644 (file)
@@ -6,16 +6,10 @@
 set(simgrid_fragile_sources
   src/simdag/sd_daxloader.c
   src/surf/surfxml_parse.c
 set(simgrid_fragile_sources
   src/simdag/sd_daxloader.c
   src/surf/surfxml_parse.c
-  src/xbt/datadesc/ddt_parse.yy.c
   src/xbt/graphxml_parse.c
   src/xbt/mmalloc/mm.c
   ${GTNETS_USED}
   )
   src/xbt/graphxml_parse.c
   src/xbt/mmalloc/mm.c
   ${GTNETS_USED}
   )
-set(gras_fragile_sources
-  src/xbt/datadesc/ddt_parse.yy.c
-  src/xbt/graphxml_parse.c
-  src/xbt/mmalloc/mm.c
-  )
 
 #####################################################
 ### END OF CONFIGURATION, NO NEED TO READ FURTHER ###
 
 #####################################################
 ### END OF CONFIGURATION, NO NEED TO READ FURTHER ###
@@ -27,8 +21,6 @@ if (enable_supernovae) # I need supernovae
   # supernovae files are generated. I promise
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
     PROPERTIES GENERATED true)
   # supernovae files are generated. I promise
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
     PROPERTIES GENERATED true)
-  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_gras.c
-    PROPERTIES GENERATED true)
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
     PROPERTIES GENERATED true)
 
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
     PROPERTIES GENERATED true)
 
@@ -40,13 +32,6 @@ if (enable_supernovae) # I need supernovae
     COMMENT "Generating supernovae_sg.c"
     )
 
     COMMENT "Generating supernovae_sg.c"
     )
 
-  ADD_CUSTOM_COMMAND(
-    OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_gras.c
-    DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl ${gras_sources}
-    COMMAND  perl ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl --out=${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_gras.c '--fragile=${gras_fragile_sources}'    '${gras_sources}'
-    WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
-    COMMENT "Generating supernovae_gras.c"
-    )
 
   ADD_CUSTOM_COMMAND(
     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
 
   ADD_CUSTOM_COMMAND(
     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
@@ -61,10 +46,6 @@ if (enable_supernovae) # I need supernovae
     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
     ${simgrid_fragile_sources})
 
     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
     ${simgrid_fragile_sources})
 
-  set(gras_sources
-    ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_gras.c
-    ${gras_fragile_sources})
-
   set(SMPI_SRC
     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
 
   set(SMPI_SRC
     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
 
index 746596e..62fb68a 100644 (file)
@@ -58,9 +58,9 @@ add_executable(testall ${TEST_UNITS})
 
 ### Add definitions for compile
 if(NOT WIN32)
 
 ### Add definitions for compile
 if(NOT WIN32)
-  target_link_libraries(testall gras m)
+  target_link_libraries(testall simgrid m)
 else()
 else()
-  target_link_libraries(testall gras)
+  target_link_libraries(testall simgrid)
 endif()
 
 add_dependencies(testall ${TEST_UNITS})
\ No newline at end of file
 endif()
 
 add_dependencies(testall ${TEST_UNITS})
\ No newline at end of file
index bb18c71..ff66d55 100644 (file)
@@ -47,14 +47,12 @@ Section "Libraries and Headers" LibSection
        # install lib\r
        CreateDirectory $INSTDIR\lib\r
        setOutPath $INSTDIR\lib\r
        # install lib\r
        CreateDirectory $INSTDIR\lib\r
        setOutPath $INSTDIR\lib\r
-       file lib\libgras.dll\r
        file lib\libsimgrid.dll\r
        file lib\libsimgrid.def\r
        \r
        #install headers\r
        CreateDirectory  $INSTDIR\include\r
        setOutPath $INSTDIR\include\r
        file lib\libsimgrid.dll\r
        file lib\libsimgrid.def\r
        \r
        #install headers\r
        CreateDirectory  $INSTDIR\include\r
        setOutPath $INSTDIR\include\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras.h \r
        file @CMAKE_HOME_DIRECTORY@\include\xbt.h\r
        file include\simgrid_config.h\r
        \r
        file @CMAKE_HOME_DIRECTORY@\include\xbt.h\r
        file include\simgrid_config.h\r
        \r
@@ -95,7 +93,6 @@ Section "Libraries and Headers" LibSection
        file @CMAKE_HOME_DIRECTORY@\include\xbt\parmap.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automatonparse_promela.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\parmap.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automatonparse_promela.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\xbt\datadesc.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\socket.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h\r
     file @CMAKE_HOME_DIRECTORY@\include\xbt\xbt_os_thread.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\socket.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h\r
     file @CMAKE_HOME_DIRECTORY@\include\xbt\xbt_os_thread.h\r
@@ -131,21 +128,6 @@ Section "Libraries and Headers" LibSection
        file @CMAKE_HOME_DIRECTORY@\include\surf\simgrid_dtd.h\r
        file @CMAKE_HOME_DIRECTORY@\include\surf\surf_routing.h\r
        \r
        file @CMAKE_HOME_DIRECTORY@\include\surf\simgrid_dtd.h\r
        file @CMAKE_HOME_DIRECTORY@\include\surf\surf_routing.h\r
        \r
-       CreateDirectory  $INSTDIR\include\gras\r
-       setOutPath $INSTDIR\include\gras\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\transport.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\virtu.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\emul.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\process.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\module.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\messages.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\gras\timer.h\r
-       \r
-       CreateDirectory  $INSTDIR\include\amok\r
-       setOutPath $INSTDIR\include\amok\r
-       file @CMAKE_HOME_DIRECTORY@\include\amok\peermanagement.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\amok\bandwidth.h\r
-       \r
        CreateDirectory  $INSTDIR\include\instr\r
        setOutPath $INSTDIR\include\instr\r
        file @CMAKE_HOME_DIRECTORY@\include\instr\instr.h\r
        CreateDirectory  $INSTDIR\include\instr\r
        setOutPath $INSTDIR\include\instr\r
        file @CMAKE_HOME_DIRECTORY@\include\instr\instr.h\r
@@ -256,14 +238,14 @@ section
 # default section end\r
 sectionEnd\r
 \r
 # default section end\r
 sectionEnd\r
 \r
-LangString DESC_LibSection             ${LANG_ENGLISH} "Install Simgrid and gras libraries with associated headers."\r
+LangString DESC_LibSection             ${LANG_ENGLISH} "Install Simgrid libraries with associated headers."\r
 LangString DESC_BinSection             ${LANG_ENGLISH} "Install some useful tools for Simgrid."\r
 LangString DESC_DocSection             ${LANG_ENGLISH} "Generated (doxygen) documentation."\r
 LangString DESC_ExamplesSection ${LANG_ENGLISH} "Simgrid's HelloWorld example and some classical platforms."\r
 LangString DESC_PCRESection    ${LANG_ENGLISH} "Install the PCRE and PCREPOSIX libraries for SimGrid."\r
 LangString DESC_JAVASection    ${LANG_ENGLISH} "Install the Java binding and examples."\r
 \r
 LangString DESC_BinSection             ${LANG_ENGLISH} "Install some useful tools for Simgrid."\r
 LangString DESC_DocSection             ${LANG_ENGLISH} "Generated (doxygen) documentation."\r
 LangString DESC_ExamplesSection ${LANG_ENGLISH} "Simgrid's HelloWorld example and some classical platforms."\r
 LangString DESC_PCRESection    ${LANG_ENGLISH} "Install the PCRE and PCREPOSIX libraries for SimGrid."\r
 LangString DESC_JAVASection    ${LANG_ENGLISH} "Install the Java binding and examples."\r
 \r
-LangString DESC_LibSection             ${LANG_FRENCH}  "Installer les librairies Simgrid et Gras et leurs Entêtes."\r
+LangString DESC_LibSection             ${LANG_FRENCH}  "Installer les librairies Simgrid et leurs Entêtes."\r
 LangString DESC_BinSection             ${LANG_FRENCH}  "Installer les outils optionnels."\r
 LangString DESC_DocSection             ${LANG_FRENCH}  "Installer la documentation."\r
 LangString DESC_ExamplesSection ${LANG_FRENCH}         "Installer un exemple 'HelloWorld' et des fichiers de plate-formes types."\r
 LangString DESC_BinSection             ${LANG_FRENCH}  "Installer les outils optionnels."\r
 LangString DESC_DocSection             ${LANG_FRENCH}  "Installer la documentation."\r
 LangString DESC_ExamplesSection ${LANG_FRENCH}         "Installer un exemple 'HelloWorld' et des fichiers de plate-formes types."\r
@@ -287,7 +269,6 @@ section "Uninstall"
        delete $INSTDIR\uninstaller@BIN_EXE@\r
 \r
        # delete installed libs\r
        delete $INSTDIR\uninstaller@BIN_EXE@\r
 \r
        # delete installed libs\r
-       delete $INSTDIR\lib\libgras.dll\r
        delete $INSTDIR\lib\libsimgrid.dll\r
        delete $INSTDIR\lib\libsimgrid.def\r
 \r
        delete $INSTDIR\lib\libsimgrid.dll\r
        delete $INSTDIR\lib\libsimgrid.def\r
 \r
@@ -302,7 +283,6 @@ section "Uninstall"
        delete $INSTDIR\bin\tesh\r
        \r
        # delete installed headers\r
        delete $INSTDIR\bin\tesh\r
        \r
        # delete installed headers\r
-       delete $INSTDIR\include\gras.h \r
        delete $INSTDIR\include\xbt.h\r
        delete $INSTDIR\include\simgrid_config.h\r
        delete $INSTDIR\include\xbt\misc.h\r
        delete $INSTDIR\include\xbt.h\r
        delete $INSTDIR\include\simgrid_config.h\r
        delete $INSTDIR\include\xbt\misc.h\r
@@ -358,16 +338,6 @@ section "Uninstall"
        delete $INSTDIR\include\surf\surfxml_parse.h\r
        delete $INSTDIR\include\surf\simgrid_dtd.h\r
        delete $INSTDIR\include\surf\surf_routing.h\r
        delete $INSTDIR\include\surf\surfxml_parse.h\r
        delete $INSTDIR\include\surf\simgrid_dtd.h\r
        delete $INSTDIR\include\surf\surf_routing.h\r
-       delete $INSTDIR\include\gras\datadesc.h\r
-       delete $INSTDIR\include\gras\transport.h\r
-       delete $INSTDIR\include\gras\virtu.h\r
-       delete $INSTDIR\include\gras\emul.h\r
-       delete $INSTDIR\include\gras\process.h\r
-       delete $INSTDIR\include\gras\module.h\r
-       delete $INSTDIR\include\gras\messages.h\r
-       delete $INSTDIR\include\gras\timer.h\r
-       delete $INSTDIR\include\amok\peermanagement.h\r
-       delete $INSTDIR\include\amok\bandwidth.h\r
        delete $INSTDIR\include\instr\instr.h\r
                \r
        # delete EXTRA FILES\r
        delete $INSTDIR\include\instr\instr.h\r
                \r
        # delete EXTRA FILES\r
@@ -382,8 +352,6 @@ section "Uninstall"
        RMDir  "$INSTDIR\lib"\r
        RMDir  "$INSTDIR\include\simix"\r
        RMDir  "$INSTDIR\include\instr"\r
        RMDir  "$INSTDIR\lib"\r
        RMDir  "$INSTDIR\include\simix"\r
        RMDir  "$INSTDIR\include\instr"\r
-       RMDir  "$INSTDIR\include\amok"\r
-       RMDir  "$INSTDIR\include\gras"\r
        RMDir  "$INSTDIR\include\surf"\r
        RMDir  "$INSTDIR\include\smpi"\r
        RMDir  "$INSTDIR\include\simdag"\r
        RMDir  "$INSTDIR\include\surf"\r
        RMDir  "$INSTDIR\include\smpi"\r
        RMDir  "$INSTDIR\include\simdag"\r
diff --git a/buildtools/Cmake/test_prog/prog_GRAS_ARCH.c b/buildtools/Cmake/test_prog/prog_GRAS_ARCH.c
deleted file mode 100644 (file)
index 00b6dff..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//This programme check size of datatypes 
-
-/* Copyright (c) 2010. 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. */
-
-#include <sys/types.h>
-#include <stdio.h>
-
-int main(void)
-{
-
-  int c = sizeof(char);
-  int si = sizeof(short int);
-  int i = sizeof(int);
-  int li = sizeof(long int);
-  int lli = sizeof(long long int);
-  int f = sizeof(float);
-  int v = sizeof(void *);
-  int vv = sizeof(void (*)(void));
-  /*printf("char : %d\n",c);
-     printf("short int : %d\n",si);
-     printf("int : %d\n",i);
-     printf("long int : %d\n",li);
-     printf("long long int : %d\n",lli);
-     printf("float : %d\n",f);
-     printf("void * : %d\n",v);
-     printf("void (*) (void) : %d\n",vv); */
-
-  struct s0 {
-    char c0;
-    char i0;
-  };
-  struct s1 {
-    char c1;
-    short int i1;
-  };
-  struct s2 {
-    char c2;
-    int i2;
-  };
-  struct s3 {
-    char c3;
-    long int i3;
-  };
-  struct s4 {
-    char c4;
-    long long int i4;
-  };
-  struct s5 {
-    char c5;
-    double i5;
-  };
-  struct s6 {
-    char c6;
-    void *i6;
-  };
-  int res0 = sizeof(struct s0) - sizeof(char);
-  int res1 = sizeof(struct s1) - sizeof(short int);
-  int res2 = sizeof(struct s2) - sizeof(int);
-  int res3 = sizeof(struct s3) - sizeof(long int);
-  int res4 = sizeof(struct s4) - sizeof(long long int);
-  int res5 = sizeof(struct s5) - sizeof(double);
-  int res6 = sizeof(struct s6) - sizeof(void *);
-  /*printf("struct-char : %d\n",res0);
-     printf("struct-short int : %d\n",res1);      
-     printf("struct-int : %d\n",res2);    
-     printf("struct-long int : %d\n",res3);       
-     printf("struct-long long int : %d\n",res4);  
-     printf("struct-double : %d\n",res5); 
-     printf("struct-void * : %d\n",res6); */
-
-  printf
-      ("_C:%d/%d:_I:%d/%d:%d/%d:%d/%d:%d/%d:_P:%d/%d:%d/%d:_D:4/%d:8/%d:",
-       c, res0, si, res1, i, res2, li, res3, lli, res4, v, res6, vv, res6,
-       f, res5);
-  return 1;
-}
diff --git a/buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c b/buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c
deleted file mode 100644 (file)
index 865eeaf..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2010. 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. */
-
-#include <sys/types.h>
-#include <stddef.h>             /* offsetof() */
-#include <stdio.h>
-
-int main(void)
-{
-
-  struct s0 {
-    char c0;
-    double d0;
-  };
-  struct s1 {
-    double d1;
-    int i1;
-    char c1;
-  };
-  struct s2 {
-    double d2;
-    int i2;
-    char c2[6];
-  };
-  struct s3 {
-    double d3;
-    int a3;
-    int b3;
-  };
-
-  int gras_struct_packed;
-  int gras_struct_compact;
-  int gras_array_straddle_struct;
-  int gras_compact_struct;
-
-  if (sizeof(struct s0) == sizeof(double) + sizeof(char)) {
-    gras_struct_packed = 1;
-  } else {
-    gras_struct_packed = 0;
-  }
-  if (offsetof(struct s1, c1) == sizeof(double) + sizeof(int)) {
-    gras_struct_compact = 1;
-  } else {
-    gras_struct_compact = 0;
-  }
-  if (offsetof(struct s2, c2) == sizeof(double) + sizeof(int)) {
-    gras_array_straddle_struct = 1;
-  } else {
-    gras_array_straddle_struct = 0;
-  }
-  if (offsetof(struct s3, b3) == sizeof(double) + sizeof(int)) {
-    gras_compact_struct = 1;
-  } else {
-    gras_compact_struct = 0;
-  }
-
-
-  if (gras_struct_packed == 0 && gras_struct_compact == 1)
-    printf("GRAS_STRUCT_COMPACT ");
-
-  if (gras_array_straddle_struct == 1)
-    printf("GRAS_ARRAY_STRADDLE_STRUCT ");
-
-  if (gras_compact_struct == 1)
-    printf("GRAS_COMPACT_STRUCT ");
-
-  return 1;
-
-}
diff --git a/doc/gras_comm.png b/doc/gras_comm.png
deleted file mode 100644 (file)
index 00d54a1..0000000
Binary files a/doc/gras_comm.png and /dev/null differ
diff --git a/doc/gtut-files/01-bones.c b/doc/gtut-files/01-bones.c
deleted file mode 100644 (file)
index 97fea93..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2006, 2010. 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. */
-
-#include <gras.h>
-
-int client(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-
-  /* Your own code for the client process */
-
-  gras_exit();
-  return 0;
-}
-
-int server(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-
-  /* Your own code for the server process */
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/01-bones.output b/doc/gtut-files/01-bones.output
deleted file mode 100644 (file)
index 1257295..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-$ ./test_client
-[arthur:client:(28729) 0.000011] [gras/INFO] Exiting GRAS
-$ ./test_server
-[arthur:server:(28733) 0.000012] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/02-simple.c b/doc/gtut-files/02-simple.c
deleted file mode 100644 (file)
index 269414c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <stdio.h>
-#include <gras.h>
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toclient;       /* socket used to write to the client */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server(12345);
-
-  gras_msg_wait(60, "hello", &toclient, NULL /* no payload */ );
-
-  fprintf(stderr, "Cool, we received the message from %s:%d.\n",
-          gras_socket_peer_name(toclient),
-          gras_socket_peer_port(toclient));
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  fprintf(stderr, "Client ready; listening on %d\n",
-          gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client("Jacquelin", 12345);
-
-  gras_msg_send(toserver, "hello", NULL);
-  fprintf(stderr, "That's it, we sent the data to the server\n");
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/02-simple.output b/doc/gtut-files/02-simple.output
deleted file mode 100644 (file)
index 7b961ea..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-$ ./test_simulator platform.xml test.xml
-Client ready; listening on 1024
-That's it, we sent the data to the server
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-Cool, we received the message from Boivin:1024.
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/03-args.c b/doc/gtut-files/03-args.c
deleted file mode 100644 (file)
index 06d6f1a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <stdio.h>
-#include <gras.h>
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toclient;       /* socket used to write to the client */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_msg_wait(60, "hello", &toclient, NULL /* no payload */ );
-
-  fprintf(stderr, "Cool, we received the message from %s:%d.\n",
-          gras_socket_peer_name(toclient),
-          gras_socket_peer_port(toclient));
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  fprintf(stderr, "Client ready; listening on %d\n",
-          gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  gras_msg_send(toserver, "hello", NULL);
-  fprintf(stderr, "That's it, we sent the data to the server on %s\n",
-          gras_socket_peer_name(toserver));
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/03-args.output b/doc/gtut-files/03-args.output
deleted file mode 100644 (file)
index 498ea45..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-$ ./test_server 12345 & ./test_client 127.0.0.1 12345
-Client ready; listening on 1024
-That's it, we sent the data to the server on 127.0.0.1
-[arthur:client:(27443) 0.000018] [gras/INFO] Exiting GRAS
-Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27441) 0.000012] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-Client ready; listening on 1024
-That's it, we sent the data to the server on Jacquelin
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-Cool, we received the message from Boivin:1024.
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/03-args.xml b/doc/gtut-files/03-args.xml
deleted file mode 100644 (file)
index b8ad263..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Jacquelin" function="server">
-    <argument value="12345"/>
-  </process>
-  <process host="Boivin" function="client">
-    <argument value="Jacquelin"/>
-    <argument value="12345"/>
-  </process>
-</platform>
-
diff --git a/doc/gtut-files/04-callback.c b/doc/gtut-files/04-callback.c
deleted file mode 100644 (file)
index 1e4c45f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <stdio.h>
-#include <gras.h>
-
-int server_hello_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-
-  fprintf(stderr, "Cool, we received the message from %s:%d.\n",
-          gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  return 0;
-}                               /* end_of_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("hello", &server_hello_cb);
-  gras_msg_handle(60);
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  fprintf(stderr, "Client ready; listening on %d\n",
-          gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  gras_msg_send(toserver, "hello", NULL);
-  fprintf(stderr, "That's it, we sent the data to the server on %s\n",
-          gras_socket_peer_name(toserver));
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/04-callback.output b/doc/gtut-files/04-callback.output
deleted file mode 100644 (file)
index 880ab77..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-$ ./test_server 23451 & ./test_client 127.0.0.1 23451
-Client ready; listening on 1024
-That's it, we sent the data to the server on 127.0.0.1
-[arthur:client:(27507) 0.000019] [gras/INFO] Exiting GRAS
-Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27505) 0.000013] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-Client ready; listening on 1024
-That's it, we sent the data to the server on Jacquelin
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-Cool, we received the message from Boivin:1024.
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/05-globals.c b/doc/gtut-files/05-globals.c
deleted file mode 100644 (file)
index 4751176..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include <stdio.h>
-#include <gras.h>
-
-typedef struct {
-  int killed;
-} server_data_t;
-
-
-int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  fprintf(stderr, "Argh, killed by %s:%d! Bye folks...\n",
-          gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  globals->killed = 1;
-
-  return 0;
-}                               /* end_of_kill_callback */
-
-int server_hello_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-
-  fprintf(stderr, "Cool, we received the message from %s:%d.\n",
-          gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  return 0;
-}                               /* end_of_hello_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t);
-  globals->killed = 0;
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("hello", &server_hello_cb);
-  gras_cb_register("kill", &server_kill_cb);
-
-  while (!globals->killed) {
-    gras_msg_handle(-1);        /* blocking */
-  }
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  fprintf(stderr, "Client ready; listening on %d\n",
-          gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  gras_msg_send(toserver, "hello", NULL);
-  fprintf(stderr,
-          "we sent the data to the server on %s. Let's do it again for fun\n",
-          gras_socket_peer_name(toserver));
-  gras_msg_send(toserver, "hello", NULL);
-
-  fprintf(stderr, "Ok. Enough. Have a rest, and then kill the server\n");
-  gras_os_sleep(5);             /* sleep 1 second and half */
-  gras_msg_send(toserver, "kill", NULL);
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/05-globals.output b/doc/gtut-files/05-globals.output
deleted file mode 100644 (file)
index 6ed9de7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$ ./test_server 12345 & ./test_client 127.0.0.1 12345
-Client ready; listening on 1024
-we sent the data to the server on 127.0.0.1. Let's do it again for fun
-Ok. Enough. Have a rest, and then kill the server
-Cool, we received the message from 127.0.0.1:1024.
-Cool, we received the message from 127.0.0.1:1024.
-[arthur:client:(28822) 0.000027] [gras/INFO] Exiting GRAS
-Argh, killed by 127.0.0.1:1024! Bye folks...
-[arthur:server:(28820) 0.000013] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-Client ready; listening on 1024
-we sent the data to the server on Jacquelin. Let's do it again for fun
-Cool, we received the message from Boivin:1024.
-Ok. Enough. Have a rest, and then kill the server
-Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-Argh, killed by Boivin:1024! Bye folks...
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/06-logs.c b/doc/gtut-files/06-logs.c
deleted file mode 100644 (file)
index 6de6602..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-typedef struct {
-  int killed;
-} server_data_t;
-
-
-int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  XBT_CRITICAL("Argh, killed by %s:%d! Bye folks...",
-            gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  globals->killed = 1;
-
-  return 0;
-}                               /* end_of_kill_callback */
-
-int server_hello_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-
-  XBT_INFO("Cool, we received the message from %s:%d.",
-        gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  return 0;
-}                               /* end_of_hello_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t *);
-  globals->killed = 0;
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("hello", &server_hello_cb);
-  gras_cb_register("kill", &server_kill_cb);
-
-  while (!globals->killed) {
-    gras_msg_handle(-1);        /* blocking */
-  }
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  gras_msg_send(toserver, "hello", NULL);
-  XBT_INFO("we sent the data to the server on %s. Let's do it again for fun",
-        gras_socket_peer_name(toserver));
-  gras_msg_send(toserver, "hello", NULL);
-
-  XBT_INFO("Ok. Enough. Have a rest, and then kill the server");
-  gras_os_sleep(5);             /* sleep 1 second and half */
-  gras_msg_send(toserver, "kill", NULL);
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/06-logs.output b/doc/gtut-files/06-logs.output
deleted file mode 100644 (file)
index 97565d1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-$ ./test_server 12345 & ./test_client 127.0.0.1 12345
-[arthur:client:(27755) 0.000016] [test/INFO] we sent the data to the server on 127.0.0.1. Let's do it again for fun
-[arthur:client:(27755) 0.000148] [test/INFO] Ok. Enough. Have a rest, and then kill the server
-[arthur:client:(27755) 5.000415] [gras/INFO] Exiting GRAS
-[arthur:server:(27752) 0.000010] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27752) 0.000409] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27752) 5.001363] test.c:15: [test/CRITICAL] Argh, killed by 127.0.0.1:1024! Bye folks...
-[arthur:server:(27752) 5.001409] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-[Boivin:client:(2) 0.000000] [test/INFO] we sent the data to the server on Jacquelin. Let's do it again for fun
-[Jacquelin:server:(1) 0.000000] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 0.000537] [test/INFO] Ok. Enough. Have a rest, and then kill the server
-[Jacquelin:server:(1) 0.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 5.001074] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 5.001074] test.c:15: [test/CRITICAL] Argh, killed by Boivin:1024! Bye folks...
-[Jacquelin:server:(1) 5.001074] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/06-logs.output.error b/doc/gtut-files/06-logs.output.error
deleted file mode 100644 (file)
index 3052af8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-$ ./test_server 12345 --log=root.thres:error & ./test_client 127.0.0.1 12345 --log=root.thres:error
-[arthur:server:(27705) 0.000024] test.c:15: [test/CRITICAL] Argh, killed by 127.0.0.1:1024! Bye folks...
-$
-$ ./test_simulator platform.xml test.xml --log=root.thres:error
-[Jacquelin:server:(1) 0.000000] test.c:15: [test/CRITICAL] Argh, killed by Boivin:1024! Bye folks...
-$
diff --git a/doc/gtut-files/06-logs.output.fmt b/doc/gtut-files/06-logs.output.fmt
deleted file mode 100644 (file)
index 712efb2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-$ ./test_server 12345 --log=test.fmt:%m%n & ./test_client 127.0.0.1 12345 --log=test.fmt:%m%n
-Cool, we received the message from 127.0.0.1:1024.
-nCool, we received the message from 127.0.0.1:1024.
-nArgh, killed by 127.0.0.1:1024! Bye folks...
-n[arthur:server:(27630) 0.000011] [gras/INFO] Exiting GRAS
-we sent the data to the server on 127.0.0.1. Let's do it again for fun
-Ok. Enough. Have a rest, and then kill the server
-[arthur:client:(27634) 0.000019] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml --log=test.fmt:%m%n
-we sent the data to the server on Jacquelin. Let's do it again for fun
-Cool, we received the message from Boivin:1024.
-Ok. Enough. Have a rest, and then kill the server
-Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 0.000000] [gras/INFO] Exiting GRAS
-Argh, killed by Boivin:1024! Bye folks...
-[Jacquelin:server:(1) 0.000000] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/06-logs.output.fmt-bt b/doc/gtut-files/06-logs.output.fmt-bt
deleted file mode 100644 (file)
index cebafc3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-$ ./test_server 12345 --log=test.fmt:"[%r] %m%n%b%n%n" & ./test_client 127.0.0.1 12345 --log=test.fmt:"[%r] %m%n%b%n%n"
-$
-$ ./test_simulator platform.xml test.xml --log=test.fmt:[%r]%m%n%b%n%n
-$
diff --git a/doc/gtut-files/06-logs.output.verbose b/doc/gtut-files/06-logs.output.verbose
deleted file mode 100644 (file)
index 42a8db8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$ ./test_server 12345 --log=test.thres:verbose & ./test_client 127.0.0.1 12345 --log=test.thres:verbose
-[arthur:client:(27681) 0.000012] test.c:65: [test/VERBOSE] Client ready; listening on 1024
-[arthur:client:(27681) 1.500865] [test/INFO] we sent the data to the server on 127.0.0.1. Let's do it again for fun
-[arthur:client:(27681) 1.500972] [test/INFO] Ok. Enough. Have a rest, and then kill the server
-[arthur:client:(27681) 6.501225] [gras/INFO] Exiting GRAS
-[arthur:server:(27677) 0.000015] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27677) 0.000144] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27677) 5.000244] test.c:15: [test/CRITICAL] Argh, killed by 127.0.0.1:1024! Bye folks...
-[arthur:server:(27677) 5.000296] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml --log=test.thres:verbose
-[Boivin:client:(2) 0.000000] test.c:65: [test/VERBOSE] Client ready; listening on 1024
-[Boivin:client:(2) 1.500552] [test/INFO] we sent the data to the server on Jacquelin. Let's do it again for fun
-[Jacquelin:server:(1) 1.500552] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 1.501089] [test/INFO] Ok. Enough. Have a rest, and then kill the server
-[Jacquelin:server:(1) 1.501089] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 6.501626] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 6.501626] test.c:15: [test/CRITICAL] Argh, killed by Boivin:1024! Bye folks...
-[Jacquelin:server:(1) 6.501626] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/07-timers.c b/doc/gtut-files/07-timers.c
deleted file mode 100644 (file)
index 202f76c..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-/* *********************** Server *********************** */
-typedef struct {
-  int killed;
-} server_data_t;
-
-int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  XBT_CRITICAL("Argh, killed by %s:%d! Bye folks...",
-            gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  globals->killed = 1;
-
-  return 0;
-}                               /* end_of_kill_callback */
-
-int server_hello_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-
-  XBT_INFO("Cool, we received the message from %s:%d.",
-        gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  return 0;
-}                               /* end_of_hello_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t *);
-  globals->killed = 0;
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("hello", &server_hello_cb);
-  gras_cb_register("kill", &server_kill_cb);
-
-  while (!globals->killed) {
-    gras_msg_handle(60);
-  }
-
-  gras_exit();
-  return 0;
-}
-
-/* *********************** Client *********************** */
-/* client_data */
-typedef struct {
-  gras_socket_t toserver;
-  int done;
-} client_data_t;
-
-
-void client_do_hello(void)
-{
-  client_data_t *globals = (client_data_t *) gras_userdata_get();
-
-  gras_msg_send(globals->toserver, "hello", NULL);
-  XBT_INFO("Hello sent to server");
-}                               /* end_of_client_do_hello */
-
-void client_do_stop(void)
-{
-  client_data_t *globals = (client_data_t *) gras_userdata_get();
-
-  gras_msg_send(globals->toserver, "kill", NULL);
-  XBT_INFO("Kill sent to server");
-
-  gras_timer_cancel_repeat(0.5, client_do_hello);
-
-  globals->done = 1;
-  XBT_INFO("Break the client's while loop");
-}                               /* end_of_client_do_stop */
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  client_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("hello", NULL);
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock));
-
-  globals = gras_userdata_new(client_data_t *);
-  globals->done = 0;
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  globals->toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  XBT_INFO("Programming the repetitive action with a frequency of 0.5 sec");
-  gras_timer_repeat(0.5, client_do_hello);
-
-  XBT_INFO("Programming the delayed action in 5 secs");
-  gras_timer_delay(5, client_do_stop);
-
-  while (!globals->done) {
-    gras_msg_handle(60);
-  }
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/07-timers.output b/doc/gtut-files/07-timers.output
deleted file mode 100644 (file)
index d71db4c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-$ ./test_server 12345 & ./test_client 127.0.0.1 12345
-[arthur:client:(27825) 0.000016] [test/INFO] Programming the repetitive action with a frequency of 0.5 sec
-[arthur:client:(27825) 0.000125] [test/INFO] Programming the delayed action in 5 secs
-[arthur:client:(27825) 0.500685] [test/INFO] Hello sent to server
-[arthur:client:(27825) 1.000855] [test/INFO] Hello sent to server
-[arthur:client:(27825) 1.501094] [test/INFO] Hello sent to server
-[arthur:client:(27825) 2.001261] [test/INFO] Hello sent to server
-[arthur:client:(27825) 2.501446] [test/INFO] Hello sent to server
-[arthur:client:(27825) 3.001591] [test/INFO] Hello sent to server
-[arthur:client:(27825) 3.501798] [test/INFO] Hello sent to server
-[arthur:client:(27825) 4.002111] [test/INFO] Hello sent to server
-[arthur:client:(27825) 4.502264] [test/INFO] Hello sent to server
-[arthur:client:(27825) 5.000513] [test/INFO] Kill sent to server
-[arthur:client:(27825) 5.000562] [test/INFO] Break the client's while loop
-[arthur:client:(27825) 5.000594] [gras/INFO] Exiting GRAS
-[arthur:server:(27821) 0.000014] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 0.500134] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 1.000349] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 1.500519] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 2.000788] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 2.500996] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 3.001083] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 3.501370] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 4.001514] [test/INFO] Cool, we received the message from 127.0.0.1:1024.
-[arthur:server:(27821) 4.499772] test.c:15: [test/CRITICAL] Argh, killed by 127.0.0.1:1024! Bye folks...
-[arthur:server:(27821) 4.499823] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-[Boivin:client:(2) 0.000000] [test/INFO] Programming the repetitive action with a frequency of 0.5 sec
-[Boivin:client:(2) 0.000000] [test/INFO] Programming the delayed action in 5 secs
-[Boivin:client:(2) 0.500537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 0.500537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 1.000537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 1.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 1.500537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 1.500537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 2.000537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 2.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 2.500537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 2.500537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 3.000537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 3.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 3.500537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 3.500537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 4.000537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 4.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 4.500537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 4.500537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 5.000537] [test/INFO] Hello sent to server
-[Jacquelin:server:(1) 5.000537] [test/INFO] Cool, we received the message from Boivin:1024.
-[Boivin:client:(2) 5.001074] [test/INFO] Kill sent to server
-[Boivin:client:(2) 5.001074] [test/INFO] Break the client's while loop
-[Boivin:client:(2) 5.001074] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 5.001074] test.c:15: [test/CRITICAL] Argh, killed by Boivin:1024! Bye folks...
-[Jacquelin:server:(1) 5.001074] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/08-exceptions.c b/doc/gtut-files/08-exceptions.c
deleted file mode 100644 (file)
index d419342..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-typedef struct {
-  int killed;
-} server_data_t;
-
-
-int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  XBT_CRITICAL("Argh, killed by %s:%d! Bye folks, I'm out of here...",
-            gras_socket_peer_name(client), gras_socket_peer_port(client));
-
-  globals->killed = 1;
-
-  return 0;
-}                               /* end_of_kill_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t *);
-  globals->killed = 0;
-
-  gras_msgtype_declare("kill", NULL);
-  gras_cb_register("kill", &server_kill_cb);
-
-  if (argc > 1 && !strcmp(argv[1], "--cheat")) {
-    mysock = gras_socket_server(9999);
-    XBT_INFO("Hi! hi! I'm not in the search range, but in 9999...");
-  } else {
-    mysock = gras_socket_server((rand() % 10) + 3000);
-    XBT_INFO("Ok, I'm hidden on port %d. Hope for the best.",
-          gras_socket_my_port(mysock));
-  }
-
-  while (!globals->killed) {
-    gras_msg_handle(-1);        /* blocking */
-  }
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-  int found;                    /* whether we found peer */
-  int port;                     /* where we think that the server is */
-  xbt_ex_t e;
-
-  gras_init(&argc, argv);
-
-  gras_msgtype_declare("kill", NULL);
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Run little server, run. I'll get you. (sleep 1.5 sec)");
-  gras_os_sleep(1.5);
-
-  for (port = 3000, found = 0; port < 3010 && !found; port++) {
-    TRY {
-      toserver = gras_socket_client(argv[1], port);
-      gras_msg_send(toserver, "kill", NULL);
-      gras_socket_close(toserver);
-      found = 1;
-      XBT_INFO("Yeah! I found the server on %d! It's eradicated by now.",
-            port);
-    }
-    CATCH(e) {
-      xbt_ex_free(e);
-    }
-    if (!found)
-      XBT_INFO("Damn, the server is not on %d", port);
-  }                             /* end_of_loop */
-
-  if (!found)
-    THROWF(not_found_error, 0,
-           "Damn, I failed to find the server! I cannot survive this humilliation.");
-
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/08-exceptions.output b/doc/gtut-files/08-exceptions.output
deleted file mode 100644 (file)
index 3da7114..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-$ ./test_server & ./test_client 127.0.0.1 
-[arthur:client:(27889) 0.000013] [test/INFO] Damn, the server is not on 3000
-[arthur:client:(27889) 0.000729] [test/INFO] Yeah! I found the server on 3001! It's eradicated by now.
-[arthur:client:(27889) 0.000767] [gras/INFO] Exiting GRAS
-[arthur:server:(27886) 0.000013] [test/INFO] Ok, I'm hidden on port 3001. Hope for the best.
-[arthur:server:(27886) 1.500772] test.c:15: [test/CRITICAL] Argh, killed by 127.0.0.1:1024! Bye folks, I'm out of here...
-[arthur:server:(27886) 1.500819] [gras/INFO] Exiting GRAS
-$
-$ ./test_server --cheat & ./test_client 127.0.0.1 
-[arthur:client:(27901) 0.000014] [test/INFO] Damn, the server is not on 3000
-[arthur:client:(27901) 0.000240] [test/INFO] Damn, the server is not on 3001
-[arthur:client:(27901) 0.000386] [test/INFO] Damn, the server is not on 3002
-[arthur:client:(27901) 0.000532] [test/INFO] Damn, the server is not on 3003
-[arthur:client:(27901) 0.000671] [test/INFO] Damn, the server is not on 3004
-[arthur:client:(27901) 0.000815] [test/INFO] Damn, the server is not on 3005
-[arthur:client:(27901) 0.000960] [test/INFO] Damn, the server is not on 3006
-[arthur:client:(27901) 0.001100] [test/INFO] Damn, the server is not on 3007
-[arthur:client:(27901) 0.001257] [test/INFO] Damn, the server is not on 3008
-[arthur:client:(27901) 0.001396] [test/INFO] Damn, the server is not on 3009
-** SimGrid: UNCAUGHT EXCEPTION received on arthur(27901): category: not found; value: 0
-** Damn, I failed to find the server! I cannot survive this humilliation.
-** Thrown by client() in this process
-[arthur:client:(27901) 0.001475] xbt/ex.c:113: [xbt_ex/CRITICAL] Damn, I failed to find the server! I cannot survive this humilliation.
-
-**   In client() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:80
-$ killall test_server
-[arthur:server:(27897) 0.000014] [test/INFO] Hi! hi! I'm not in the search range, but in 9999...
-$
-$ ./test_simulator platform.xml test.xml
-[Jacquelin:server:(1) 0.000000] [test/INFO] Ok, I'm hidden on port 3000. Hope for the best.
-[Boivin:client:(2) 1.500552] [test/INFO] Yeah! I found the server on 3000! It's eradicated by now.
-[Boivin:client:(2) 1.500552] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 1.500552] test.c:15: [test/CRITICAL] Argh, killed by Boivin:1024! Bye folks, I'm out of here...
-[Jacquelin:server:(1) 1.500552] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/09-datatype-dump.c b/doc/gtut-files/09-datatype-dump.c
deleted file mode 100644 (file)
index 8124064..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2006, 2010. 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. */
-
-#include <gras.h>
-#include <stdio.h>
-
-/* We must set this to make logging mecanism happy */
-extern const char *_gras_procname;
-
-/* This is a private data of gras/Datadesc we want to explore */
-xbt_set_t gras_datadesc_set_local = NULL;
-
-int main(int argc, char *argv[])
-{
-  xbt_set_elm_t elm;
-  xbt_set_cursor_t cursor;
-  gras_init(&argc, argv);
-
-  xbt_set_foreach(gras_datadesc_set_local, cursor, elm) {
-    printf("%s\n", elm->name);
-  }
-
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/09-simpledata.c b/doc/gtut-files/09-simpledata.c
deleted file mode 100644 (file)
index 29c24c0..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-typedef struct {
-  int killed;
-} server_data_t;
-
-
-int server_kill_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  double delay = *(double *) payload;
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  XBT_CRITICAL("Argh, %s:%d gave me %.2f seconds before suicide!",
-            gras_socket_peer_name(client), gras_socket_peer_port(client),
-            delay);
-  gras_os_sleep(delay);
-  XBT_CRITICAL("Bye folks...");
-
-
-  globals->killed = 1;
-
-  return 0;
-}                               /* end_of_kill_callback */
-
-int server_hello_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  char *msg = *(char **) payload;
-  gras_socket_t client = gras_msg_cb_ctx_from(ctx);
-
-  XBT_INFO("Cool, we received a message from %s:%d. Here it is: \"%s\"",
-        gras_socket_peer_name(client), gras_socket_peer_port(client), msg);
-
-  return 0;
-}                               /* end_of_hello_callback */
-
-void message_declaration(void)
-{
-  gras_msgtype_declare("kill", gras_datadesc_by_name("double"));
-  gras_msgtype_declare("hello", gras_datadesc_by_name("string"));
-}
-
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t *);
-  globals->killed = 0;
-
-  message_declaration();
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("hello", &server_hello_cb);
-  gras_cb_register("kill", &server_kill_cb);
-
-  while (!globals->killed) {
-    gras_msg_handle(-1);        /* blocking */
-  }
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  message_declaration();
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  char *hello_payload = "Nice to meet you";
-  gras_msg_send(toserver, "hello", &hello_payload);
-  XBT_INFO("we sent the hello to the server on %s.",
-        gras_socket_peer_name(toserver));
-
-  double kill_payload = 0.5;
-  gras_msg_send(toserver, "kill", &kill_payload);
-  XBT_INFO("Gave the server more 0.5 second to live");
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/09-simpledata.output b/doc/gtut-files/09-simpledata.output
deleted file mode 100644 (file)
index 2465493..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-$ ./test_server 12345 & ./test_client 127.0.0.1 12345
-[arthur:client:(27970) 0.000025] [test/INFO] we sent the hello to the server on 127.0.0.1.
-[arthur:client:(27970) 0.000124] [test/INFO] Gave the server more 0.5 second to live
-[arthur:client:(27970) 0.000152] [gras/INFO] Exiting GRAS
-[arthur:server:(27967) 0.000013] [test/INFO] Cool, we received a message from 127.0.0.1:1024. Here it is: "Nice to meet you"
-[arthur:server:(27967) 0.000105] test.c:16: [test/CRITICAL] Argh, 127.0.0.1:1024 gave me 0.50 seconds before suicide!
-[arthur:server:(27967) 0.500236] test.c:18: [test/CRITICAL] Bye folks...
-[arthur:server:(27967) 0.500303] [gras/INFO] Exiting GRAS
-$
-$ ./test_simulator platform.xml test.xml
-[Boivin:client:(2) 0.000000] [test/INFO] we sent the hello to the server on Jacquelin.
-[Jacquelin:server:(1) 0.000000] [test/INFO] Cool, we received a message from Boivin:1024. Here it is: "Nice to meet you"
-[Boivin:client:(2) 0.000539] [test/INFO] Gave the server more 0.5 second to live
-[Boivin:client:(2) 0.000539] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 0.000539] test.c:16: [test/CRITICAL] Argh, Boivin:1024 gave me 0.50 seconds before suicide!
-[Jacquelin:server:(1) 0.500539] test.c:18: [test/CRITICAL] Bye folks...
-[Jacquelin:server:(1) 0.500539] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/10-rpc.c b/doc/gtut-files/10-rpc.c
deleted file mode 100644 (file)
index bc01cbf..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include <stdlib.h>
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-typedef struct {
-  int done;
-} server_data_t;
-int server_done_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-  globals->done = 1;
-  XBT_INFO("Server done");
-
-  return 0;
-}                               /* end_of_done_callback */
-
-void message_declaration(void)
-{
-  gras_msgtype_declare_rpc("convert a2i", gras_datadesc_by_name("string"),
-                           gras_datadesc_by_name("long"));
-  gras_msgtype_declare_rpc("convert i2a", gras_datadesc_by_name("long"),
-                           gras_datadesc_by_name("string"));
-
-  /* the other message allowing the client to stop the server after use */
-  gras_msgtype_declare("done", NULL);
-}
-
-int server_convert_i2a_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  long data = *(long *) payload;
-  char *result;
-  char *p;
-
-  XBT_INFO("Convert %ld to string", data);
-  result = bprintf("%ld", data);
-  XBT_INFO("%ld converted to string: %s", data, result);
-
-  gras_msg_rpcreturn(60, ctx, &result);
-  free(result);
-  return 0;
-}                               /* end_of_convert_callback */
-
-int server_convert_a2i_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  char *string = *(char **) payload;
-  long result;
-  char *p;
-
-  XBT_INFO("Convert %s to long", string);
-  result = strtol(string, &p, 10);
-
-  if (*p != '\0')
-    THROWF(arg_error, 0,
-           "Error while converting %s: this does not seem to be a valid number (problem at '%s')",
-           string, p);
-
-  gras_msg_rpcreturn(60, ctx, &result);
-  return 0;
-}                               /* end_of_convert_callback */
-
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-
-  gras_init(&argc, argv);
-
-  globals = gras_userdata_new(server_data_t *);
-  globals->done = 0;
-
-  message_declaration();
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  gras_cb_register("convert a2i", &server_convert_a2i_cb);
-  gras_cb_register("convert i2a", &server_convert_i2a_cb);
-  gras_cb_register("done", &server_done_cb);
-
-  while (!globals->done) {
-    gras_msg_handle(-1);        /* blocking */
-  }
-
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  message_declaration();
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  long long_to_convert = 4321;
-  char *string_result;
-  XBT_INFO("Ask to convert %ld", long_to_convert);
-  gras_msg_rpccall(toserver, 60, "convert i2a", &long_to_convert,
-                   &string_result);
-  XBT_INFO("The server says that %ld is equal to \"%s\".", long_to_convert,
-        string_result);
-  free(string_result);
-
-  char *string_to_convert = "1234";
-  long long_result;
-  XBT_INFO("Ask to convert %s", string_to_convert);
-  gras_msg_rpccall(toserver, 60, "convert a2i", &string_to_convert,
-                   &long_result);
-  XBT_INFO("The server says that \"%s\" is equal to %d.", string_to_convert,
-        long_result);
-
-  xbt_ex_t e;
-  string_to_convert = "azerty";
-  TRY {
-    gras_msg_rpccall(toserver, 60, "convert a2i", &string_to_convert,
-                     &long_result);
-  }
-  CATCH(e) {
-    XBT_INFO
-        ("The server refuses to convert %s. Here is the received exception:",
-         string_to_convert);
-    xbt_ex_display(&e);
-    xbt_ex_free(e);
-    XBT_INFO("Again, previous exception was excepted");
-  }
-
-  gras_msg_send(toserver, "done", NULL);
-  XBT_INFO("Stopped the server");
-
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/10-rpc.output b/doc/gtut-files/10-rpc.output
deleted file mode 100644 (file)
index e77826b..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-$ ./test_server & ./test_client 127.0.0.1 
-[arthur:server:(12832) 0.000013] [test/INFO] Convert 4321 to string
-[arthur:server:(12832) 0.000128] [test/INFO] 4321 converted to string: 4321
-[arthur:server:(12832) 0.003889] [test/INFO] Convert 1234 to long
-[arthur:server:(12832) 0.008356] [test/INFO] Convert azerty to long
-[arthur:server:(12832) 0.053995] [gras_msg/INFO] Propagate local exception ('Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')') from 'convert a2i' RPC cb back to 127.0.0.1:1024
-** SimGrid: UNCAUGHT EXCEPTION received on arthur(12832): category: invalid_arg; value: 0
-** Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-** Thrown by server() in this process
-[arthur:server:(12832) 0.054088] xbt/ex.c:113: [xbt_ex/CRITICAL] Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-
-**   In server_convert_a2i_cb() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:48
-**   In gras_msg_handle() at /home/mquinson/Code/simgrid-git/src/gras/Msg/gras_msg_exchange.c:400
-**   In server() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:71
-[arthur:server:(12832) 0.055022] [test/INFO] Server done
-[arthur:server:(12832) 0.055063] [gras/INFO] Exiting GRAS
-[arthur:client:(12837) 0.000025] [test/INFO] Ask to convert 4321
-[arthur:client:(12837) 0.004416] [test/INFO] The server says that 4321 is equal to "4321".
-[arthur:client:(12837) 0.004468] [test/INFO] Ask to convert 1234
-[arthur:client:(12837) 0.008930] [test/INFO] The server says that "1234" is equal to 1234.
-[arthur:client:(12837) 0.055412] [test/INFO] The server refuses to convert azerty. Here is the received exception:
-** SimGrid: UNCAUGHT EXCEPTION received on arthur(12837): category: invalid_arg; value: 0
-** Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-** Thrown by server() on host arthur(12832)
-[arthur:client:(12837) 0.055505] xbt/ex.c:113: [xbt_ex/CRITICAL] Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-
-**   In server_convert_a2i_cb() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:48
-**   In gras_msg_handle() at /home/mquinson/Code/simgrid-git/src/gras/Msg/gras_msg_exchange.c:400
-**   In server() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:71
-[arthur:client:(12837) 0.055564] [test/INFO] Again, previous exception was excepted
-[arthur:client:(12837) 0.056367] [test/INFO] Stopped the server
-[arthur:client:(12837) 0.056404] [gras/INFO] Exiting GRAS
-$
-$ killall test_server
-$
-$ ./test_simulator platform.xml test.xml
-[Boivin:client:(2) 0.000000] [test/INFO] Ask to convert 4321
-[Jacquelin:server:(1) 0.000538] [test/INFO] Convert 4321 to string
-[Jacquelin:server:(1) 0.000538] [test/INFO] 4321 converted to string: 4321
-[Boivin:client:(2) 0.001077] [test/INFO] The server says that 4321 is equal to "4321".
-[Boivin:client:(2) 0.001077] [test/INFO] Ask to convert 1234
-[Jacquelin:server:(1) 0.001615] [test/INFO] Convert 1234 to long
-[Boivin:client:(2) 0.002153] [test/INFO] The server says that "1234" is equal to 1234.
-[Jacquelin:server:(1) 0.002692] [test/INFO] Convert azerty to long
-[Jacquelin:server:(1) 0.002692] [gras_msg/INFO] Propagate local exception ('Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')') from 'convert a2i' RPC cb back to Boivin:1024
-** SimGrid: UNCAUGHT EXCEPTION received on Jacquelin(1): category: invalid_arg; value: 0
-** Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-** Thrown by server() in this process
-[Jacquelin:server:(1) 0.002692] xbt/ex.c:113: [xbt_ex/CRITICAL] Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-
-**   In server_convert_a2i_cb() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:48
-**   In gras_msg_handle() at /home/mquinson/Code/simgrid-git/src/gras/Msg/gras_msg_exchange.c:400
-**   In server() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:71
-**   In xbt_ctx_sysv_stop() at /home/mquinson/Code/simgrid-git/src/xbt/xbt_context_sysv.c:257
-**   In makecontext() at ??:0
-**   In update_actions_state() at /home/mquinson/Code/simgrid-git/src/surf/surf_timer.c:108
-**   In surf_solve() at /home/mquinson/Code/simgrid-git/src/surf/surf.c:543
-**   In SIMIX_solve() at /home/mquinson/Code/simgrid-git/src/simix/smx_global.c:347
-**   In gras_main() at /home/mquinson/Code/simgrid-git/src/gras/Virtu/sg_process.c:222
-[Boivin:client:(2) 0.003490] [test/INFO] The server refuses to convert azerty. Here is the received exception:
-** SimGrid: UNCAUGHT EXCEPTION received on Boivin(2): category: invalid_arg; value: 0
-** Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-** Thrown by server() on host Jacquelin(1)
-[Boivin:client:(2) 0.003490] xbt/ex.c:113: [xbt_ex/CRITICAL] Error while converting azerty: this does not seem to be a valid number (problem at 'azerty')
-
-**   In server_convert_a2i_cb() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:48
-**   In gras_msg_handle() at /home/mquinson/Code/simgrid-git/src/gras/Msg/gras_msg_exchange.c:400
-**   In server() at /home/mquinson/Code/simgrid-git/doc/gtut-files/test.c:71
-**   In xbt_ctx_sysv_stop() at /home/mquinson/Code/simgrid-git/src/xbt/xbt_context_sysv.c:257
-**   In makecontext() at ??:0
-**   In update_actions_state() at /home/mquinson/Code/simgrid-git/src/surf/surf_timer.c:108
-**   In surf_solve() at /home/mquinson/Code/simgrid-git/src/surf/surf.c:543
-**   In SIMIX_solve() at /home/mquinson/Code/simgrid-git/src/simix/smx_global.c:347
-**   In gras_main() at /home/mquinson/Code/simgrid-git/src/gras/Virtu/sg_process.c:222
-[Boivin:client:(2) 0.003490] [test/INFO] Again, previous exception was excepted
-[Boivin:client:(2) 0.004027] [test/INFO] Stopped the server
-[Boivin:client:(2) 0.004027] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 0.004027] [test/INFO] Server done
-[Jacquelin:server:(1) 0.004027] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/11-explicitwait.c b/doc/gtut-files/11-explicitwait.c
deleted file mode 100644 (file)
index f13c7e9..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Copyright (c) 2007, 2010. 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. */
-
-#include <stdlib.h>
-#include <gras.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "My little example");
-
-void message_declaration(void)
-{
-  gras_msgtype_declare("request", NULL);
-  gras_msgtype_declare("grant", NULL);
-  gras_msgtype_declare("release", NULL);
-}
-
-typedef struct {
-  int process_in_CS;
-  xbt_dynar_t waiting_queue;
-} server_data_t;
-
-int server_request_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-  gras_socket_t s = gras_msg_cb_ctx_from(ctx);
-
-  if (globals->process_in_CS) {
-    xbt_dynar_push(globals->waiting_queue, &s);
-    XBT_INFO("put %s:%d in waiting queue", gras_socket_peer_name(s),
-          gras_socket_peer_port(s));
-  } else {
-    globals->process_in_CS = 1;
-    XBT_INFO("grant %s:%d since nobody wanted it", gras_socket_peer_name(s),
-          gras_socket_peer_port(s));
-    gras_msg_send(s, "grant", NULL);
-  }
-  return 0;
-}                               /* end_of_request_callback */
-
-int server_release_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-
-  if (!xbt_dynar_is_empty(globals->waiting_queue)) {
-    gras_socket_t s;
-    xbt_dynar_pop(globals->waiting_queue, &s);
-
-    XBT_INFO("grant %s:%d since token released", gras_socket_peer_name(s),
-          gras_socket_peer_port(s));
-    gras_msg_send(s, "grant", NULL);
-  } else {
-    globals->process_in_CS = 0;
-  }
-
-  return 0;
-}                               /* end_of_release_callback */
-
-int server(int argc, char *argv[])
-{
-  gras_socket_t mysock;         /* socket on which I listen */
-  server_data_t *globals;
-  int i;
-
-  gras_init(&argc, argv);
-  mysock = gras_socket_server(atoi(argv[1]));
-
-  globals = gras_userdata_new(server_data_t);
-  globals->process_in_CS = 0;
-  globals->waiting_queue =
-      xbt_dynar_new(sizeof(gras_socket_t),
-                    NULL /* not closing sockets */ );
-
-  message_declaration();
-  gras_cb_register("request", &server_request_cb);
-  gras_cb_register("release", &server_release_cb);
-
-  for (i = 0; i < 20; i++)      /* 5 requests of each process, 2 processes, 2 messages per request */
-    gras_msg_handle(-1);
-
-  gras_exit();
-  return 0;
-}                               /* end_of_server */
-
-void lock(gras_socket_t toserver)
-{
-  gras_msg_send(toserver, "request", NULL);
-  gras_msg_wait(-1, "grant", NULL, NULL);
-  XBT_INFO("Granted by server");
-}                               /* end_of_lock */
-
-void unlock(gras_socket_t toserver)
-{
-  XBT_INFO("Release the token");
-  gras_msg_send(toserver, "release", NULL);
-}                               /* end_of_unlock */
-
-int client(int argc, char *argv[])
-{
-  int i;
-  gras_socket_t mysock;         /* socket on which I listen */
-  gras_socket_t toserver;       /* socket used to write to the server */
-
-  gras_init(&argc, argv);
-
-  mysock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  XBT_VERB("Client ready; listening on %d", gras_socket_my_port(mysock));
-
-  gras_os_sleep(1.5);           /* sleep 1 second and half */
-  message_declaration();
-  toserver = gras_socket_client(argv[1], atoi(argv[2]));
-
-  for (i = 0; i < 5; i++) {
-    gras_os_sleep(0.1);
-    lock(toserver);
-    gras_os_sleep(0.1);
-    unlock(toserver);
-  }
-  gras_exit();
-  return 0;
-}
diff --git a/doc/gtut-files/11-explicitwait.output b/doc/gtut-files/11-explicitwait.output
deleted file mode 100644 (file)
index 5f24d07..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-$ ./test_server & ./test_client 127.0.0.1 12345 & ./test_client 127.0.0.1 12345 
-[arthur:server:(28159) 0.000023] [test/INFO] grant 127.0.0.1:1024 since nobody wanted it
-[arthur:client:(28160) 0.000013] [test/INFO] Granted by server
-[arthur:server:(28159) 0.014750] [test/INFO] put 127.0.0.1:1025 in waiting queue
-[arthur:client:(28160) 0.100254] [test/INFO] Release the token
-[arthur:server:(28159) 0.100950] [test/INFO] grant 127.0.0.1:1025 since token released
-[arthur:client:(28162) 0.000014] [test/INFO] Granted by server
-[arthur:server:(28159) 0.201146] [test/INFO] put 127.0.0.1:1024 in waiting queue
-[arthur:client:(28162) 0.100169] [test/INFO] Release the token
-[arthur:server:(28159) 0.201593] [test/INFO] grant 127.0.0.1:1024 since token released
-[arthur:client:(28160) 0.201472] [test/INFO] Granted by server
-[arthur:client:(28160) 0.301560] [test/INFO] Release the token
-[arthur:server:(28159) 0.302114] [test/INFO] put 127.0.0.1:1025 in waiting queue
-[arthur:server:(28159) 0.302172] [test/INFO] grant 127.0.0.1:1025 since token released
-[arthur:client:(28162) 0.201166] [test/INFO] Granted by server
-[arthur:server:(28159) 0.402342] [test/INFO] put 127.0.0.1:1024 in waiting queue
-[arthur:client:(28162) 0.301265] [test/INFO] Release the token
-[arthur:server:(28159) 0.402687] [test/INFO] grant 127.0.0.1:1024 since token released
-[arthur:client:(28160) 0.402605] [test/INFO] Granted by server
-[arthur:server:(28159) 0.503013] [test/INFO] put 127.0.0.1:1025 in waiting queue
-[arthur:client:(28160) 0.502739] [test/INFO] Release the token
-[arthur:server:(28159) 0.503260] [test/INFO] grant 127.0.0.1:1025 since token released
-[arthur:client:(28162) 0.402236] [test/INFO] Granted by server
-[arthur:server:(28159) 0.603517] [test/INFO] put 127.0.0.1:1024 in waiting queue
-[arthur:client:(28162) 0.502304] [test/INFO] Release the token
-[arthur:server:(28159) 0.603699] [test/INFO] grant 127.0.0.1:1024 since token released
-[arthur:client:(28160) 0.603564] [test/INFO] Granted by server
-[arthur:client:(28160) 0.703651] [test/INFO] Release the token
-[arthur:server:(28159) 0.704098] [test/INFO] put 127.0.0.1:1025 in waiting queue
-[arthur:server:(28159) 0.704146] [test/INFO] grant 127.0.0.1:1025 since token released
-[arthur:client:(28162) 0.603133] [test/INFO] Granted by server
-[arthur:server:(28159) 0.804385] [test/INFO] put 127.0.0.1:1024 in waiting queue
-[arthur:client:(28162) 0.703226] [test/INFO] Release the token
-[arthur:server:(28159) 0.804647] [test/INFO] grant 127.0.0.1:1024 since token released
-[arthur:client:(28160) 0.804530] [test/INFO] Granted by server
-[arthur:client:(28160) 0.904608] [test/INFO] Release the token
-[arthur:server:(28159) 0.905011] [test/INFO] put 127.0.0.1:1025 in waiting queue
-[arthur:client:(28160) 0.904749] [gras/INFO] Exiting GRAS
-[arthur:server:(28159) 0.905159] [test/INFO] grant 127.0.0.1:1025 since token released
-[arthur:client:(28162) 0.804870] [test/INFO] Granted by server
-[arthur:client:(28162) 0.905010] [test/INFO] Release the token
-[arthur:client:(28162) 0.905181] [gras/INFO] Exiting GRAS
-[arthur:server:(28159) 1.007620] [gras/INFO] Exiting GRAS
-$
-$
-$ ./test_simulator platform-3nodes.xml test.xml
-[Jacquelin:server:(1) 0.000000] [test/INFO] grant Boivin:1024 since nobody wanted it
-[Jacquelin:server:(1) 0.000537] [test/INFO] put Geoff:1024 in waiting queue
-[Boivin:client:(2) 0.000537] [test/INFO] Granted by server
-[Boivin:client:(2) 0.100537] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.101074] [test/INFO] grant Geoff:1024 since token released
-[Geoff:client:(3) 0.101264] [test/INFO] Granted by server
-[Geoff:client:(3) 0.201264] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.201611] [test/INFO] put Boivin:1024 in waiting queue
-[Jacquelin:server:(1) 0.201801] [test/INFO] grant Boivin:1024 since token released
-[Boivin:client:(2) 0.202338] [test/INFO] Granted by server
-[Jacquelin:server:(1) 0.301991] [test/INFO] put Geoff:1024 in waiting queue
-[Boivin:client:(2) 0.302338] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.302875] [test/INFO] grant Geoff:1024 since token released
-[Geoff:client:(3) 0.303065] [test/INFO] Granted by server
-[Geoff:client:(3) 0.403065] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.403412] [test/INFO] put Boivin:1024 in waiting queue
-[Jacquelin:server:(1) 0.403602] [test/INFO] grant Boivin:1024 since token released
-[Boivin:client:(2) 0.404139] [test/INFO] Granted by server
-[Jacquelin:server:(1) 0.503792] [test/INFO] put Geoff:1024 in waiting queue
-[Boivin:client:(2) 0.504139] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.504675] [test/INFO] grant Geoff:1024 since token released
-[Geoff:client:(3) 0.504865] [test/INFO] Granted by server
-[Geoff:client:(3) 0.604865] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.605212] [test/INFO] put Boivin:1024 in waiting queue
-[Jacquelin:server:(1) 0.605402] [test/INFO] grant Boivin:1024 since token released
-[Boivin:client:(2) 0.605939] [test/INFO] Granted by server
-[Jacquelin:server:(1) 0.705592] [test/INFO] put Geoff:1024 in waiting queue
-[Boivin:client:(2) 0.705939] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.706476] [test/INFO] grant Geoff:1024 since token released
-[Geoff:client:(3) 0.706666] [test/INFO] Granted by server
-[Geoff:client:(3) 0.806666] [test/INFO] Release the token
-[Jacquelin:server:(1) 0.807013] [test/INFO] put Boivin:1024 in waiting queue
-[Jacquelin:server:(1) 0.807203] [test/INFO] grant Boivin:1024 since token released
-[Boivin:client:(2) 0.807740] [test/INFO] Granted by server
-[Jacquelin:server:(1) 0.907393] [test/INFO] put Geoff:1024 in waiting queue
-[Boivin:client:(2) 0.907740] [test/INFO] Release the token
-[Boivin:client:(2) 0.908277] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 0.908277] [test/INFO] grant Geoff:1024 since token released
-[Geoff:client:(3) 0.908467] [test/INFO] Granted by server
-[Geoff:client:(3) 1.008467] [test/INFO] Release the token
-[Geoff:client:(3) 1.008657] [gras/INFO] Exiting GRAS
-[Jacquelin:server:(1) 1.008657] [gras/INFO] Exiting GRAS
-$
diff --git a/doc/gtut-files/11-explicitwait.xml b/doc/gtut-files/11-explicitwait.xml
deleted file mode 100644 (file)
index bb94d69..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Jacquelin" function="server">
-    <argument value="12345"/>
-  </process>
-  <process host="Boivin" function="client">
-    <argument value="Jacquelin"/>
-    <argument value="12345"/>
-  </process>
-  <process host="Geoff" function="client">
-    <argument value="Jacquelin"/>
-    <argument value="12345"/>
-  </process>
-</platform>
-
diff --git a/doc/gtut-files/Makefile b/doc/gtut-files/Makefile
deleted file mode 100644 (file)
index 6b602ef..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-# This works mainly on my box for now
-export LD_LIBRARY_PATH=$(GRAS_ROOT)/lib
-GRAS_STUB_GENERATOR=$(GRAS_ROOT)/bin/gras_stub_generator
-
-all: 01-bones.output 02-simple.output 03-args.output 04-callback.output \
-     05-globals.output 06-logs.output 07-timers.output 08-exceptions.output \
-     09-simpledata.output 10-rpc.output 11-explicitwait.output
-
-veryclean: clean
-       rm *.output*
-
-# Lesson 01: simple bones of project
-########################################
-
-01-bones.output: 01-bones_client 01-bones_server 01-bones_simulator
-       echo '$$ ./test_client'                           > $@ 
-       ./01-bones_client                                 >> $@ 2>&1
-       echo '$$ ./test_server'                          >> $@
-       ./01-bones_server                                 >> $@ 2>&1
-       echo '$$'                                        >> $@ 
-       echo '$$ ./test_simulator platform.xml test.xml' >> $@ 
-       ./01-bones_simulator gtut-platform.xml test.xml   >> $@ 2>&1
-       echo '$$'                                        >> $@ 
-
-01-bones_client 01-bones_server 01-bones_simulator: _01-bones_client.c _01-bones_server.c _01-bones_simulator.c
-       make -f 01-bones.mk
-
-_01-bones_client.c _01-bones_server.c _01-bones_simulator.c: 01-bones.c test.xml
-       $(GRAS_STUB_GENERATOR) 01-bones test.xml >/dev/null
-
-clean::
-       if [ -e 01-bones.mk ] ; then make -f 01-bones.mk clean; fi
-       rm -f _01-bones_client.c _01-bones_server.c _01-bones_simulator.c 01-bones.trace 01-bones.mk
-
-# Lesson 02: simple message exchange
-########################################
-
-02-simple.output: 02-simple_client 02-simple_server 02-simple_simulator
-       echo '$$ ./test_simulator platform.xml test.xml'  > $@
-       ./02-simple_simulator gtut-platform.xml test.xml  >> $@ 2>&1
-       echo '$$'                                        >> $@ 
-
-02-simple_client 02-simple_server 02-simple_simulator: _02-simple_client.c _02-simple_server.c _02-simple_simulator.c
-       make -f 02-simple.mk
-
-_02-simple_client.c _02-simple_server.c _02-simple_simulator.c: 02-simple.c test.xml
-       $(GRAS_STUB_GENERATOR) 02-simple test.xml >/dev/null
-
-clean::
-       if [ -e 02-simple.mk ] ; then make -f 02-simple.mk clean; fi
-       rm -f _02-simple_client.c _02-simple_server.c _02-simple_simulator.c 02-simple.trace 02-simple.mk
-
-# Lesson 03: passing args to processes
-########################################
-
-03-args.output: 03-args_client 03-args_server 03-args_simulator
-       echo '$$ ./test_server 12345 & ./test_client 127.0.0.1 12345'  > $@ 
-       ./03-args_server 12345                                         >> $@ 2>&1&
-       ./03-args_client 127.0.0.1 12345                               >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./03-args_simulator gtut-platform.xml 03-args.xml               >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 03-args_server 03-args_client 2>/dev/null || true
-
-03-args_client 03-args_server 03-args_simulator: _03-args_client.c _03-args_server.c _03-args_simulator.c
-       make -f 03-args.mk
-
-_03-args_client.c _03-args_server.c _03-args_simulator.c: 03-args.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 03-args 03-args.xml >/dev/null
-
-clean::
-       if [ -e 03-args.mk ] ; then make -f 03-args.mk clean; fi
-       rm -f _03-args_client.c _03-args_server.c _03-args_simulator.c 03-args.trace 03-args.mk
-
-# Lesson 4: callbacks
-########################################
-
-04-callback.output: 04-callback_client 04-callback_server 04-callback_simulator
-       echo '$$ ./test_server 23451 & ./test_client 127.0.0.1 23451'  > $@ 
-       ./04-callback_server 23451                                     >> $@ 2>&1&
-       ./04-callback_client 127.0.0.1 23451                           >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./04-callback_simulator gtut-platform.xml 03-args.xml           >> $@ 2>&1
-       echo '$$'                                                     >> $@
-       killall 04-callback_server 04-callback_client 2>/dev/null || true
-
-04-callback_client 04-callback_server 04-callback_simulator: _04-callback_client.c _04-callback_server.c _04-callback_simulator.c
-       make -f 04-callback.mk
-
-_04-callback_client.c _04-callback_server.c _04-callback_simulator.c: 04-callback.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 04-callback 03-args.xml >/dev/null
-
-clean::
-       if [ -e 04-callback.mk ] ; then make -f 04-callback.mk clean; fi
-       rm -f _04-callback_client.c _04-callback_server.c _04-callback_simulator.c 04-callback.trace 04-callback.mk
-
-# Lesson 5: globals
-########################################
-
-05-globals.output: 05-globals_client 05-globals_server 05-globals_simulator
-       echo '$$ ./test_server 12345 & ./test_client 127.0.0.1 12345'  > $@ 
-       ./05-globals_server 12345                                      >> $@ 2>&1&
-       ./05-globals_client 127.0.0.1 12345                            >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./05-globals_simulator gtut-platform.xml 03-args.xml            >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 05-globals_server 05-globals_client 2>/dev/null || true
-
-05-globals_client 05-globals_server 05-globals_simulator: _05-globals_client.c _05-globals_server.c _05-globals_simulator.c
-       make -f 05-globals.mk
-
-_05-globals_client.c _05-globals_server.c _05-globals_simulator.c: 05-globals.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 05-globals 03-args.xml >/dev/null
-
-clean::
-       if [ -e 05-globals.mk ] ; then make -f 05-globals.mk clean; fi
-       rm -f _05-globals_client.c _05-globals_server.c _05-globals_simulator.c 05-globals.trace 05-globals.mk
-
-# Lesson 6: logs
-########################################
-
-06-logs.output: 06-logs_client 06-logs_server 06-logs_simulator \
-        06-logs.output.fmt 06-logs.output.fmt-bt 06-logs.output.verbose 06-logs.output.error
-       echo '$$ ./test_server 12345 & ./test_client 127.0.0.1 12345'  > $@ 
-       ./06-logs_server 12345                             2>&1 |sed s/06-logs/test/  >> $@ 2>&1&
-       ./06-logs_client 127.0.0.1 12345                   2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./06-logs_simulator gtut-platform.xml 03-args.xml   2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 06-logs_server 06-logs_client 2>/dev/null || true
-
-06-logs.output.fmt: 06-logs_client 06-logs_server 06-logs_simulator 
-       echo '$$ ./test_server 12345 --log=test.fmt:%m%n & ./test_client 127.0.0.1 12345 --log=test.fmt:%m%n'  > $@
-       ./06-logs_server 12345  --log=test.fmt:%m%nn          2>&1 |sed s/06-logs/test/  >> $@ 2>&1&
-       ./06-logs_client 127.0.0.1 12345 --log=test.fmt:%m%n 2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml --log=test.fmt:%m%n'              >> $@
-       ./06-logs_simulator gtut-platform.xml 03-args.xml  --log=test.fmt:%m%n 2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 06-logs_server 06-logs_client 2>/dev/null || true
-
-06-logs.output.fmt-bt: 06-logs_client 06-logs_server 06-logs_simulator 
-       echo '$$ ./test_server 12345 --log=test.fmt:"[%r] %m%n%b%n%n" & ./test_client 127.0.0.1 12345 --log=test.fmt:"[%r] %m%n%b%n%n"'  > $@
-       ./06-logs_server 12345  --log=test.fmt:[%r]%m%n%b%n%n          2>&1 |sed s/06-logs/test/  >> $@ 2>&1&
-       ./06-logs_client 127.0.0.1 12345 --log=test.fmt:[%r]%m%n%b%n%n 2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml --log=test.fmt:[%r]%m%n%b%n%n'              >> $@
-       ./06-logs_simulator gtut-platform.xml 03-args.xml  --log=test.fmt:[%r]%m%n%b%n%n 2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 06-logs_server 06-logs_client 2>/dev/null || true
-
-06-logs.output.verbose: 06-logs_client 06-logs_server 06-logs_simulator
-       echo '$$ ./test_server 12345 --log=test.thres:verbose & ./test_client 127.0.0.1 12345 --log=test.thres:verbose'  > $@
-       ./06-logs_server 12345 --log=test.thres:verbose                            2>&1 |sed s/06-logs/test/  >> $@ 2>&1&
-       ./06-logs_client 127.0.0.1 12345 --log=test.thres:verbose                  2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml --log=test.thres:verbose'              >> $@
-       ./06-logs_simulator gtut-platform.xml 03-args.xml --log=test.thres:verbose  2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 06-logs_server 06-logs_client 2>/dev/null || true
-
-06-logs.output.error: 06-logs_client 06-logs_server 06-logs_simulator
-       echo '$$ ./test_server 12345 --log=root.thres:error & ./test_client 127.0.0.1 12345 --log=root.thres:error'  > $@
-       ./06-logs_server 12345 --log=root.thres:error                            2>&1 |sed s/06-logs/test/  >> $@ 2>&1&
-       ./06-logs_client 127.0.0.1 12345 --log=root.thres:error                  2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml --log=root.thres:error'              >> $@
-       ./06-logs_simulator gtut-platform.xml 03-args.xml --log=root.thres:error  2>&1 |sed s/06-logs/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 06-logs_server 06-logs_client 2>/dev/null || true
-
-
-06-logs_client 06-logs_server 06-logs_simulator: _06-logs_client.c _06-logs_server.c _06-logs_simulator.c
-       make -f 06-logs.mk
-
-_06-logs_client.c _06-logs_server.c _06-logs_simulator.c: 06-logs.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 06-logs 03-args.xml >/dev/null
-
-clean::
-       if [ -e 06-logs.mk ] ; then make -f 06-logs.mk clean; fi
-       rm -f _06-logs_client.c _06-logs_server.c _06-logs_simulator.c 06-logs.trace 06-logs.mk
-
-
-# Lesson 7: timers
-########################################
-
-07-timers.output: 07-timers_client 07-timers_server 07-timers_simulator
-       echo '$$ ./test_server 12345 & ./test_client 127.0.0.1 12345'  > $@ 
-       ./07-timers_server 12345                             2>&1 |sed s/07-timers/test/  >> $@ 2>&1&
-       ./07-timers_client 127.0.0.1 12345                   2>&1 |sed s/07-timers/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./07-timers_simulator gtut-platform.xml 03-args.xml   2>&1 |sed s/07-timers/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 07-timers_server 07-timers_client 2>/dev/null || true
-
-07-timers_client 07-timers_server 07-timers_simulator: _07-timers_client.c _07-timers_server.c _07-timers_simulator.c
-       make -f 07-timers.mk
-
-_07-timers_client.c _07-timers_server.c _07-timers_simulator.c: 07-timers.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 07-timers 03-args.xml >/dev/null
-
-clean::
-       if [ -e 07-timers.mk ] ; then make -f 07-timers.mk clean; fi
-       rm -f _07-timers_client.c _07-timers_server.c _07-timers_simulator.c 07-timers.trace 07-timers.mk
-
-# Lesson 8: exceptions
-########################################
-
-08-exceptions.output: 08-exceptions_client 08-exceptions_server 08-exceptions_simulator
-       echo '$$ ./test_server & ./test_client 127.0.0.1 '             > $@
-       ./08-exceptions_server                                   2>&1 |sed s/08-exceptions/test/  >> $@ 2>&1&
-       ./08-exceptions_client 127.0.0.1                         2>&1 |sed s/08-exceptions/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_server --cheat & ./test_client 127.0.0.1 '    >> $@
-       ./08-exceptions_server --cheat                           2>&1 |sed s/08-exceptions/test/  >> $@ 2>&1&
-       ./08-exceptions_client 127.0.0.1                         2>&1 |sed s/08-exceptions/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$ killall test_server'                                 >> $@
-       killall 08-exceptions_server 08-exceptions_client 2>/dev/null || true
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./08-exceptions_simulator gtut-platform.xml 03-args.xml   2>&1 |sed s/08-exceptions/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-
-08-exceptions_client 08-exceptions_server 08-exceptions_simulator: _08-exceptions_client.c _08-exceptions_server.c _08-exceptions_simulator.c
-       make -f 08-exceptions.mk
-
-_08-exceptions_client.c _08-exceptions_server.c _08-exceptions_simulator.c: 08-exceptions.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 08-exceptions 03-args.xml >/dev/null
-
-clean::
-       if [ -e 08-exceptions.mk ] ; then make -f 08-exceptions.mk clean; fi
-       rm -f _08-exceptions_client.c _08-exceptions_server.c _08-exceptions_simulator.c 08-exceptions.trace 08-exceptions.mk 08-exceptions.output
-
-# Lesson 9: simple data exchange
-########################################
-09-datatype-dump: 09-datatype-dump.c
-       gcc -I$(GRAS_ROOT)/include -lgras -L$(GRAS_ROOT)/lib $^ -o $@ 
-
-clean::
-       rm -f 09-datatype-dump.o 09-datatype-dump
-
-09-simpledata.output: 09-simpledata_client 09-simpledata_server 09-simpledata_simulator
-       echo '$$ ./test_server 12345 & ./test_client 127.0.0.1 12345'  > $@ 
-       ./09-simpledata_server 12345                             2>&1 |sed s/09-simpledata/test/  >> $@ 2>&1&
-       ./09-simpledata_client 127.0.0.1 12345                   2>&1 |sed s/09-simpledata/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./09-simpledata_simulator gtut-platform.xml 03-args.xml   2>&1 |sed s/09-simpledata/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-       killall 09-simpledata_server 09-simpledata_client 2>/dev/null || true
-
-09-simpledata_client 09-simpledata_server 09-simpledata_simulator: _09-simpledata_client.c _09-simpledata_server.c _09-simpledata_simulator.c
-       make -f 09-simpledata.mk
-
-_09-simpledata_client.c _09-simpledata_server.c _09-simpledata_simulator.c: 09-simpledata.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 09-simpledata 03-args.xml >/dev/null
-
-clean::
-       if [ -e 09-simpledata.mk ] ; then make -f 09-simpledata.mk clean; fi
-       rm -f _09-simpledata_client.c _09-simpledata_server.c _09-simpledata_simulator.c 09-simpledata.trace 09-simpledata.mk
-
-# Lesson 10: RPC
-########################################
-10-rpc.output: 10-rpc_client 10-rpc_server 10-rpc_simulator
-       echo '$$ ./test_server & ./test_client 127.0.0.1 '             > $@
-       ./10-rpc_server 12345                             2>&1 |sed s/10-rpc/test/  >> $@ 2>&1&
-       ./10-rpc_client 127.0.0.1 12345                   2>&1 |sed s/10-rpc/test/  >> $@ 2>&1
-       sleep 1
-       echo '$$'                                                     >> $@
-       echo '$$ killall test_server'                                 >> $@
-       killall 10-rpc_server 10-rpc_client 2>/dev/null || true
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform.xml test.xml'              >> $@
-       ./10-rpc_simulator gtut-platform.xml 03-args.xml   2>&1 |sed s/10-rpc/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-
-10-rpc_client 10-rpc_server 10-rpc_simulator: _10-rpc_client.c _10-rpc_server.c _10-rpc_simulator.c
-       make -f 10-rpc.mk
-
-_10-rpc_client.c _10-rpc_server.c _10-rpc_simulator.c: 10-rpc.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 10-rpc 03-args.xml >/dev/null
-
-clean::
-       if [ -e 10-rpc.mk ] ; then make -f 10-rpc.mk clean; fi
-       rm -f _10-rpc_client.c _10-rpc_server.c _10-rpc_simulator.c 10-rpc.trace 10-rpc.mk
-
-
-# Lesson 11: Explicit wait
-########################################
-11-explicitwait.output: 11-explicitwait_client 11-explicitwait_server 11-explicitwait_simulator
-       (echo '$$ ./test_server & ./test_client 127.0.0.1 12345 & ./test_client 127.0.0.1 12345 '; \
-        ./11-explicitwait_client 127.0.0.1 12345            & \
-        ./11-explicitwait_client 127.0.0.1 12345            & \
-        ./11-explicitwait_server 12345                        \
-       ) 2>&1 | sed s/11-explicitwait/test/ > $@
-       sleep 1
-       echo '$$'                                                     >> $@
-       killall 11-explicitwait_server 11-explicitwait_client 2>/dev/null || true
-       echo '$$'                                                     >> $@
-       echo '$$ ./test_simulator platform-3nodes.xml test.xml'              >> $@
-       ./11-explicitwait_simulator gtut-platform-3nodes.xml 11-explicitwait.xml   2>&1 |sed s/11-explicitwait/test/  >> $@ 2>&1
-       echo '$$'                                                     >> $@ 
-
-11-explicitwait_client 11-explicitwait_server 11-explicitwait_simulator: _11-explicitwait_client.c _11-explicitwait_server.c _11-explicitwait_simulator.c
-       make -f 11-explicitwait.mk
-
-_11-explicitwait_client.c _11-explicitwait_server.c _11-explicitwait_simulator.c: 11-explicitwait.c 03-args.xml
-       $(GRAS_STUB_GENERATOR) 11-explicitwait 03-args.xml >/dev/null
-
-clean::
-       if [ -e 11-explicitwait.mk ] ; then make -f 11-explicitwait.mk clean; fi
-       rm -f _11-explicitwait_client.c _11-explicitwait_server.c _11-explicitwait_simulator.c 11-explicitwait.trace 11-explicitwait.mk
-
-
diff --git a/doc/gtut-files/README b/doc/gtut-files/README
deleted file mode 100644 (file)
index df4eff4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-You shouldn't muck with these files unless you know what you are doing. They
-are used for the GRAS tutorial.
-
-Mt.
diff --git a/doc/gtut-files/gtut-howto-design.doc b/doc/gtut-files/gtut-howto-design.doc
deleted file mode 100644 (file)
index 715d850..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/** @defgroup GRAS_howto_design HOWTO design a GRAS application
-    @ingroup GRAS_howto HOWTOs
-
-This page tries to give some hints on how to design a GRAS application. The
-provided model and functionnalities are somehow different from the other
-existing solutions (nammly, MPI), and this page tries to give you the feeling
-of the GRAS philosophy. You may also want to (re)read the \ref GRAS_tut_intro.
-
-As an example, you may have a look at \ref GRAS_tut_tour_explicitwait_use,
-which somehow follows the guidelines given here.
-
-\section GRAS_howto_design_toc Table of content
-  - \ref GRAS_howto_design_what
-  - \ref GRAS_howto_design_design
-    - \ref GRAS_howto_design_design_api
-    - \ref GRAS_howto_design_design_processes
-    - \ref GRAS_howto_design_design_protocol
-      - \ref GRAS_howto_design_design_protocol_msg
-      - \ref GRAS_howto_design_design_protocol_cb
-  - \ref GRAS_howto_design_implem
-    - \ref GRAS_howto_design_implem_cb
-    - \ref GRAS_howto_design_implem_api
-    - \ref GRAS_howto_design_implem_init
-  - \ref GRAS_howto_design_test
-    - \ref GRAS_howto_design_test_sim
-    - \ref GRAS_howto_design_test_local
-    - \ref GRAS_howto_design_test_dist
-
-\section GRAS_howto_design_what What is a GRAS application
-
-As explained in \ref GRAS_tut_intro, you should see a GRAS application as a
-distributed service. There is two main parts:
- - a user API, composed of regular functions offering services to the users
- - a set of nodes (or processes, or agents, name them as you want)
-   collaborating and exchanging messages to achieve the requested service on
-   behalf of the user.
-
-It is naturally possible to not follow this split, and let the users of your
-service directly sending messages by themselves. Nevertheless, this
-encapsulation is a good thing because distributed computing is a bit hard to
-achieve. You may thus not want to force your users to go into this tricky
-part. Instead, shield them with a regular C API.
-
-If you are the only user of the code you develop, I'd advice you to still
-follow this approach. But do as you prefer, of course.
-
-\section GRAS_howto_design_design The design phase
-
-\subsection GRAS_howto_design_design_api Specify the user API
-
-These will be the entry points of your system, and you should think twice
-about their syntax and semantic.
-
-\subsection GRAS_howto_design_design_processes Identify the types of processes in your application
-
-Note that we are not speaking about the amount of processes in your
-application, but rather on the type of processes. The amount of distinct
-roles.
-
-Depending on your application, there may be only one type (for example in a
-peer-to-peer system), two types of processes (for example in a client/server
-system), three types of processes (for example if you add a forwarder to a
-client/server system), or maybe much more.
-
-\subsection GRAS_howto_design_design_protocol Design an application-level protocol
-
-During this phase, you should try to sketch your application before
-implementing it.  You should sketch temporal execution of the application. I
-personnaly prefer to do so graphically on a blackboard, drawing comic strips
-of the several steps of the algorithm under specific conditions. Ask
-yourself questions as "What gets exchanged between who when the user request
-this?", "How to react when this condition occures?" and "What is the initial
-state of the system?"
-
-Here are some important points to identify in your future application during
-the design phase:
-
-\subsubsection GRAS_howto_design_design_protocol_msg Message types
-
-The most important point to design a GRAS protocol is to identify the
-different type of messages that can be exchanged in your system, and the
-datatype of their payload. Doing so, remember that GRAS messages are
-strongly typed. They are formed by a so-called message type (identified by
-its name) and a type description describing what kind of data you can
-include in the message. The message type is a qualitative information
-"someone asked you to run that function" while the payload is the
-quantitative information (the arguments to the function).
-
-A rule of thumb: <b>A given message type have only one semantic meaning, and
-one syntaxic payload datatype</b>. If you don't do so, you have a problem.
-
-   - If the same message type may have two semantic value depending on some
-     fields of the payload, I'd say that you used MPI too much before. You
-     should use the full power of the GRAS messaging functions by using
-     several message types. It will simplify your code and yield better
-     performance.
-
-   - You shouldn't have a given message type with differing payload
-     datatypes. It is possible to do so (using gras_datadesc_ref_generic()),
-     but it's quite painful, and is rarely what you really want. Are you
-     sure you don't want to split these messages in two separate types?
-
-\subsubsection GRAS_howto_design_design_protocol_cb Message callbacks
-
-Also sketch what your processes should do when they get the given message.
-These action will constitute the message callbacks during the
-implementation. But you should first go through a design phase of the
-application level-protocol, were these action remain simplistic. Also
-identify the process-wide globals needed to write the callbacks (even if it
-can be later).
-
-
-\section GRAS_howto_design_implem The implementation phase
-
-\subsection GRAS_howto_design_implem_cb Write your callbacks
-
-Most of the time, you will find tons of specific cases you didn't thought
-about in the design phase, and going from a code sketch to an actual
-implementation is often quite difficult.
-
-You will probably need some process-wide globals to store some state of your
-processes. See \ref GRAS_tut_tour_globals on need.
-
-\subsection GRAS_howto_design_implem_api Implement your user-API
-
-If your protocol was wisely designed, writting the user API should be quite
-easy.
-
-\subsection GRAS_howto_design_implem_init Implement the initialization code
-
-You must write some initialization code for all the process kinds of your
-application.
-
-You may want to turn your code into a clean GRAS library by using the adhoc
-mecanism, but unfortunately, it's not documented yet. Worse, there is two
-such systems for now, one of them being deprecated. Check the \ref AMOK_pm
-implementation to see how to use the new system. Naturally, this is only
-optional.
-
-\section GRAS_howto_design_test The test phase
-
-Testing software is important to check that it works. But in a distributed
-setting, this is mandatory.
-
-\subsection GRAS_howto_design_test_sim Test it on the simulator
-
-In addition to all the good old bugs you find in a classical C program
-(memory corruption, logical errors, etc), distributed computing introduce
-subtil ways to get things wrong. Actually, this is why I wrote GRAS: to get
-able to test my code on simulator before using it in distributed settings.
-
-The simulator is a nicely controled environment. You can rerun the same code
-in the exact same condition as often as you want to reproduce a bug. You can
-run the simulator in a debugger such as valgrind or gdb to debug all
-processes at once. You can cheat and have global variables (to check global
-invariants or such). You can test your code on platform you don't have
-access to in the real life, or in condition which almost never occur (such
-as having 80% of the nodes stopping at the same time).
-
-Use all these possibilities, and test your code throughfully in the
-simulator. You may find it boring, but when you'll go to the next steps,
-you'll dream of going back into the comfort of the simulator.
-
-\subsection GRAS_howto_design_test_local Test it locally
-
-Once it works in the simulator, test it in real-life, but will all processes
-on the same host. Even if the GRAS API is made to make the simulator as
-close to the real life as possible, you often discover new and exciting bugs
-when going outside of the simulator. Fix'em all before going further.
-
-If you find you've found a discrepency between both implementation of GRAS,
-please drop us a mail. That would be a bug.
-
-\subsection GRAS_howto_design_test_dist Test it in a distributed setting
-
-You are now ready for the big jump...
-
-
-*/
diff --git a/doc/gtut-files/gtut-howto.doc b/doc/gtut-files/gtut-howto.doc
deleted file mode 100644 (file)
index f849375..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/** @defgroup GRAS_howto HOWTOs
-    @ingroup GRAS_tut
-
-This page tries to explain how to use the GRAS framework. It does not focus
-on specific functionalities (which are detailed in the initiatic tour), but
-rather on global aspects. Here is the list of existing howtos for now:
-
- - \ref GRAS_howto_design
- - I plan to write a document on how to debug a GRAS application, one day.
-
-*/
diff --git a/doc/gtut-files/gtut-introduction.doc b/doc/gtut-files/gtut-introduction.doc
deleted file mode 100644 (file)
index 6659aaf..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/** @defgroup GRAS_tut_intro What is GRAS
-    @ingroup GRAS_tut
-
-\htmlinclude .gtut-introduction.doc.toc
-
-\section GRAS_tut_intro_toc What will you find here
-
- - The section \ref GRAS_tut_intro_what explains what the GRAS framework and how it
-   relates to other existing solutions.
- - The section \ref GRAS_tut_intro_model presents somehow formaly the programmation
-   model used in GRAS.
-
-\section GRAS_tut_intro_further Further readings
-
-After this page, you may find these one interesting:
-\ref GRAS_howto_design. If you're new to GRAS, you may want to read the
-initiatic tour first, begining with \ref GRAS_tut_tour_install or
-\ref GRAS_tut_tour_setup.
-
-<hr>
-
-\section GRAS_tut_intro_what What is GRAS
-
-GRAS is a framework to implement and study distributed algorithms. It
-provides a simple communication API to allow several processes to
-interoperate through the exchange of messages. This is quite classical, and
-GRAS differs from the other existing messaging API by several points:
-
-  - \ref GRAS_tut_intro_what_2ways
-  - \ref GRAS_tut_intro_what_dist
-  - \ref GRAS_tut_intro_what_grid
-  - \ref GRAS_tut_intro_what_target
-  - \ref GRAS_tut_intro_what_simple
-
-We now detail each of these points.
-
-\subsection GRAS_tut_intro_what_2ways GRAS allows you to run both in simulation mode and on real platforms
-
-We wrote two implementations of the interface: the first one is built on top
-of the SimGrid simulator, allowing you to run your application in a
-controled environment, which reveals precious to debug and study algorithms.
-Everyone who tried to run even simple tests on more than 100 real machines
-will consider a simulator as a nirvana.
-
-The experiments can be reproduced in the exact same conditions (which is
-somehow hard in real settings), allowing for example to reproduce a bug as
-many times as you want while debugging. You can also test your algorithm
-under experimental conditions which you couldn't achieve on a real platform
-(like a network topology and/or size you do don't have access to). Under
-some conditions, SimGrid simulations are also much faster than real
-executions, allowing you to run more experiments in less time.
-
-Once you assessed the quality of your algorithm in the simulator, you can
-deploy it on real platforms using the second implementation of the library.
-Usually, taking an algorithm out of a simulator implies an almost complete
-rewrite. There is no need to modify your program for this in GRAS. You don't
-even need to recompile it, but simply to relink your program it against the
-right library.
-
-GRAS applications running on real hardware deliver high performance.
-The sequential parts of your code are not mediated by GRAS or slowed down
-anyhow. The communications use advanced data exchange and conversion
-mecanism ensuring that you are likely to get performance at least comparable
-to other communication solutions (FIXME: cite the paper once it gets
-accepted).
-
-GRAS applications are portable on several operating systems (Linux, MacOS X,
-Solaris, IRIX, AIX and soon Windows) and several processor architectures
-(x86, amd64, ppc, sparc, etc). Moreover, GRAS processes can interoperate
-efficiently even when deployed on differing material. You can for example
-have a process deployed on ppc/MacOS X interacting transparently with
-another one deployed on alpha/Linux.
-
-The simulation mode of GRAS is called usually SG (for SimGrid) while the in
-situ execution mode is called RL (for Real Life).
-
-\subsection GRAS_tut_intro_what_dist GRAS was designed for distributed computing, not parallel computing
-
-In GRAS, you build your algorithm as a set of independent processes
-interacting through messages. This is the well known MPMD model (multiple
-program, multiple data). It contrasts to the SPMD model (simple program,
-multiple data) and communications solutions such as MPI or PVM, where you
-build an uniq program with conditionnals here and there specifying what each
-processes should do (something like "If I'm process number 0, then send data
-to the others, else get the data sent to me").
-
-None of these models are inherently better than the other, and there is a
-plenty of algorithms betterly expressed in the SPMD paradigm. If your
-program falls into that category, then GRAS may not be the right tool for
-you. We think however that most non-sequential algorithms can be expressed
-gracefully in a MPMD way where some are really difficult to express in a
-SPMD way.
-
-There is no parallelism in GRAS, and it is discouraged to introduce threads
-in GRAS (althrough it should be possible in some months). This is an explict
-choice since threads are so hard to use (see the section \ref
-GRAS_tut_intro_what_simple below). The framework itself do use threads to
-achieve good performances, but I don't want to impose this to users (FIXME:
-actually, GRAS is not multi-threaded yet internally, but I plan to do so
-really soon).
-
-\subsection GRAS_tut_intro_what_grid GRAS was designed for large scale computing
-
-Another difference to the MPI communication libraries is that GRAS was not
-designed for static small-sized platforms such as clusters, but to dynamic
-larger-scale platforms such as grids. That is why GRAS do include static
-membership solutions such as the MPI channels. Support for fault-tolerance
-is also provided through the timeouts on communication primitives and
-through an exception mecanism.
-
-GRAS also comes with a sister library called AMOK containing several usefull
-building block for large scale network aware applications. The most
-proheminent one allows to assess the network availabilities through active
-testing, just like the classical NWS tool in the grid research community. We
-are actively working on a network topology discovery mecanism and a
-distributed locking solution. Some other modules are planned, such as
-reliable broacasting in open environments.
-
-\subsection GRAS_tut_intro_what_target GRAS targets at applicative overlay rather than end-user application
-
-The application class targeted by GRAS is constituted of so called overlays.
-They do not constitute a complete application by themselves, but can be seen
-as a "distributed library", a thing offering offering a service to another
-application through a set of physically distributed entities. An example of
-such overlay could be a monitoring system allowing you to retrieve the
-available bandwidth between two remote hosts. It could be used in a
-network-aware parallel matrix multiplication library assigning more work to
-well interconnected nodes. I wouldn't advice to build a physical or
-biological compututation program on top of GRAS, even if it would be
-possible in theory.
-
-In other words, GRAS is not a grid middleware in the common understanding of
-the world, but rather a tool to constitute the building bricks of such a
-middleware. GRAS is thus a sort of "underware" ;)
-
-\subsection GRAS_tut_intro_what_simple GRAS tries to remain simple to use
-
-A lot of effort was put into the framework so that it remains simple to the
-users. For example, you can exchange structured data (any kind of C data
-structure) just by passing its address, and the framework will create the
-exact same structure on the receiver side.
-
-There is no threads like the pthread ones in GRAS, and it is not planned to
-introduce this in the future. This is an explicit choice since I consider
-multi-threading as too complicated for usual users. There is too much
-non-determinism, too many race conditions, and too few language-level
-constructs to keep yourself from screwing up. This idea is well expressed
-by John Ousterhout in <i>Why Threads Are a Bad Idea (for most purposes)</i>,
-published at USENIX'96. See section \ref GRAS_tut_intro_what_dist for
-platform performance consideration.
-
-For the user code, I plan to allow the co-existance of several "gras
-processes" within the same regular unix process. The communication semantic
-will still be message-oriented, even if implemented using the shared memory
-for efficiency.
-
-Likewise, there is no interuption mecanism in GRAS which could break the
-user code execution flow. When you write a function, you can be absolutely
-sure that nothing will happen between each lines of it. This assumption
-considerably simplify the code written in GRAS. The main use of of
-interruptions in a distributed application is to timeout communications when
-they fail. GRAS communication calls allow to setup a timeout value, and
-handle it internally (see below).
-
-The only interruption mecanism used is constituted by exceptions, just like
-in C++ or Java (but implemented directly in C). They are propagated from the
-point where they are raised to a point where they will be trapped, if any,
-or abort the execution when not trapped. You can still be certain that
-nothing will happen between two lines of your code, but the second line may
-never be executed if the first one raises an exception ;)
-
-This exception mecanism was introduced because without it, user code has to
-be loaded by tons of non-functional code to check whether an operation was
-properly performed or whether you have to pass the error condition to your
-caller.
-
-<hr>
-
-\section GRAS_tut_intro_model The model provided by GRAS
-
-From a more formal point of view, GRAS overlays (=applications) can be seen
-as a set of state machines mainly interacting with messages. Because of the
-distributed setting of overlays, the internal state of each process cannot
-be accessed or modified directly by other processes. Even when it would be
-possible pratically (like in SG), it is forbidden by the model. This makes
-it difficult to gain a complete knowledge on the global system state. This
-global system state can still be defined by agregating the states of each
-processes, but this remains theoretical and impratical because of the
-probable combinatorial explosion.
-
- - \ref GRAS_tut_intro_model_events
- - \ref GRAS_tut_intro_model_commmodel
- - \ref GRAS_tut_intro_model_timing_policy
- - \ref GRAS_tut_intro_model_exception
- - \ref GRAS_tut_intro_model_rpc
-
-\subsection GRAS_tut_intro_model_events Event types
-
-Two main types of events may change the internal state of a given process:
-
- - <b>Incomming messages</b>. Messages are somehow strongly typed: a message
-   type is described by its name (a string), and the C datatype of its
-   payload. Any message of the same type will convey the same datatype, but
-   of course the actual content of the payload may change from message to
-   message of the same type.\n
-   \n
-   Processes may attach <b>callback functions</b> to the arrival of messages
-   of a given type. They describe the action to achieve to handle the
-   messages during the transition associated to this event.\n
-   \n
-   Incoming messages are not handled as soon as they arrive, but only when
-   the process declares to be ready to accept incoming events (using \ref
-   gras_msg_handle or related functions). It ensures that the treatment of a
-   given message won't run in parallel to any other callback, so that
-   process globals (its state) can be accessed and modified without
-   locking.\n
-   \n
-   Messages received when the process is not ready to consume them are
-   queued, and will be processed in order in the subsequent calls to \ref
-   gras_msg_handle.\n
-   \n
-   Processes can also wait explicitely for incoming messages matching some
-   given criterions (using \ref gras_msg_wait). Any messages received before the
-   one matching the criterions will be added to the incoming messages'
-   queue for further use. This may breaks the message delivery order.
-   Moreover, there is no restriction on when this can be done. So, a
-   callback to a given message can consume messages of other types. There is
-   also no restriction on the criterion: you can specify a function in charge
-   of examinating the messages either incoming or already in the queue and
-   decide based on their meta-data (sender and message type) or their actual
-   content whether they match your criterions.\n
-   \n
-   It is even possible to program processes so that they only explicitely
-   wait for messages without using \ref gras_msg_handle to accept messages
-   and start the callbacks associated to them. GRAS thus supports both the
-   pure event-based programming model and the more classical message passing
-   model.\n
-
- - <b>Internal timers</b>. There is two types of timers: delayed actions and
-   repetitive actions. The former happen only once when the delay expires
-   while the second happen regularly each time that a period expires.\n
-   \n
-   Like incoming messages, timer treatments are not prehemptive. Ie, the
-   function attached to a given timer will not start as soon as the period
-   expires, but only when the process declares to be ready to accept
-   incoming events. This also done in the \ref gras_msg_handle function, and
-   expired timers are prioritaire with regard to incoming messages.
-
-Messages are sent using the \ref gras_msg_send function. You should specify
-the receiver, the message type and the actual payload. This operation can
-happen at any time of your program. Message sending is not considered as a
-process state change, but rather as a reaction to an incoming event. It
-changes the state of another process, though. Trying to send messages to
-yourself will deadlock (althrough it may change in the future).
-
-\subsection GRAS_tut_intro_model_commmodel Communication model
-
-Send operations are <b>as synchronous as possible pratically</b>. They block
-the process until the message actually gets delivered to the receiving
-process. An acknoledgment is awaited in SG, and we consider the fact that RL
-does not the same as a bug to be fixed one day. We thus have an <b>1-port model
-in emission</b>. This limitation allows the framework to signal error condition
-to the user code in the section which asked for the transmission, without
-having to rely on an interuption mecanism to signal errors asynchronously.
-This communication model is not completely synchronous in that sense that the
-receiver cannot be sure that the acknoledgment has been delivered (this is the
-classical byzantin generals problem). Pratically, the acknoledgment is so small
-that there is a good probability that the message where delivered. If you need
-more guaranty, you will need to implement better solutions in the user space.
-
-As in SimGrid v3.3, receive operations are done in a separated thread, but they
-are done sequentially by this thread. The model is thus <b>1-port in
-reception</b>, but something like 2-port in general. Moreover, the messages not
-matching the criterion in explicite receive (see for example \ref
-gras_msg_wait) are queued for further use. Thanks to this specific
-thread, the emission and reception are completely decorelated. Ie, the
-main thread can perfectly send a message while the listener is
-receiving something. We thus have a classical <b>1-port model</b>.
-
-Here is a graphical representation of a scenario involving two processes A and
-B.  Both are naturally composed of two threads: the one running user code, and
-the listener in charge of listening incoming messages from the network. Both
-processes also have a queue for the communication between the two threads, even
-if only the queue of process B is depicted in the graph.
-
-The experimental scenario is as follows: <ul>
-
-<li>Process A sends a first message (depicted in red) with gras_msg_send(), do
-    some more computation, and then send another message (depicted in
-    yellow). Then, this process handles any incoming message with
-    gras_msg_handle(). Since no message is already queued in process A at this
-    point, this is a blocking call until the third message (depicted in
-    magenta) arrives from the other process.</li>
-
-<li>On its side, the process B explicitely wait for the second message with
-    gras_msg_wait(), do some computation with it, and then call
-    gras_msg_handle() to handle any incoming message. This will pop the red
-    message from the queue, and start the callback attached to that kind of
-    messages. This callback sends back a new message (depicted in magenta) back
-    to process A.</li>
-</ul>
-
-<img src="gras_comm.png">
-
-This figure is a bit dense, and there is several point to detail here:<ul>
-
-<li>The timings associated to a given data exchange are detailed for the first
-message. The time (1) corresponds to the network latency. That is the time to
-reach the machine on which B is running from the machine running on A. The time
-(2) is mainly given by the network bandwidth. This is the time for all bytes of
-the messages to travel from one machine to the other. Please note that the
-models used by SimGrid are a bit more complicated to keep realistic, as
-explained in <a href="http://www.loria.fr/~quinson/blog/2010/06/28/Tutorial_at_HPCS/">the
-slides of the HPCS'10</a>, but this not that important here. The time (3) is mainly
-found in the SG version and not in RL (and that's a bug). This is the time to
-make sure that message were received on machine B. In real life, some buffering
-at system and network level may give the illusion to machine A that the message
-were already received before it's actually delivered to the listener of machine
-B (this would reduce the time (3)). To circumvent this, machine B should send a
-little acknoledgment message when it's done, but this is not implemented yet.</li>
-
-<li>As you can see on the figure, sending is blocking until the message is
-received by the listener on the other side, but the main thread of the receiver
-side is not involved in this operation. Sender will get released from its send
-even if the main thread of receiver is occuped elsewhere.</li>
-
-<li>Incomming messages not matching the expectations of a gras_msg_wait() (such
-as the red one) are queued for further use. The next message receiving
-operation will explore this queue in order, and if empty, block on the
-network. The order of unexpected messages and subsequent ones is thus preserved
-from the receiver point of view.</li>
-
-<li>gras_msg_wait() and gras_msg_handle() accept timeouts as argument to
-specify how long you are willing to wait at most for incoming messages. These
-were ignored here to not complexify the example any further. It is worth
-mentionning that the send operation cannot be timeouted. The existance of the
-listener should make it useless.</li>
-
-</ul>
-
-\subsection GRAS_tut_intro_model_timing_policy Timing policy
-
-All communication primitives allow 3 timout policies: one can only poll for
-incoming events (using timeout=0), wait endlessly for the communication to
-be performed (using timeout<0) or specify a maximal delay to wait for the
-communication to proceed (using timeout>0, being a number of seconds).
-
-Again, this describes the targeted model. The current implementation does
-not allow to specify a delay for the outgoing communication. In SG, the
-delay is then hardcoded to 60 seconds while outgoing communication wait for
-ever to proceed in RL.
-
-Another timing policy we plan to implement in the future is "adaptative
-timeouts", where the timeout is computed automatically by the framework
-according to performance of previous communications. This was demonstrated
-for example in the NWS tool.
-
-\subsection GRAS_tut_intro_model_exception Error handling through exceptions
-
-As explained in section \ref GRAS_tut_intro_what_simple, any function may
-raise exceptions breaking their execution. No support is provided by the
-framework to ensure that the internal state remains consistent when
-exceptions are raised. Changing this would imply that we are able to
-checkpoint the internal state to provide a transaction service, which seems
-quite difficult to achieve efficiently.
-
-\subsection GRAS_tut_intro_model_rpc RPC messaging
-
-In addition to the one-way messages described above, GRAS supports RPC
-communication. Using this, a client process asks for the execution of a
-callback on a server process. RPC types are close to regular message types:
-they are described by a type (a string), a payload type for the request, but
-in addition, they also have a payload type for the answer from the server to
-the client.
-
-RPC can be either synchronous (the function blocks until an answer is
-received) or asynchronous (you send the request and wait later for the
-anwer). They accept the same timing policies than regular messages.
-
-If the callback raises an exception on the server side, this exception will
-be trapped by the framework on the server side, sent back to the client
-side, and revived on the client side. So, if the client calls a RPC which
-raises an error, it will have to deal with the exception itself. No
-provision is given concerning the state consistency on the server side when
-an exception arise. The <tt>host</tt> fields of the exception structure
-indicates the name of the host on which it was raised.
-
-The callback performing the treatment associated to a RPC can perform any
-kind of communication itself, including RPC. In the case where A calls a RPC
-on B, leading to B calling a RPC on C (ie, A->B->C), if an exception is
-raised on C, it will be forwarded back to A. The <tt>host</tt> field will
-indicate C.
-
-<hr>
-
-\section GRAS_tut_intro_next What's next?
-
-Now that you know what GRAS is and the communication model used, it is time
-to move to the \ref GRAS_tut_tour section. There, you will build
-incrementally a full-featured GRAS application demonstrating most of the
-aspects of the framework.
-
-*/
diff --git a/doc/gtut-files/gtut-main.doc b/doc/gtut-files/gtut-main.doc
deleted file mode 100644 (file)
index c916ece..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-@addtogroup GRAS_tut
-
-This section constitutes a tutorial to the GRAS programming environment.
-
- - \ref GRAS_tut_intro :\n
-   This section details what GRAS is, and what are the target application
-   class. It also formalize somehow the communication model used in GRAS.\n
-   If you are new to the system and want to start using the tool as quickly
-   as possible and learn by trying things out instead of reading a lenghty
-   manual, you might want to start from next section directly.
-   - \ref GRAS_tut_intro_what
-   - \ref GRAS_tut_intro_model
-
- - \ref GRAS_tut_tour :\n
-   This section aims at turning new-comers into GRAS power user. It briefly
-   explains how to install the framework and setup your own projects. Then,
-   an example distributed application is builded incrementaly to show the
-   several aspects of the framework.
-   - Part 1: Bases
-     - \ref GRAS_tut_tour_install
-     - \ref GRAS_tut_tour_setup
-   - Part 2: Message passing
-     - \ref GRAS_tut_tour_simpleexchange
-     - \ref GRAS_tut_tour_args
-     - \ref GRAS_tut_tour_callbacks
-     - \ref GRAS_tut_tour_globals
-     - \ref GRAS_tut_tour_logs
-     - \ref GRAS_tut_tour_timers
-     - \ref GRAS_tut_tour_exceptions
-     - \ref GRAS_tut_tour_simpledata
-     - \ref GRAS_tut_tour_rpc
-     - \ref GRAS_tut_tour_explicitwait
-     - \ref GRAS_tut_tour_message_recaping
-   - Part 3: Data description
-     - \ref GRAS_tut_tour_staticstruct
-     - \ref GRAS_tut_tour_pointers
-     - \ref GRAS_tut_tour_dynar
-     - \ref GRAS_tut_tour_manualdatadef
-     - \ref GRAS_tut_tour_exchangecb
-   - Part 4: Advanced topics (TODO)
-
- - \ref GRAS_howto :\n
-   This section contains some self-contained document explaining one
-   aspect of the framework which would be hard to integrate in the
-   suite of lessons composing the tutorial.
-    - \ref GRAS_howto_design
-
-*/
-
diff --git a/doc/gtut-files/gtut-platform-3nodes.xml b/doc/gtut-files/gtut-platform-3nodes.xml
deleted file mode 100644 (file)
index ccc44c5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version='1.0'?>
- <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
- <platform version="3">
- <AS  id="AS0"  routing="Full">
-   <host id="Jacquelin" power="137333000"/>
-   <host id="Boivin"    power="98095000"/>
-   <host id="Geoff"     power="42917000"/>
-   
-   <link id="1" bandwidth="3430125"  latency="0.000536941"/>
-   <link id="2" bandwidth="11618875" latency="0.00018998"/>
-   <link id="3" bandwidth="10314625" latency="0.006932556"/>
-     
-   <route src="Jacquelin" dst="Boivin">   <link_ctn id="1"/></route>
-   <route src="Boivin"    dst="Jacquelin"><link_ctn id="1"/></route>
-   <route src="Jacquelin" dst="Geoff">    <link_ctn id="2"/></route>
-   <route src="Geoff"     dst="Jacquelin"><link_ctn id="2"/></route>
-   <route src="Geoff"  dst="Boivin">      <link_ctn id="3"/></route>
-   <route src="Boivin" dst="Geoff">       <link_ctn id="3"/></route>
- </AS>
- </platform>
diff --git a/doc/gtut-files/gtut-platform.xml b/doc/gtut-files/gtut-platform.xml
deleted file mode 100644 (file)
index 7164bbb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
- <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
- <platform version="3">
- <AS  id="AS0"  routing="Full">
-   <host id="Jacquelin" power="137333000"/>
-   <host id="Boivin" power="98095000"/>
-   <link id="1" bandwidth="3430125" latency="0.000536941"/>
-   <route src="Jacquelin" dst="Boivin"><link_ctn id="1"/></route>
-   <route src="Boivin" dst="Jacquelin"><link_ctn id="1"/></route>
- </AS>
- </platform>
diff --git a/doc/gtut-files/gtut-tour-00-install.doc b/doc/gtut-files/gtut-tour-00-install.doc
deleted file mode 100644 (file)
index 675fc3d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-/**
-@page GRAS_tut_tour_install Lesson 0: Installing GRAS
-
-Since GRAS is technically part of the SimGrid project, you have to install
-SimGrid to install GRAS. Doing so is explained in the relevant FAQ section
-(\ref install).
-
-Newcommers should install the stable release from the tarball, since the
-snapshots may suffer from (additionnal;) stability issues. Only go for the
-git if you really need features not present in the stable releases yet (or
-if you plan to help us improving the tool, what is always welcomed).
-
-Proceed to \ref GRAS_tut_tour_setup.
-
-*/
diff --git a/doc/gtut-files/gtut-tour-01-bones.doc b/doc/gtut-files/gtut-tour-01-bones.doc
deleted file mode 100644 (file)
index 04963f3..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-
-/**
-@page GRAS_tut_tour_setup Lesson 1: Setting up your own project
-
-\section GRAS_tut_tour_setup_toc Table of Contents
- - \ref GRAS_tut_tour_setup_C
- - \ref GRAS_tut_tour_setup_plat
- - \ref GRAS_tut_tour_setup_deploy
- - \ref GRAS_tut_tour_setup_glue
- - \ref GRAS_tut_tour_setup_make
- - \ref GRAS_tut_tour_setup_start
-
-<hr>
-
-Any GRAS project should be constituted of at least 3 files, and possibly
-much more.
-
-  - <tt>&lt;project&gt;.c</tt>: A source file providing the source code of your
-    processes.
-
-  - <tt>&lt;platform&gt;.xml</tt>: A platform description file. It describes
-    the virtual platform you want to run your application onto following the
-    SurfXML formatting so that the simulator can parse it. This file is only
-    needed in SG, and you don't need any to run on real platforms (of
-    course). The simplest is to use one of the pre-existing one.
-
-  - <tt>&lt;project&gt;.xml</tt>: A deployment file. It describes which of
-    your processes to start, on which machine and with which arguments.
-
-  - A makefile is often needed, too, even if it's not mandatory.
-
-If we start a project called <tt>test</tt>, we have to write 3 files:
-<tt>test.c</tt>, <tt>platform.xml</tt> and <tt>test.xml</tt>
-
-\section GRAS_tut_tour_setup_C The C source file
-
-Let's look at the C source file first. It should contain one main function
-for each type of processes in your overlay. Let's assume that you want to
-code a simple client/server communication. For this, the source file should
-read as:
-
-\verbatim #include <gras.h>
-
-int client(int argc, char *argv[]) {
-  ...
-}
-
-int server(int argc, char *argv[]) {
-  ...
-}
-\endverbatim
-
-Note that each of the processes's main function have the exact same
-prototype of the classical <tt>main()</tt> function in C.
-
-This is on purpose, each of them can assume this role when running in RL.
-But you shouldn't write a main() function yourself since all processes will
-run as threads within the same regular process in simulation mode. That is
-why the real <tt>main</tt> function of GRAS programs are generated
-automatically. This will be detailled in time (section \ref
-GRAS_tut_tour_setup_glue), but for now just note the similarity between the
-"main" functions you have to write for each processes and a "real main"
-function.
-
-Then, each process must initialize the GRAS framework at the beginning (with
-\ref gras_init) and should finalize it at the end (with \ref gras_exit).
-
-You should pass to \ref gras_init the <tt>argc</tt> and <tt>argv</tt> you
-received in your "main" function so that the users of your application can
-pass some configuration flags to the framework.
-
-It is not enough to have one of the processes initializing the framework
-since in RL, each of them will run on a different host. If you use some AMOK
-modules, you have to initialize them in each process too.
-
-The source file then reads: \include 01-bones.c
-
-That's it. You have a working GRAS application with two processes. They
-don't do anything useful, but that's a beginning. Let's see how to bring
-them to life.
-
-\section GRAS_tut_tour_setup_plat The platform file
-
-The platform file is used by the simulator to know about the existing hosts
-and their interactions. Its exact syntax is at the same time very simple and
-a bit beyond the topic of this document. Here is a very simple example
-describin two hosts named <i>Jacquelin</i> and <i>Boivin</i> and how they
-are interconnected.
-
-\include gtut-platform.xml
-
-At this point, you should not try to write your own platform file, but use
-one of the existing ones. There is a few of them in the examples/msg
-directory of the project. The only information we need from those files are
-the names of the existing hosts. It will be mandatory to write the
-deployment file.
-
-\section GRAS_tut_tour_setup_deploy The deployment file
-
-This file explains which of your processes should be started on the
-different hosts. It is mainly used in simulation. In real life, you will
-have to start your processes manually (see below). We we dream of a system
-able to apply a deployment file in real life and TakTuk may be the right
-tool for this, but this is still to be done.
-
-Here is an example of such file, describing that a <tt>server</tt> process
-must be started onto the <tt>Jacquelin</tt> host and a <tt>client</tt>
-process must be started on the <tt>Boivin</tt> host.
-
-\include test.xml
-
-Actually, you should write such a file also if you only plan to use GRAS in
-RL since this file is also used to glue your code to GRAS, as explained in
-the next section.
-
-\section GRAS_tut_tour_setup_glue Glueing things together
-
-As explained above, you shouldn't write any real <tt>main</tt> function
-since its content depends on whether you run in RL ou in SG. Instead, you
-use a tool <tt>gras_stub_generator</tt> to get the proper glue around your
-code generated. If you installed SimGrid in a regular place, this program is
-now in your path. Its source resides in the tools/gras/ directory of the
-archive, if you wonder.
-
-Here is the calling syntax:
-\verbatim gras_stub_generator <project_name> <deployment_file.xml>\endverbatim
-
-It parses the deployment file (called <tt>test.xml</tt> in our example),
-searching for all the kind of processes you have in your project. It
-then generates the following C files:
-
- - a <tt>_&lt;project_name&gt;_&lt;process_kind&gt;.c</tt> file for each process kind you
-   have.\n
-   They are used to launch your project in real life. They
-   contain a main() in charge of initializing the GRAS infrastructure and
-   launching your code afterward.
- - a <tt>_&lt;project_name&gt;_simulator.c</tt> file.\n
-   This file is suited to the simulation mode. It contains a main()
-   function initializing the simulator and launching your project within.
- - a <tt>&lt;project_name&gt;.mk</tt> file.\n
-   This is a makefile to regenerate any files on need. See next section.
-
-In our example, we will thus obtain <tt>_test_server.c</tt>,
-<tt>_test_client.c</tt>, <tt>_test_simulator.c</tt> and <tt>test.mk</tt>.
-
-There is a pitfall: no verification is made on your actual source code, so
-if you have a typo on the process name in the deployment file, the generated
-code will be wrong, and the linker will spit error messages at you. Also
-remember that those names are in fact C function names, so they are
-case-sensitive.
-
-\section GRAS_tut_tour_setup_make A typical Makefile
-
-Now, we want to compile all the source files to build the actual binaries.
-It can be done manually, but it is much more convenient to use a makefile.
-Fortunately, gras_stub_generator generates a makefile for you under the name
-<tt>&lt;project&gt;.mk</tt>. This file is sufficient for now. To compile our test
-application, just type:
-\verbatim make -f test.mk \endverbatim
-
-You may want to rename this file to Makefile so that typing <tt>make</tt>
-without argument becomes sufficient. In any case, do not edit this file
-without renaming it, or your changes will get overwritten at the next glue
-generation.
-
-If you already have a Makefile (or a Makefile.am for automake users), you
-can also add the following chunk at the end of your file:
-\verbatim NAME=your_project_name
- PROCESSES=list of processes type in your project
-
- $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(NAME).c $(NAME)_deployment.xml
-        path/to/gras_stub_generator $(NAME) $(NAME)_deployment.xml >/dev/null
-\endverbatim
-
-A simpler solution in our example would be to add:
-\verbatim _test_client.c _test_server.c _test_simulator.c: test.c test.xml
-        path/to/gras_stub_generator test test.xml >/dev/null
-\endverbatim
-
-\section GRAS_tut_tour_setup_start Actually running the processes
-
-There is nothing to know to start your processes in RL. Simply call the
-generated binaries, and that's it. To start the simulation, simply call:
-\verbatim ./<project>_simulator platform.xml deployment.xml\endverbatim
-
-If you have an error message similar to
-\verbatim
-./<project>_simulator: error while loading shared libraries: libsimgrid.so.2: cannot open shared object file: No such file or directory
-\endverbatim
-it simply means that the dynamic linker of you system fails to find
-the simgrid library. The easiest way to solve this is to declare a
-LD_LIBRARY_PATH shell variable pointing to the directory where your
-library lives (that's /opt/simgrid/lib on my machine because I passed
---prefix=/opt/simgrid to the configure script).
-
-Here is an example of execution: \include 01-bones.output
-
-That's it. You are done with this lesson and can now write, build and
-execute GRAS applications as long as they don't do anything ;) Move
-to the next lessons to add some flesh on these bones.
-
-Go to \ref GRAS_tut_tour_simpleexchange
-
-*/
diff --git a/doc/gtut-files/gtut-tour-02-simple.doc b/doc/gtut-files/gtut-tour-02-simple.doc
deleted file mode 100644 (file)
index 16cfee8..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-
-/**
-@page GRAS_tut_tour_simpleexchange Lesson 2: Exchanging simple messages
-
-\section GRAS_tut_tour_simpleexchange_toc Table of Contents
- - \ref GRAS_tut_tour_simpleexchange_msgtype
- - \ref GRAS_tut_tour_simpleexchange_socks
- - \ref GRAS_tut_tour_simpleexchange_exchange
- - \ref GRAS_tut_tour_simpleexchange_recaping
-
-<hr>
-
-\section GRAS_tut_tour_simpleexchange_msgtype Declaring the messages to be exchanged
-
-We will now see how to exchange messages between hosts. As explained in
-section \ref GRAS_tut_intro_model, every GRAS message is (strongly) typed. A
-message type is described by its name and the datatype of the data it can
-convey. Each process which may exchange a given type of message should
-declare it before sending or receiving it. If the description used by the
-sender doesn't match the one used by the receiver, you'll get into trouble.
-Fortunately, such discrepency will be detected in SG.
-
-We won't convey any payload in this lesson, so we just have to give the name
-of message to declare them:
-\dontinclude 02-simple.c
-\skip gras_msgtype_declare
-\until gras_msgtype_declare
-
-Remember that all processes should declare the message types they use.
-
-\section GRAS_tut_tour_simpleexchange_socks Identifying peers you want to communicate with
-
-Then, you need to specify with who you want to communicate. This is done
-by opening sockets. GRAS sockets are loosely inspirated by the regular BSD
-sockets, but with several simplifications.
-
-If you want to eventually receive messages, you have to open a so-called
-<i>server socket</i>. Actually, any GRAS process should open a server socket
-since it will allows to identify it uniquely in the system. A socket is
-defined by an host name and a port number (just like with BSD sockets).
-
-Since server socket are on the current host, opening a socket to receive
-messages on the port 12345 is as easy as:
-\skip gras_socket_server
-\until gras_socket_server
-
-Hardcoding port numbers that way may lead to difficulties on RL (at least)
-since at most one process can listen on a given port. So, if you can, prefer
-the \ref gras_socket_server_range, which picks a working port from a range
-of value. Of course, if you want your processes to find each others, at
-least one port must be hardcoded in the system. Then, any other processes
-contact the one listening on that port, which acts as a coordinator.
-
-Our client should also open a server socket, but the picked port don't
-matter, so we use:
-\skip gras_socket_server
-\until gras_socket_server
-
-It will select a port between 1024 (ports below 1024 are reserved under
-UNIX) and 10000. You can safely ignore the two last arguments for now and
-pass 0.
-
-So, you now know how to create sockets allowing to receive messages. To send
-messages, you have to create a so-called <i>client socket</i>. For this, use
-\ref gras_socket_client with the hostname and the port of the process you
-want to contact as arguments. Our client should simply do:
-
-\dontinclude 02-simple.c
-\skip socket_client
-\until socket_client
-
-The corresponding server socket must be opened before any client socket can
-connect to it. It is thus safe to add a little delay before creating the
-client socket. But you cannot use the classical sleep() function for this,
-or you will delay the simulator in SG, not your processes. Use \ref
-gras_os_sleep instead.
-
-\section GRAS_tut_tour_simpleexchange_exchange Actually exchanging messages
-
-GRAS offers a plenty of ways to communicate. The simple one is to use \ref
-gras_msg_send on the sender side, and \ref gras_msg_wait on the receiver side.
-
-\ref gras_msg_send expects 3 arguments: the socket on which to send the
-message, the message type (described by its name), and a pointer to the actual content of the
-message. Since we don't have any payload, this becomes:
-
-\dontinclude 02-simple.c
-\skip msg_send
-\until msg_send
-
-\ref gras_msg_wait accepts 4 arguments. The first one is the delay you are
-disposed to wait for messages, while the the type of message you are
-expecting. Then come output arguments. The third argument should be the
-address of a gras_socket_t variable which will indicate who wrote the
-message you received while the last argument is where to put the payload.
-
-Since our server is willing to wait up to 60 seconds for a message, the
-following will do it:
-\dontinclude 02-simple.c
-\skip msg_wait
-\until msg_wait
-
-\section GRAS_tut_tour_simpleexchange_recaping Recaping everything together
-
-Here is the complete code of this example. Note the use of the functions
-\ref xbt_socket_my_port, \ref xbt_socket_peer_name and \ref
-xbt_socket_peer_port to retrieve information about who you are connected to.
-
-\include 02-simple.c
-
-Here is the output of the simulator. Note that \ref xbt_socket_peer_port
-actually returns the port number of the <i>server</i> of the peer. This may
-sound a bit strange to BSD experts, but it is actually really useful: you
-can store this value, and contact your peer afterward passing this number to
-\ref gras_socket_client .
-\include 02-simple.output
-
-Here we are, you now know how to exchange messages between peers. There is
-still a large room for improvement, such as adding payload to messages. But
-there some little things you should know before we speak of payloads.
-
-Go to \ref GRAS_tut_tour_args
-
-*/
diff --git a/doc/gtut-files/gtut-tour-03-args.doc b/doc/gtut-files/gtut-tour-03-args.doc
deleted file mode 100644 (file)
index 3e13e0d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-/**
-@page GRAS_tut_tour_args Lesson 3: Passing arguments to the processes (in SG)
-
-\section GRAS_tut_tour_args_toc Table of Contents
- - \ref GRAS_tut_tour_args_use
- - \ref GRAS_tut_tour_args_sg
- - \ref GRAS_tut_tour_args_recap
-
-<hr>
-
-The most problematic issue with the code of previous lesson is that it does
-not work in RL since we hardcoded the server hostname in the client code. We
-will thus learn you how to pass arguments to your processes to overcome this
-situation.
-
-\section GRAS_tut_tour_args_use Using command line arguments from user code
-
-In RL, the situation is quite simple: we just have to use the command line
-arguments as we would do in a usual C program. In the server, only change
-concern the opennong of the master socket:
-\dontinclude 03-args.c
-\skip gras_socket_server
-\until gras_socket_server
-
-In the client, we only need to change the way we open the client socket:
-\skip gras_socket_client
-\until gras_socket_client
-
-The rest of the program remains inchanged.
-
-\section GRAS_tut_tour_args_sg Passing command line arguments in deployment files
-
-At this point, the problem is to pass arguments to the processes in SG.
-Fortunately, it is quite simple. You just have to edit your deployment file
-so that it reads: \include 03-args.xml
-The syntax should be self-explanatory at this point.
-
-\section GRAS_tut_tour_args_recap Recaping everything together
-
-The whole program now reads:
-\include 03-args.c
-
-And here is the output:
-\include 03-args.output
-
-Go to \ref GRAS_tut_tour_callbacks
-
-*/
diff --git a/doc/gtut-files/gtut-tour-04-callback.doc b/doc/gtut-files/gtut-tour-04-callback.doc
deleted file mode 100644 (file)
index c217ff5..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-
-/**
-@page GRAS_tut_tour_callbacks Lesson 4: Attaching callbacks to messages
-
-\section GRAS_tut_tour_callbacks_toc Table of Contents
- - \ref GRAS_tut_tour_callbacks_declare
- - \ref GRAS_tut_tour_callbacks_attach
- - \ref GRAS_tut_tour_callbacks_handle
- - \ref GRAS_tut_tour_callback_recap
-
-<hr>
-
-Our program is well and good, but if we had to write a longer program,
-explicitely waiting for messages of a given type would not be really
-practical. To add some more dynamism, what we want to do is to attach
-callbacks to the several messages types, and tell GRAS that we are ready to
-deal with new messages. That's what we will do now.
-
-\section GRAS_tut_tour_callbacks_declare Declaring callbacks
-
-First of all, we define the callback we want to attach to the arrival of the
-"hello" message on the server. Its signature is fixed: it accepts two
-arguments of relative types <tt>gras_msg_cb_ctx_t ctx</tt> and <tt>void
-*</tt>. The first one is a working context we should pass to GRAS when
-speaking about the message we are handling while the second is the payload.
-The callback returns an integer being its error code, just like the "main()"
-function. Here is the actual code of our callback:
-
-\dontinclude 04-callback.c
-\skip gras_msg_cb_ctx_t
-\until end_of_callback
-
-\section GRAS_tut_tour_callbacks_attach Attaching callbacks
-
-Then, we have to change the server code to use this callback instead of
-gras_msg_wait. This simply done by a construct like the following:
-
-\skip cb_register
-\until cb_register
-
-\section GRAS_tut_tour_callbacks_handle Handling incoming messages
-
-Once the callback is declared and attached, the server simply has to call
-\ref gras_msg_handle to tell GRAS it's ready to handle for incoming
-messages. The only argument is the maximum delay we are disposed to wait for
-a message. If the delay is negative, the process will block until a message
-arrives. With delay=0, the process just polls for already arrived messages,
-but do not wait at all if none arrived yet. If the delay is greater than 0,
-the process will wait for at most that amount of seconds. If a message
-arrives in the meanwhile, it won't even wait that long.
-
-Sometimes, you want to handle all messages arriving in a given period
-without really knowing how much messages will come (this is often the case
-during the initialization phase of an algorithm). In that case, use \ref
-gras_msg_handleall . It has the same prototype than \ref gras_msg_handle,
-but waits exactly the passed delay, dealing with all the messages arriving
-in the meanwhile.
-
-We have no such needs in our example, so the code simply reads:
-\skip handle
-\until handle
-
-\section GRAS_tut_tour_callback_recap Recaping everything together
-
-The whole program now reads:
-\include 04-callback.c
-
-And here is the output (unchanged wrt previous version):
-\include 04-callback.output
-
-Our little example turns slowly to a quite advanced GRAS program. It entails
-most of the mecanism most program will use.
-
-There is one last thing you should know about callbacks: you can stack them,
-ie attach several callbacks to the same message. GRAS will pass it to the
-lastly attached first, and if the returned error code is not 0, it will pass
-it also to the next one, and so on. I'm not sure there is any sensible use
-of this feature, but it's possible ;)
-
-Go to \ref GRAS_tut_tour_globals
-*/
diff --git a/doc/gtut-files/gtut-tour-05-globals.doc b/doc/gtut-files/gtut-tour-05-globals.doc
deleted file mode 100644 (file)
index da702fd..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
-@page GRAS_tut_tour_globals Lesson 5: Using globals in processes
-
-\section GRAS_tut_tour_globals_toc Table of Contents
- - \ref GRAS_tut_tour_globals_intro
- - \ref GRAS_tut_tour_globals_use
- - \ref GRAS_tut_tour_callback_pitfall
- - \ref GRAS_tut_tour_callback_recap
-
-<hr>
-
-\section GRAS_tut_tour_globals_intro Introduction
-
-Callbacks are great to express your processes as state machines, but they
-pose another problem: callbacks don't have acces to the variable declared
-within the scope of the process' main function (of course). You should
-however resist to the temptation to declare globals outside of the scope of
-the functions, or you won't be able to use more than one process of each
-type in the simulation. Remember, all gras processes run as thread
-within the same naming space in SG so your globals will be shared between
-the several instances of your process, leading to bad problems.
-
-Instead, you you have to put all globals in a structure, and let GRAS handle
-it with the gras_userdata_* functions (there is only 3 of them ;).
-
-\section GRAS_tut_tour_globals_use Putting globals into action
-
-We will now modify the example to add a "kill" message, and let the server
-loop on incoming messages until it gets such a message. We only need a
-boolean, so the structure is quite simple:
-\dontinclude 05-globals.c
-\skip struct
-\until server_data
-
-Then, we need to create this structure in the process main function. We
-could use either gras_userdata_new() or gras_userdata_set(). The former is an
-helper macro mallocing the space needed by the structure and passing it to
-gras using the latter function. If you go for gras_userdata_set(), you
-should pass it a pointer to your data you want to retrieve afterward.
-
-\dontinclude 05-globals.c
-\skip userdata_new
-\until userdata_new
-
-BEWARE, the gras_userdata_new expects the pointed type, not the
-pointer type. As you can see, in our example, you should pass
-server_data_t to the macro, even if the global variable is later
-defined as being of type server_data_t*.
-
-Once you declared a global that way, retriving this (for example in a
-callback) is really easy:
-\dontinclude 05-globals.c
-\skip userdata_get
-\until userdata_get
-
-We can now write the callback, which simply retrive the globals and change
-the value of the <tt>kileld</tt> field.
-\dontinclude 05-globals.c
-\skip kill_cb
-\until end_of_kill_callback
-
-And we replace the single gras_msg_handle() of the server main function by a
-loop:
-\skip while
-\until }
-
-Please note that in our example, only one process creates a global
-structure. But this is naturally completely ok to have several
-processes creating their globals this way. Each of these globals will
-be separated, so process A cannot access globals defined by process B.
-Maybe this implies that the name "globals" is a bit misleading. It
-should be "process state" or something similar.
-
-\section GRAS_tut_tour_callback_pitfall Common pitfall of globals
-
-There is an error that I do myself every other day using globals in GRAS.
-This is to write something like:
-\verbatim int server(int argc, char *argv[]) {
-  server_data_t globals=gras_user_new(server_data_t);
-  /* other variable definition */
-
-  gras_init(&argc, argv);
-
-  /* rest of the code */
-}\endverbatim
-
-The problem is that you call gras_userdata_new() before gras_init(). Doing so,
-embarass GRAS since it does not have its internal buffer initialized yet,
-and cannot store your data anywhere. That is why doing so triggers an error
-at run time.
-
-Also, as noted above, the gras_userdata_new expects the pointed type,
-not the pointer type. As you can see, in our example, you should pass
-server_data_t to the macro, even if the global variable is later
-defined as being of type server_data_t*.
-
-
-\section GRAS_tut_tour_callback_recap Recaping everything together
-
-The whole program now reads:
-\include 05-globals.c
-
-And here is the output (unchanged wrt previous version):
-\include 05-globals.output
-
-That's it, we're done. We have a server able to handle any number of
-messages, which the client can stop remotely properly. That's already
-something, hu?
-
-Go to \ref GRAS_tut_tour_logs
-
-*/
diff --git a/doc/gtut-files/gtut-tour-06-logs.doc b/doc/gtut-files/gtut-tour-06-logs.doc
deleted file mode 100644 (file)
index f8b72a9..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
-@page GRAS_tut_tour_logs Lesson 6: Logging informations properly
-
-\section GRAS_tut_tour_logs_toc Table of Contents
- - \ref GRAS_tut_tour_logs_intro
- - \ref GRAS_tut_tour_logs_practice
- - \ref GRAS_tut_tour_logs_recap
- - \ref GRAS_tut_tour_logs_config
-   - \ref GRAS_tut_tour_logs_config_prio
-   - \ref GRAS_tut_tour_logs_config_layout
-
-<hr>
-
-\section GRAS_tut_tour_logs_intro Introduction
-
-Let's have another look at the output of the program we came up with in
-lesson 5:
-\include 05-globals.output
-
-It is a bit difficult to read, isn't it? Indeed, it is hard to identify
-which process printed which line. It would be possible to add [server] in
-any messages comming from the server and do the same for every process
-running. Idealy, we would also add the location at which the message was
-generated (using __FILE__ and __LINE__) to help debuging, as well as a
-timestamping so that we can still reorder the messages in RL when they get
-intermixed (yeah, it happen, and there is not much to do against it).
-At the end, each time we would like to print a little "hello" debugging
-message, we would have to write 3 lines of arguments to fprintf, which is
-not that practical.
-
-That is why there is a support for proper logging in GRAS. Technically
-speaking, it is not part of GRAS but of XBT, which is the toolbox on which
-the whole SimGrid library is built, but that's the same for us.
-
-This logging library follows the spirit of another one called log4j, which
-is more or less the reference in the domain. The original version is for
-Java, as the name implies, and there was reimplementation for Python
-(log4py), C/C++ (log4c) and so on. Since one of the credo of the GRAS
-framework is that we don't want any external dependency to ease the
-deployment in grid settings, we reimplemented a version of our own.
-
-One of the strong idea of log4j is that log events get structured to give
-the user a fine control at run time of what gets displayed and what don't.
-For that, <i>log event</i> are produced into <i>log channels</i> at a given
-<i>log priority</i>. Then, you can select the minimal priority an event
-should have on a given channel to get displayed.
-
-Then, to keep things managable even when the number of channels increase,
-the channels form a tree and properties get inherited from parent channel to
-childs. Have a look at the existing channels in SimGrid: \ref XBT_log_cats.
-You see that for example, the <tt>gras</tt> channel have 5 subchannels (at
-time of writing): <tt>gras_ddt</tt>, <tt>gras_msg</tt>, <tt>gras_timer</tt>,
-<tt>gras_trp</tt> and <tt>gras_virtu</tt>. If you open or close the
-<tt>gras</tt> channel, it automatically affects all those subchannels (and
-their respective subchannels too). Finally, channels are not just open or
-closed, but filter messages below a given priority (as we said). The
-priorities are defined by type #e_xbt_log_priority_t.
-
-That is all you really need to know about the logs before diving into
-practice. If you want more information on that topic, refer to the \ref
-XBT_log section, which contains much more information than this page.
-
-\section GRAS_tut_tour_logs_practice Putting logs into action
-
-Enough with theory, let's change our example so that it uses proper
-loggings. The first thing to do is to add a new channel in the existing
-hierarchy. There is 4 macros to create log channels, depending on the kind
-of channel we want:
-- XBT_LOG_NEW_CATEGORY(MyCat,desc); Create a new root
-- XBT_LOG_NEW_SUBCATEGORY(MyCat, ParentCat,desc); Create a new category being child of the category ParentCat
-- XBT_LOG_NEW_DEFAULT_CATEGORY(MyCat,desc); Like XBT_LOG_NEW_CATEGORY, but the new category is the default one in this file
-- XBT_LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, ParentCat,desc); Like XBT_LOG_NEW_SUBCATEGORY, but the new category is the default one in this file
-
-What we want here is a root category (it does not belong to any existing
-channel, for sure), and we want it to be the default one in our file (of
-course, it's the only one).
-\dontinclude 06-logs.c
-\skip XBT_LOG
-\until XBT_LOG
-
-Then, we change any call to fprintf to one of the logging macros. There is a
-plenty of them, called &lt;priority&gt;&lt;nb args&gt;, such as #XBT_DEBUG,
-which produces a debuging log event onto the default category. Here is a
-list of the existing macros: #XBT_DEBUG, #XBT_VERB, #XBT_INFO, #XBT_WARN,
-#XBT_ERROR and #XBT_CRITICAL.
-
-Note also that there is no need to add a '\\n' at the end of your format
-line, it gets automatically added.
-
-\section GRAS_tut_tour_logs_recap Recapping everything together
-
-Once we changed any fprintf of our code to some of these macros, the program
-may read:
-\include 06-logs.c
-
-And the output now looks better:
-\include 06-logs.output
-
-\section GRAS_tut_tour_logs_config The user side: configuring logs at run time
-
-\subsection GRAS_tut_tour_logs_config_prio Choosing what gets displayed
-
-Once we changed our program to use proper logging, it is naturally possible
-to choose at run time what we want to see. For example, if we want more
-details about our code, we should pass <tt>--log=test.thres:verbose</tt>
-on the command line of our programs to change the <tt>thres</tt>old.
-Note that a VERBOSE line appears on client side:
-\include 06-logs.output.verbose
-
-On the contrary, if we want to reduce the amount of logging, we may want to
-do pass <tt>--log=test.thres:error</tt>:
-
-\subsection GRAS_tut_tour_logs_config_layout Choosing how things get displayed
-
-As with SimGrid 3.3, it is also possible to change how each and every
-message get displayed from the command line without even recompiling
-your code. This is done by changing the <tt>fmt</tt> field of the
-category you want to change. The value of this field is somehow
-similar to printf's format strings, with several existing specifiers.
-
-For example, if you just want the message you passed to the macro
-without any decoration about the host which raised it, its pid and
-everything, just pass <tt>--log=test.fmt:%m</tt>:
-\include 06-logs.output.fmt
-
-For debuging purpose, you can even ask to get the backtrace at each
-execution point:
-\include 06-logs.output.fmt-bt
-
-
-Again, you should refer to the \ref XBT_log section for more information on
-how to configure the logs. Or you can proceed with the next lesson, of
-course.
-
-Go to \ref GRAS_tut_tour_timers
-*/
diff --git a/doc/gtut-files/gtut-tour-07-timers.doc b/doc/gtut-files/gtut-tour-07-timers.doc
deleted file mode 100644 (file)
index 7d45e04..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
-@page GRAS_tut_tour_timers Lesson 7: Using internal timers
-
-\section GRAS_tut_tour_timers_toc Table of Contents
- - \ref GRAS_tut_tour_timers_intro
- - \ref GRAS_tut_tour_timers_use
- - \ref GRAS_tut_tour_timers_recap
-
-<hr>
-
-\section GRAS_tut_tour_timers_intro Introduction
-
-The messaging primitives we saw until now allow the processes to react to
-external events. This is good, but sometimes, you want the same action to be
-done periodically. Think of a system based on a group of processes. If you
-want to give some adaptability to this system, you shouldn't hardcode the
-memberships but have the members send a message to a coordinator to register
-to the system.
-
-This add some dynamism to your system since new members can join at any
-time. To have a process leaving the system, you can imagine an "unregister"
-message symetric to the "register" one. But how will you deal with failures?
-What if a process leaves without being given the ability to inform the
-coordinator?
-
-One solution is to have the members re-register periodically, so that the
-coordinator can detect the processes which didn't do so since a while, and
-dismiss them.
-
-To implement this in GRAS, we need some more functions: gras_timer_repeat()
-allows to specify a periodic action and gras_timer_delay() allows to get an
-action done once a given delay expires. gras_timer_cancel_delay() and
-gras_timer_cancel_repeat() allow to remove already declared timers. Actions
-must be function without argument nor result (<tt>void my_action(void){
-... }</tt>).
-
-It is important to note that timers are not prehemptive. They will not start
-as soon as they are ready. Instead, they get served when you go into
-gras_msg_handle() (and they are served before incoming messages). This is
-because allowing timers to run in parallel to the callbacks would add
-parallelism to the user code, which would have to protect data with mutexes.
-This is a level of complexity I really don't want for user code. If you
-really need several running entities, simply run several processes (see \ref
-GRAS_tut_intro_model for more details).
-
-\section GRAS_tut_tour_timers_use Putting timers into action
-
-We will change the client of our example so that it send an hello message
-every half second to the server. Then we will add a delayed action scheduled
-5 seconds later in charge of stopping every processes. For this to work, we
-first need to add a global to the server too, containing the socket binded
-onto the server (to send messages) and a boolean indicating whether we are
-done or not, just like we did on the server side in \ref
-GRAS_tut_tour_globals. Here is the resulting global structure:
-\dontinclude 07-timers.c
-\skip client_data
-\until client_data_t
-
-Then, we define the repetitive action in charge of sending messages to the
-server:
-
-\skip client_do_hello
-\until end_of_client_do_hello
-
-This timer is installed the following way. You simply tell the action to
-schedule and its periodicity.
-\skip gras_timer_repeat
-\until gras_timer_repeat
-
-Desinstalling this is not harder. You tell the action to unschedule, and the
-periodicity at which it was desinstalled (so that the same action can be
-scheduled at different intervals, and each of them be desinstallable
-separately).
-\dontinclude 07-timers.c
-\skip gras_timer_cancel_repeat
-\until gras_timer_cancel_repeat
-
-Then comes the delayed action in charge of stopping everything, which should
-be self-explanatory at this point. It could be cancelled before its
-expiration using gras_timer_cancel_delay(), which accepts exactly the same
-kind of arguments than gras_timer_cancel_repeat().
-\dontinclude 07-timers.c
-\skip client_do_stop
-\until end_of_client_do_stop
-
-Finally, we should change the client main function to adapt to these
-modifications, as you can see in the recapping below.
-
-\section GRAS_tut_tour_timers_recap Recapping everything together
-
-The program now reads:
-\include 07-timers.c
-
-Which produces the expected output:
-\include 07-timers.output
-
-Go to \ref GRAS_tut_tour_exceptions
-
-*/
diff --git a/doc/gtut-files/gtut-tour-08-exceptions.doc b/doc/gtut-files/gtut-tour-08-exceptions.doc
deleted file mode 100644 (file)
index d330b00..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
-@page GRAS_tut_tour_exceptions Lesson 8: Handling errors through exceptions
-
-\section GRAS_tut_tour_exceptions_toc Table of Contents
- - \ref GRAS_tut_tour_exceptions_intro
- - \ref GRAS_tut_tour_exceptions_use
- - \ref GRAS_tut_tour_exceptions_recap
-
-<hr>
-
-\section GRAS_tut_tour_exceptions_intro Introduction
-
-Exceptions are a great mecanism to deal with error exception, everyone knows
-that.
-
-Without exceptions, you have to rely on returning a value indicating whether
-the function call were right or not, and check the return values of every
-single function you call. If there is one point in the calling sequence
-where your forgot this check, the chain is broken and caller won't notice
-the issue. In practice, dealing with error without exceptions loads user
-code with *tons* of those stupid checks and you loose your functional code
-in the middle of that miasm.
-
-With them, you simply write your code. If you want to deal with errors (ie,
-you actually know how to react to errors at this point of your code), you
-write a catching block. If you don't, you don't. And exceptions flow through
-from trowing point to catching point without bothering you.
-
-At this point, you may be a bit surprised by the previous paragraphs.
-SimGrid and GRAS are written in C, and everybody knows that there is no
-exception in C but only in C++, Java and such. This is true, exceptions are
-not part of the C language, but this is such a great tool that we
-implemented an exception mecanism as part of the SimGrid library (with
-setjmp and longjmp, for the curious).
-
-Being "home-grown" make our exception mecanic both stronger and weaker at
-the same time. First it is weaker because, well, we are more limitated
-within the library as we are than if we could change the compiler itself to
-add some extra checks here and specific treatment there. But it is also a
-advantage for us, since the exception mecanism is perfectly fitted to the
-distributed settings of GRAS processes. They can easily propagate on the
-net, as we will see in the next lesson (\ref GRAS_tut_tour_rpc) and contain
-information about the host on which they were thrown (#xbt_ex_t) along with
-the thrown point in the source code.
-
-The syntax of XBT exceptions should not sound unfamilliar to most of you.
-You throw them using the #THROW and #THROWF macros. They take 2 arguments:
-an error category (of type #xbt_errcat_t) and an error "value" (an integer;
-pratically, this is often left to 0 in my own code). #THROWF also takes a
-message string as extra argument which is a printf-like format string with
-its own arguments. So, you may have something like the following:
-\verbatim THROWF(system_error, 0, "Cannot connect to %s:%d because of %s", hostname, port, reason);\endverbatim
-
-Then, you simply add a #TRY/#CATCH block around your code:
-\verbatim TRY{
-  /* your code */
-}
-CATCH(e) {
-  /* error handling code */
-} \endverbatim
-
-Another strange thing is that you should actually free the memory allocated
-to the exception with xbt_ex_fres() if you manage to deal with them. There
-is a bit more than this on the picture (#TRY_CLEANUP blocks, for example), and
-you should check the section \ref XBT_ex for more details.
-
-You should be <b>very carfull</b> when using the exceptions. They work great
-when used correctly, but there is a few golden rules you should never break.
-Moreover, the error messages and symptom can get <b>really crude</b> when
-misusing the exceptions.
-
- - <b>Do not move out of a TRY block with a return, a break or any other
-   kind of jump. NEVER. EVER.</b>. This is the most tempting error, and this
-   drives the system nuts. You will probably segfault in the next exception
-   raising, far away from where you incidentally typed <tt>return</tt>
-   (this is because there is some cleanups to do at the end of a TRY block,
-   you cannot just leave it).
- - <b>Play safe with variables modified in the TRY block</b>. You may want
-   to mark them as <tt>volatile</tt>, which is a modifier (just like
-   <tt>const</tt>) indicating that the value of the denoted variable may get
-   changed by external parts of the program during the run. This is the case
-   when your data gets modified by an exception raising function, I guess.
-
-So, as you can see, you don't want to include large sections of your program
-in TRY blocks. If you do so, it's quite sure that one day, you'll do a break
-or a return within this block. And believe me, finding such typos is a real
-pain.
-
-If you are suspecting this kind of error, I made a little script for you:
-check <tt>tools/xbt_exception_checker</tt> from the CVS. Given a set of C
-files, it extracts the TRY blocks and display them on the standard output so
-that you can grep for <tt>return</tt>, <tt>break</tt> and such forbidden
-words.
-
-\section GRAS_tut_tour_exceptions_use Putting exceptions into action
-
-Okay. I hope those little warnings didn't discourage you from using the
-exceptions, because they really are a nice mecanism. We will now change a
-bit our program to take advantage of them. The only issue is that when a
-program run properly, it usually don't raise any exception. We could protect
-the calls we already have with exception handling, but it wouldn't be really
-exciting since we know this code does not throw any exception under the
-condition we use (actually, most of the GRAS functions may throw exception
-on problem).
-
-Instead, we will code a little game between the client and the server. We
-won't tell the client the exact port on which the server listen, and it will
-have to find from itself. For this, it will try to open socket and send the
-kill message to each ports of the search range. If it manage to close the
-socket after sending the message without being interrupted by an exception,
-it can assume that it killed the server and stop searching.
-\dontinclude 08-exceptions.c
-\skip port=3000
-\until end_of_loop
-
-To make the game a bit more fun (and to show you what an exception actually
-look like when it's not catched), we add a potential command line argument
-to the server, asking it to cheat and to not open its port within the search
-range but elsewhere:
-\dontinclude 08-exceptions.c
-\skip strcmp
-\until gras_socket_my_port
-\until }
-
-Then, when the client detects that it didn't manage to find&destroy the
-server, it throws a suicide exception (sorry for the bad jokes):
-\skip if(!found)
-\until THROW
-
-\section GRAS_tut_tour_exceptions_recap Recapping everything together
-
-Here is the output produced by this new program. Note that when the program
-bails out because of an uncatched exception, it displays its backtrace just
-like a JVM would do (ok, it'a a bit cruder than the one of the JVM, but
-anyway). For each function frame of the calling stack, it displays the
-function name and its location in the source files (if it manage to retrieve
-it). Don't be jalous, you can display such stacks wherever you want with
-xbt_backtrace_display() ;)
-
-Unfortunately, this feature is only offered under Linux for now since I have
-no idea of how to retrieve the call stack of the current process under the
-other operating systems. But help is always welcome in this area too ;)
-
-\include 08-exceptions.output
-
-The complete program reads:
-\include 08-exceptions.c
-
-
-Go to \ref GRAS_tut_tour_simpledata
-
-*/
diff --git a/doc/gtut-files/gtut-tour-09-simpledata.doc b/doc/gtut-files/gtut-tour-09-simpledata.doc
deleted file mode 100644 (file)
index 7a39aec..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/**
-@page GRAS_tut_tour_simpledata Lesson 9: Exchanging simple data
-
-\section GRAS_tut_tour_simpledata_toc Table of Contents
- - \ref GRAS_tut_tour_simpledata_intro
-   - \ref GRAS_tut_tour_simpledata_intro_conv
-   - \ref GRAS_tut_tour_simpledata_intro_gras
-   - \ref GRAS_tut_tour_simpledata_use
- - \ref GRAS_tut_tour_simpledata_example
- - \ref GRAS_tut_tour_simpledata_recap
-
-<hr>
-
-\section GRAS_tut_tour_simpledata_intro Introduction
-
-Until now, we only exchanged "empty" messages, ie messages with no data
-attached. Simply receiving the message was a sufficient information for the
-receiver to proceed. There is a similarity between them and procedures not
-accepting any argument in the sequential setting. For example, our "kill"
-message can be seen as a distributed version of the <tt>exit()</tt> system
-call, simply stopping the process receiving this call.
-
-Of course, this is not enough for most applications and it is now time to
-see how to attach some arbitrary data to our messages. In the GRAS parlance,
-we will add a <i>payload</i> to the messages. Reusing the similarity between
-message exchanges and procedure calls, we will now add arguments to our
-calls.
-
-Passing arguments in a distributed setting such as GRAS is a bit more
-complicated than when performing a local call.  The messaging layer must be
-aware of the type of data you want to send and be able to actually send them
-remotely, serializing them on sender side and deserializing them on the
-other side. Of course, GRAS can do so for you.
-
-\subsection GRAS_tut_tour_simpledata_intro_conv Data conversion issues on heterogeneous platforms
-
-The platforms targeted by GRAS complicate the data transfers since the
-machines may well be heterogeneous. You may want to exchange data between a
-regular x86 machine (Intel and assimilated) and amd64 machine or even a ppc
-machine (Mac).
-
-The first problem comes from the fact that C datatypes are not always of the
-same size depending on the processor. On 32 bits machines (such as x86 and
-some ppc), they are stored on 4 bytes where they are stored on 8 bytes on 64
-bits machines (such as amd64).
-
-Then, a second problem comes from the fact that datatypes are not
-represented the same way on these architectures. amd64 and x86 are called
-little-endian architectures (as opposed to big-endian architectures like
-ppc) because they store the bytes of a given integer in a right-to-left way.
-For example, the number 16909060 is written Ox01020304 in hexadecimal base.
-On big endian machines, it will be stored as for bytes ordered that way:
-01.02.03.04. On little-endian machines, it will be stored as 04.03.02.01, ie
-bytes are in reverse order.
-
-A third problem comes from the so-called padding bytes. They come from the
-fact that it is for example much more efficient for the processor to load a
-4-bytes long data (such as an float) if it is aligned on a 4-bytes boundary,
-ie if its first byte is placed in a region of the memory which address is a
-multiple of 4. If it is not the case, the bus needs 2 cycles to retrieve the
-data.  That is why the compiler makes sure that any data declared in your
-program are aligned in memory. When manipulating structures, it means that
-the compiler may introduce some "spaces" between your fields to make sure
-that each of them is aligned on the right boundary. Then, the boundaries
-vary according to the aligned data. Most of the time, the alignment for a
-data type is the data size (2 bytes for shorts which are 2-bytes long and so
-on), but not always ;) And this all this was too easy, those values are not
-only processor dependent, but also compiler and OS dependent. For example,
-doubles (eight bytes) are 8-byte aligned on Windows and 4-byte aligned on
-Linux... Let's take an example:
-
-\verbatim struct MixedData{
-   char    data_1;
-   short   data_2;
-   char    data_3;
-   int     data_4;
-};\endverbatim
-
-One would say that the size of this structure should be 8 bytes long on x86
-(1+2+1+4), but in fact, it is 12 bytes long. To ensure that data_2 is
-2-aligned, one unused byte is added between data_1 and data_2 and 3 bytes
-are wasted between data_3 and data_4 to make sure that this integer is
-4-bytes aligned. Those bytes added by the compiler are called padding bytes.
-Some of them may be added at the end of the structure to make sure that the
-total size fulfill some criterions. On ARM machines, any structure size must
-be a multiple of 4, leading a structure containing two chars to be 4 bytes
-long instead of 2.
-
-\subsection GRAS_tut_tour_simpledata_intro_gras Dealing with hardware heterogeneity in GRAS
-
-All this certainly sounds scary and getting the things right can easily turn
-into a nightmare if you want to do so yourself. Lukily, GRAS converts your
-data seamlessly in heterogeneous exchanges. This is not really a revolution
-since most high-level data exchange solution do so. For this, most solutions
-convert any data to be exchanged from the sender representation into their
-own format on the sender side and convert it to the receiver representation
-on the other side. Sun RPC (used in NFS file systems) for example use the
-XDR representation for this.  When exchanging data between homogeneous
-hosts, this is a clear waste of time since no conversion at all is needed,
-but it is easier to implement. To deal with N kind of hardware architecture,
-you only have to implement 2*N conversion schema (from any arch into the
-exchange format, and from the exchange format into any arch).
-
-In GRAS, we prefered performance over ease of implementation, and data won't
-get converted when it's not needed. Instead, data are sent in the sender
-representation and it is then the responsability of the receiver process to
-convert it on need. To deal with N architectures, there is N^2 conversion
-schema (from any arch to any arch). Nevertheless, GRAS known 9 different
-architectures, allowing it to run on almost any existing computer: Linux
-(x86, ia64, amd64, alpha, sparc, hppa and PPC), Solaris (Sparc and x86), Mac
-OSX, IRIX and AIX. The conversion mecanism also work with the Windows
-conventions, but other issues are still to be solved on this arch.
-
-This approach, along with careful optimization, allows GRAS to offer very
-competitive performance. It is faster than CORBA, not speaking from web
-services which suffer badly from their textual data representation (XML).
-
-\subsection GRAS_tut_tour_simpledata_use Actually exchanging data in GRAS messages
-
-As stated above, all this conversion issues are dealed automatically by GRAS
-and there is very few thing you should do yourself to get it working.
-Simply, when you declare a message type with gras_msgtype_declare(), you
-should provide a description of the payload data type as last argument. GRAS
-will serialize the data, send it on the socket, convert it on need and
-deserialize it for you automatically.
-
-That means that any given message type can only convey a payload of a
-predefined type. You cannot have a message type sometimes conveying an
-integer and sometimes conveying a double.  But in practice, this limitation
-is not very hard to live with. Comparing message exchanges to procedure
-calls again, you cannot have the same procedure accepting arbitrary argument
-types. What you have in Java, for example, is several functions of the same
-name accepting differing argument types, which is a bit different. In C, you
-can also trick the limitation by using <tt>void*</tt> arguments. And
-actually, you can do the same kind of tricks in GRAS, but this is really
-premature at this point of the tutorial. It is the subject of \ref
-GRAS_tut_tour_exchangecb.
-
-Another limitation is that you can only convey one argument per message in
-GRAS. We when that way in GRAS mainly because otherwise, gras_msg_send() and
-the like would have to accept a variating number of parameters. It is
-possible in C, but this reveals rather cumbersome since the compiler do not
-check the number of arguments in any way, and the symptom on error is often
-a segfault. Try passing too few parameters to printf with regard to the
-format string if you want an example. Moreover, since you can convey
-structures, it is easy to overcome this limitation: if you want several
-arguments, simply pack them into a structure before doing so.
-
-There is absolutely no limitation on the type of data you can exchange in
-GRAS. If you can build a C representation of your data, you can exchange it
-with GRAS. More precisely, you can exchange scalars, structures,
-enumerations, arrays (both static and dynamic), pointers, and even things
-like chained list of structures. It is even possible to exchange graphs of
-structures containing cycles between members.
-
-Actually, the main difficulty is to describe the data to be exchanged to
-GRAS. This will be addressed in subsequent tutorial lessons, and we will
-focus on exchanging data that GRAS already knows. Here is a list of such
-data:
-
- - char
- - short int
- - int
- - long int
- - long long int
-
-For all these types, there is three variant: signed, unsigned and the
-version where it is not specified. For example, "signed char", "char" and
-"unsigned char" are all GRAS predefined datatype. The use of the unqualified
-variant ("char") is not encouraged since you may gain some trouble
-sometimes. On hppa, chars are unsigned by default where they are signed by
-default on most archs. Use unqualified variant at your own risk ;)
-
- - float
- - double
- - data and function pointers (on some arch, both types are not of the same
-   size)
-
-You also have some more advanced types:
-
- - string (which are null-terminated char*, as usual in the libc)
- - #xbt_ex_t (the exception types in GRAS, which can get automatically exchanged
-   over the network and are thus predefined)
- - #xbt_peer_t (a datatype describing a peer. There is a plenty of situation
-   in which you want to exchange data of this type, so this is also predefined)
-
-\section GRAS_tut_tour_simpledata_example Back to our example
-
-We will now modify our example to add some data to the "hello" and the
-"kill" messages. "hello" will convey a string being displayed in the logs
-while "kill" will convey an double indicating the number of seconds to wait
-before dying.
-
-The first thing is to modify the message declarations to specify that they
-convey a payload. Of course, all nodes have to agree on message definitions,
-and it would be very bad if the sender and the receiver would not agree on
-the payload data type. GRAS checks for such discrepencies in the simulator
-and dies loudly when something goes wrong. But in RL, GRAS do not check for
-such things, and you are likely to get a segfault rather painful to debug.
-To avoid such mistakes, it is a good habit to declare a function common to
-any nodes declaring the message types involved in your application. Most of
-the time, callbacks can't get declared in the same function since they
-differ from node types to node types (the server attach 2 callbacks where
-the client don't attach any). Here is the message declaring function in our
-case:
-
-\dontinclude 09-simpledata.c
-\skip message_declaration(void)
-\until }
-
-It is very similar to what we had previously, we simply retrieve the
-#xbt_datadesc_type_t definitions of double and string and use them as payload
-type of our messages.
-
-The next step is to change our calls to gras_msg_send() to pass the data to
-send. The rule is that you should put the data into a variable and then pass
-the address of this variable. It makes no difference whether the type
-happens to be a pointer (as char*) or a scalar (as double). Just give
-gras_msg_send the address of the variable, it will do the things right.
-
-\skip hello_payload
-\until Gave
-
-Then, we have to retrieve the sent data from the callbacks. The syntax for
-this is a bit crude, but at least it is very systematic so you don't have to
-think too much about this. The <tt>payload</tt> argument of callbacks is
-declared as <tt>void*</tt> and you can consider that it is the address of
-the variable passed during the send. Ok, it got serialized, exchanged over
-the network, converted and deserialized, but really, you can consider that
-it's the exact copy of your variable. So, to retrieve the content, you have
-to cast the <tt>void*</tt> pointer to a pointer on your datatype, and then
-derefence it.
-
-So, it you want to retrieve a double, you have to cast the pointer using
-<tt>(double*)</tt>, and then dereference the obtained pointer by adding a
-star before the cast. This is what we do here:
-
-\dontinclude 09-simpledata.c
-\skip server_kill_cb
-\until delay
-
-Again, it makes no difference whether the type happens to be a pointer or a
-scalar. You simply end up with more stars in the cast for pointers:
-
-\skip server_hello_cb
-\until char**
-
-That's it, you know how to exchange data between nodes. It's really simple
-with GRAS, even if it's a nightmare to do so portably without it...
-
-\section GRAS_tut_tour_simpledata_recap Recapping everything together
-
-The program now reads:
-\include 09-simpledata.c
-
-Which produces the following output:
-\include 09-simpledata.output
-
-Now that you know how to exchange simple data along with messages, you can
-proceed to the last lesson of the message exchanging part (\ref
-GRAS_tut_tour_rpc) or jump to \ref GRAS_tut_tour_staticstruct to learn more
-on data definition and see how to attach more complicated payloads to your
-messages.
-
-*/
diff --git a/doc/gtut-files/gtut-tour-10-rpc.doc b/doc/gtut-files/gtut-tour-10-rpc.doc
deleted file mode 100644 (file)
index 46c962b..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
-@page GRAS_tut_tour_rpc Lesson 10: Remote Procedure Calling (RPC)
-
-\section GRAS_tut_tour_rpc_toc Table of Contents
- - \ref GRAS_tut_tour_rpc_intro
- - \ref GRAS_tut_tour_rpc_use
-   - \ref GRAS_tut_tour_rpc_use_declare
-   - \ref GRAS_tut_tour_rpc_use_i2a_cb
-   - \ref GRAS_tut_tour_rpc_use_a2i_cb
-   - \ref GRAS_tut_tour_rpc_use_rest
- - \ref GRAS_tut_tour_rpc_recap
-
-<hr>
-
-\section GRAS_tut_tour_rpc_intro Introduction
-
-So far, we saw how to send messages from one host to another, but quite
-often, we need a two-way message exchange: a "client" sends a request to a
-"server", and the server returns a result after doing some sort of
-computation. This design is often refered to as "Remote Procedure Call" or
-RPC for short.
-
-It is naturally possible to build RPC exchanges using only one-way messages,
-as the ones we used in GRAS so far, but it's a bit awkward (specially when
-the server wants to return a value to the client in a remote function call).
-That is why GRAS provide a support for RPC, as we will now detail.
-
-\section GRAS_tut_tour_rpc_use Putting rpc into action
-
-We will build a simple RPC where clients use a remote server to convert
-strings into numbers and vice-versa (ie, changing between "1234" and 1234).
-To achieve its duty, the server will simply use the strtol function in one
-direction. In the other direction, we will use bprintf(). This is a sprintf()
-version allocating the needed room before doing the conversion. Its
-portability is discutable, but SimGrid declares this function when it cannot
-be found on the host architecture, so you can use it peacefully.
-
-\subsection GRAS_tut_tour_rpc_use_declare Declaring the RPC
-
-To declare a RPC message, we should simply use gras_msgtype_declare_rpc().
-Compared to gras_msgtype_declare() that we use to declare one-way messages,
-this function accepts one extra argument: the datatype of the answer
-message. In our example, we accept one string in input, and a long in
-output for the a2i conversion (a=char 2=to i=integer), and the contrary in
-the other direction.
-
-\dontinclude 10-rpc.c
-\skip gras_msgtype_declare_rpc
-\until long
-\until string
-
-\subsection GRAS_tut_tour_rpc_use_i2a_cb Declaring a simple RPC callback: the integer to string conversion
-
-RPC callbacks are very close to "regular" ones. The only difference is that
-they must call gras_msg_rpcreturn() at some point to return their result to
-the caller. This function accepts 3 arguments: First the timeout to use when
-sending back the result (we must use callbacks when doing network
-communication to avoid deadlocks and such issues). The second argument is
-the callback context that the callback got as first argument. It denotes how
-to reach the caller and such. The last argument is a pointer to a variable
-containing the result to pass to the caller.
-
-Having the callee explicitly returning data to the caller allows to free
-data that were allocated to do the job asked by the client, as in this
-example.
-
-\skip server_convert_i2a_cb
-\until end_of_convert_callback
-
-\subsection GRAS_tut_tour_rpc_use_a2i_cb RPC and exceptions: the string to integer conversion
-
-When converting strings into integer, we must deal with the possibility that
-the provided string is not a number. This is done very easily by raising an
-exception in the RPC callback. This exception will get captured by the
-middleware running the callback on the server side, sent accross the network
-to the client side, and revived here. In short, exceptions raised on callee
-side get passed automagically to the caller.
-
-\skip server_convert_a2i_cb
-\until end_of_convert_callback
-
-\subsection GRAS_tut_tour_rpc_use_rest The rest of the story
-
-The rest of the story is not really exciting. The server and the client are
-very classical compared to what we saw so far. We simply have a specific
-message "done" to stop the server when the client is done using it.
-
-This may also be the first time you see the xbt_ex_display() function, which
-allows to display an exception as if it were not catched without killing the
-process.
-
-\section GRAS_tut_tour_rpc_recap Recapping everything together
-
-The program now reads:
-\include 10-rpc.c
-
-Which produces the expected output:
-\include 10-rpc.output
-
-Now, you know how to send messages, attach callbacks and do RPCs. The next
-lesson will learn you the last missing part of the messaging library:
-\ref GRAS_tut_tour_explicitwait
-
-*/
diff --git a/doc/gtut-files/gtut-tour-11-explicitwait.doc b/doc/gtut-files/gtut-tour-11-explicitwait.doc
deleted file mode 100644 (file)
index 3960164..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
-@page GRAS_tut_tour_explicitwait Lesson 11: Explicitely waiting for messages
-
-\section GRAS_tut_tour_explicitwait_toc Table of Contents
- - \ref GRAS_tut_tour_explicitwait_intro
- - \ref GRAS_tut_tour_explicitwait_use
-   - \ref GRAS_tut_tour_explicitwait_algo
-   - \ref GRAS_tut_tour_explicitwait_code
-     - \ref GRAS_tut_tour_explicitwait_code_msg
-     - \ref GRAS_tut_tour_explicitwait_code_cb
-     - \ref GRAS_tut_tour_explicitwait_code_api
-     - \ref GRAS_tut_tour_explicitwait_code_smain
-     - \ref GRAS_tut_tour_explicitwait_code_cmain
- - \ref GRAS_tut_tour_explicitwait_recap
-
-<hr>
-
-\section GRAS_tut_tour_explicitwait_intro Introduction
-
-The messaging primitive we have seen so far are somehow limited on the
-receiver side. You have to attach a callback to a message type, and then go
-into an infinite loop. Sometimes, you want to block your execution until a
-message of a given type arrives. This often occures when you want to deal
-with synchronization problems.
-
-As an example, we will study a simple centralized algorithm for mutual
-exclusion. In short, when the client wants to enter the critical section
-(CS), it sends a specific message to the server, and waits for the server to
-answer back with another message. While the client is "locked" waiting for
-the message, nothing else should occure for it (no callback or timer should
-be served).
-
-The simplest interface to explicit message waiting allows you to specify the
-message type you are willing to accept (using gras_msg_wait()). But you can
-also specify a list of accepted message types (using gras_msg_wait_or()), or
-even provide your own message filters to decide precisly the kind of message
-you are waiting for (for example depending on message content -- this is
-done using gras_msg_wait_ext()).
-
-Any message received not matching your expectation will be queued for
-further use. Ie, they will be stored in memory and are candidates for the
-next gras_msg_handle() or gras_msg_wait().
-
-\section GRAS_tut_tour_explicitwait_use Example: mutual exclusion with centralized coordinator
-
-\subsection GRAS_tut_tour_explicitwait_algo GRAS modelization of the algorithm
-
-This section naturally provides an example of how to use gras_msg_wait(),
-but it can also be seen as an example of the guidelines provided in
-\ref GRAS_howto_design.
-
-So, here are the caracteristics of our example:
-
-There is two types of processes:
- - several <i>clients</i> which want to enter a critical section
- - a <i>server</i>, which grants clients to enter the CS when no other
-   process is already in it.
-
-There is three kind of messages in the system:
- - <i>request</i> (from clients to server) to ask for the permission to enter the CS
- - <i>release</i> (from clients to server) to express that they exited the CS
- - <i>grant</i> (from server to clients) to allow the given process to enter the CS
-
-The server has 2 callbacks attached:
- - When it gets a <i>request</i>, it checks whether their is already a process in
-   the CS. If yes, it adds the requester into a FIFO list. If not, it sends
-   a <i>grant</i> message to the asking client.
- - When it gets a <i>release</i>, it checks whether there is some waiting
-   processes in the waiting queue. If yes, it dequeues the first one and
-   send a <i>grant</i> message to it. If no, it notes that the CS is free.
-
-The server has two private data (for the callbacks to work):
- - a boolean indicating whether there is a process in the CS already
- - a waiting queue (#xbt_dynar_t is quite natural to code this).
-
-The client interface is composed of two functions:
- - lock(), which tries to get the grant from the server to enter the CS.
-   This is where explicit waiting comes into the game. This function sends a
-   <i>request</i> to the server, and blocks until the server issues a
-   <i>grant</i> back.
- - unlock(), which informs the server that we exited the CS (by sending a
-   <i>release</i> message)
-
-\subsection GRAS_tut_tour_explicitwait_code The code step-by-step
-
-\subsubsection GRAS_tut_tour_explicitwait_code_msg a) Messages declaration
-
-First of all, we should have a function declaring all used messages. As said
-before, this should be in a separate function so that it can be shared
-between all process kinds and avoid code dupplication which may result in
-definition discrepency.
-
-Here, there is no payload attached to the messages.
-
-\dontinclude 11-explicitwait.c
-\skip message_declaration
-\until }
-
-\subsubsection GRAS_tut_tour_explicitwait_code_cb b) Defining private data and callbacks of the server
-
-Then, we define the callbacks that should be invoqued on the server side
-when some messages are received, as previously. For this, we also have to
-declare a structure for the private data of the server.
-
-\skip typedef
-\until end_of_release_callback
-
-\subsubsection GRAS_tut_tour_explicitwait_code_api c) Client-side API
-
-Now, we define the functions that the client must call to use the service.
-Note that this is where the explicit wait feature is used.
-
-\skip lock
-\until end_of_unlock
-
-\subsubsection GRAS_tut_tour_explicitwait_code_smain d) Server-side initialization
-
-The core of our distributed service is implemented (protocol, actions on
-server side, and accessing function on client side). We should now
-initialize the server and let it wait for incoming messages.
-
-Defining when to stop the server can become tricky. The simplest solution is
-to never let the server stop. It simply runs forever. But the simulator will
-raise an error at the end, so I won't do so here to keep the output clean.
-Another solution would be to deal with client membership properly: clients
-registers, use the service and quit afterward. When no client use the
-service, the server stops. This would be a bit difficult to implement
-(actually, there is an AMOK module to do so simply: \ref AMOK_pm).
-Here, we will just hardcode that the clients ask 5 times for the token, and
-that there is two clients. This clearly simplify the problem.
-
-\dontinclude 11-explicitwait.c
-\skip gras_userdata_new
-\until gras_msg_handle
-
-\subsubsection GRAS_tut_tour_explicitwait_code_cmain e) Client-side use
-
-And now, the client is <b>really</b> simple to write:
-
-\skip message_declaration
-\until }
-
-\section GRAS_tut_tour_explicitwait_recap Recapping everything together
-
-The program now reads:
-\include 11-explicitwait.c
-
-Which produces the expected output:
-\include 11-explicitwait.output
-
-
-*/
diff --git a/doc/gtut-files/gtut-tour-12-staticstruct.doc b/doc/gtut-files/gtut-tour-12-staticstruct.doc
deleted file mode 100644 (file)
index 1327b78..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-@page GRAS_tut_tour_staticstruct Lesson 12: Defining static structures (TODO)
-
-\section GRAS_tut_tour_staticstruct_toc Table of Contents
- - \ref GRAS_tut_tour_staticstruct_intro
- - \ref GRAS_tut_tour_staticstruct_use
- - \ref GRAS_tut_tour_staticstruct_recap
-
-<hr>
-
-\section GRAS_tut_tour_staticstruct_intro Introduction
-
-
-\section GRAS_tut_tour_staticstruct_use Defining static structure to GRAS
-
-
-\section GRAS_tut_tour_staticstruct_recap Recapping everything together
-
-The program now reads:
-include 11-staticstruct.c
-
-Which produces the expected output:
-include 11-staticstruct.output
-
-
-*/
diff --git a/doc/gtut-files/gtut-tour-13-pointers.doc b/doc/gtut-files/gtut-tour-13-pointers.doc
deleted file mode 100644 (file)
index d58f5e6..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
-@page GRAS_tut_tour_pointers Lesson 13: Defining structure containing pointers (TODO)
-
-This lesson is a bit different from the other ones. It aims at explaining
-several features of the automatic datadesc parsing. Since it would be a bit
-long otherwise, the lesson is organized as a FAQ, with little examples of
-how to do things.
-
-\section GRAS_tut_tour_pointers_toc Table of Contents
- - \ref GRAS_tut_tour_pointers_intro
- - \ref GRAS_tut_tour_pointers_use
- - \ref GRAS_tut_tour_pointers_recap
- - \ref GRAS_tut_tour_pointers_cste
-
-<hr>
-\section GRAS_tut_tour_pointers_intro Introduction to pointers in datadesc
-\section GRAS_tut_tour_pointers_use Using pointers in datadesc
-\section GRAS_tut_tour_pointers_recap Recapping everything
-
-
-\section GRAS_tut_tour_pointers_cste How to have constants in parsed structures?
-
-You can use gras_datadesc_set_const() to explain GRAS about the value of
-your \#define'd constants.
-
-\verbatim
-#define SIZE 12
-GRAS_DEFINE_TYPE(array,struct array {
-  int data[SIZE];
-};);
-
-void declare_ddt() {
-  gras_datadesc_type_t ddt;
-
-  gras_datadesc_set_const("SIZE",SIZE); /* Set it before */
-  gras_datadesc_by_symbol(array);
-}
-\endverbatim
-
-
-*/
-
-    and the this example do use structures as payload,
-    so we have to declare it to GRAS. Hopefully, this can be done easily by enclosing
-    the structure declaration within a \ref GRAS_DEFINE_TYPE macro call. It will then copy this
-    declaration into an hidden string variable, which can be automatically parsed at
-    run time. Of course, the declaration is also copied unmodified by this macro, so that it
-    gets parsed by the compiler also.
-
-    There is some semantic that GRAS cannot guess alone and you need to  <i>annotate</i>
-    your declaration to add some. For example, the ctn pointer can be a reference to an
-    object or a whole array (in which case you also has to specify its size). This is done
-    with the GRAS_ANNOTE call. It is removed from the text passed to the compiler, but it helps
-    GRAS getting some information about the semantic of your data. Here, it says that \a ctn is an
-    array, which size is the result of the operation \a rows * \a cols (with \a rows and \a cols
-    being the other fields of the structure).
-
-    Please note that this annotation mechanism is not as robust and cool as this example seems to
-    imply. If you want to use it yourself, you'd better use the exact right syntax, which is
-    detailed in the \ref GRAS_dd section.
-
-    \skip GRAS_DEFINE_TYPE
-    \until matrix_t
-
-
-
-#define COLS 16
-#define MAX_ROUTESET 10
-#define MAX_LEAFSET COLS
-
-GRAS_DEFINE_TYPE(gras_row_t,
-struct gras_row_t {
-  int which_row;
-  int row[COLS][MAX_ROUTESET];
-};)
-
-typedef struct gras_row_t gras_row_t;
-
-GRAS_DEFINE_TYPE(gras_welcome_msg_t,
-struct gras_welcome_msg_t {
-  int id;
-  double time_sent;
-
-  int row_count;
-  gras_row_t *rows GRAS_ANNOTE(size,row_count);
-
-  int leaves[MAX_LEAFSET];
-};)
-
-void declare_ddt(void) {
-  gras_datadesc_type_t ddt;
-
-  gras_datadesc_set_const("COLS",COLS);
-  gras_datadesc_set_const("MAX_ROUTESET",MAX_ROUTESET);
-  gras_datadesc_set_const("MAX_LEAFSET",MAX_LEAFSET);
-
-  gras_datadesc_by_symbol(gras_row_t); /* Parse it before */
-  ddt=gras_datadesc_ref("welcome_msg_t*",gras_datadesc_by_symbol(gras_welcome_msg_t));
-  gras_msgtype_declare("welcome",ddt);
-}
diff --git a/doc/gtut-files/gtut-tour-14-dynar.doc b/doc/gtut-files/gtut-tour-14-dynar.doc
deleted file mode 100644 (file)
index 2c6c97d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-@page GRAS_tut_tour_dynar Lesson 14: Exchanging aggregate datatypes such as dynar (TODO)
-
-\section GRAS_tut_tour_dynar_toc Table of Contents
- - \ref GRAS_tut_tour_dynar_intro
- - \ref GRAS_tut_tour_dynar_use
- - \ref GRAS_tut_tour_dynar_recap
-
-<hr>
-
-\section GRAS_tut_tour_dynar_intro Introduction
-
-
-\section GRAS_tut_tour_dynar_use Defining structure containing dynars
-
-
-\section GRAS_tut_tour_dynar_recap Recapping everything together
-
-The program now reads:
-include 13-dynar.c
-
-Which produces the expected output:
-include 13-dynar.output
-
-
-*/
diff --git a/doc/gtut-files/gtut-tour-15-manualdatadef.doc b/doc/gtut-files/gtut-tour-15-manualdatadef.doc
deleted file mode 100644 (file)
index 7a685b5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-@page GRAS_tut_tour_manualdatadef Lesson 15: Manual data definition (TODO)
-
-\section GRAS_tut_tour_manualdatadef_toc Table of Contents
- - \ref GRAS_tut_tour_manualdatadef_intro
- - \ref GRAS_tut_tour_manualdatadef_use
- - \ref GRAS_tut_tour_manualdatadef_recap
-
-<hr>
-
-\section GRAS_tut_tour_manualdatadef_intro Introduction
-
-
-\section GRAS_tut_tour_manualdatadef_use Defining data manually
-
-
-\section GRAS_tut_tour_manualdatadef_recap Recapping everything together
-
-The program now reads:
-include 14-manualdatadef.c
-
-Which produces the expected output:
-include 14-manualdatadef.output
-
-
-*/
diff --git a/doc/gtut-files/gtut-tour-16-exchangecb.doc b/doc/gtut-files/gtut-tour-16-exchangecb.doc
deleted file mode 100644 (file)
index 5f3801b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-@page GRAS_tut_tour_exchangecb Lesson 16: Advanced topics on data definition (TODO)
-
-\section GRAS_tut_tour_exchangecb_toc Table of Contents
- - \ref GRAS_tut_tour_exchangecb_intro
- - \ref GRAS_tut_tour_exchangecb_use
- - \ref GRAS_tut_tour_exchangecb_recap
-
-<hr>
-
-\section GRAS_tut_tour_exchangecb_intro Introduction
-
-
-\section GRAS_tut_tour_exchangecb_use Using exchange callbacks
-
-
-\section GRAS_tut_tour_exchangecb_recap Recapping everything together
-
-The program now reads:
-include 15-exchangecb.c
-
-Which produces the expected output:
-include 15-exchangecb.output
-
-
-*/
diff --git a/doc/gtut-files/gtut-tour-recap-messages.doc b/doc/gtut-files/gtut-tour-recap-messages.doc
deleted file mode 100644 (file)
index 0794ddc..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/**
-@page GRAS_tut_tour_message_recaping Recaping the GRAS messaging system (ongoing)
-
-\section GRAS_tut_tour_message_recaping_toc Table of Contents
- - \ref GRAS_tut_tour_message_recaping_intro
- - \ref GRAS_tut_tour_message_recaping_rpc
-   - \ref GRAS_tut_tour_message_recaping_rpc1
-   - \ref GRAS_tut_tour_message_recaping_rpc2
-   - \ref GRAS_tut_tour_message_recaping_rpc3
-   - \ref GRAS_tut_tour_message_recaping_rpc4
-   - \ref GRAS_tut_tour_message_recaping_rpc5
-   - \ref GRAS_tut_tour_message_recaping_rpc_aside1
-   - \ref GRAS_tut_tour_message_recaping_rpc_aside2
-   - \ref GRAS_tut_tour_message_recaping_rpc_aside3
- - \ref GRAS_tut_tour_message_recaping_sync
-
-<hr>
-
-This is the end of the first big part of this tutorial. At this point, you
-know pretty much everything about message passing in GRAS. In second big
-part, you will learn how to describe data to the middleware in order to
-convey your own structures in messages instead of the predefined scalar
-types. But for now, it is time to recap what we have seen so far.
-
-\section GRAS_tut_tour_message_recaping_intro Message passing compared to procedure call
-
-In GRAS, you pass message to get remote component to achieve some work for
-you. In some sense, this is very similar to the good old procedure
-abstraction: you call some procedure to get <i>it</i> doing some work for
-you. Looking closer at this good old abstraction, we notice 4 call semantics:
-
- - <tt>void procedure(void)</tt> this is a procedure accepting no argument
-   and returning no result (<b>type 1</b>).
- - <tt>void procedure2(int i)</tt> this is a procedure accepting an
-   argument, but returning no result (<b>type 2</b>).
- - <tt>int function(void)</tt> this is a function accepting no argument, but
-   returning a result (<b>type 3</b>).
- - <tt>int function(int i)</tt> this is a function accepting an argument,
-   and returning a result (<b>type 4</b>).
-
-The whole story of the GRAS message passing subsystem is to allow to
-reproduce these call semantics in a distributed setting. That being said, We
-must also note that some messages exchanged using GRAS do not intend to
-mimic these semantics, but instead to help the syncronisation between
-distributed processes. When exchanged from peer A to peer B, they don't mean
-that A requests a service from B, but rather that A gives an information (a
-signal) to B. It could be for example that A reached a specific point of its
-computation, and that B can proceed with its own (this syncronisation schema
-being a simple rendez-vous). These messages are covered in the next part of
-this recapping (\ref GRAS_tut_tour_message_recaping_sync).
-
-To return on the call semantics described above, there is a big difference
-between the types T1 and T2 on one side and the types T3 and T4 on the other
-side. In the second case, the caller do wait for an answer from the callee
-side. In a distributed setting, you have to exchange one extra message in
-that case. That is why T1;T2 (sometimes refered as <i>one-way messages</i>)
-are treated quite differently in GRAS from T3;T4.
-
-\section GRAS_tut_tour_message_recaping_rpc Remote Procedure Call in GRAS
-
-Mimicing the same call semantic in a distributed setting is the goal of the
-RPC systems. To do so in GRAS, you must do the following actions:
-
-\subsection GRAS_tut_tour_message_recaping_rpc1 1. Declaring a datatype
-
-If you want that your messages convey complex datatypes and not only scalar,
-you have to do it first. Learning how to do so is the subject of the second
-part of this tutorial. For now, simply observe that this is the same thing
-than doing a <tt>typedef</tt> in your code before using this type:
-\verbatim typedef struct {
-  int a;
-  char b;
-} *mytype;\endverbatim
-
-\subsection GRAS_tut_tour_message_recaping_rpc2 2. Declaring a message type
-
-This is very similar to forward procedure declarations in your sequential
-code:
-\verbatim int myfunction(mytype myarg);\endverbatim
-More formally it comes down to associating a data type to a given
-symbol name. For example, in \ref GRAS_tut_tour_simpledata, we specified
-that the message <tt>"kill"</tt> conveyed a double as payload.
-
-Doing so depends on whether you have a one-way message (ie, type 1 or 2) or
-not. One-way messages are declared with gras_msgtype_declare() while RPC
-messages are declared with gras_msgtype_declare_rpc()
-
-\subsection GRAS_tut_tour_message_recaping_rpc3 3. Declaring message callbacks
-
-If the message is intended to be a work request one (and not a
-syncronization one as detailed below), you then want to attach some code to
-execute when a process receives the given request. In other words, you want
-to attach a callback to the message. Of course, you usualy don't want to do
-so on every nodes, but only on "servers" or "workers" or such. First of all,
-you need to declare the callback itself. This function that will be executed
-on request incoming must follow a very specific prototype (the same
-regardless of the call semantic):
-
-\verbatim
-int callback_name(gras_msg_cb_ctx_t context, void *payload) \endverbatim
-
-The first argument (of type #gras_msg_cb_ctx_t) is an opaque structure
-describing the callback context: who sent you the message (which you can
-find back using gras_msg_cb_ctx_from()), whether it's a one-way call or not,
-and so on. GRAS functions altering the call (such as gras_msg_rpcreturn(),
-used to return the result to the caller) require this context as argument.
-
-The second argument is a pointer to where the message payload is stored. In
-the T1 and T3 semantics (ie, when the message had no payload), this second
-argument is NULL. If not, the first line of your callback will probably
-retrieve the payload and store it in a variable of yours. The semantic for
-this is very systematic, if not elegant: If your payload is of type TOTO,
-<tt>payload</tt> is a pointer to a TOTO variable. So, cast it properly (add
-<tt>(TOTO*)</tt> in front of it), and dereference it (add a star right
-before the cast). For example:
-
-\verbatim
-TOTO myvariable = *(TOTO*) payload; \endverbatim
-
-This becomes even uglier if the conveyed type is a pointer itself, but you
-must stick to the rule anyway:
-
-\verbatim
-int **myvariable = *(int ** *) payload; \endverbatim
-
-If your message is of semantic T3 or T4 (ie, it returns a value to the
-caller), then you must use the function gras_msg_rpcreturn() to do so. It
-takes three arguments:
-  - a timeout to use (so that the server don't get frozen if the client is
-    unresponsive)
-  - the message context (the variable ctx of type #gras_msg_cb_ctx_t you got
-    as argument of the callback)
-  - a pointer to the data to send back.
-After it returned the result this way, you should free any data you
-mallocated in your callback (including the data you returned to the caller:
-GRAS made a copy of it during the call to gras_msg_rpcreturn()).
-
-The callback is expected to return 0 if ok, as detailed in
-\ref GRAS_tut_tour_message_recaping_rpc_aside1.
-
-\subsection GRAS_tut_tour_message_recaping_rpc4 4. Attaching callbacks to the messages
-
-To attach a given callback to a given message, you simply use
-gras_cb_register(). If you even want to de-register a callback, use
-gras_cb_unregister().
-
-\subsection GRAS_tut_tour_message_recaping_rpc5 5. Send your message from the client
-
-Again, sending messages depend on the semantic call. If you have a one-way
-message, you should call gras_msg_send() while RPC calls are sent with
-gras_msg_rpccall(). The main difference between them is that you have an
-extra argument for RPC, to specify where to store the result.
-
-It is also possible to call RPC asyncronously: you send the request (using
-gras_msg_rpc_async_call()), do some other computation. And then later, you
-wait for the answer of your RPC (using gras_msg_rpc_async_wait()).
-
-\subsection GRAS_tut_tour_message_recaping_rpc_aside1 Aside: stacking callbacks
-
-The callback is expected to return 0 if everything went well, which is the
-same semantic than the "main()" function. You can also build stacks of
-callbacks. It is perfectly valid to register several callbacks to a given
-message. When a message arrives, it is passed to the firstly-registered
-callback. If the callback returns 0, it means that it consumed the message,
-which is discarded. If the callback returns 1 (or any other "true" value),
-the message is passed to the next callback of the stack, and so on. At the
-end, if no callback returned 0, an exception is raised.
-
-This mecanism can for example be used to introduce dupplication and replay.
-You add a callback simply in charge of storing the message in a database,
-and since it returns 1, the message is then passed to the "real" callback.
-To be perfectly honest, I never had use of this functionnality myself, but I
-feel it could be useful in some cases...
-
-\subsection GRAS_tut_tour_message_recaping_rpc_aside2 Aside: Exceptions and callbacks
-
-One of the parts I'm the most proud of in GRAS is this one: imagine you have
-a rpc callback executing on a remote server. If this callback raises an
-exception, it will be propagated on the network back to the client, and
-revived there. So, the client will get automatically any exception raised by
-the server. Cool, isn't it? Afterward, simply refer to the <tt>host</tt>
-field of the #xbt_ex_t to retrieve the machine on which it was initialy
-raised.
-
-In case you wonder about the exceptions I'm speaking about (after all,
-SimGrid is in C ANSI, and there is usually no exception mecanism in C ANSI),
-you may want to refer to the section \ref XBT_ex. Note that exception can be
-troublesome to use (mainly because the compiler won't catch your mistakes on
-this).
-
-\subsection GRAS_tut_tour_message_recaping_rpc_aside3 Aside: Symbol versionning (TODO)
-
-This section covers a point not explicited elsewhere in the documentation.
-It may be seen as a bit hardcore, and you should probably skip it the first
-time you read the tutorial.
-
-\section GRAS_tut_tour_message_recaping_sync Syncronization messages in GRAS (TODO)
-
-*/
-
diff --git a/doc/gtut-files/gtut-tour.doc b/doc/gtut-files/gtut-tour.doc
deleted file mode 100644 (file)
index 949d8ea..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/** @defgroup GRAS_tut_tour Initiatic tour
-    @ingroup GRAS_tut
-
-During this tour, you will learn all you need to write your own GRAS
-applications, from the installation of the framework to the use of (almost)
-all features available in GRAS.
-
-    \htmlonly <!--
-      DOXYGEN_NAVBAR_CHILD "0: Installing"=GRAS_tut_tour_install.html
-      DOXYGEN_NAVBAR_CHILD "1: Setup a project"=GRAS_tut_tour_setup.html
-      DOXYGEN_NAVBAR_CHILD "2: Simple messaging"=GRAS_tut_tour_simpleexchange.html
-      DOXYGEN_NAVBAR_CHILD "3: Process args"=GRAS_tut_tour_args.html
-      DOXYGEN_NAVBAR_CHILD "4: Callbacks"=GRAS_tut_tour_callbacks.html
-      DOXYGEN_NAVBAR_CHILD "5: Globals"=GRAS_tut_tour_globals.html
-      DOXYGEN_NAVBAR_CHILD "6: Logs"=GRAS_tut_tour_logs.html
-      DOXYGEN_NAVBAR_CHILD "7: Timers"=GRAS_tut_tour_timers.html
-      DOXYGEN_NAVBAR_CHILD "8: Exceptions"=GRAS_tut_tour_exceptions.html
-      DOXYGEN_NAVBAR_CHILD "9: Data exchange"=GRAS_tut_tour_simpledata.html
-      DOXYGEN_NAVBAR_CHILD "10: RPC"=GRAS_tut_tour_rpc.html
-      DOXYGEN_NAVBAR_CHILD "11: Explicit wait"=GRAS_tut_tour_explicitwait.html
-      DOXYGEN_NAVBAR_CHILD "Recapping part 1"=GRAS_tut_tour_message_recaping.html
-      DOXYGEN_NAVBAR_CHILD "12: Static data definition"=GRAS_tut_tour_staticstruct.html
-      DOXYGEN_NAVBAR_CHILD "13: Pointers definition"=GRAS_tut_tour_pointers.html
-      DOXYGEN_NAVBAR_CHILD "14: Dynars definition"=GRAS_tut_tour_dynar.html
-      DOXYGEN_NAVBAR_CHILD "15: Manual data definition"=GRAS_tut_tour_manualdatadef.html
-      DOXYGEN_NAVBAR_CHILD "16: Advanced data definition"=GRAS_tut_tour_exchangecb.html
-    --> \endhtmlonly
-
-<b>Part 1: Bases</b>
-
- - \ref GRAS_tut_tour_install
-
- - \ref GRAS_tut_tour_setup
-    - \ref GRAS_tut_tour_setup_C
-    - \ref GRAS_tut_tour_setup_plat
-    - \ref GRAS_tut_tour_setup_deploy
-    - \ref GRAS_tut_tour_setup_glue
-    - \ref GRAS_tut_tour_setup_make
-    - \ref GRAS_tut_tour_setup_start
-
-<b>Part 2: Message passing</b>
-
- - \ref GRAS_tut_tour_simpleexchange
-    - \ref GRAS_tut_tour_simpleexchange_msgtype
-    - \ref GRAS_tut_tour_simpleexchange_socks
-    - \ref GRAS_tut_tour_simpleexchange_exchange
-    - \ref GRAS_tut_tour_simpleexchange_recaping
-
- - \ref GRAS_tut_tour_args
-    - \ref GRAS_tut_tour_args_use
-    - \ref GRAS_tut_tour_args_sg
-    - \ref GRAS_tut_tour_args_recap
-
- - \ref GRAS_tut_tour_callbacks
-    - \ref GRAS_tut_tour_callbacks_declare
-    - \ref GRAS_tut_tour_callbacks_attach
-    - \ref GRAS_tut_tour_callbacks_handle
-    - \ref GRAS_tut_tour_callback_recap
-
- - \ref GRAS_tut_tour_globals
-    - \ref GRAS_tut_tour_globals_intro
-    - \ref GRAS_tut_tour_globals_use
-    - \ref GRAS_tut_tour_callback_pitfall
-    - \ref GRAS_tut_tour_callback_recap
-
- - \ref GRAS_tut_tour_logs
-    - \ref GRAS_tut_tour_logs_intro
-    - \ref GRAS_tut_tour_logs_practice
-    - \ref GRAS_tut_tour_logs_recap
-    - \ref GRAS_tut_tour_logs_config
-      - \ref GRAS_tut_tour_logs_config_prio
-      - \ref GRAS_tut_tour_logs_config_layout
-
- - \ref GRAS_tut_tour_timers
-    - \ref GRAS_tut_tour_timers_intro
-    - \ref GRAS_tut_tour_timers_use
-    - \ref GRAS_tut_tour_timers_recap
-
- - \ref GRAS_tut_tour_exceptions
-    - \ref GRAS_tut_tour_exceptions_intro
-    - \ref GRAS_tut_tour_exceptions_use
-    - \ref GRAS_tut_tour_exceptions_recap
-
- - \ref GRAS_tut_tour_simpledata
-    - \ref GRAS_tut_tour_simpledata_intro
-      - \ref GRAS_tut_tour_simpledata_intro_conv
-      - \ref GRAS_tut_tour_simpledata_intro_gras
-      - \ref GRAS_tut_tour_simpledata_use
-    - \ref GRAS_tut_tour_simpledata_example
-    - \ref GRAS_tut_tour_simpledata_recap
-
- - \ref GRAS_tut_tour_rpc
-    - \ref GRAS_tut_tour_rpc_intro
-    - \ref GRAS_tut_tour_rpc_use
-      - \ref GRAS_tut_tour_rpc_use_declare
-      - \ref GRAS_tut_tour_rpc_use_i2a_cb
-      - \ref GRAS_tut_tour_rpc_use_a2i_cb
-      - \ref GRAS_tut_tour_rpc_use_rest
-    - \ref GRAS_tut_tour_rpc_recap
-
- - \ref GRAS_tut_tour_explicitwait
-    - \ref GRAS_tut_tour_explicitwait_intro
-    - \ref GRAS_tut_tour_explicitwait_use
-      - \ref GRAS_tut_tour_explicitwait_algo
-      - \ref GRAS_tut_tour_explicitwait_code
-        - \ref GRAS_tut_tour_explicitwait_code_msg
-        - \ref GRAS_tut_tour_explicitwait_code_cb
-        - \ref GRAS_tut_tour_explicitwait_code_api
-        - \ref GRAS_tut_tour_explicitwait_code_smain
-        - \ref GRAS_tut_tour_explicitwait_code_cmain
-    - \ref GRAS_tut_tour_explicitwait_recap
-
- - \ref GRAS_tut_tour_message_recaping
-    - \ref GRAS_tut_tour_message_recaping_intro
-    - \ref GRAS_tut_tour_message_recaping_rpc
-      - \ref GRAS_tut_tour_message_recaping_rpc1
-      - \ref GRAS_tut_tour_message_recaping_rpc2
-      - \ref GRAS_tut_tour_message_recaping_rpc3
-      - \ref GRAS_tut_tour_message_recaping_rpc4
-      - \ref GRAS_tut_tour_message_recaping_rpc5
-      - \ref GRAS_tut_tour_message_recaping_rpc_aside1
-      - \ref GRAS_tut_tour_message_recaping_rpc_aside2
-      - \ref GRAS_tut_tour_message_recaping_rpc_aside3
-    - \ref GRAS_tut_tour_message_recaping_sync
-
-<b>Part 3: Data description</b>
-
- - \ref GRAS_tut_tour_staticstruct
-    - \ref GRAS_tut_tour_staticstruct_intro
-    - \ref GRAS_tut_tour_staticstruct_use
-    - \ref GRAS_tut_tour_staticstruct_recap
-
- - \ref GRAS_tut_tour_pointers
-    - \ref GRAS_tut_tour_pointers_intro
-    - \ref GRAS_tut_tour_pointers_use
-    - \ref GRAS_tut_tour_pointers_recap
-    - \ref GRAS_tut_tour_pointers_cste
-
- - \ref GRAS_tut_tour_dynar
-    - \ref GRAS_tut_tour_dynar_intro
-    - \ref GRAS_tut_tour_dynar_use
-    - \ref GRAS_tut_tour_dynar_recap
-
- - \ref GRAS_tut_tour_manualdatadef
-    - \ref GRAS_tut_tour_manualdatadef_intro
-    - \ref GRAS_tut_tour_manualdatadef_use
-    - \ref GRAS_tut_tour_manualdatadef_recap
-
- - \ref GRAS_tut_tour_exchangecb
-    - \ref GRAS_tut_tour_exchangecb_intro
-    - \ref GRAS_tut_tour_exchangecb_use
-    - \ref GRAS_tut_tour_exchangecb_recap
-
-<b>Part 4: Advanced topics</b>
-
-Unfortunately, the tour is not terminated yet, but I already know the kind
-of missi^W lessons I want to add:
-
-   - Computation virtualization
-   - Splitting in several files (logs, datadesc)
-   - Debugging GRAS programs
-   - Doing proper GRAS modules
-
-<hr>
-
-
-
-*/
diff --git a/doc/gtut-files/test.xml b/doc/gtut-files/test.xml
deleted file mode 100644 (file)
index 2aaa6f8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Jacquelin" function="server" />
-  <process host="Boivin" function="client" />
-</platform>
-
diff --git a/doc/ref_guide/doxygen/module-gras.doc b/doc/ref_guide/doxygen/module-gras.doc
deleted file mode 100644 (file)
index 7b8d028..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/** \addtogroup GRAS_API
-
-    \section GRAS_funct GRAS offers the following functionnalities
-     - <b>\ref GRAS_comm</b>: Exchanging messages between peers
-       - \ref GRAS_dd : any data which may transit on the network must be
-         described beforehand so that GRAS can handle the platform
-         heterogeneity and convert them if needed.
-       - \ref GRAS_sock : this is how to open a communication channel to
-         other processes, and retrive information about them.
-       - \ref GRAS_msg : communications are message oriented. You have to
-         describe all possible messages and their payload beforehand, and
-         can then attach callbacks to the arrival of a given kind of message.
-       - \ref GRAS_timer : this is how to program repetitive and delayed
-         tasks, not unlike cron(8) and at(1). This cannot be used to timeout
-         a function (like setitimer(2) or signal(2) games could do).
-     - <b>\ref GRAS_run</b>: Running both on top of the simulator and on
-       top of real platforms, and portability support.
-       - \ref GRAS_virtu : You naturally don't want to call the
-          gettimeofday(2) function in simulation mode since it would give
-          you the time on the host running the simulation, not the time in
-          the simulated world (you are belonging to).\n
-         This a system call virtualization layer, which also acts as a
-          portability layer.
-       - \ref GRAS_globals : The use of globals is forbidden since the
-         "processes" are threads in simulation mode. \n
-        This is how to let GRAS handle your globals properly.
-       - \ref GRAS_emul : Support to emulate code excution (ie, reporting
-         execution time into the simulator and having code sections specific
-         to simulation or to real mode).
-
-
-    @{ */
-       /** @defgroup GRAS_comm    Communication facilities */
-       /** @defgroup GRAS_run     Virtualization */
-
-/** @} */
-#####################################################################
-/** @addtogroup GRAS_comm
-
-   Here are the communication facilities. GRAS allows you to exchange
-   <i>messages</i> on <i>sockets</i> (which can be seen as pipes between
-   processes). On reception, messages start <i>callbacks</i> (that's the
-   default communication mode, not the only one). All messages of a given
-   type convey the same kind of data, and you have to describe it
-   beforehand.
-
-   Timers are also seen as a mean of communication (with yourself). It
-   allows you to run a repetitive task ("do this every N second until I tell
-   you to stop"), or to deffer a treatment ("do this in 3 sec").
-
-    @{ */
-       /** @defgroup GRAS_dd      Data description      */
-       /** @defgroup GRAS_sock    Sockets               */
-       /** @defgroup GRAS_msg     Messages              */
-       /** @defgroup GRAS_timer   Timers                */
-
-/** @} */
-#####################################################################
-/** @addtogroup GRAS_run
-
-   Virtualization facilities allow your code to run both on top of the simulator or in real setting.
-
-    @{ */
-
-       /** @defgroup GRAS_globals Globals               */
-       /** @defgroup GRAS_emul    Emulation support */
-       /** @defgroup GRAS_virtu   Syscalls              */
-
-/** @} */
-
-
diff --git a/examples/amok/alnem/alnem.c b/examples/amok/alnem/alnem.c
deleted file mode 100644 (file)
index 9bcb87f..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/* ALNeM itself                                                             */
-
-/* Copyright (c) 2005, 2010. 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. */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <time.h>
-
-#include <gras.h>
-
-#include <tbx_graph.h>          /* alvin's graph toolbox (+ reconstruction algorithm) */
-
-/* **********************************************************************
- * Sensor code
- * **********************************************************************/
-
-/* Global private data */
-typedef struct {
-  gras_sock_t *sock;
-} sensor_data_t;
-
-/* Function prototypes */
-int sensor(int argc, char *argv[]);
-
-int sensor(int argc, char *argv[])
-{
-  xbt_error_t errcode;
-  sensor_data_t *g = gras_userdata_new(sensor_data_t);
-
-  if ((errcode = gras_sock_server_open(4000, 4000, &(g->sock)))) {
-    fprintf(stderr,
-            "Sensor: Error %s encountered while opening the server socket\n",
-            xbt_error_name(errcode));
-    return 1;
-  }
-
-  if (grasbw_register_messages()) {
-    gras_sock_close(g->sock);
-    return 1;
-  }
-
-  while (1) {
-    if ((errcode = gras_msg_handle(3600.0)) && errcode != timeout_error) {
-      fprintf(stderr, "Sensor: Error '%s' while handling message\n",
-              xbt_error_name(errcode));
-    }
-  }
-
-  gras_sleep(5, 0);
-  return gras_sock_close(g->sock);
-}
-
-/* **********************************************************************
- * Maestro code
- * **********************************************************************/
-
-/* Global private data */
-typedef struct {
-  gras_sock_t *sock;
-} maestro_data_t;
-
-/* Function prototypes */
-int maestro(int argc, char *argv[]);
-
-#define MAXHOSTS 100
-
-#define INTERF(graph,table,a,u,b,v) INTERFERENCE(table,\
-                                                TBX_Graph_nodeSearch(graph,a),\
-                                                TBX_Graph_nodeSearch(graph,u),\
-                                                TBX_Graph_nodeSearch(graph,b),\
-                                                TBX_Graph_nodeSearch(graph,v))
-
-int maestro(int argc, char *argv[])
-{
-  int bufSize = 32 * 1024;
-  int expSize = 1024 * 1024;
-  int msgSize = expSize;
-  int satSize = msgSize * 100;
-  double dummy, beginSim;
-  xbt_error_t errcode;
-  maestro_data_t *g = gras_userdata_new(maestro_data_t);
-
-  double bw[MAXHOSTS][MAXHOSTS];
-  double bw_sat[MAXHOSTS][MAXHOSTS];
-
-  int a, b, c, d, begin;
-
-  TBX_Graph_t graph = TBX_Graph_newGraph("Essai", 0, NULL);     /* a dummy graph containing all hosts */
-  TBX_FIFO_t host_fifo = TBX_FIFO_newFIFO();
-  TBX_InterfTable_t interf = NULL;      /* the measured interferences */
-  TBX_Graph_t builded_graph = NULL;     /* the graph builded from the interferences */
-
-  /* basics setups */
-  if (argc > MAXHOSTS) {
-    fprintf(stderr,
-            "You gave more than %d sensors for this experiment. Increase the MAX HOSTS constant in alnem code to be bigger than this number.\n",
-            argc);
-    return 1;
-  }
-
-  if ((errcode = gras_sock_server_open(4000, 5000, &(g->sock)))) {
-    fprintf(stderr,
-            "MAESTRO: Error %s encountered while opening the server socket\n",
-            xbt_error_name(errcode));
-    return 1;
-  }
-
-  if (grasbw_register_messages()) {
-    gras_sock_close(g->sock);
-    return 1;
-  }
-
-  for (a = 1; a < argc; a++) {
-    TBX_FIFO_insert(host_fifo, TBX_Graph_newNode(graph, argv[a], NULL));
-  }
-  TBX_Graph_fixNodeNumbering(graph);
-  interf = TBX_Graph_newInterfTable(host_fifo);
-  TBX_Graph_graphInterfTableInit(graph, interf);
-
-  /* measure the bandwidths */
-  begin = time(NULL);
-  beginSim = gras_time();
-  for (a = 1; a < argc; a++) {
-    for (b = 1; b < argc; b++) {
-      int test = 0;
-
-      if (a == b)
-        continue;
-      fprintf(stderr, "BW XP(%s %s)=", argv[a], argv[b]);
-      while ((errcode =
-              grasbw_request(argv[a], 4000, argv[b], 4000, bufSize,
-                             expSize, msgSize, &dummy, &(bw[a][b])))
-             && (errcode == timeout_error)) {
-        test++;
-        if (test == 10) {
-          fprintf(stderr, "MAESTRO: 10 Timeouts; giving up\n");
-          return 1;
-        }
-      }
-      if (errcode) {
-        fprintf(stderr,
-                "MAESTRO: Error %s encountered while doing the test\n",
-                xbt_error_name(errcode));
-        return 1;
-      }
-      fprintf(stderr, "%f Mb/s in %f sec\n", bw[a][b], dummy);
-    }
-  }
-  fprintf(stderr, "Did all BW tests in %ld sec (%.2f simulated sec)\n",
-          time(NULL) - begin, gras_time() - beginSim);
-
-  /* saturation tests */
-  for (a = 1; a < argc; a++) {
-    for (b = 1; b < argc; b++) {
-      for (c = 1; c < argc; c++) {
-        INTERF(graph, interf, argv[a], argv[c], argv[b], argv[c]) = 1;
-      }
-    }
-  }
-
-  for (a = 1; a < argc; a++) {
-    for (b = 1; b < argc; b++) {
-      if (a == b)
-        continue;
-
-      if ((errcode =
-           grasbw_saturate_start(argv[a], 4000, argv[b], 4000, satSize,
-                                 360000000))) {
-        fprintf(stderr,
-                "MAESTRO: Error %s encountered while starting saturation\n",
-                xbt_error_name(errcode));
-        return -1;
-      }
-      gras_sleep(1, 0);
-
-      begin = time(NULL);
-      beginSim = gras_time();
-      for (c = 1; c < argc; c++) {
-        if (a == c || b == c)
-          continue;
-
-        for (d = 1; d < argc; d++) {
-          if (a == d || b == d || c == d)
-            continue;
-
-          if ((errcode =
-               grasbw_request(argv[c], 4000, argv[d], 4000, bufSize,
-                              expSize, msgSize, &dummy,
-                              &(bw_sat[c][d])))) {
-            fprintf(stderr, "MAESTRO: Error %s encountered in test\n",
-                    xbt_error_name(errcode));
-            return 1;
-          }
-          fprintf(stderr,
-                  "MAESTRO[%.2f sec]: SATURATED BW XP(%s %s // %s %s) => %f (%f vs %f)%s\n",
-                  gras_time(), argv[c], argv[d], argv[a], argv[b],
-                  bw_sat[c][d] / bw[c][d], bw[c][d], bw_sat[c][d],
-                  (bw_sat[c][d] / bw[c][d] <
-                   0.75) ? " THERE IS SOME INTERFERENCE !!!" : "");
-          INTERF(graph, interf, argv[c], argv[d], argv[a], argv[b]) =
-              (bw_sat[c][d] / bw[c][d] < 0.75) ? 1 : 0;
-        }
-      }
-
-      if ((errcode = grasbw_saturate_stop(argv[a], 4000, argv[b], 4000))) {
-        fprintf(stderr,
-                "MAESTRO: Error %s encountered while stopping saturation\n",
-                xbt_error_name(errcode));
-        return -1;
-      }
-      fprintf(stderr,
-              "Did an iteration on saturation pair in %ld sec (%.2f simulated sec)\n",
-              time(NULL) - begin, gras_time() - beginSim);
-    }
-  }
-
-  /* reconstruct the graph */
-  TBX_Graph_interferenceTableDump(interf);
-  TBX_Graph_interferenceTableSave(interf, "interference.dat");
-  begin = time(NULL);
-  fprintf(stderr, "MAESTRO: Reconstruct the graph... ");
-  builded_graph = TBX_Graph_exploreInterference(interf);
-  TBX_Graph_exportToGraphViz(builded_graph, "toto.dot");
-  fprintf(stderr, "done (took %d sec)", (int) time(NULL));
-
-  /* end */
-  TBX_Graph_freeGraph(graph, NULL, NULL, NULL);
-  TBX_Graph_freeGraph(builded_graph, NULL, NULL, NULL);
-  TBX_Graph_freeInterfTable(interf);
-
-  gras_sleep(5, 0);
-  exit(0);                      /* FIXME: There is a bug in MSG preventing me from terminating this server properly */
-  return gras_sock_close(g->sock);
-}
diff --git a/examples/amok/alnem/alnem_builder.c b/examples/amok/alnem/alnem_builder.c
deleted file mode 100644 (file)
index 26341f1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* ALNeM builder. Take an interference matrix as argument,                  */
-/*  and reconstruct the corresponding graph itself                          */
-
-/* Copyright (c) 2005, 2010. 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. */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <tbx_graph.h>          /* alvin's graph toolbox (+ reconstruction algorithm) */
-
-int main(int argc, char *argv[])
-{
-  TBX_Graph_t graph;            /* a dummy graph containing all hosts */
-  TBX_FIFO_t host_fifo;
-  TBX_InterfTable_t interf;     /* the measured interferences */
-  TBX_Graph_t builded_graph;    /* the graph builded from the interferences */
-
-  if (argc != 2) {
-    fprintf(stderr, "alnem_builder: USAGE:\n");
-    fprintf(stderr, "  alnem_builder interference_file\n");
-    exit(1);
-  }
-
-  if (TBX_Graph_interferenceTableRead
-      (argv[1], &graph, &interf, &host_fifo)) {
-    fprintf(stderr, "Can't read the interference data, aborting\n");
-    exit(1);
-  }
-
-  builded_graph = TBX_Graph_exploreInterference(interf);
-  TBX_Graph_exportToGraphViz(builded_graph, "toto.dot");
-  return 0;
-}
diff --git a/examples/amok/alnem/alnem_deployment.txt b/examples/amok/alnem/alnem_deployment.txt
deleted file mode 100644 (file)
index 963935a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-A sensor
-B sensor
-C sensor
-D sensor
-Master maestro A B C D
diff --git a/examples/amok/alnem/deploy_WAN3.txt b/examples/amok/alnem/deploy_WAN3.txt
deleted file mode 100644 (file)
index 6a88ba6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-61 sensor
-62 sensor
-63 sensor
-69 sensor
-70 sensor
-77 sensor
-81 sensor
-83 sensor
-85 sensor
-87 sensor
-88 sensor
-95 sensor
-98 sensor
-107 sensor
-109 sensor
-111 sensor
-112 sensor
-121 sensor
-124 sensor
-125 sensor
-131 sensor
-145 sensor
-150 sensor
-156 sensor
-157 sensor
-162 sensor
-165 sensor
-168 sensor
-169 sensor
-170 sensor
-175 sensor
-177 sensor
-178 sensor
-109 maestro 61 62 63 69 70 77 81 83 85 98 107 109 111 112 121 124 125 131 145 150 156 157 162 165 168 169 170 175 177 178
diff --git a/examples/amok/alnem/interference.dat b/examples/amok/alnem/interference.dat
deleted file mode 100644 (file)
index c2fdc05..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-INTERFERENCE GRAPH DUMPED TO FILE. DO NOT EDIT, EVEN TO ADD OR REMOVE A SPACE !!
-4
-A
-B
-C
-D
-1 1 
-1 1 
-1 0 
-1 1 
-1 0 
-1 1 
-1 1 
-1 1 
-1 0 
-1 1 
-1 0 
-1 1 
-1 1 
-0 1 
-1 1 
-0 1 
-1 1 
-1 1 
-1 1 
-0 1 
-1 1 
-0 1 
-1 1 
-1 1 
diff --git a/examples/amok/bandwidth/CMakeLists.txt b/examples/amok/bandwidth/CMakeLists.txt
deleted file mode 100644 (file)
index 5d657fd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_maestro.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_sensor.c
-  PROPERTIES GENERATED true
-  )
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(bandwidth_simulator ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.c)
-add_executable(bandwidth_maestro   ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_maestro.c ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.c)
-add_executable(bandwidth_sensor    ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_sensor.c ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.c)
-
-add_custom_command(
-  OUTPUT       ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_maestro.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_bandwidth_sensor.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator bandwidth ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(bandwidth_simulator simgrid pthread m)
-  target_link_libraries(bandwidth_maestro gras pthread m)
-  target_link_libraries(bandwidth_sensor gras pthread m)
-else()
-  target_link_libraries(bandwidth_simulator simgrid)
-  target_link_libraries(bandwidth_maestro gras)
-  target_link_libraries(bandwidth_sensor gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bandwidth.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/amok/bandwidth/bandwidth.c b/examples/amok/bandwidth/bandwidth.c
deleted file mode 100644 (file)
index 8df320a..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/* bandwidth - bandwidth test demo of GRAS features                         */
-
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-
-#include "gras.h"
-#include "amok/bandwidth.h"
-#include "amok/peermanagement.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(Bandwidth,
-                             "Messages specific to this example");
-
-/* **********************************************************************
- * Sensor code
- * **********************************************************************/
-
-static xbt_socket_t try_gras_socket_client_from_string(const char *host)
-{
-  volatile xbt_socket_t sock = NULL;
-  xbt_ex_t e;
-  TRY {
-    sock = gras_socket_client_from_string(host);
-  }
-  CATCH(e) {
-    xbt_ex_free(e);
-  }
-  return sock;
-}
-
-/* Function prototypes */
-int sensor(int argc, char *argv[]);
-
-int sensor(int argc, char *argv[])
-{
-  xbt_socket_t mysock;
-  xbt_socket_t master = NULL;
-  int connection_try = 10;
-
-  gras_init(&argc, argv);
-  amok_bw_init();
-  amok_pm_init();
-
-  mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  XBT_INFO("Sensor starting (on port %d)", gras_os_myport());
-  while (connection_try > 0 &&
-         !(master = try_gras_socket_client_from_string(argv[1]))) {
-    connection_try--;
-    gras_os_sleep(0.5);       /* let the master get ready */
-  }
-
-  amok_pm_group_join(master, "bandwidth");
-  amok_pm_mainloop(60);
-
-  gras_socket_close(mysock);
-  gras_socket_close(master);
-  gras_exit();
-  return 0;
-}
-
-/* **********************************************************************
- * Maestro code
- * **********************************************************************/
-
-/* Function prototypes */
-int maestro(int argc, char *argv[]);
-
-int maestro(int argc, char *argv[])
-{
-  double sec, bw;
-  int buf_size = 32 * 1024;
-  int msg_size = 512 * 1024;
-  int msg_amount = 1;
-  double min_duration = 1;
-
-  xbt_socket_t peer;
-  xbt_socket_t mysock;
-  xbt_peer_t h1, h2, h_temp;
-  xbt_dynar_t group;
-
-  gras_init(&argc, argv);
-  amok_bw_init();
-  amok_pm_init();
-
-  XBT_INFO("Maestro starting");
-  if (argc != 2) {
-    XBT_ERROR("Usage: maestro port\n");
-    return 1;
-  }
-  mysock = gras_socket_server(atoi(argv[1]));
-  group = amok_pm_group_new("bandwidth");
-  XBT_INFO("Wait for peers for 5 sec");
-  gras_msg_handleall(5);        /* friends, we're ready. Come and play */
-
-  if (xbt_dynar_length(group) < 2) {
-    amok_pm_group_shutdown("bandwidth");
-    xbt_die("Not enough peers arrived. Expected 2 got %ld",
-            xbt_dynar_length(group));
-  }
-  h1 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 0);
-  h2 = *(xbt_peer_t *) xbt_dynar_get_ptr(group, 1);
-  /* sort peers in right order to keep output right */
-  if (strcmp(h1->name, h2->name) < 0 || h1->port > h2->port) {
-    h_temp = h1;
-    h1 = h2;
-    h2 = h_temp;
-  }
-
-  XBT_INFO("Contact %s:%d", h1->name, h1->port);
-  peer = gras_socket_client(h1->name, h1->port);
-
-  XBT_INFO("Test the BW between me and one of the sensors");
-  amok_bw_test(peer, buf_size, msg_size, msg_amount, min_duration, &sec,
-               &bw);
-  XBT_INFO
-      ("Experience between me and %s:%d (initially %d msgs of %d bytes, maybe modified to fill the pipe at least %.1fs) took %f sec, achieving %f kb/s",
-       h1->name, h1->port, msg_amount, msg_size, min_duration, sec,
-       ((double) bw) / 1024.0);
-
-  XBT_INFO("Test the BW between %s:%d and %s:%d", h1->name, h1->port,
-        h2->name, h2->port);
-  amok_bw_request(h1->name, h1->port, h2->name, h2->port, buf_size,
-                  msg_size, msg_amount, min_duration, &sec, &bw);
-  XBT_INFO
-      ("Experience between %s:%d and %s:%d took took %f sec, achieving %f kb/s",
-       h1->name, h1->port, h2->name, h2->port, sec,
-       ((double) bw) / 1024.0);
-
-  /* Game is over, friends */
-  amok_pm_group_shutdown("bandwidth");
-
-  gras_socket_close(mysock);
-  gras_exit();
-  return 0;
-}
diff --git a/examples/amok/bandwidth/bandwidth.xml b/examples/amok/bandwidth/bandwidth.xml
deleted file mode 100644 (file)
index 777aa91..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="sensor">
-     <argument value="Ginette:4000"/>       <!-- maestro -->
-  </process>
-  <process host="Jupiter" function="sensor">
-     <argument value="Ginette:4000"/>       <!-- maestro -->
-  </process>
-  <process host="Ginette" function="maestro">
-     <argument value="4000"/>   <!-- my port -->
-  </process>
-</platform>
diff --git a/examples/amok/bandwidth/bandwidth_rl.tesh b/examples/amok/bandwidth/bandwidth_rl.tesh
deleted file mode 100755 (executable)
index 34bb825..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-! timeout 20
-& $SG_TEST_ENV bandwidth/bandwidth_sensor$EXEEXT 127.0.0.1:6000 "--log=root.fmt=%P:%t%e%m%n"
-> sensor:main Sensor starting (on port 3000)
-
-! timeout 20
-& $SG_TEST_ENV bandwidth/bandwidth_sensor$EXEEXT 127.0.0.1:6000 "--log=root.fmt=%P:%t%e%m%n"
-> sensor:main Sensor starting (on port 3001)
-
-! timeout 20
-& $SG_TEST_ENV bandwidth/bandwidth_maestro$EXEEXT 6000 "--log=root.fmt=%P:%t%e%m%n"
-> maestro:main Maestro starting
-> maestro:main Wait for peers for 5 sec
-> maestro:main Contact 127.0.0.1:3000
-> maestro:main Test the BW between me and one of the sensors
diff --git a/examples/amok/bandwidth/bandwidth_sg_32.tesh b/examples/amok/bandwidth/bandwidth_sg_32.tesh
deleted file mode 100644 (file)
index 4f06b3f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-$ $SG_TEST_EXENV bandwidth/bandwidth_simulator${EXEEXT} ${srcdir:=.}/../msg/small_platform.xml ${srcdir:=.}/bandwidth/bandwidth.xml
-> [Ginette:maestro:(3) 0.000000] [Bandwidth/INFO] Maestro starting
-> [Tremblay:sensor:(1) 0.000156] [Bandwidth/INFO] Sensor starting (on port 3000)
-> [Ginette:maestro:(3) 0.000156] [Bandwidth/INFO] Wait for peers for 5 sec
-> [Jupiter:sensor:(2) 0.000156] [Bandwidth/INFO] Sensor starting (on port 3000)
-> [Ginette:maestro:(3) 5.000156] [Bandwidth/INFO] Contact Tremblay:3000
-> [Ginette:maestro:(3) 5.000312] [Bandwidth/INFO] Test the BW between me and one of the sensors
-> [Ginette:maestro:(3) 7.091301] [Bandwidth/INFO] Experience between me and Tremblay:3000 (initially 1 msgs of 524288 bytes, maybe modified to fill the pipe at least 1.0s) took 1.090703 sec, achieving 7489.460506 kb/s
-> [Ginette:maestro:(3) 7.091301] [Bandwidth/INFO] Test the BW between Tremblay:3000 and Jupiter:3000
-> [Ginette:maestro:(3) 9.249120] [Bandwidth/INFO] Experience between Tremblay:3000 and Jupiter:3000 took took 1.089859 sec, achieving 6296.831079 kb/s
-> [Ginette:maestro:(3) 9.291095] [gras/INFO] Exiting GRAS
-> [Jupiter:sensor:(2) 9.291095] [gras/INFO] Exiting GRAS
-> [Tremblay:sensor:(1) 10.249120] [gras/INFO] Exiting GRAS
diff --git a/examples/amok/bandwidth/bandwidth_sg_64.tesh b/examples/amok/bandwidth/bandwidth_sg_64.tesh
deleted file mode 100644 (file)
index 15b1bab..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-$ $SG_TEST_EXENV bandwidth/bandwidth_simulator${EXEEXT} ${srcdir:=.}/../msg/small_platform.xml ${srcdir:=.}/bandwidth/bandwidth.xml
-> [Ginette:maestro:(3) 0.000000] [Bandwidth/INFO] Maestro starting
-> [Tremblay:sensor:(1) 0.000156] [Bandwidth/INFO] Sensor starting (on port 3000)
-> [Ginette:maestro:(3) 0.000156] [Bandwidth/INFO] Wait for peers for 5 sec
-> [Jupiter:sensor:(2) 0.000156] [Bandwidth/INFO] Sensor starting (on port 3000)
-> [Ginette:maestro:(3) 5.000156] [Bandwidth/INFO] Contact Tremblay:3000
-> [Ginette:maestro:(3) 5.000312] [Bandwidth/INFO] Test the BW between me and one of the sensors
-> [Ginette:maestro:(3) 7.091307] [Bandwidth/INFO] Experience between me and Tremblay:3000 (initially 1 msgs of 524288 bytes, maybe modified to fill the pipe at least 1.0s) took 1.090703 sec, achieving 7489.460506 kb/s
-> [Ginette:maestro:(3) 7.091307] [Bandwidth/INFO] Test the BW between Tremblay:3000 and Jupiter:3000
-> [Ginette:maestro:(3) 9.249135] [Bandwidth/INFO] Experience between Tremblay:3000 and Jupiter:3000 took took 1.089859 sec, achieving 6296.831079 kb/s
-> [Ginette:maestro:(3) 9.291110] [gras/INFO] Exiting GRAS
-> [Jupiter:sensor:(2) 9.291110] [gras/INFO] Exiting GRAS
-> [Tremblay:sensor:(1) 10.249135] [gras/INFO] Exiting GRAS
diff --git a/examples/amok/saturate/CMakeLists.txt b/examples/amok/saturate/CMakeLists.txt
deleted file mode 100644 (file)
index aec9f8c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_saturate_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_saturate_maestro.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_saturate_sensor.c
-  PROPERTIES GENERATED true
-  )
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(saturate_simulator ${CMAKE_CURRENT_BINARY_DIR}/_saturate_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/saturate.c)
-add_executable(saturate_maestro   ${CMAKE_CURRENT_BINARY_DIR}/_saturate_maestro.c ${CMAKE_CURRENT_SOURCE_DIR}/saturate.c)
-add_executable(saturate_sensor    ${CMAKE_CURRENT_BINARY_DIR}/_saturate_sensor.c ${CMAKE_CURRENT_SOURCE_DIR}/saturate.c)
-
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_saturate_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_saturate_maestro.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_saturate_sensor.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/saturate.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator saturate ${CMAKE_CURRENT_SOURCE_DIR}/saturate.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(saturate_simulator simgrid pthread m)
-  target_link_libraries(saturate_maestro gras pthread m)
-  target_link_libraries(saturate_sensor gras pthread m)
-else()
-  target_link_libraries(saturate_simulator simgrid)
-  target_link_libraries(saturate_maestro gras)
-  target_link_libraries(saturate_sensor gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/saturate_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/saturate_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/saturate_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/saturate.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/env.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/saturate.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/amok/saturate/env.c b/examples/amok/saturate/env.c
deleted file mode 100644 (file)
index fc87222..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* saturate - link saturation demo of AMOK features                         */
-
-/* Copyright (c) 2006, 2010. 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. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <time.h>
-
-#include "gras.h"
-#include "amok/bandwidth.h"
-#include "amok/hostmanagement.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(saturate,
-                             "Messages specific to this example");
-
-static void env_hosttohost_bw(int argc, char *argv[])
-{
-
-  /* where are the sensors */
-  xbt_dynar_t hosts = xbt_dynar_new(sizeof(xbt_host_t), &free_host);
-  int nb_hosts;
-
-  /* results */
-  double sec, bw;
-
-  /* iterators */
-  int i;
-  xbt_host_t h1;
-
-  xbt_socket_t peer;           /* socket to sensor */
-
-  /* wait to ensure that all server sockets are there before starting the experiment */
-  gras_os_sleep(0.5);
-
-  /* Get the sensor location from argc/argv */
-  for (i = 1; i < argc - 1; i += 2) {
-    xbt_host_t host = xbt_new(s_xbt_host_t, 1);
-    host->name = strdup(argv[i]);
-    host->port = atoi(argv[i + 1]);
-    XBT_INFO("New sensor: %s:%d", host->name, host->port);
-    xbt_dynar_push(hosts, &host);
-  }
-  nb_hosts = xbt_dynar_length(hosts);
-
-  XBT_INFO(">>> start Test1: ENV end to end mesurements");
-
-  xbt_dynar_foreach(hosts, i, h1) {
-    peer = gras_socket_client(h1->name, h1->port);
-    amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
-                 &bw);
-    XBT_INFO
-        ("Bandwidth between me and %s:%d (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
-         h1->name, h1->port, exp_size, msg_size, sec,
-         ((double) bw) / 1024.0);
-  }
-
-  xbt_dynar_map(hosts, kill_buddy_dynar);
-  xbt_dynar_free(&hosts);
-
-}
-
-/********************************************************************************************/
-static void env_Pairwisehost_bw(int argc, char *argv[])
-{
-  /* where are the sensors */
-  xbt_dynar_t hosts = xbt_dynar_new(sizeof(xbt_host_t), &free_host);
-  int nb_hosts;
-
-  /* getting the name of maestro for the saturation and the concurrent bandwidth measurements  */
-  char *host_test = argv[0];
-
-  /* results */
-  double sec, bw;
-
-  /* iterators */
-  int i, j;
-  xbt_host_t h1, h2;
-
-  /* socket to sensor */
-  xbt_socket_t peer;
-
-  /* wait to ensure that all server sockets are there before starting the experiment */
-  gras_os_sleep(0.5);
-
-  XBT_INFO(">>>>>< le maestro est: %s ", argv[0]);
-  /* Get the sensor location from argc/argv */
-  for (i = 1; i < argc - 1; i += 2) {
-    xbt_host_t host = xbt_new(s_xbt_host_t, 1);
-    host->name = strdup(argv[i]);
-    host->port = atoi(argv[i + 1]);
-    XBT_INFO("New sensor: %s:%d", host->name, host->port);
-    xbt_dynar_push(hosts, &host);
-  }
-  nb_hosts = xbt_dynar_length(hosts);
-
-  XBT_INFO(">>> start Test2: ENV pairwise host bandwidth mesurements");
-  xbt_dynar_foreach(hosts, i, h1) {
-
-    TRY {
-      amok_bw_saturate_start(h1->name, h1->port, host_test, h1->port,   //"Ginette"
-                             msg_size, 120);    // sturation of the link with msg_size to compute a concurent bandwidth MA //MB
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Cannot ask hosts to saturate the link: %s");
-    }
-    // gras_os_sleep(1.0);
-
-    xbt_dynar_foreach(hosts, j, h2) {
-      if (i == j)
-        continue;
-
-      peer = gras_socket_client(h2->name, h2->port);
-      amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
-                   &bw);
-      XBT_INFO
-          ("Bandwidth between me and %s // measurement between me and %s (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
-           h2->name, h1->name, exp_size, msg_size, sec,
-           ((double) bw) / 1024.0);
-
-    }
-    amok_bw_saturate_stop(h1->name, h1->port, NULL, NULL);
-  }
-  xbt_dynar_map(hosts, kill_buddy_dynar);
-  xbt_dynar_free(&hosts);
-
-}
-
-int maestro(int argc, char *argv[])
-{
-
-  gras_init(&argc, argv);
-  amok_bw_init();
-  amok_hm_init();
-
-  gras_socket_server(3333);     /* only so that messages from the transport layer in gras identify us */
-
-  //env_Pairwisehost_bw(argc,argv);
-  //env_hosttohost_bw(argc,argv);
-
-  gras_exit();
-  return 0;
-
-}
diff --git a/examples/amok/saturate/medium_deployment.xml b/examples/amok/saturate/medium_deployment.xml
deleted file mode 100644 (file)
index 7c1146b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Apple" function="maestro">
-     <argument value="Anne_Marie:4000"/>
-     <argument value="Audy:4000"/>
-     <argument value="Verville:4000"/>
-     <argument value="St_Jean:4000"/>
-     <argument value="PERL:4000"/>
-     <argument value="Charron:4000"/>
-     <argument value="April:4000"/>
-     <argument value="Jocelyne:4000"/>
-     <argument value="Gosselin:4000"/>
-     <argument value="Raymond:4000"/>
-     <argument value="Owen:4000"/>
-     <argument value="St_Antoine:4000"/>
-     <argument value="Gregory:4000"/>
-     <argument value="SunOS:4000"/>
-     <argument value="Laurendeau:4000"/>
-     <argument value="Nelligan:4000"/>
-     <argument value="Lepage:4000"/>
-     <argument value="Jacques_Cartier:4000"/>
-     <argument value="Domey:4000"/>
-     <argument value="Olivier:4000"/>
-     <argument value="Jeannine:4000"/>
-  </process>
-  <process host="Anne_Marie" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Audy" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Verville" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="St_Jean" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="PERL" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Charron" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="April" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Jocelyne" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Gosselin" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Raymond" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Owen" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="St_Antoine" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Gregory" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="SunOS" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Laurendeau" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Nelligan" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Lepage" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Jacques_Cartier" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Domey" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Olivier" function="sensor">
-     <argument value="4000"/>
-  </process>
-  <process host="Jeannine" function="sensor">
-     <argument value="4000"/>
-  </process>
-</platform>
diff --git a/examples/amok/saturate/saturate.c b/examples/amok/saturate/saturate.c
deleted file mode 100644 (file)
index fde8bfc..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/* saturate - link saturation demo of AMOK features                         */
-
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <time.h>
-
-#include "xbt/peer.h"
-#include "gras.h"
-#include "amok/bandwidth.h"
-#include "amok/peermanagement.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(saturate,
-                             "Messages specific to this example");
-
-/* **********************************************************************
- * Sensor code
- * **********************************************************************/
-
-/* Function prototypes */
-int sensor(int argc, char *argv[]);
-
-int sensor(int argc, char *argv[])
-{
-  xbt_socket_t mysock;
-  xbt_socket_t master;
-
-  gras_init(&argc, argv);
-  amok_bw_init();
-  amok_pm_init();
-
-  mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  XBT_INFO("Sensor starting (on port %d)", gras_os_myport());
-  gras_os_sleep(2);             /* let the master get ready */
-  master = gras_socket_client_from_string(argv[1]);
-
-  amok_pm_group_join(master, "saturate");
-  amok_pm_mainloop(600);
-
-  gras_socket_close(mysock);
-  gras_socket_close(master);
-  gras_exit();
-  return 0;
-}
-
-/* **********************************************************************
- * Maestro code
- * **********************************************************************/
-
-/* Function prototypes */
-int maestro(int argc, char *argv[]);
-
-/* XP setups */
-const int buf_size = 0;
-const int msg_size = 50 * 1024;
-const int msg_amount = 2;
-const int sat_size = 1024 * 1024 * 10;
-const double min_duration = 1;
-
-static double XP(const char *bw1, const char *bw2,
-                 const char *sat1, const char *sat2)
-{
-
-  double sec, bw, sec_sat, bw_sat;
-
-  gras_os_sleep(5.0);           /* wait for the sensors to show up */
-  /* Test BW without saturation */
-  amok_bw_request(bw1, 4000, bw2, 4000,
-                  buf_size, msg_size, msg_amount, min_duration, &sec, &bw);
-  XBT_INFO("BW(%s,%s) => %f sec, achieving %f Mb/s",
-        bw1, bw2, sec, (bw / 1024.0 / 1024.0));
-
-
-  /* Test BW with saturation */
-  amok_bw_saturate_start(sat1, 4000, sat2, 4000, sat_size, 60);
-  gras_os_sleep(1.0);           /* let it start */
-
-  amok_bw_request(bw1, 4000, bw2, 4000,
-                  buf_size, msg_size, msg_amount, min_duration, &sec_sat,
-                  &bw_sat);
-  XBT_INFO("BW(%s,%s//%s,%s) => %f sec, achieving %f Mb/s", bw1, bw2, sat1,
-        sat2, sec, bw / 1024.0 / 1024.0);
-
-  amok_bw_saturate_stop(sat1, 4000, NULL, NULL);
-
-  if (bw_sat / bw < 0.7) {
-    XBT_INFO("THERE IS SOME INTERFERENCE !!!");
-  }
-  if (bw / bw_sat < 0.7) {
-    XBT_INFO("THERE IS SOME INTERFERENCE (and I'm an idiot) !!!");
-  }
-  return bw_sat / bw;
-}
-
-static void kill_buddy(char *name, int port)
-{
-  xbt_socket_t sock = gras_socket_client(name, port);
-  gras_msg_send(sock, "kill", NULL);
-  gras_socket_close(sock);
-}
-
-static void kill_buddy_dynar(void *b)
-{
-  xbt_peer_t buddy = *(xbt_peer_t *) b;
-  kill_buddy(buddy->name, buddy->port);
-}
-
-static void free_peer(void *d)
-{
-  xbt_peer_t h = *(xbt_peer_t *) d;
-  free(h->name);
-  free(h);
-}
-
-static void simple_saturation(int argc, char *argv[])
-{
-  xbt_ex_t e;
-
-  /* where are the sensors */
-  xbt_dynar_t peers;
-  xbt_peer_t h1, h2;
-  /* results */
-  double duration, bw;
-
-  /* Init the group */
-  peers = amok_pm_group_new("saturate");
-  /* wait for dudes */
-  gras_msg_handleall(5);
-
-  /* Stop all sensors but two of them */
-  while (xbt_dynar_length(peers) > 2) {
-    xbt_dynar_pop(peers, &h1);
-    amok_pm_kill_hp(h1->name, h1->port);
-    xbt_peer_free(h1);
-  }
-
-  /* get 2 friends */
-  xbt_dynar_get_cpy(peers, 0, &h1);
-  xbt_dynar_get_cpy(peers, 1, &h2);
-
-  /* Start saturation */
-  XBT_INFO("Start saturation between %s:%d and %s:%d",
-        h1->name, h1->port, h2->name, h2->port);
-
-  amok_bw_saturate_start(h1->name, h1->port, h2->name, h2->port, 0,     /* Be a nice boy, compute msg_size yourself */
-                         30 /* 5 sec timeout */ );
-
-  /* Stop it after a while */
-  XBT_INFO("Have a rest");
-  gras_os_sleep(1);
-  TRY {
-    XBT_INFO("Stop the saturation");
-    amok_bw_saturate_stop(h1->name, h1->port, &duration, &bw);
-  }
-  CATCH(e) {
-    XBT_INFO("Ooops, stoping the saturation raised an exception");
-    xbt_ex_free(e);
-  }
-  XBT_INFO("Saturation took %.2fsec, achieving %fb/s", duration, bw);
-
-  /* Game is over, friends */
-  amok_pm_group_shutdown("saturate");
-}
-
-/********************************************************************************************/
-static void full_fledged_saturation(int argc, char *argv[])
-{
-  double time1 = 5.0, bw1 = 5.0;        // 0.5 for test
-  /* timers */
-  double begin_simulated;
-  int begin;
-
-  /* where are the sensors */
-  xbt_dynar_t peers;
-  int nb_peers;
-
-  /* results */
-  double *bw;
-  double *bw_sat;
-
-  /* iterators */
-  unsigned int i, j, k, l;
-  xbt_peer_t h1, h2, h3, h4;
-
-  /* Init the group */
-  peers = amok_pm_group_new("saturate");
-  /* wait 4 dudes */
-  gras_msg_handle(60);
-  gras_msg_handle(60);
-  gras_msg_handle(60);
-  gras_msg_handle(60);
-  nb_peers = xbt_dynar_length(peers);
-
-  XBT_INFO("Let's go for the bw_matrix");
-
-  /* Do the test without saturation */
-  begin = time(NULL);
-  begin_simulated = gras_os_time();
-
-  bw = amok_bw_matrix(peers, buf_size, msg_size, msg_amount, min_duration);
-
-  XBT_INFO("Did all BW tests in %ld sec (%.2f simulated(?) sec)",
-        (long int) (time(NULL) - begin), gras_os_time() - begin_simulated);
-
-  /* Do the test with saturation */
-  bw_sat = xbt_new(double, nb_peers * nb_peers);
-  xbt_dynar_foreach(peers, i, h1) {
-    xbt_dynar_foreach(peers, j, h2) {
-      if (i == j)
-        continue;
-
-      TRY {
-        amok_bw_saturate_start(h1->name, h1->port, h2->name, h2->port, 0,       /* Be nice, compute msg_size yourself */
-                               0 /* no timeout */ );
-      }
-      CATCH_ANONYMOUS {
-        RETHROWF("Cannot ask peers to saturate the link: %s");
-      }
-      gras_os_sleep(5);
-
-      begin = time(NULL);
-      begin_simulated = gras_os_time();
-      xbt_dynar_foreach(peers, k, h3) {
-        if (i == k || j == k)
-          continue;
-
-        xbt_dynar_foreach(peers, l, h4) {
-          double ratio;
-          if (i == l || j == l || k == l)
-            continue;
-
-          XBT_VERB("TEST %s %s // %s %s",
-                h1->name, h2->name, h3->name, h4->name);
-          amok_bw_request(h3->name, h3->port, h4->name, h4->port,
-                          buf_size, msg_size, msg_amount, min_duration,
-                          NULL, &(bw_sat[k * nb_peers + l]));
-
-          ratio = bw_sat[k * nb_peers + l] / bw[k * nb_peers + l];
-          XBT_INFO("SATURATED BW XP(%s %s // %s %s) => %f (%f vs %f)%s",
-                h1->name, h2->name, h3->name, h4->name,
-                ratio,
-                bw[k * nb_peers + l], bw_sat[k * nb_peers + l],
-                ratio < 0.7 ? " THERE IS SOME INTERFERENCE !!!" : "");
-        }
-      }
-      amok_bw_saturate_stop(h1->name, h1->port, &time1, &bw1);
-
-      XBT_INFO
-          ("Did an iteration on saturation pair in %ld sec (%.2f simulated sec)",
-           (long int) (time(NULL) - begin),
-           gras_os_time() - begin_simulated);
-      XBT_INFO
-          ("the duration of the experiment >>>>> %.3f sec (%.3f bandwidth)",
-           time1, bw1);
-    }
-  }
-  free(bw_sat);
-  free(bw);
-  /* Game is over, friends */
-  amok_pm_group_shutdown("saturate");
-}
-
-
-int maestro(int argc, char *argv[])
-{
-
-  gras_init(&argc, argv);
-  amok_bw_init();
-  amok_pm_init();
-
-  gras_socket_server(atoi(argv[1]));
-
-  simple_saturation(argc, argv);
-  //full_fledged_saturation(argc, argv);  
-
-  gras_exit();
-  return 0;
-
-}
diff --git a/examples/amok/saturate/saturate.xml b/examples/amok/saturate/saturate.xml
deleted file mode 100644 (file)
index 965663e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
-  <process host="Tremblay" function="sensor">  <argument value="Bourassa:4000"/> </process>
-  <process host="Jupiter"  function="sensor">  <argument value="Bourassa:4000"/> </process>
-  <process host="Fafard"   function="sensor">  <argument value="Bourassa:4000"/> </process>
-  <process host="Ginette"  function="sensor">  <argument value="Bourassa:4000"/> </process>
-
-  <process host="Bourassa" function="maestro"> <argument value="4000"/>          </process>
-
-</platform>
diff --git a/examples/amok/saturate/saturate_rl.tesh b/examples/amok/saturate/saturate_rl.tesh
deleted file mode 100755 (executable)
index f9d57d2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-! timeout 20
-& $SG_TEST_ENV saturate/saturate_sensor$EXEEXT 127.0.0.1:3333 "--log=root.fmt=%P:%t%e%m%n"
-
-! timeout 20
-& $SG_TEST_ENV saturate/saturate_sensor$EXEEXT 127.0.0.1:3333 "--log=root.fmt=%P:%t%e%m%n"
-
-! timeout 20
-& $SG_TEST_ENV saturate/saturate_sensor$EXEEXT 127.0.0.1:3333 "--log=root.fmt=%P:%t%e%m%n"
-
-! timeout 20
-& $SG_TEST_ENV saturate/saturate_sensor$EXEEXT 127.0.0.1:3333 "--log=root.fmt=%P:%t%e%m%n"
-
-! timeout 20
-& $SG_TEST_ENV saturate/saturate_maestro$EXEEXT 3333 "--log=root.fmt=%P:%t%e%m%n"
diff --git a/examples/amok/saturate/saturate_sg_32.tesh b/examples/amok/saturate/saturate_sg_32.tesh
deleted file mode 100644 (file)
index df0b549..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-$ $SG_TEST_EXENV saturate/saturate_simulator${EXEEXT} ${srcdir:=.}/../msg/small_platform.xml ${srcdir:=.}/saturate/saturate.xml
-> [Tremblay:sensor:(1) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Ginette:sensor:(4) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Fafard:sensor:(3) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Jupiter:sensor:(2) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Jupiter:sensor:(2) 5.035848] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 5.041416] [saturate/INFO] Start saturation between Tremblay:3000 and Ginette:3000
-> [Fafard:sensor:(3) 5.041416] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 5.082248] [saturate/INFO] Have a rest
-> [Bourassa:maestro:(5) 6.082248] [saturate/INFO] Stop the saturation
-> [Tremblay:sensor:(1) 7.200171] [amok_bw_sat/INFO] Saturation(Tremblay:3000->Ginette:3000) started
-> [Tremblay:sensor:(1) 13.188984] [amok_bw_sat/INFO] Saturation from Tremblay:3000 to Ginette:3000 stopped by Bourassa:4000
-> [Bourassa:maestro:(5) 13.209324] [saturate/INFO] Saturation took 5.99sec, achieving 1280588.867148b/s
-> [Tremblay:sensor:(1) 13.229816] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 13.242860] [gras/INFO] Exiting GRAS
-> [Ginette:sensor:(4) 73.188984] [amok_bw_sat/INFO] Saturation comming from Tremblay:3000 stopped on Ginette:3000
-> [Ginette:sensor:(4) 73.188984] [gras/INFO] Exiting GRAS
diff --git a/examples/amok/saturate/saturate_sg_64.tesh b/examples/amok/saturate/saturate_sg_64.tesh
deleted file mode 100644 (file)
index ea4ee30..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-$ $SG_TEST_EXENV saturate/saturate_simulator${EXEEXT} ${srcdir:=.}/../msg/small_platform.xml ${srcdir:=.}/saturate/saturate.xml
-> [Tremblay:sensor:(1) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Ginette:sensor:(4) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Fafard:sensor:(3) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Jupiter:sensor:(2) 0.000156] [saturate/INFO] Sensor starting (on port 3000)
-> [Jupiter:sensor:(2) 5.035848] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 5.041416] [saturate/INFO] Start saturation between Tremblay:3000 and Ginette:3000
-> [Fafard:sensor:(3) 5.041416] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 5.082248] [saturate/INFO] Have a rest
-> [Bourassa:maestro:(5) 6.082248] [saturate/INFO] Stop the saturation
-> [Tremblay:sensor:(1) 7.200177] [amok_bw_sat/INFO] Saturation(Tremblay:3000->Ginette:3000) started
-> [Tremblay:sensor:(1) 13.188990] [amok_bw_sat/INFO] Saturation from Tremblay:3000 to Ginette:3000 stopped by Bourassa:4000
-> [Bourassa:maestro:(5) 13.209330] [saturate/INFO] Saturation took 5.99sec, achieving 1280588.867148b/s
-> [Tremblay:sensor:(1) 13.229822] [gras/INFO] Exiting GRAS
-> [Bourassa:maestro:(5) 13.242866] [gras/INFO] Exiting GRAS
-> [Ginette:sensor:(4) 73.188990] [amok_bw_sat/INFO] Saturation comming from Tremblay:3000 stopped on Ginette:3000
-> [Ginette:sensor:(4) 73.188990] [gras/INFO] Exiting GRAS
diff --git a/examples/gras/all2all/CMakeLists.txt b/examples/gras/all2all/CMakeLists.txt
deleted file mode 100644 (file)
index 18b5c1d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_sender.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_receiver.c
-  PROPERTIES GENERATED true
-  )
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(all2all_simulator ${CMAKE_CURRENT_BINARY_DIR}/_all2all_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/all2all.c)
-add_executable(all2all_sender    ${CMAKE_CURRENT_BINARY_DIR}/_all2all_sender.c ${CMAKE_CURRENT_SOURCE_DIR}/all2all.c)
-add_executable(all2all_receiver  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_receiver.c ${CMAKE_CURRENT_SOURCE_DIR}/all2all.c)
-
-add_custom_command(
-  OUTPUT       ${CMAKE_CURRENT_BINARY_DIR}/_all2all_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_sender.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_all2all_receiver.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/all2all.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator all2all ${CMAKE_CURRENT_SOURCE_DIR}/all2all.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(all2all_simulator simgrid pthread m)
-  target_link_libraries(all2all_sender gras pthread m)
-  target_link_libraries(all2all_receiver gras pthread m)
-else()
-  target_link_libraries(all2all_simulator simgrid)
-  target_link_libraries(all2all_sender gras)
-  target_link_libraries(all2all_receiver gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/all2all.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/all2all.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/make_deployment.pl
-  ${CMAKE_CURRENT_SOURCE_DIR}/run.sh
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/all2all/all2all.c b/examples/gras/all2all/all2all.c
deleted file mode 100644 (file)
index 7872303..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/* ALL2ALL - all2all of GRAS features                                       */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "gras.h"
-#include "xbt/ex.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(all2all, "Messages specific to this example");
-
-/* register data which may be sent (common to client and server) */
-static void register_messages(void)
-{
-}
-
-/* Function prototypes */
-int receiver(int argc, char *argv[]);
-int sender(int argc, char *argv[]);
-
-
-/* **********************************************************************
- * Receiver code
- * **********************************************************************/
-int receiver(int argc, char *argv[])
-{
-
-  int myport;                   /* port on which I receive stuff */
-  int todo;                     /* amount of messages I should get */
-  char *data;                   /* message content */
-
-  xbt_socket_t mysock;         /* socket on which other people contact me */
-  xbt_socket_t expeditor;      /* to notice who wrote me */
-
-  /* Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-
-  /* Get my settings from the command line */
-  myport = atoi(argv[1]);
-  todo = atoi(argv[2]);
-
-  /* Register the known messages */
-  gras_msgtype_declare("data", xbt_datadesc_by_name("string"));
-
-  /* Create my master socket */
-  mysock = gras_socket_server(myport);
-
-  /* Get the data */
-  XBT_INFO("Listening on port %d (expecting %d messages)",
-        xbt_socket_my_port(mysock), todo);
-  while (todo > 0) {
-    gras_msg_wait(60 /* wait up to one minute */ ,
-                  "data", &expeditor, &data);
-    todo--;
-    free(data);
-
-    XBT_INFO("Got Data from %s:%d (still %d to go)",
-          xbt_socket_peer_name(expeditor),
-          xbt_socket_peer_port(expeditor), todo);
-
-  }
-
-  /* Free the allocated resources, and shut GRAS down */
-  gras_socket_close(mysock);
-
-  gras_exit();
-  return 0;
-}                               /* end_of_receiver */
-
-/* **********************************************************************
- * Sender code
- * **********************************************************************/
-
-int sender(int argc, char *argv[])
-{
-
-  unsigned int iter;            /* iterator */
-  char *data;                   /* data exchanged */
-  int datasize;                 /* size of message */
-  xbt_peer_t h;                 /* iterator */
-  int connected = 0;
-
-  volatile xbt_socket_t peer = NULL;    /* socket to node */
-
-
-  /* xbt_dynar for peers */
-  xbt_dynar_t peers =
-      xbt_dynar_new(sizeof(xbt_peer_t), &xbt_peer_free_voidp);
-
-  /* Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-
-  /* Get the node location from argc/argv */
-  for (iter = 1; iter < argc - 1; iter++) {
-    xbt_peer_t peer = xbt_peer_from_string(argv[iter]);
-    xbt_dynar_push(peers, &peer);
-  }
-
-  datasize = atoi(argv[argc - 1]);
-
-  data = (char *) malloc(datasize + 1); // allocation of datasize octets
-  memset(data, 32, datasize);
-  data[datasize] = '\0';
-
-  XBT_INFO("Launch current node");
-
-  /* Register the known messages */
-  gras_msgtype_declare("data", xbt_datadesc_by_name("string"));
-
-
-  /* write to the receivers */
-  xbt_dynar_foreach(peers, iter, h) {
-    connected = 0;
-    while (!connected) {
-      xbt_ex_t e;
-      TRY {
-        peer = gras_socket_client(h->name, h->port);
-        connected = 1;
-      }
-      CATCH(e) {
-        if (e.category != system_error  /*in RL */
-            && e.category != mismatch_error /*in SG */ )
-          RETHROW;
-        xbt_ex_free(e);
-        gras_os_sleep(0.01);
-      }
-    }
-    gras_msg_send(peer, "data", &data);
-    if (gras_if_SG()) {
-      XBT_INFO("  Sent Data from %s to %s", gras_os_myname(), h->name);
-    } else {
-      XBT_INFO("  Sent Data");
-    }
-
-    gras_socket_close(peer);
-  }
-
-  /* Free the allocated resources, and shut GRAS down */
-  free(data);
-  xbt_dynar_free(&peers);
-
-  gras_exit();
-  return 0;
-}                               /* end_of_sender */
diff --git a/examples/gras/all2all/all2all.xml b/examples/gras/all2all/all2all.xml
deleted file mode 100644 (file)
index 0eed86f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <!-- For each host, we have a sender and a receiver (because we use a
-       1-port model and still don't want any deadlocks neither synchronization
-       delays).
-       Sender arguments = receiver peer + Message size as last argument (in byte)
-       Receiver arguments: amount of incoming messages expected -->
-
-
-  <process host="Tremblay" function="sender">
-     <argument value="Jupiter:4000"/>
-     <argument value="Fafard:4000"/> 
-     <argument value="Ginette:4000"/> 
-     <argument value="Bourassa:4000"/> 
-     <argument value="512"/>
-  </process>
-  <process host="Tremblay" function="receiver">
-     <argument value="4000"/>
-     <argument value="4"/>  
-  </process>
-
-
-  <process host="Jupiter" function="sender">
-     <argument value="Tremblay:4000"/> 
-     <argument value="Fafard:4000"/> 
-     <argument value="Ginette:4000"/> 
-     <argument value="Bourassa:4000"/> 
-     <argument value="512"/>
-  </process>
-  <process host="Jupiter" function="receiver">
-     <argument value="4000"/>
-     <argument value="4"/>
-  </process>
-
-
-  <process host="Fafard" function="sender">
-     <argument value="Tremblay:4000"/> 
-     <argument value="Jupiter:4000"/>  
-     <argument value="Ginette:4000"/> 
-     <argument value="Bourassa:4000"/> 
-     <argument value="512"/>
-  </process>
-  <process host="Fafard" function="receiver">
-     <argument value="4000"/>
-     <argument value="4"/> 
-  </process>
-  <process host="Ginette" function="sender">
-     <argument value="Tremblay:4000"/> 
-     <argument value="Jupiter:4000"/>  
-     <argument value="Fafard:4000"/> 
-     <argument value="Bourassa:4000"/> 
-     <argument value="512"/>
-  </process>
-  <process host="Ginette" function="receiver">
-     <argument value="4000"/>
-     <argument value="4"/>
-  </process>
-
-
-  <process host="Bourassa" function="sender">
-     <argument value="Tremblay:4000"/> 
-     <argument value="Jupiter:4000"/>  
-     <argument value="Fafard:4000"/> 
-     <argument value="Ginette:4000"/> 
-     <argument value="512"/>
-  </process>
-  <process host="Bourassa" function="receiver">
-     <argument value="4000"/>
-     <argument value="4"/>
-  </process>
-</platform>
diff --git a/examples/gras/all2all/make_deployment.pl b/examples/gras/all2all/make_deployment.pl
deleted file mode 100755 (executable)
index 3220e86..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-
-sub usage {
-    print STDERR <<EOH
-Usage: all2all_make_deployment.pl platform_file.xml nb_host size_msg (bcast source?)
-  
-This script generates a deployment file for the all2all program. It takes 
-a SimGrid platform file as first argument and the number of wanted peers as 
-second argument. If the amount of peers exceeds the amount of available 
-hosts in the deployment file, several peers will be placed on the same host.
-
-The third argument is a size of the message to send ( octets )  
-
-If a fourth argument is passed, this is the source of the broadcast
-(given as a number between 0 and nb_host-1).
-EOH
-      ;
-    die "\n";
-}
-
-my $input    = shift @ARGV || usage();
-my $size_msg = shift @ARGV || usage();
-my $source   = shift @ARGV || "";
-my $nb_hosts = shift @ARGV || 0;
-
-my @host;
-
-open IN,$input || die "Cannot open $input: $!\n";
-
-while (<IN>) {
-  next unless /<host id="([^"]*)"/; # "
-  
-  push @host, $1;
-}
-
-# map { print "$_\n" } @host;
-
-die "No host found in $input. Is it really a SimGrid platform file?\nCheck that you didn't pass a deployment file, for example.\n"
-  unless (scalar @host);
-
-if (! $nb_hosts) {
-    $nb_hosts = scalar @host;
-}
-
-
-# 
-# Build the receiver string
-
-my @receivers;    # strings containing sender argument describing all receivers.
-
-my $it_host=0;    # iterator
-my $it_port=4000; # iterator, in case we have so much processes to add that we must change it
-
-for (my $i=0; $i<$nb_hosts; $i++) {
-  push (@receivers, "$host[$it_host]:$it_port");
-  $it_host ++;
-  if ($it_host == scalar @host) {
-    $it_host=0;
-    $it_port++;
-  }
-}
-
-#
-# and now, really generate the file. Receiver first.
-
-print "<?xml version='1.0'?>\n";
-print "<!DOCTYPE platform SYSTEM \"simgrid.dtd\">\n";
-print "<platform version=\"2\">\n\n";
-
-for my $r (@receivers) {
-    my ($h, $p) = split(':', $r);
-    print "  <process host=\"".$h."\" function=\"receiver\">\n";
-    print "    <argument value=\"$p\"/><argument value=\"".(length($source)?1:$nb_hosts)."\"/>\n";
-    print "  </process>\n\n";
-}
-
-#
-# Here come the sender(s)
-
-if(length($source)) {
-    print "  <process host=\"".$host[$source % (scalar @host)].
-       "\" function=\"sender\">\n";
-    for my $r (@receivers) {
-       print "    <argument value=\"$r\"/>\n"; 
-    }
-    print "    <argument value=\"$size_msg\"/>\n"; 
-    print "  </process>\n";
-} else {
-    my $i = 0; 
-    for my $r (@receivers) {
-       my ($h, $p) = split(":", $r); 
-        print "  <process host=\"".$h."\" function=\"sender\">\n";
-        for (my $j = 0; $j < $nb_hosts; $j++) {
-           my $r2 = $receivers[($i + $j) % ($nb_hosts)]; 
-           print "    <argument value=\"$r2\"/>\n"; 
-        }
-        print "    <argument value=\"$size_msg\"/>\n"; 
-        print "  </process>\n";
-        $i++;
-    }
-}
-
-print "</platform>\n";
-
-# print "source='$source' nb_hosts=$nb_hosts\n";
diff --git a/examples/gras/all2all/run.sh b/examples/gras/all2all/run.sh
deleted file mode 100755 (executable)
index 36d5147..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/bash
-
-#
-# USAGE: run.sh  plaform  nb_host (broadcast source?)
-#
-# This script takes a platform file and a number of hosts as argument.
-#  if a third argument is passed, this is the source of the broadcast 
-#  (given as a number between 0 and nb_host-1).
-#
-# It generates the right deployment platform and run the experiment, 
-#  only showing the last line of the run, showing the resulting time.
-
-plat=$1
-nb_host=$2
-bcast=$3
-set -e
-
-if [ -z $plat -o -z $nb_host ] ; then
-  # invalid argument. Display the comment at the script begining & exit
-  grep '^#\(\([^!]\)\|$\)' $0 | sed 's/# *//' >&2
-  exit 1
-fi
-if ! [ -e $plat ] ; then
-  echo "Platform file not found" >&2
-  exit 1
-fi
-
-echo "Generating the deployment"
-./make_deployment.pl $plat $nb_host $bcast > tmp_deployment_$nb_host
-echo "Running the experiment"
-./all2all_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat"
-rm tmp_deployment_$nb_host
diff --git a/examples/gras/all2all/test_rl.tesh b/examples/gras/all2all/test_rl.tesh
deleted file mode 100755 (executable)
index c7ffc41..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-# The receivers, waiting for 5 messages
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./all2all_receiver$EXEEXT 4400 5 --log=root.fmt:%m%n
-> Listening on port 4400 (expecting 5 messages)
-> Got Data from 127.0.0.1:5005 (still 4 to go)
-> Got Data from 127.0.0.1:5005 (still 3 to go)
-> Got Data from 127.0.0.1:5005 (still 2 to go)
-> Got Data from 127.0.0.1:5005 (still 1 to go)
-> Got Data from 127.0.0.1:5005 (still 0 to go)
-> Exiting GRAS
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./all2all_receiver$EXEEXT 4401 5 --log=root.fmt:%m%n
-> Listening on port 4401 (expecting 5 messages)
-> Got Data from 127.0.0.1:5005 (still 4 to go)
-> Got Data from 127.0.0.1:5005 (still 3 to go)
-> Got Data from 127.0.0.1:5005 (still 2 to go)
-> Got Data from 127.0.0.1:5005 (still 1 to go)
-> Got Data from 127.0.0.1:5005 (still 0 to go)
-> Exiting GRAS
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./all2all_receiver$EXEEXT 4402 5 --log=root.fmt:%m%n
-> Listening on port 4402 (expecting 5 messages)
-> Got Data from 127.0.0.1:5005 (still 4 to go)
-> Got Data from 127.0.0.1:5005 (still 3 to go)
-> Got Data from 127.0.0.1:5005 (still 2 to go)
-> Got Data from 127.0.0.1:5005 (still 1 to go)
-> Got Data from 127.0.0.1:5005 (still 0 to go)
-> Exiting GRAS
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./all2all_receiver$EXEEXT 4403 5 --log=root.fmt:%m%n
-> Listening on port 4403 (expecting 5 messages)
-> Got Data from 127.0.0.1:5005 (still 4 to go)
-> Got Data from 127.0.0.1:5005 (still 3 to go)
-> Got Data from 127.0.0.1:5005 (still 2 to go)
-> Got Data from 127.0.0.1:5005 (still 1 to go)
-> Got Data from 127.0.0.1:5005 (still 0 to go)
-> Exiting GRAS
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./all2all_receiver$EXEEXT 4404 5 --log=root.fmt:%m%n
-> Listening on port 4404 (expecting 5 messages)
-> Got Data from 127.0.0.1:5005 (still 4 to go)
-> Got Data from 127.0.0.1:5005 (still 3 to go)
-> Got Data from 127.0.0.1:5005 (still 2 to go)
-> Got Data from 127.0.0.1:5005 (still 1 to go)
-> Got Data from 127.0.0.1:5005 (still 0 to go)
-> Exiting GRAS
-
-# give the receivers a chance to acquire the expected port numbers
-$ $SG_TEST_EXENV sleep 1
-
-# Five time a sender
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_sender$EXEEXT 127.0.0.1:4400 127.0.0.1:4401 127.0.0.1:4402 127.0.0.1:4403 127.0.0.1:4404 512 --log=root.fmt:%m%n
-> Launch current node
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_sender$EXEEXT 127.0.0.1:4400 127.0.0.1:4401 127.0.0.1:4402 127.0.0.1:4403 127.0.0.1:4404 512 --log=root.fmt:%m%n
-> Launch current node
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_sender$EXEEXT 127.0.0.1:4400 127.0.0.1:4401 127.0.0.1:4402 127.0.0.1:4403 127.0.0.1:4404 512 --log=root.fmt:%m%n
-> Launch current node
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_sender$EXEEXT 127.0.0.1:4400 127.0.0.1:4401 127.0.0.1:4402 127.0.0.1:4403 127.0.0.1:4404 512 --log=root.fmt:%m%n
-> Launch current node
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_sender$EXEEXT 127.0.0.1:4400 127.0.0.1:4401 127.0.0.1:4402 127.0.0.1:4403 127.0.0.1:4404 512 --log=root.fmt:%m%n
-> Launch current node
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
->   Sent Data
-> Exiting GRAS
diff --git a/examples/gras/all2all/test_sg_32.tesh b/examples/gras/all2all/test_sg_32.tesh
deleted file mode 100644 (file)
index 6d522da..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#! ./tesh
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%.2i:%P@%h)%e%m%n"
-> [  0.000000] (00:@) Configuration change: Set 'network/crosstraffic' to '0'
-> [  0.000000] (01:sender@Tremblay) Launch current node
-> [  0.000000] (03:sender@Jupiter) Launch current node
-> [  0.000000] (05:sender@Fafard) Launch current node
-> [  0.000000] (07:sender@Ginette) Launch current node
-> [  0.000000] (09:sender@Bourassa) Launch current node
-> [  0.000195] (02:receiver@Tremblay) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (04:receiver@Jupiter) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (06:receiver@Fafard) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (08:receiver@Ginette) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (10:receiver@Bourassa) Listening on port 4000 (expecting 4 messages)
-> [  0.019284] (01:sender@Tremblay)   Sent Data from Tremblay to Jupiter
-> [  0.019284] (04:receiver@Jupiter) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.025735] (02:receiver@Tremblay) Got Data from Bourassa:5000 (still 3 to go)
-> [  0.025735] (09:sender@Bourassa)   Sent Data from Bourassa to Tremblay
-> [  0.042352] (02:receiver@Tremblay) Got Data from Ginette:5000 (still 2 to go)
-> [  0.042352] (07:sender@Ginette)   Sent Data from Ginette to Tremblay
-> [  0.045289] (01:sender@Tremblay)   Sent Data from Tremblay to Fafard
-> [  0.045289] (06:receiver@Fafard) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.062102] (01:sender@Tremblay)   Sent Data from Tremblay to Ginette
-> [  0.062102] (08:receiver@Ginette) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.068162] (02:receiver@Tremblay) Got Data from Fafard:5000 (still 1 to go)
-> [  0.068162] (05:sender@Fafard)   Sent Data from Fafard to Tremblay
-> [  0.070559] (04:receiver@Jupiter) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.070559] (09:sender@Bourassa)   Sent Data from Bourassa to Jupiter
-> [  0.077590] (06:receiver@Fafard) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.077590] (09:sender@Bourassa)   Sent Data from Bourassa to Fafard
-> [  0.087251] (02:receiver@Tremblay) Got Data from Jupiter:5000 (still 0 to go)
-> [  0.087251] (02:receiver@Tremblay) Exiting GRAS
-> [  0.087251] (03:sender@Jupiter)   Sent Data from Jupiter to Tremblay
-> [  0.087837] (01:sender@Tremblay)   Sent Data from Tremblay to Bourassa
-> [  0.087837] (01:sender@Tremblay) Exiting GRAS
-> [  0.087837] (10:receiver@Bourassa) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.093971] (08:receiver@Ginette) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.093971] (09:sender@Bourassa)   Sent Data from Bourassa to Ginette
-> [  0.093971] (09:sender@Bourassa) Exiting GRAS
-> [  0.106266] (04:receiver@Jupiter) Got Data from Ginette:5000 (still 1 to go)
-> [  0.106266] (07:sender@Ginette)   Sent Data from Ginette to Jupiter
-> [  0.132345] (03:sender@Jupiter)   Sent Data from Jupiter to Fafard
-> [  0.132345] (06:receiver@Fafard) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.148801] (06:receiver@Fafard) Got Data from Ginette:5000 (still 0 to go)
-> [  0.148801] (06:receiver@Fafard) Exiting GRAS
-> [  0.148801] (07:sender@Ginette)   Sent Data from Ginette to Fafard
-> [  0.151165] (04:receiver@Jupiter) Got Data from Fafard:5000 (still 0 to go)
-> [  0.151165] (04:receiver@Jupiter) Exiting GRAS
-> [  0.151165] (05:sender@Fafard)   Sent Data from Fafard to Jupiter
-> [  0.165182] (07:sender@Ginette)   Sent Data from Ginette to Bourassa
-> [  0.165182] (07:sender@Ginette) Exiting GRAS
-> [  0.165182] (10:receiver@Bourassa) Got Data from Ginette:5000 (still 2 to go)
-> [  0.168247] (03:sender@Jupiter)   Sent Data from Jupiter to Ginette
-> [  0.168247] (08:receiver@Ginette) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.184703] (05:sender@Fafard)   Sent Data from Fafard to Ginette
-> [  0.184703] (08:receiver@Ginette) Got Data from Fafard:5000 (still 0 to go)
-> [  0.184703] (08:receiver@Ginette) Exiting GRAS
-> [  0.213071] (03:sender@Jupiter)   Sent Data from Jupiter to Bourassa
-> [  0.213071] (03:sender@Jupiter) Exiting GRAS
-> [  0.213071] (10:receiver@Bourassa) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.219907] (05:sender@Fafard)   Sent Data from Fafard to Bourassa
-> [  0.219907] (05:sender@Fafard) Exiting GRAS
-> [  0.219907] (10:receiver@Bourassa) Got Data from Fafard:5000 (still 0 to go)
-> [  0.219907] (10:receiver@Bourassa) Exiting GRAS
diff --git a/examples/gras/all2all/test_sg_64.tesh b/examples/gras/all2all/test_sg_64.tesh
deleted file mode 100644 (file)
index 5150816..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#! ./tesh
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%.2i:%P@%h)%e%m%n"
-> [  0.000000] (00:@) Configuration change: Set 'network/crosstraffic' to '0'
-> [  0.000000] (01:sender@Tremblay) Launch current node
-> [  0.000000] (03:sender@Jupiter) Launch current node
-> [  0.000000] (05:sender@Fafard) Launch current node
-> [  0.000000] (07:sender@Ginette) Launch current node
-> [  0.000000] (09:sender@Bourassa) Launch current node
-> [  0.000195] (04:receiver@Jupiter) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (02:receiver@Tremblay) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (10:receiver@Bourassa) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (08:receiver@Ginette) Listening on port 4000 (expecting 4 messages)
-> [  0.000195] (06:receiver@Fafard) Listening on port 4000 (expecting 4 messages)
-> [  0.019284] (01:sender@Tremblay)   Sent Data from Tremblay to Jupiter
-> [  0.019284] (04:receiver@Jupiter) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.025735] (09:sender@Bourassa)   Sent Data from Bourassa to Tremblay
-> [  0.025735] (02:receiver@Tremblay) Got Data from Bourassa:5000 (still 3 to go)
-> [  0.042352] (07:sender@Ginette)   Sent Data from Ginette to Tremblay
-> [  0.042352] (02:receiver@Tremblay) Got Data from Ginette:5000 (still 2 to go)
-> [  0.045289] (01:sender@Tremblay)   Sent Data from Tremblay to Fafard
-> [  0.045289] (06:receiver@Fafard) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.062102] (01:sender@Tremblay)   Sent Data from Tremblay to Ginette
-> [  0.062102] (08:receiver@Ginette) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.068162] (05:sender@Fafard)   Sent Data from Fafard to Tremblay
-> [  0.068162] (02:receiver@Tremblay) Got Data from Fafard:5000 (still 1 to go)
-> [  0.070559] (09:sender@Bourassa)   Sent Data from Bourassa to Jupiter
-> [  0.070559] (04:receiver@Jupiter) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.077590] (09:sender@Bourassa)   Sent Data from Bourassa to Fafard
-> [  0.077590] (06:receiver@Fafard) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.087251] (03:sender@Jupiter)   Sent Data from Jupiter to Tremblay
-> [  0.087251] (02:receiver@Tremblay) Got Data from Jupiter:5000 (still 0 to go)
-> [  0.087251] (02:receiver@Tremblay) Exiting GRAS
-> [  0.087837] (01:sender@Tremblay)   Sent Data from Tremblay to Bourassa
-> [  0.087837] (01:sender@Tremblay) Exiting GRAS
-> [  0.087837] (10:receiver@Bourassa) Got Data from Tremblay:5000 (still 3 to go)
-> [  0.093971] (09:sender@Bourassa)   Sent Data from Bourassa to Ginette
-> [  0.093971] (09:sender@Bourassa) Exiting GRAS
-> [  0.093971] (08:receiver@Ginette) Got Data from Bourassa:5000 (still 2 to go)
-> [  0.106266] (07:sender@Ginette)   Sent Data from Ginette to Jupiter
-> [  0.106266] (04:receiver@Jupiter) Got Data from Ginette:5000 (still 1 to go)
-> [  0.132345] (03:sender@Jupiter)   Sent Data from Jupiter to Fafard
-> [  0.132345] (06:receiver@Fafard) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.148801] (07:sender@Ginette)   Sent Data from Ginette to Fafard
-> [  0.148801] (06:receiver@Fafard) Got Data from Ginette:5000 (still 0 to go)
-> [  0.148801] (06:receiver@Fafard) Exiting GRAS
-> [  0.151165] (05:sender@Fafard)   Sent Data from Fafard to Jupiter
-> [  0.151165] (04:receiver@Jupiter) Got Data from Fafard:5000 (still 0 to go)
-> [  0.151165] (04:receiver@Jupiter) Exiting GRAS
-> [  0.165182] (07:sender@Ginette)   Sent Data from Ginette to Bourassa
-> [  0.165182] (07:sender@Ginette) Exiting GRAS
-> [  0.165182] (10:receiver@Bourassa) Got Data from Ginette:5000 (still 2 to go)
-> [  0.168247] (03:sender@Jupiter)   Sent Data from Jupiter to Ginette
-> [  0.168247] (08:receiver@Ginette) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.184703] (05:sender@Fafard)   Sent Data from Fafard to Ginette
-> [  0.184703] (08:receiver@Ginette) Got Data from Fafard:5000 (still 0 to go)
-> [  0.184703] (08:receiver@Ginette) Exiting GRAS
-> [  0.213071] (03:sender@Jupiter)   Sent Data from Jupiter to Bourassa
-> [  0.213071] (03:sender@Jupiter) Exiting GRAS
-> [  0.213071] (10:receiver@Bourassa) Got Data from Jupiter:5000 (still 1 to go)
-> [  0.219907] (05:sender@Fafard)   Sent Data from Fafard to Bourassa
-> [  0.219907] (05:sender@Fafard) Exiting GRAS
-> [  0.219907] (10:receiver@Bourassa) Got Data from Fafard:5000 (still 0 to go)
-> [  0.219907] (10:receiver@Bourassa) Exiting GRAS
diff --git a/examples/gras/chrono/CMakeLists.txt b/examples/gras/chrono/CMakeLists.txt
deleted file mode 100644 (file)
index 218d24f..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_chrono_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_chrono_multiplier.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(chrono_simulator  ${CMAKE_CURRENT_BINARY_DIR}/_chrono_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/chrono.c)
-add_executable(chrono_multiplier ${CMAKE_CURRENT_BINARY_DIR}/_chrono_multiplier.c ${CMAKE_CURRENT_SOURCE_DIR}/chrono.c)
-
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_chrono_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_chrono_multiplier.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/chrono.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator chrono ${CMAKE_CURRENT_SOURCE_DIR}/chrono.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(chrono_simulator simgrid pthread m )
-  target_link_libraries(chrono_multiplier gras pthread m )
-else()
-  target_link_libraries(chrono_simulator simgrid)
-  target_link_libraries(chrono_multiplier gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/chrono.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/chrono.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/chrono2.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/chrono/chrono.c b/examples/gras/chrono/chrono.c
deleted file mode 100644 (file)
index 8dba577..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* chrono - demo of GRAS benchmarking features                              */
-
-/* Copyright (c) 2005, 2007, 2009, 2010. 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. */
-
-#include "gras.h"
-#include "xbt/log.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono, "Messages specific to this example");
-
-
-/* Function prototypes */
-int multiplier(int argc, char *argv[]);
-
-int multiplier(int argc, char *argv[])
-{
-  int i, j, k, l;
-  double *A, *B, *C;
-  int n = 100;
-  double start = 0.0;
-  double now = 0.0;
-
-  gras_init(&argc, argv);
-
-  A = malloc(n * n * sizeof(double));
-  B = malloc(n * n * sizeof(double));
-  C = malloc(n * n * sizeof(double));
-
-  start = now = gras_os_time();
-
-  XBT_INFO("Begin matrix multiplication loop (time: %g)", start);
-
-  for (l = 0; l < 4; l++) {
-    now = gras_os_time();
-    GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
-    for (i = 0; i < n; i++)
-      for (j = 0; j < n; j++) {
-        A[i * n + j] = 2 / n;
-        B[i * n + j] = 1 / n;
-        C[i * n + j] = 0.0;
-      }
-
-    for (i = 0; i < n; i++)
-      for (j = 0; j < n; j++)
-        for (k = 0; k < n; k++)
-          C[i * n + j] += A[i * n + k] * B[k * n + j];
-
-    GRAS_BENCH_ONCE_RUN_ONCE_END();
-    now = gras_os_time() - now;
-    XBT_INFO("Iteration %d : %g ", l, now);
-  }
-
-  now = gras_os_time() - start;
-  XBT_INFO("End matrix multiplication loop (time: %g; Duration: %g)",
-        gras_os_time(), now);
-
-  start = now = gras_os_time();
-  XBT_INFO("Begin malloc loop (time: %g)", start);
-  for (l = 0; l < 4; l++) {
-    now = gras_os_time();
-    GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
-    free(A);
-    A = malloc(n * n * sizeof(double));
-    GRAS_BENCH_ONCE_RUN_ONCE_END();
-    now = gras_os_time() - now;
-    XBT_INFO("Iteration %d : %g ", l, now);
-  }
-
-  start = now = gras_os_time();
-  XBT_INFO("Begin integer incrementation loop (time: %g)", start);
-  for (l = 0; l < 4; l++) {
-    GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
-    j++;
-    GRAS_BENCH_ONCE_RUN_ONCE_END();
-  }
-  free(A);
-  free(B);
-  free(C);
-
-  gras_exit();
-  return 0;
-}
diff --git a/examples/gras/chrono/chrono.xml b/examples/gras/chrono/chrono.xml
deleted file mode 100644 (file)
index 780ea23..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="multiplier"/>
-</platform>
diff --git a/examples/gras/chrono/chrono2.c b/examples/gras/chrono/chrono2.c
deleted file mode 100644 (file)
index a64936a..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* chrono - demo of GRAS benchmarking features                              */
-
-/* Copyright (c) 2005, 2010. 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. */
-
-#include "gras.h"
-#include "xbt/log.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono, "Messages specific to this example");
-
-#include <cblas.h>
-void cblas_dgemm(const enum CBLAS_ORDER Order,
-                 const enum CBLAS_TRANSPOSE TransA,
-                 const enum CBLAS_TRANSPOSE TransB, const int M,
-                 const int N, const int K, const double alpha,
-                 const double *A, const int lda, const double *B,
-                 const int ldb, const double beta, double *C,
-                 const int ldc);
-
-
-/* Function prototypes */
-static int mat_mult(int n)
-{
-  int i, j, k, l;
-  double *A, *B, *C;
-  double start = 0.0;
-  double now = 0.0;
-
-  A = malloc(n * n * sizeof(double));
-  B = malloc(n * n * sizeof(double));
-  C = malloc(n * n * sizeof(double));
-
-  start = now = gras_os_time();
-
-  XBT_INFO("Matrix size: %d", n);
-/*   XBT_INFO("Before computation: %lg", start); */
-
-  for (l = 0; l < 40; l++) {
-    now = gras_os_time();
-    GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
-    for (i = 0; i < n; i++)
-      for (j = 0; j < n; j++) {
-        A[i * n + j] = 2 / n;
-        B[i * n + j] = 1 / n;
-        C[i * n + j] = 0.0;
-      }
-
-    cblas_dgemm(CblasRowMajor,
-                CblasNoTrans, CblasNoTrans, n, n, n,
-                1.0, A, n, B, n, 0.0, C, n);
-    GRAS_BENCH_ONCE_RUN_ONCE_END();
-    now = gras_os_time() - now;
-/*     XBT_INFO("Iteration %d : %lg ", l, now); */
-  }
-
-  now = gras_os_time() - start;
-  XBT_INFO("Duration: %lg ", now);
-
-  free(A);
-  free(B);
-  free(C);
-}
-
-int multiplier(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-
-  mat_mult(10);
-  mat_mult(20);
-  mat_mult(30);
-  mat_mult(40);
-  mat_mult(50);
-  mat_mult(75);
-  mat_mult(100);
-  mat_mult(300);
-  mat_mult(500);
-  mat_mult(750);
-  mat_mult(1000);
-
-  return 0;
-}
diff --git a/examples/gras/chrono/test_rl.tesh b/examples/gras/chrono/test_rl.tesh
deleted file mode 100755 (executable)
index 16aa7b0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-! output display
-$ $SG_TEST_EXENV ./chrono_multiplier$EXEEXT --log=root.fmt:%m%n $@
diff --git a/examples/gras/chrono/test_sg_32.tesh b/examples/gras/chrono/test_sg_32.tesh
deleted file mode 100755 (executable)
index 3e0f53b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-! output display
-$ $SG_TEST_EXENV ./chrono_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/chrono.xml
diff --git a/examples/gras/chrono/test_sg_64.tesh b/examples/gras/chrono/test_sg_64.tesh
deleted file mode 100755 (executable)
index 3e0f53b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-! output display
-$ $SG_TEST_EXENV ./chrono_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/chrono.xml
diff --git a/examples/gras/console/CMakeLists.txt b/examples/gras/console/CMakeLists.txt
deleted file mode 100644 (file)
index e27e444..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-if(HAVE_LUA)
-  cmake_minimum_required(VERSION 2.6)
-
-  set_source_files_properties(
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-    PROPERTIES GENERATED true)
-
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  add_executable(ping_simulator_console
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-
-  add_executable(ping_client_console
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-
-  add_executable(ping_server_console
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-
-  add_custom_command(
-    OUTPUT
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-    ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-    ${CMAKE_CURRENT_BINARY_DIR}/simgrid.${LIB_EXE}
-    COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${CMAKE_CURRENT_BINARY_DIR}/simgrid.${LIB_EXE}
-    COMMAND lua ${CMAKE_CURRENT_SOURCE_DIR}/ping_generator.lua
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} #needed to find simgrid.so. By default CMAKE_CURRENT_BINARY_DIR
-    )
-
-  ### Add definitions for compile
-  target_link_libraries(ping_simulator_console simgrid pthread m)
-  target_link_libraries(ping_client_console gras simgrid pthread m)
-  target_link_libraries(ping_server_console gras simgrid pthread m)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/gras_platform_script.lua
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_generator.lua
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/console/gras_platform_script.lua b/examples/gras/console/gras_platform_script.lua
deleted file mode 100644 (file)
index 1884b05..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-require "simgrid"
-
-  simgrid.AS.new{id="AS0",mode="Full"};
-
-  simgrid.host.new{id="Tremblay",power=98095000};
-  simgrid.host.new{id="Jupiter",power=76296000};
-  simgrid.host.new{id="Fafard",power=76296000};
-  simgrid.host.new{id="Ginette",power=48492000};
-  simgrid.host.new{id="Bourassa",power=48492000};
-
-    -- create Links
-  for i=10,0,-1 do
-    simgrid.link.new{id=i,bandwidth=252750+ i*768,latency=0.000270544+i*0.087};   
-  end
-  -- simgrid.route.new(src_id,des_id,links_nb,links_list)
-   simgrid.route.new("Tremblay","Jupiter",{"1"});
-   simgrid.route.new("Tremblay","Fafard",{"0","1","2","3","4","8"});
-   simgrid.route.new("Tremblay","Ginette",{"3","4","5"});
-   simgrid.route.new("Tremblay","Bourassa",{"0","1","3","2","4","6","7"});
-
-   simgrid.route.new("Jupiter","Tremblay",{"1"});
-   simgrid.route.new("Jupiter","Fafard",{"0","1","2","3","4","8","9"});
-   simgrid.route.new("Jupiter","Ginette",{"3","4","5","9"});
-   simgrid.route.new("Jupiter","Bourassa",{"0","1","2","3","4","6","7","9"});
-   simgrid.route.new("Fafard","Tremblay",{"0","1","2","3","4","8"});
-   simgrid.route.new("Fafard","Jupiter",{"0","1","2","3","4","8","9"});
-   simgrid.route.new("Fafard","Ginette",{"0","1","2","5","8"});
-   simgrid.route.new("Fafard","Bourassa",{"6","7","8"});
-  
-   simgrid.route.new("Ginette","Tremblay",{"3","4","5"});
-   simgrid.route.new("Ginette","Jupiter",{"3","4","5","9"});
-   simgrid.route.new("Ginette","Fafard",{"0","1","2","5","8"});
-   simgrid.route.new("Ginette","Bourassa",{"0","1","2","5","6","7"});
-
-   simgrid.route.new("Bourassa","Tremblay",{"0","1","3","2","4","6","7"});
-   simgrid.route.new("Bourassa","Jupiter",{"0","1","2","3","4","6","7","9"});
-   simgrid.route.new("Bourassa","Fafard",{"6","7","8"});
-   simgrid.route.new("Bourassa","Ginette",{"0","1","2","5","6","7"});
-  
-   --Save Platform
-   simgrid.gras_register_platform();
-
-  --Set Application
-   simgrid.host.set_function{host="Tremblay",fct="server",args="4000"};
-   simgrid.host.set_function{host="Fafard",fct="client",args="Tremblay,4000"};
-
-  --Save Application 
-   simgrid.gras_register_application(); 
-
-
diff --git a/examples/gras/console/ping.h b/examples/gras/console/ping.h
deleted file mode 100644 (file)
index ffd57cf..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#ifndef PING_COMMON_H
-#define PING_COMMON_H
-
-#include "gras.h"
-
-/* register messages which may be sent (common to client and server) */
-void ping_register_messages(void);
-
-/* Function prototypes */
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-#endif
diff --git a/examples/gras/console/ping_client.c b/examples/gras/console/ping_client.c
deleted file mode 100644 (file)
index d0af525..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "ping.h"
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(Ping);
-
-static xbt_socket_t try_gras_socket_client(const char *host, int port)
-{
-  volatile xbt_socket_t sock = NULL;
-  xbt_ex_t e;
-  TRY {
-    sock = gras_socket_client(host, port);
-  }
-  CATCH(e) {
-    if (e.category != system_error)
-      /* dunno what happened, let the exception go through */
-      RETHROWF("Unable to connect to the server: %s");
-    xbt_ex_free(e);
-  }
-  return sock;
-}
-
-int client(int argc, char *argv[])
-{
-  xbt_socket_t toserver = NULL;        /* peer */
-
-  xbt_socket_t from;
-  int ping, pong;
-
-  const char *host = "127.0.0.1";
-  int port = 4000;
-
-  /* 1. Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the server's address. The command line override defaults when specified */
-  if (argc == 3) {
-    host = argv[1];
-    port = atoi(argv[2]);
-  }
-
-  XBT_INFO("Launch client (server on %s:%d)", host, port);
-
-  /* 3. Create a socket to speak to the server */
-  while (!(toserver = try_gras_socket_client(host, port)))
-    gras_os_sleep(0.05);
-
-  XBT_INFO("Connected to %s:%d.", host, port);
-
-  /* 4. Register the messages.
-     See, it doesn't have to be done completely at the beginning, only before use */
-  ping_register_messages();
-
-  /* 5. Keep the user informed of what's going on */
-  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 6. Prepare and send the ping message to the server */
-  ping = 1234;
-  TRY {
-    gras_msg_send(toserver, "ping", &ping);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(toserver);
-    RETHROWF("Failed to send PING to server: %s");
-  }
-  XBT_INFO(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
-        ping,
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 7. Wait for the answer from the server, and deal with issues */
-  TRY {
-    gras_msg_wait(6000, "pong", &from, &pong);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(toserver);
-    RETHROWF("Why can't I get my PONG message like everyone else: %s");
-  }
-
-  /* 8. Keep the user informed of what's going on, again */
-  XBT_INFO(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
-        pong, xbt_socket_peer_name(from), xbt_socket_peer_port(from));
-
-  /* 9. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(toserver);
-  XBT_INFO("Done.");
-  gras_exit();
-  return 0;
-}                               /* end_of_client */
diff --git a/examples/gras/console/ping_common.c b/examples/gras/console/ping_common.c
deleted file mode 100644 (file)
index f0b6e49..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#include "ping.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(Ping, "Messages specific to this example");
-
-/* register messages which may be sent (common to client and server) */
-void ping_register_messages(void)
-{
-  gras_msgtype_declare("ping", xbt_datadesc_by_name("int"));
-  gras_msgtype_declare("pong", xbt_datadesc_by_name("int"));
-  XBT_INFO("Messages registered");
-}
diff --git a/examples/gras/console/ping_generator.lua b/examples/gras/console/ping_generator.lua
deleted file mode 100644 (file)
index edca5a9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-require "simgrid"
-
-  --Set Application
-   simgrid.gras_set_process_function("Fafard","client",{"Tremblay","4000"});
-   simgrid.gras_set_process_function("Tremblay","server",{"4000"});
-  --Save Application 
-   simgrid.gras_generate("ping"); 
-
-
diff --git a/examples/gras/console/ping_server.c b/examples/gras/console/ping_server.c
deleted file mode 100644 (file)
index f1324b1..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "ping.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(Ping);
-
-/* Global private data */
-typedef struct {
-  xbt_socket_t sock;
-  int endcondition;
-} server_data_t;
-
-
-static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  /* 1. Get the payload into the msg variable, and retrieve my caller */
-  int msg = *(int *) payload;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  /* 2. Retrieve the server's state (globals) */
-
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-  globals->endcondition = 0;
-
-  /* 3. Log which client connected */
-  XBT_INFO(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
-        msg,
-        xbt_socket_peer_name(expeditor),
-        xbt_socket_peer_port(expeditor));
-
-  /* 4. Change the value of the msg variable */
-  msg = 4321;
-  /* 5. Send it back as payload of a pong message to the expeditor */
-  TRY {
-    gras_msg_send(expeditor, "pong", &msg);
-
-    /* 6. Deal with errors: add some details to the exception */
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(globals->sock);
-    RETHROWF("Unable answer with PONG: %s");
-  }
-
-  XBT_INFO(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
-
-  /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
-  globals->endcondition = 1;
-
-  /* 8. Tell GRAS that we consummed this message */
-  return 0;
-}                               /* end_of_server_cb_ping_handler */
-
-int server(int argc, char *argv[])
-{
-  server_data_t *globals;
-
-  int port = 4000;
-
-  /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-  globals = gras_userdata_new(server_data_t);
-
-  /* 2. Get the port I should listen on from the command line, if specified */
-  if (argc == 2) {
-    port = atoi(argv[1]);
-  }
-
-  XBT_INFO("Launch server (port=%d)", port);
-
-  /* 3. Create my master socket */
-  globals->sock = gras_socket_server(port);
-
-  /* 4. Register the known messages. This function is called twice here, but it's because
-     this file also acts as regression test, no need to do so yourself of course. */
-  ping_register_messages();
-  ping_register_messages();     /* just to make sure it works ;) */
-
-  /* 5. Register my callback */
-  gras_cb_register("ping", &server_cb_ping_handler);
-
-  XBT_INFO(">>>>>>>> Listening on port %d <<<<<<<<",
-        xbt_socket_my_port(globals->sock));
-  globals->endcondition = 0;
-
-  /* 6. Wait up to 20 minutes for an incoming message to handle */
-  gras_msg_handle(20.0);
-
-  /* 7. Housekeeping */
-  if (!globals->endcondition)
-    XBT_WARN
-        ("An error occured, the endcondition was not set by the callback");
-
-  /* 8. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(globals->sock);
-  free(globals);
-  XBT_INFO("Done.");
-  gras_exit();
-
-  return 0;
-}                               /* end_of_server */
diff --git a/examples/gras/mmrpc/CMakeLists.txt b/examples/gras/mmrpc/CMakeLists.txt
deleted file mode 100644 (file)
index 4ccd671..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(mmrpc_simulator
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_simulator.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_server.c)
-add_executable(mmrpc_client
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_client.c)
-add_executable(mmrpc_server
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_server.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_mmrpc_server.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator mmrpc ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(mmrpc_simulator simgrid pthread m )
-  target_link_libraries(mmrpc_client gras pthread m )
-  target_link_libraries(mmrpc_server gras pthread m )
-else()
-  target_link_libraries(mmrpc_simulator simgrid)
-  target_link_libraries(mmrpc_client gras)
-  target_link_libraries(mmrpc_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mmrpc.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/mmrpc/mmrpc.c b/examples/gras/mmrpc/mmrpc.c
deleted file mode 100644 (file)
index fa9de31..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
-
-/* Copyright (c) 2005, 2006, 2007, 2010. 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. */
-
-#define XBT_DEFINE_TYPE_EXTERN
-#include "xbt/matrix.h"
-#include "mmrpc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(MatMult, "Messages specific to this example");
-
-/* register messages which may be sent and their payload
-   (common to client and server) */
-void mmrpc_register_messages(void)
-{
-  xbt_datadesc_type_t matrix_type, request_type;
-
-  matrix_type = xbt_datadesc_matrix(xbt_datadesc_by_name("double"),
-                                     NULL);
-  request_type =
-      xbt_datadesc_array_fixed("s_matrix_t(double)[2]", matrix_type, 2);
-
-  gras_msgtype_declare("answer", matrix_type);
-  gras_msgtype_declare("request", request_type);
-}
-
-typedef xbt_matrix_t request_t[2];
-static int server_cb_request_handler(gras_msg_cb_ctx_t ctx,
-                                     void *payload_data)
-{
-
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  /* 1. Get the payload into the data variable */
-  xbt_matrix_t *request = (xbt_matrix_t *) payload_data;
-  xbt_matrix_t result;
-
-  /* 2. Do the computation */
-  result = xbt_matrix_double_new_mult(request[0], request[1]);
-
-  /* 3. Send it back as payload of a pong message to the expeditor */
-  gras_msg_send(expeditor, "answer", &result);
-
-  /* 4. Cleanups */
-  xbt_matrix_free(request[0]);
-  xbt_matrix_free(request[1]);
-  xbt_matrix_free(result);
-  gras_socket_close(expeditor);
-
-  return 0;
-}                               /* end_of_server_cb_request_handler */
-
-int server(int argc, char *argv[])
-{
-  xbt_socket_t sock = NULL;
-  int port = 4000;
-
-  /* 1. Init the GRAS infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the port I should listen on from the command line, if specified */
-  if (argc == 2) {
-    port = atoi(argv[1]);
-  }
-
-  /* 3. Create my master socket */
-  XBT_INFO("Launch server (port=%d)", port);
-  TRY {
-    sock = gras_socket_server(port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a server socket: %s");
-  }
-
-  /* 4. Register the known messages and payloads. */
-  mmrpc_register_messages();
-
-  /* 5. Register my callback */
-  gras_cb_register("request", &server_cb_request_handler);
-
-  /* 6. Wait up to 10 minutes for an incoming message to handle */
-  gras_msg_handle(600.0);
-
-  /* 7. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(sock);
-  gras_exit();
-
-  XBT_INFO("Done.");
-  return 0;
-}                               /* end_of_server */
-
-
-int client(int argc, char *argv[])
-{
-  xbt_socket_t toserver = NULL;        /* peer */
-
-  xbt_socket_t from;
-  xbt_matrix_t request[2], answer;
-
-  int i, j;
-
-  const char *host = "127.0.0.1";
-  int port = 4000;
-
-  /* 1. Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the server's address. The command line override defaults when specified */
-  if (argc == 3) {
-    host = argv[1];
-    port = atoi(argv[2]);
-  }
-
-  XBT_INFO("Launch client (server on %s:%d)", host, port);
-
-  /* 3. Wait for the server startup */
-  gras_os_sleep(1);
-
-  /* 4. Create a socket to speak to the server */
-  TRY {
-    toserver = gras_socket_client(host, port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to connect to the server: %s");
-  }
-  XBT_INFO("Connected to %s:%d.", host, port);
-
-
-  /* 5. Register the messages (before use) */
-  mmrpc_register_messages();
-
-  /* 6. Keep the user informed of what's going on */
-  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 7. Prepare and send the request to the server */
-
-  request[0] = xbt_matrix_double_new_id(MATSIZE, MATSIZE);
-  request[1] = xbt_matrix_double_new_rand(MATSIZE, MATSIZE);
-
-  /*
-     xbt_matrix_dump(request[0],"C:sent0",0,xbt_matrix_dump_display_double);
-     xbt_matrix_dump(request[1],"C:sent1",0,xbt_matrix_dump_display_double);
-   */
-
-  gras_msg_send(toserver, "request", &request);
-
-  xbt_matrix_free(request[0]);
-
-  XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 8. Wait for the answer from the server, and deal with issues */
-  gras_msg_wait(6000, "answer", &from, &answer);
-
-  /*
-     xbt_matrix_dump(answer,"C:answer",0,xbt_matrix_dump_display_double);
-   */
-  for (i = 0; i < MATSIZE; i++)
-    for (j = 0; i < MATSIZE; i++)
-      xbt_assert(xbt_matrix_get_as(answer, i, j, double) ==
-                  xbt_matrix_get_as(request[1], i, j, double),
-                  "Answer does not match expectations. Found %f at cell %d,%d instead of %f",
-                  xbt_matrix_get_as(answer, i, j, double), i, j,
-                  xbt_matrix_get_as(request[1], i, j, double));
-
-  /* 9. Keep the user informed of what's going on, again */
-  XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
-        xbt_socket_peer_name(from), xbt_socket_peer_port(from));
-
-  /* 10. Free the allocated resources, and shut GRAS down */
-  xbt_matrix_free(request[1]);
-  xbt_matrix_free(answer);
-  gras_socket_close(toserver);
-  gras_exit();
-  XBT_INFO("Done.");
-  return 0;
-}                               /* end_of_client */
diff --git a/examples/gras/mmrpc/mmrpc.h b/examples/gras/mmrpc/mmrpc.h
deleted file mode 100644 (file)
index 3f08bc8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#ifndef MMRPC_H
-#define MMRPC_H
-
-#include "gras.h"
-
-#define MATSIZE 128
-
-/* register messages which may be sent and their payload
-   (common to client and server) */
-void mmrpc_register_messages(void);
-
-/* Function prototypes */
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-#endif                          /* MMRPC_H */
diff --git a/examples/gras/mmrpc/mmrpc.xml b/examples/gras/mmrpc/mmrpc.xml
deleted file mode 100644 (file)
index e74a853..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="server">
-     <argument value="4000"/>       <!-- port number -->
-  </process>
-  <process host="Fafard" function="client">
-     <argument value="Tremblay"/>   <!-- server host -->
-     <argument value="4000"/>       <!-- port number -->
-  </process>
-</platform>
diff --git a/examples/gras/mmrpc/mmrpc_client.c b/examples/gras/mmrpc/mmrpc_client.c
deleted file mode 100644 (file)
index 6472af0..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#define XBT_DEFINE_TYPE_EXTERN
-#include "xbt/matrix.h"
-#include "mmrpc.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(MatMult);
-
-static xbt_socket_t try_gras_socket_client(const char *host, int port)
-{
-  volatile xbt_socket_t sock = NULL;
-  xbt_ex_t e;
-  TRY {
-    sock = gras_socket_client(host, port);
-  }
-  CATCH(e) {
-    if (e.category != system_error)
-      RETHROWF("Unable to connect to the server: %s");
-    xbt_ex_free(e);
-  }
-  return sock;
-}
-
-int client(int argc, char *argv[])
-{
-  xbt_socket_t toserver = NULL;        /* peer */
-
-  xbt_socket_t from;
-  xbt_matrix_t request[2], answer;
-
-  int i;
-  _XBT_GNUC_UNUSED int j;
-
-  const char *host = "127.0.0.1";
-  int port = 4000;
-
-  /* 1. Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the server's address. The command line override defaults when specified */
-  if (argc == 3) {
-    host = argv[1];
-    port = atoi(argv[2]);
-  }
-
-  XBT_INFO("Launch client (server on %s:%d)", host, port);
-
-  /* 3. Register the messages (before use) */
-  mmrpc_register_messages();
-
-  /* 4. Create a socket to speak to the server */
-  while (!(toserver = try_gras_socket_client(host, port)))
-    gras_os_sleep(0.05);
-  XBT_INFO("Connected to %s:%d.", host, port);
-
-  /* 5. Keep the user informed of what's going on */
-  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 6. Prepare and send the request to the server */
-
-  request[0] = xbt_matrix_double_new_id(MATSIZE, MATSIZE);
-  request[1] = xbt_matrix_double_new_rand(MATSIZE, MATSIZE);
-
-  /*
-     xbt_matrix_dump(request[0],"C:sent0",0,xbt_matrix_dump_display_double);
-     xbt_matrix_dump(request[1],"C:sent1",0,xbt_matrix_dump_display_double);
-   */
-
-  gras_msg_send(toserver, "request", &request);
-
-  xbt_matrix_free(request[0]);
-
-  XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 7. Wait for the answer from the server, and deal with issues */
-  gras_msg_wait(6000, "answer", &from, &answer);
-
-  /*
-     xbt_matrix_dump(answer,"C:answer",0,xbt_matrix_dump_display_double);
-   */
-  for (i = 0; i < MATSIZE; i++)
-    for (j = 0; i < MATSIZE; i++)
-      xbt_assert(xbt_matrix_get_as(answer, i, j, double) ==
-                  xbt_matrix_get_as(request[1], i, j, double),
-                  "Answer does not match expectations. Found %f at cell %d,%d instead of %f",
-                  xbt_matrix_get_as(answer, i, j, double), i, j,
-                  xbt_matrix_get_as(request[1], i, j, double));
-
-  /* 8. Keep the user informed of what's going on, again */
-  XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
-        xbt_socket_peer_name(from), xbt_socket_peer_port(from));
-
-  /* 9. Free the allocated resources, and shut GRAS down */
-  xbt_matrix_free(request[1]);
-  xbt_matrix_free(answer);
-  gras_socket_close(toserver);
-  gras_exit();
-  return 0;
-}                               /* end_of_client */
diff --git a/examples/gras/mmrpc/mmrpc_common.c b/examples/gras/mmrpc/mmrpc_common.c
deleted file mode 100644 (file)
index 62da601..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "mmrpc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(MatMult, "Messages specific to this example");
-
-/* register messages which may be sent and their payload
-   (common to client and server) */
-void mmrpc_register_messages(void)
-{
-  xbt_datadesc_type_t matrix_type, request_type;
-
-  matrix_type =
-      xbt_datadesc_matrix(xbt_datadesc_by_name("double"), NULL);
-  request_type =
-      xbt_datadesc_array_fixed("s_matrix_t(double)[2]", matrix_type, 2);
-
-  gras_msgtype_declare("answer", matrix_type);
-  gras_msgtype_declare("request", request_type);
-}
diff --git a/examples/gras/mmrpc/mmrpc_server.c b/examples/gras/mmrpc/mmrpc_server.c
deleted file mode 100644 (file)
index d1585f5..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* GridRPC - Fake Grid RPC thingy doing matrix multiplications (as expected)*/
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#define XBT_DEFINE_TYPE_EXTERN
-#include "xbt/matrix.h"
-#include "mmrpc.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(MatMult);
-
-
-typedef xbt_matrix_t request_t[2];
-static int server_cb_request_handler(gras_msg_cb_ctx_t ctx,
-                                     void *payload_data)
-{
-
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  /* 1. Get the payload into the data variable */
-  xbt_matrix_t *request = (xbt_matrix_t *) payload_data;
-  xbt_matrix_t result;
-
-  /* 2. Do the computation */
-  result = xbt_matrix_double_new_mult(request[0], request[1]);
-
-  /* 3. Send it back as payload of a pong message to the expeditor */
-  gras_msg_send(expeditor, "answer", &result);
-
-  /* 4. Cleanups */
-  xbt_matrix_free(request[0]);
-  xbt_matrix_free(request[1]);
-  xbt_matrix_free(result);
-
-  return 0;
-}                               /* end_of_server_cb_request_handler */
-
-static xbt_socket_t try_gras_socket_server(int port)
-{
-  volatile xbt_socket_t sock = NULL;
-  TRY {
-    sock = gras_socket_server(port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a server socket: %s");
-  }
-  return sock;
-}
-
-int server(int argc, char *argv[])
-{
-  xbt_socket_t sock = NULL;
-  int port = 4002;
-
-  /* 1. Init the GRAS infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the port I should listen on from the command line, if specified */
-  if (argc == 2) {
-    port = atoi(argv[1]);
-  }
-
-  /* 3. Register the known messages and payloads. */
-  mmrpc_register_messages();
-
-  /* 4. Register my callback */
-  gras_cb_register("request", &server_cb_request_handler);
-
-  /* 5. Create my master socket */
-  XBT_INFO("Launch server (port=%d)", port);
-  sock = try_gras_socket_server(port);
-
-  /* 6. Wait up to 10 minutes for an incoming message to handle */
-  gras_msg_handle(600.0);
-
-  /* 7. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(sock);
-  gras_exit();
-
-  return 0;
-}                               /* end_of_server */
diff --git a/examples/gras/mmrpc/test_rl.tesh b/examples/gras/mmrpc/test_rl.tesh
deleted file mode 100755 (executable)
index 35534b2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./mmrpc_server$EXEEXT 4502 --log=root.fmt:%m%n
-> Launch server (port=4502)
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./mmrpc_client$EXEEXT 127.0.0.1 4502 --log=root.fmt:%m%n
-> Launch client (server on 127.0.0.1:4502)
-> Connected to 127.0.0.1:4502.
-> >>>>>>>> Connected to server which is on 127.0.0.1:4502 <<<<<<<<
-> >>>>>>>> Request sent to 127.0.0.1:4502 <<<<<<<<
-> >>>>>>>> Got answer from 127.0.0.1:4502 (values are right) <<<<<<<<
-> Exiting GRAS
diff --git a/examples/gras/mmrpc/test_sg_32.tesh b/examples/gras/mmrpc/test_sg_32.tesh
deleted file mode 100644 (file)
index a3018a6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
-> [  0.000195] (2:client@Fafard) Connected to Tremblay:4000.
-> [  0.000195] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [  0.077710] (2:client@Fafard) >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
-> [  0.129321] (1:server@Tremblay) Exiting GRAS
-> [  0.129321] (2:client@Fafard) >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
-> [  0.129321] (2:client@Fafard) Exiting GRAS
diff --git a/examples/gras/mmrpc/test_sg_64.tesh b/examples/gras/mmrpc/test_sg_64.tesh
deleted file mode 100644 (file)
index 27fadc7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
-> [  0.000195] (2:client@Fafard) Connected to Tremblay:4000.
-> [  0.000195] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [  0.077713] (2:client@Fafard) >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
-> [  0.129326] (1:server@Tremblay) Exiting GRAS
-> [  0.129326] (2:client@Fafard) >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
-> [  0.129326] (2:client@Fafard) Exiting GRAS
\ No newline at end of file
diff --git a/examples/gras/mutual_exclusion/simple_token/CMakeLists.txt b/examples/gras/mutual_exclusion/simple_token/CMakeLists.txt
deleted file mode 100644 (file)
index 2166f97..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_node.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(simple_token_simulator ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.c)
-add_executable(simple_token_node      ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_node.c ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_simple_token_node.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator simple_token ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(simple_token_simulator simgrid pthread m )
-  target_link_libraries(simple_token_node gras pthread m )
-else()
-  target_link_libraries(simple_token_simulator simgrid)
-  target_link_libraries(simple_token_node gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/simple_token.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/run.sh
-  ${CMAKE_CURRENT_SOURCE_DIR}/make_deployment.pl
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/mutual_exclusion/simple_token/make_deployment.pl b/examples/gras/mutual_exclusion/simple_token/make_deployment.pl
deleted file mode 100755 (executable)
index 2fba770..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-
-my $input    = shift @ARGV || die "Usage: $ARGV[0] platform_file.xml nb_host\n";
-my $nb_hosts = shift @ARGV || 0;
-
-my @host;
-
-open IN,$input || die "Cannot open $input: $!\n";
-
-while (<IN>) {
-  next unless /<host id="([^"]*)"/; # "
-  
-  push @host, $1;
-}
-
-die "No host found in $input. Is it really a SimGrid platform file?\nCheck that you didn't pass a deployment file, for example.\n"
-  unless (scalar @host);
-
-if (! $nb_hosts) {
-    $nb_hosts = scalar @host;
-}
-
-# map { print "$_\n" } @host;
-
-print "<?xml version='1.0'?>\n";
-print "<!DOCTYPE platform SYSTEM \"simgrid.dtd\">\n";
-print "<platform version=\"2\">\n\n";
-
-
-my $it_port=4000;
-my $it_host=0;
-
-for (my $i=0; $i<$nb_hosts -1; $i++) {
-
-  print "  <process host=\"".$host[$it_host]."\" function=\"node\">\n";
-  print "    <argument value=\"". $it_port ."\"/>     <!-- port on which I am listening -->\n";
-  $it_host ++;
-  if ($it_host == scalar @host) {
-    $it_host=0;
-    $it_port++;
-  }
-  print "    <argument value=\"". $host[ $it_host ]."\"/>   <!-- peer (successor) host -->\n";
-  print "    <argument value=\"".($it_port)."\"/>     <!-- port on which peer is listening -->\n";
-  print "  </process>\n\n";
-                
-}
-
-print "  <process host=\"".$host[$it_host]."\" function=\"node\">\n";
-print "    <argument value=\"". $it_port ."\"/>     <!-- port on which I am listening -->\n";
-print "    <argument value=\"". $host[ 0 ]."\"/>   <!-- peer (successor) host -->\n";
-print "    <argument value=\"4000\"/>     <!-- port on which peer is listening -->\n";
-print "    <argument value=\"--create-token\"/>   <!-- I'm first client, ie I have to create the token -->\n";
-print "  </process>\n\n";
-
-print "</platform>\n";
diff --git a/examples/gras/mutual_exclusion/simple_token/run.sh b/examples/gras/mutual_exclusion/simple_token/run.sh
deleted file mode 100755 (executable)
index f8aa0bd..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/bash
-
-#
-# USAGE: run.sh  plaform  nb_host 
-#
-# This script takes a platform file and a number of hosts as argument.
-#
-# It generates the right deployment platform and run the experiment, 
-#  only showing the last line of the run, showing the resulting time.
-
-plat=$1
-nb_host=$2
-
-set -e
-
-if [ -z $plat -o -z $nb_host ] ; then
-  # invalid argument. Display the comment at the script begining & exit
-  grep '^#\(\([^!]\)\|$\)' $0 | sed 's/# *//' >&2
-  exit 1
-fi
-if ! [ -e $plat ] ; then
-  echo "Platform file not found" >&2
-  exit 1
-fi
-
-echo "Generating the deployment"
-./make_deployment.pl $plat $nb_host > tmp_deployment_$nb_host
-echo "Running the experiment"
-./tokenS_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat"
-rm tmp_deployment_$nb_host
diff --git a/examples/gras/mutual_exclusion/simple_token/simple_token.c b/examples/gras/mutual_exclusion/simple_token/simple_token.c
deleted file mode 100644 (file)
index ef80458..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/* stoken - simple/static token ring                                        */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "gras.h"
-
-#define NBLOOPS 3
-/*#define NBLOOPS 30000*/
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(SimpleToken,
-                             "Messages specific to this example");
-
-/* Function prototypes */
-int node(int argc, char *argv[]);
-
-
-/* **********************************************************************
- * Node code
- * **********************************************************************/
-
-/* Global private data */
-typedef struct {
-  xbt_socket_t sock;           /* server socket on which I hear */
-  int remaining_loop;           /* number of loops to do until done */
-  int create;                   /* whether I have to create the token */
-  xbt_socket_t tosuccessor;    /* how to connect to the successor on ring */
-  double start_time;            /* to measure the elapsed time. Only used by the 
-                                   node that creates the token */
-} node_data_t;
-
-
-/* Callback function */
-static int node_cb_stoken_handler(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  /* 1. Get the payload into the msg variable, and retrieve my caller */
-  int msg = *(int *) payload;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-
-  /* 2. Retrieve the node's state (globals) */
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-
-  /* 3. Log which predecessor connected */
-  int supersteps = 1;           /* only log every superstep loop */
-  if (NBLOOPS >= 1000) {
-    supersteps = 100;
-  } else if (NBLOOPS >= 100) {
-    supersteps = 10;
-  } else if (NBLOOPS <= 10) {
-    supersteps = 1;
-  }
-  if (globals->create && (!(globals->remaining_loop % supersteps))) {
-    XBT_INFO("Begin a new loop. Still to do: %d", globals->remaining_loop);
-  } else if (!(globals->remaining_loop % supersteps)) {
-    XBT_VERB("Got token(%d) from %s remaining_loop=%d",
-          msg, xbt_socket_peer_name(expeditor), globals->remaining_loop);
-  }
-
-  /* 4. If the right shouldn't be stopped yet */
-  if (globals->remaining_loop > 0) {
-    msg += 1;
-
-    XBT_DEBUG("Send token(%d) to %s:%d", msg,
-           xbt_socket_peer_name(globals->tosuccessor),
-           xbt_socket_peer_port(globals->tosuccessor));
-
-    /* 5. Send the token as payload of a stoken message to the successor */
-    TRY {
-      gras_msg_send(globals->tosuccessor, "stoken", &msg);
-
-      /* 6. Deal with errors */
-    }
-    CATCH_ANONYMOUS {
-      gras_socket_close(globals->sock);
-      RETHROWF("Unable to forward token: %s");
-    }
-
-  }
-
-  /* DO NOT CLOSE THE expeditor SOCKET since the client socket is
-     reused by our predecessor.
-     Closing this side would thus create troubles */
-
-  /* 7. Decrease the remaining_loop integer. */
-  globals->remaining_loop -= 1;
-
-  /* 8. Repport the hop number to the user at the end */
-  if (globals->remaining_loop == -1 && globals->create) {
-    double elapsed = gras_os_time() - globals->start_time;
-    XBT_INFO("Shut down the token-ring. There was %d hops.", msg);
-    XBT_VERB("Elapsed time: %g", elapsed);
-  }
-
-  /* 9. Tell GRAS that we consummed this message */
-  return 0;
-}                               /* end_of_node_cb_stoken_handler */
-
-int node(int argc, char *argv[])
-{
-  node_data_t *globals;
-
-  const char *host;
-  int myport;
-  int peerport;
-
-  /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-  globals = gras_userdata_new(node_data_t);
-
-
-  /* 2. Get the successor's address. The command line overrides
-     defaults when specified */
-  host = "127.0.0.1";
-  myport = 4000;
-  peerport = 4000;
-  if (argc >= 4) {
-    myport = atoi(argv[1]);
-    host = argv[2];
-    peerport = atoi(argv[3]);
-  }
-
-  /* 3. Save successor's address in global var */
-  globals->remaining_loop = NBLOOPS;
-  globals->create = 0;
-  globals->tosuccessor = NULL;
-
-  if (!gras_os_getpid() % 100 || gras_if_RL())
-    XBT_INFO("Launch node listening on %d (successor on %s:%d)",
-          myport, host, peerport);
-
-  /* 4. Register the known messages.  */
-  gras_msgtype_declare("stoken", xbt_datadesc_by_name("int"));
-
-  /* 5. Create my master socket for listening */
-  globals->sock = gras_socket_server(myport);
-  gras_os_sleep(1.0);           /* Make sure all server sockets are created */
-
-  /* 6. Create socket to the successor on the ring */
-  XBT_DEBUG("Connect to my successor on %s:%d", host, peerport);
-
-  globals->tosuccessor = gras_socket_client(host, peerport);
-
-  /* 7. Register my callback */
-  gras_cb_register("stoken", &node_cb_stoken_handler);
-
-  /* 8. One node has to create the token at startup. 
-     It's specified by a command line argument */
-  if (argc >= 5
-      && !strncmp("--create-token", argv[4], strlen("--create-token")))
-    globals->create = 1;
-
-  if (globals->create) {
-    int token = 0;
-
-    globals->start_time = gras_os_time();
-
-    globals->remaining_loop = NBLOOPS - 1;
-
-    XBT_INFO("Create the token (with value %d) and send it to %s:%d",
-          token, host, peerport);
-
-    TRY {
-      gras_msg_send(globals->tosuccessor, "stoken", &token);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to send the freshly created token: %s");
-    }
-  }
-
-  /* 8. Wait up to 10 seconds for an incoming message to handle */
-  while (globals->remaining_loop > (globals->create ? -1 : 0)) {
-    gras_msg_handle(-1);
-
-    XBT_DEBUG("looping (remaining_loop=%d)", globals->remaining_loop);
-  }
-
-  gras_os_sleep(1.0);           /* FIXME: if the sender quited, receive fail */
-
-  /* 9. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(globals->sock);
-  gras_socket_close(globals->tosuccessor);
-  free(globals);
-  gras_exit();
-
-  return 0;
-}                               /* end_of_node */
diff --git a/examples/gras/mutual_exclusion/simple_token/simple_token.xml b/examples/gras/mutual_exclusion/simple_token/simple_token.xml
deleted file mode 100644 (file)
index d45a60a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
- <process host="Tremblay" function="node">
-  <argument value="4000"/>                           <!-- port on which I am listening -->
-  <argument value="Fafard"/><argument value="4000"/> <!-- peer (successor) host id and port-->
-  <argument value="--create-token"/>                 <!-- I'm first client, ie I have to create the token -->
- </process>
- <process host="Fafard" function="node">
-  <argument value="4000"/>                           <!-- port on which I am listening -->
-  <argument value="Jupiter"/><argument value="4000"/><!-- peer (successor) host id and port-->
- </process>
- <process host="Jupiter" function="node">
-  <argument value="4000"/>                            <!-- port on which I am listening -->
-  <argument value="Ginette"/><argument value="4000"/> <!-- peer (successor) host id and port-->
- </process>
- <process host="Ginette" function="node">
-  <argument value="4000"/>                            <!-- port on which I am listening -->
-  <argument value="Bourassa"/><argument value="4000"/><!-- peer (successor) host id and port-->
- </process>
- <process host="Bourassa" function="node">
-  <argument value="4000"/>                            <!-- port on which I am listening -->
-  <argument value="Tremblay"/><argument value="4000"/><!-- peer (successor) host id and port-->
- </process>
-</platform>
diff --git a/examples/gras/mutual_exclusion/simple_token/test_rl.tesh b/examples/gras/mutual_exclusion/simple_token/test_rl.tesh
deleted file mode 100755 (executable)
index 6911513..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4100 127.0.0.1 4110 --create-token --log=root.fmt:%m%n $@
-> Launch node listening on 4100 (successor on 127.0.0.1:4110)
-> Create the token (with value 0) and send it to 127.0.0.1:4110
-> Begin a new loop. Still to do: 2
-> Begin a new loop. Still to do: 1
-> Begin a new loop. Still to do: 0
-> Shut down the token-ring. There was 17 hops.
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4110 127.0.0.1 4120 --log=root.fmt:%m%n $@
-> Launch node listening on 4110 (successor on 127.0.0.1:4120)
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4120 127.0.0.1 4130 --log=root.fmt:%m%n $@
-> Launch node listening on 4120 (successor on 127.0.0.1:4130)
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4130 127.0.0.1 4141 --log=root.fmt:%m%n $@
-> Launch node listening on 4130 (successor on 127.0.0.1:4141)
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4141 127.0.0.1 4150 --log=root.fmt:%m%n $@
-> Launch node listening on 4141 (successor on 127.0.0.1:4150)
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./simple_token_node$EXEEXT 4150 127.0.0.1 4100 --log=root.fmt:%m%n $@
-> Launch node listening on 4150 (successor on 127.0.0.1:4100)
-> Exiting GRAS
diff --git a/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh b/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh
deleted file mode 100644 (file)
index 1e8c49e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./simple_token_simulator$EXEEXT ${srcdir:=.}/../../../msg/small_platform.xml ${srcdir:=.}/simple_token.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  1.000390] (1:node@Tremblay) Create the token (with value 0) and send it to Fafard:4000
-> [  1.147954] (1:node@Tremblay) Begin a new loop. Still to do: 2
-> [  1.295517] (1:node@Tremblay) Begin a new loop. Still to do: 1
-> [  1.443080] (1:node@Tremblay) Begin a new loop. Still to do: 0
-> [  1.443080] (1:node@Tremblay) Shut down the token-ring. There was 14 hops.
-> [  2.365949] (2:node@Fafard) Exiting GRAS
-> [  2.401517] (3:node@Jupiter) Exiting GRAS
-> [  2.417640] (4:node@Ginette) Exiting GRAS
-> [  2.443080] (1:node@Tremblay) Exiting GRAS
-> [  2.443080] (5:node@Bourassa) Exiting GRAS
diff --git a/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh b/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh
deleted file mode 100644 (file)
index 7a96a43..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./simple_token_simulator$EXEEXT ${srcdir:=.}/../../../msg/small_platform.xml ${srcdir:=.}/simple_token.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  1.000390] (1:node@Tremblay) Create the token (with value 0) and send it to Fafard:4000
-> [  1.147954] (1:node@Tremblay) Begin a new loop. Still to do: 2
-> [  1.295517] (1:node@Tremblay) Begin a new loop. Still to do: 1
-> [  1.443080] (1:node@Tremblay) Begin a new loop. Still to do: 0
-> [  1.443080] (1:node@Tremblay) Shut down the token-ring. There was 14 hops.
-> [  2.365949] (2:node@Fafard) Exiting GRAS
-> [  2.401517] (3:node@Jupiter) Exiting GRAS
-> [  2.417640] (4:node@Ginette) Exiting GRAS
-> [  2.443080] (1:node@Tremblay) Exiting GRAS
-> [  2.443080] (5:node@Bourassa) Exiting GRAS
\ No newline at end of file
diff --git a/examples/gras/p2p/can/can.c b/examples/gras/p2p/can/can.c
deleted file mode 100644 (file)
index c6755a0..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/* Broken Peer-To-Peer CAN simulator                                        */
-
-/* Copyright (c) 2006, 2007. 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. */
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "gras.h"
-
-#include "can_tests.c"
-//#include "types.h" // header alone containing the typedef struct of a node // include can_tests.c must be OFF.
-
-//XBT_LOG_NEW_DEFAULT_CATEGORY(can,"Messages specific to this example"); // include can_tests.c must be OFF.
-
-//extern char *_gras_this_type_symbol_does_not_exist__s_nuke;
-int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data);
-
-// struct of a "get_successor" message, when a node look after the area in which he want to be.
-XBT_DEFINE_TYPE(s_get_suc, struct s_get_suc {
-                 int xId; int yId; char host[1024]; int port;};);
-
-typedef struct s_get_suc get_suc_t;
-
-// struct of a "response_successor" message, hen a node receive the information of his new area.
-XBT_DEFINE_TYPE(s_rep_suc, struct s_rep_suc {
-                 int x1;        // Xmin
-                 int x2;        // Xmax
-                 int y1;        // Ymin
-                 int y2;        // Ymax
-                 char north_host[1024];
-                 int north_port;
-                 char south_host[1024];
-                 int south_port;
-                 char east_host[1024];
-                 int east_port; char west_host[1024]; int west_port;};);
-typedef struct s_rep_suc rep_suc_t;
-
-int node(int argc, char **argv);
-
-// registering messages types
-static void register_messages()
-{
-  gras_msgtype_declare("can_get_suc", xbt_datadesc_by_symbol(s_get_suc));
-  gras_msgtype_declare("can_rep_suc", xbt_datadesc_by_symbol(s_rep_suc));
-  gras_msgtype_declare("can_nuke", xbt_datadesc_by_symbol(s_nuke));    // can_test.c message // include can_tests.c must be ON.
-}
-
-
-// a forwarding function for a "get_suc" message.
-static void forward_get_suc(get_suc_t msg, char host[1024], int port)
-{
-  xbt_socket_t temp_sock = NULL;
-  //XBT_INFO("Transmiting message to %s:%d",host,port);
-  TRY {
-    temp_sock = gras_socket_client(host, port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to connect!: %s");
-  }
-  TRY {
-    gras_msg_send(temp_sock, "can_get_suc", &msg);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to send!: %s");
-  }
-  XBT_INFO("Forwarding a get_successor message to %s for (%d;%d)", host,
-        msg.xId, msg.yId);
-  gras_socket_close(temp_sock);
-}
-
-// the handling function of a "get_suc" message (what do a node when he receive a "get_suc" message.
-static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  get_suc_t *incoming = (get_suc_t *) payload_data;
-  xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  xbt_socket_t temp_sock = NULL;
-  XBT_INFO("Received a get_successor message from %s for (%d;%d)",
-        xbt_socket_peer_name(expeditor), incoming->xId, incoming->yId);
-  //XBT_INFO("My area is [%d;%d;%d;%d]",globals->x1,globals->x2,globals->y1,globals->y2);
-  if (incoming->xId < globals->x1)      // test if the message must be forwarded to a neighbour.
-    forward_get_suc(*incoming, globals->west_host, globals->west_port);
-  else if (incoming->xId > globals->x2)
-    forward_get_suc(*incoming, globals->east_host, globals->east_port);
-  else if (incoming->yId < globals->y1)
-    forward_get_suc(*incoming, globals->south_host, globals->south_port);
-  else if (incoming->yId > globals->y2)
-    forward_get_suc(*incoming, globals->north_host, globals->north_port);
-  else {                        // if the message must not be forwarded, then the area is splitted in half and one half is assignated to the new node.
-    rep_suc_t outgoing;
-    int validate = 0;
-    XBT_INFO
-        ("Spliting my area between me (%d;%d) and the inserting node (%d;%d)!",
-         globals->xId, globals->yId, incoming->xId, incoming->yId);
-    if ((globals->x2 - globals->x1) > (globals->y2 - globals->y1)) {    // the height of the area is smaller than its width.
-      if (incoming->xId < globals->xId) {       // the new node is west from the actual node.
-        outgoing.x1 = globals->x1;
-        outgoing.x2 = (incoming->xId + globals->xId) / 2;
-        outgoing.y1 = globals->y1;
-        outgoing.y2 = globals->y2;
-        strcpy(outgoing.north_host, globals->north_host);
-        outgoing.north_port = globals->north_port;
-        strcpy(outgoing.south_host, globals->south_host);
-        outgoing.south_port = globals->south_port;
-        strcpy(outgoing.east_host, globals->host);
-        outgoing.east_port = globals->port;
-        strcpy(outgoing.west_host, globals->west_host);
-        outgoing.west_port = globals->west_port;
-
-        globals->x1 = (incoming->xId + globals->xId) / 2;
-        strcpy(globals->west_host, incoming->host);
-        globals->west_port = incoming->port;
-        validate = 1;
-      } else if (incoming->xId > globals->xId) {        // the new node is east from the actual node.
-        outgoing.x1 = (incoming->xId + globals->xId) / 2;
-        outgoing.x2 = globals->x2;
-        outgoing.y1 = globals->y1;
-        outgoing.y2 = globals->y2;
-        strcpy(outgoing.north_host, globals->north_host);
-        outgoing.north_port = globals->north_port;
-        strcpy(outgoing.south_host, globals->south_host);
-        outgoing.south_port = globals->south_port;
-        strcpy(outgoing.east_host, globals->east_host);
-        outgoing.east_port = globals->east_port;
-        strcpy(outgoing.west_host, globals->host);
-        outgoing.west_port = globals->port;
-
-        globals->x2 = (incoming->xId + globals->xId) / 2;
-        strcpy(globals->east_host, incoming->host);
-        globals->east_port = incoming->port;
-        validate = 1;
-      }
-    } else {
-      if (incoming->yId < globals->yId) {       // the new node is south from the actual node.
-        outgoing.y1 = globals->y1;
-        outgoing.y2 = (incoming->yId + globals->yId) / 2;
-        outgoing.y1 = globals->y1;
-        outgoing.x2 = globals->x2;
-        strcpy(outgoing.east_host, globals->east_host);
-        outgoing.east_port = globals->east_port;
-        strcpy(outgoing.west_host, globals->west_host);
-        outgoing.west_port = globals->west_port;
-        strcpy(outgoing.north_host, globals->host);
-        outgoing.north_port = globals->port;
-        strcpy(outgoing.south_host, globals->south_host);
-        outgoing.south_port = globals->south_port;
-
-        globals->y1 = (incoming->yId + globals->yId) / 2;
-        strcpy(globals->south_host, incoming->host);
-        globals->south_port = incoming->port;
-        validate = 1;
-      } else if (incoming->yId > globals->yId) {        // the new node is north from the actual node.
-        outgoing.y1 = (incoming->yId + globals->yId) / 2;
-        outgoing.y2 = globals->y2;
-        outgoing.x1 = globals->x1;
-        outgoing.x2 = globals->x2;
-        strcpy(outgoing.east_host, globals->east_host);
-        outgoing.east_port = globals->east_port;
-        strcpy(outgoing.west_host, globals->west_host);
-        outgoing.west_port = globals->west_port;
-        strcpy(outgoing.north_host, globals->north_host);
-        outgoing.north_port = globals->north_port;
-        strcpy(outgoing.south_host, globals->host);
-        outgoing.south_port = globals->port;
-
-        globals->y2 = (incoming->yId + globals->yId) / 2;
-        strcpy(globals->north_host, incoming->host);
-        globals->north_port = incoming->port;
-        validate = 1;
-      }
-    }
-    if (validate == 1) {        // the area for the new node has been defined, then send theses informations to the new node.
-      XBT_INFO("Sending environment informations to node %s:%d",
-            incoming->host, incoming->port);
-
-      TRY {
-        temp_sock = gras_socket_client(incoming->host, incoming->port);
-      }
-      CATCH_ANONYMOUS {
-        RETHROWF
-            ("Unable to connect to the node wich has requested for an area!: %s");
-      }
-      TRY {
-        gras_msg_send(temp_sock, "can_rep_suc", &outgoing);
-        XBT_INFO("Environment informations sent!");
-      }
-      CATCH_ANONYMOUS {
-        RETHROWF("%s:Timeout sending environment informations to %s: %s",
-                 globals->host, xbt_socket_peer_name(expeditor));
-      }
-      gras_socket_close(temp_sock);
-    } else                      // we have a problem!
-      XBT_INFO("An error occurded!!!!!!!!!!!!!");
-
-  }
-  gras_socket_close(expeditor); // spare
-  TRY {
-    gras_msg_handle(10000.0);   // wait a bit in case of someone want to ask me for something.
-  }
-  CATCH(e) {
-    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
-          globals->y1, globals->y2);
-    //XBT_INFO("Closing node, all has been done!");
-    xbt_ex_free(e);
-  }
-  return 0;
-}
-
-
-
-
-
-int node(int argc, char **argv)
-{
-  node_data_t *globals = NULL;
-  xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
-  xbt_socket_t temp_sock = NULL;
-
-  rep_suc_t rep_suc_msg;
-
-  get_suc_t get_suc_msg;        // building the "get_suc" message.
-  xbt_socket_t temp_sock2 = NULL;
-
-  XBT_INFO("Starting");
-
-  /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-  gras_os_sleep((15 - gras_os_getpid()) * 20);  // wait a bit.
-
-  globals = gras_userdata_new(node_data_t);
-
-  globals->xId = atoi(argv[1]); // x coordinate of the node.
-  globals->yId = atoi(argv[2]); // y coordinate of the node.
-  globals->port = atoi(argv[3]);        // node port
-  globals->sock = gras_socket_server(globals->port);    // node socket.
-  snprintf(globals->host, 1024, gras_os_myname());      // node name.
-  globals->version = 0;         // node version (used for fun)
-
-  /* 2. Inserting the Node */
-  XBT_INFO("Inserting node %s:%d", globals->host, globals->port);
-  if (argc == 4) {              // the node is a server, then he has the whole area.
-    globals->x1 = 0;
-    globals->x2 = 1000;
-    globals->y1 = 0;
-    globals->y2 = 1000;
-  } else {                      // asking for an area.
-    XBT_INFO("Contacting %s so as to request for an area", argv[4]);
-
-    TRY {
-      temp_sock = gras_socket_client(argv[4], atoi(argv[5]));
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to connect known host to request for an area!: %s");
-    }
-
-
-    get_suc_msg.xId = globals->xId;
-    get_suc_msg.yId = globals->yId;
-    strcpy(get_suc_msg.host, globals->host);
-    get_suc_msg.port = globals->port;
-    TRY {                       // asking.
-      gras_msg_send(temp_sock, "can_get_suc", &get_suc_msg);
-    }
-    CATCH_ANONYMOUS {
-      gras_socket_close(temp_sock);
-      RETHROWF("Unable to contact known host to get an area!: %s");
-    }
-    gras_socket_close(temp_sock);
-
-
-
-    TRY {                       // waiting for a reply.
-      XBT_INFO("Waiting for reply!");
-      gras_msg_wait(6000, "can_rep_suc", &temp_sock2, &rep_suc_msg);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("%s: Error waiting for an area:%s", globals->host);
-    }
-
-    // retreiving the data of the response.
-    globals->x1 = rep_suc_msg.x1;
-    globals->x2 = rep_suc_msg.x2;
-    globals->y1 = rep_suc_msg.y1;
-    globals->y2 = rep_suc_msg.y2;
-    strcpy(globals->north_host, rep_suc_msg.north_host);
-    globals->north_port = rep_suc_msg.north_port;
-    strcpy(globals->south_host, rep_suc_msg.south_host);
-    globals->south_port = rep_suc_msg.south_port;
-    strcpy(globals->east_host, rep_suc_msg.east_host);
-    globals->east_port = rep_suc_msg.east_port;
-    strcpy(globals->west_host, rep_suc_msg.west_host);
-    globals->west_port = rep_suc_msg.west_port;
-
-    gras_socket_close(temp_sock);       // spare
-  }
-  XBT_INFO("Node %s:%d inserted", globals->host, globals->port);
-
-  // associating messages to handlers.
-  register_messages();
-  gras_cb_register("can_get_suc", &node_get_suc_handler);
-  gras_cb_register("can_nuke", &node_nuke_handler);     // can_test.c handler // include can_tests.c must be ON.
-
-  TRY {
-    gras_msg_handle(10000.0);   // waiting.. in case of someone has something to say.
-  }
-  CATCH(e) {
-    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
-          globals->y1, globals->y2);
-    //XBT_INFO("Closing node, all has been done!");
-    xbt_ex_free(e);
-  }
-
-  gras_socket_close(globals->sock);     // spare.
-  free(globals);                // spare.
-  //gras_exit();
-  return (0);
-}
-
-// END
diff --git a/examples/gras/p2p/can/can.xml b/examples/gras/p2p/can/can.xml
deleted file mode 100644 (file)
index 4f63ff4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
-
-
-
-  <process host="Tremblay" function="start_war">
-    <argument value="4000"/>           <!-- my port -->
-    <argument value="1"/>            <!-- my nuke version -->
-  </process>
-
-  <process host="Jacquelin" function="node">
-    <argument value="100"/>            <!-- my xId -->
-    <argument value="900"/>            <!-- my yId -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Tremblay"/>     <!-- my hostname -->
-    <argument value="4000"/>         <!-- my hostport -->
-  </process>
-
-  <process host="Bourassa" function="node">
-    <argument value="800"/>            <!-- my xId -->
-    <argument value="200"/>            <!-- my yId -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Tremblay"/>     <!-- my hostname -->
-    <argument value="4000"/>         <!-- my hostport -->
-  </process>
-
-  <process host="Fafard" function="node">
-    <argument value="500"/>            <!-- my xId -->
-    <argument value="600"/>            <!-- my yId -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Tremblay"/>     <!-- my hostname -->
-    <argument value="4000"/>         <!-- my hostport -->
-  </process>
-
-  <process host="Tremblay" function="node">
-    <argument value="10"/>            <!-- my xId -->
-    <argument value="20"/>            <!-- my yId -->
-    <argument value="4000"/>         <!-- my port -->
-  </process>
-
-</platform>
-
diff --git a/examples/gras/p2p/can/can_tests.c b/examples/gras/p2p/can/can_tests.c
deleted file mode 100644 (file)
index 994eea6..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Broken Peer-To-Peer CAN simulator                                        */
-
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <time.h>
-//#include "gras.h"
-#include "types.h"              // header containing the typedef struct of a node
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(can, "Messages specific to this example");
-
-// struct of a "nuke" message, when a node send a nuke to (xId;yId).
-XBT_DEFINE_TYPE(s_nuke, struct s_nuke {
-                 int xId; int yId; char host[1024];     // original expeditor..
-                 int port;      // ..and his port.
-                 int version;   // fun.
-                 };);
-
-typedef struct s_nuke nuke_t;
-
-// the function that start the **** War of the Nodes ****
-int start_war(int argc, char **argv);
-int start_war(int argc, char **argv)
-{
-  xbt_socket_t temp_sock = NULL;
-  nuke_t nuke_msg;
-  //return 0; // in order to inhibit the War of the Nodes 
-  gras_init(&argc, argv);
-  gras_os_sleep((15 - gras_os_getpid()) * 20 + 200);    // wait a bit.
-
-
-  TRY {                         // contacting the bad guy that will launch the War.
-    temp_sock = gras_socket_client(gras_os_myname(), atoi(argv[1]));
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to connect known host so as to declare WAR!: %s");
-  }
-
-
-  nuke_msg.xId = -1;
-  nuke_msg.yId = -1;
-  nuke_msg.version = atoi(argv[2]);
-  strcpy(nuke_msg.host, gras_os_myname());
-  nuke_msg.port = atoi(argv[1]);
-
-  TRY {
-    gras_msg_send(temp_sock, "can_nuke", &nuke_msg);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(temp_sock);
-    RETHROWF
-        ("Unable to contact known host so as to declare WAR!!!!!!!!!!!!!!!!!!!!!: %s");
-  }
-  gras_socket_close(temp_sock); // spare.
-  gras_exit();                  // spare.
-  return 0;
-}
-
-// the function thaht send the nuke "msg" on (xId;yId), if it's not on me :p.
-static int send_nuke(nuke_t * msg, int xId, int yId)
-{
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  xbt_socket_t temp_sock = NULL;
-
-  if (xId >= globals->x1 && xId <= globals->x2 && yId >= globals->y1
-      && yId <= globals->y2) {
-    XBT_INFO("Nuclear launch missed");
-    return 0;
-  } else {
-    char host[1024];
-    int port = 0;
-
-    if (xId < globals->x1) {
-      strcpy(host, globals->west_host);
-      port = globals->west_port;
-    } else if (xId > globals->x2) {
-      strcpy(host, globals->east_host);
-      port = globals->east_port;
-    } else if (yId < globals->y1) {
-      strcpy(host, globals->south_host);
-      port = globals->south_port;
-    } else if (yId > globals->y2) {
-      strcpy(host, globals->north_host);
-      port = globals->north_port;
-    }
-
-    msg->xId = xId;
-    msg->yId = yId;
-
-
-
-    TRY {                       // sending the nuke.
-      temp_sock = gras_socket_client(host, port);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to connect the nuke!: %s");
-    }
-    //XBT_INFO("%s ON %s %d %d <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",globals->host,host,xId,yId);
-    TRY {
-      gras_msg_send(temp_sock, "can_nuke", msg);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to send the nuke!: %s");
-    }
-    gras_socket_close(temp_sock);
-    XBT_INFO("Nuke launched by %s to %s for (%d;%d)", globals->host, host,
-          msg->xId, msg->yId);
-    return 1;
-  }
-}
-
-
-static int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  nuke_t *incoming = (nuke_t *) payload_data;
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-
-  int x;
-  int y;
-  nuke_t nuke_msg;              // writing my name one the nuke.
-  xbt_socket_t temp_sock = NULL;
-  xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
-
-
-  if (incoming->xId == -1) {    // i must start the War
-    XBT_INFO("%s:%d declare the WAR!!!!!!!!!!!!!!!!!", globals->host,
-          globals->port);
-    srand((unsigned int) time((time_t *) NULL));
-
-    do {
-      x = (int) (1000.0 * rand() / (RAND_MAX + 1.0));
-      y = (int) (1000.0 * rand() / (RAND_MAX + 1.0));
-    }
-    while (send_nuke(incoming, x, y) == 0);
-
-  } else if (incoming->xId >= globals->x1 && incoming->xId <= globals->x2 && incoming->yId >= globals->y1 && incoming->yId <= globals->y2) {    // the nuke crash on my area..
-    if (globals->version == incoming->version)  // ..but i'm dead.
-      XBT_INFO("I'm already dead :p");
-    else if ((incoming->xId - globals->xId) / 60 == 0 && (incoming->yId - globals->yId) / 60 == 0) {    // ..and it's on me, so i die :X.
-      globals->version = incoming->version;
-      XBT_INFO("Euuuaarrrgghhhh...   %s killed %s !!!!!!!!!!!!!!!!!",
-            incoming->host, globals->host);
-    } else {                    // and it miss me, i angry and i send my own nuke!
-      XBT_INFO("%s was missed, and counteract!", globals->host);
-      /*int x1=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int y1=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int x2=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int y2=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int x3=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int y3=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int x4=(int)(1000.0*rand()/(RAND_MAX+1.0));
-         int y4=(int)(1000.0*rand()/(RAND_MAX+1.0)); */
-
-
-      nuke_msg.version = incoming->version;
-      strcpy(nuke_msg.host, globals->host);
-      nuke_msg.port = globals->port;
-
-
-      do {
-        x = (int) (1000.0 * rand() / (RAND_MAX + 1.0));
-        y = (int) (1000.0 * rand() / (RAND_MAX + 1.0));
-      }
-      while (send_nuke(&nuke_msg, x, y) == 0);  // and sending if it's not on me.
-    }
-  } else {                      // the nuke isn't for me, so i forward her.
-    char host[1024];
-    int port = 0;
-
-    if (incoming->xId < globals->x1) {
-      strcpy(host, globals->west_host);
-      port = globals->west_port;
-    } else if (incoming->xId > globals->x2) {
-      strcpy(host, globals->east_host);
-      port = globals->east_port;
-    } else if (incoming->yId < globals->y1) {
-      strcpy(host, globals->south_host);
-      port = globals->south_port;
-    } else if (incoming->yId > globals->y2) {
-      strcpy(host, globals->north_host);
-      port = globals->north_port;
-    }
-
-
-
-    TRY {
-      temp_sock = gras_socket_client(host, port);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to connect the nuke!: %s");
-    }
-    TRY {
-      gras_msg_send(temp_sock, "can_nuke", incoming);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to send the nuke!: %s");
-    }
-    XBT_INFO("Nuke re-aimed by %s to %s for (%d;%d)", globals->host, host,
-          incoming->xId, incoming->yId);
-    gras_socket_close(temp_sock);
-  }
-  gras_socket_close(expeditor); // spare.
-
-  TRY {
-    gras_msg_handle(10000.0);   // wait a bit, in case of..
-  }
-  CATCH(e) {
-    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
-          globals->y1, globals->y2);
-    //XBT_INFO("Closing node, all has been done!");
-    xbt_ex_free(e);
-  }
-  return 0;
-}
-
-// END
diff --git a/examples/gras/p2p/can/test_rl.in b/examples/gras/p2p/can/test_rl.in
deleted file mode 100755 (executable)
index 929f1df..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#! @BASH@ -e
-if [ x@EXEEXT@ = x ] ; then 
-#  exenv="libtool --mode=execute valgrind --show-reachable=yes --run-libc-freeres=no "
-  exenv=$SG_TEST_EXENV
-else
-  exenv=wine
-fi
-    
-$exenv ./can_node@EXEEXT@ 4002 $@ &
-sleep 1
-$exenv ./can_node@EXEEXT@ 127.0.0.1 4002 $@
diff --git a/examples/gras/p2p/can/test_sg.in b/examples/gras/p2p/can/test_sg.in
deleted file mode 100755 (executable)
index 5d3d33e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-if [ x@EXEEXT@ = x ] ; then 
-  exenv=$SG_TEST_EXENV
-else
-  exenv=wine
-fi
-
-exec $exenv ./can_simulator @top_srcdir@/examples/msg/msg_platform.xml @srcdir@/can_deployment.xml $@
diff --git a/examples/gras/p2p/can/types.h b/examples/gras/p2p/can/types.h
deleted file mode 100644 (file)
index ddeb68f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2006, 2010. 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. */
-
-#include "gras.h"
-
-/* Global private data */
-typedef struct {
-  gras_socket_t sock;           /* server socket on which I'm listening */
-  int xId;
-  int yId;
-  char host[1024];              /* my host name */
-  int port;                     /* port on which I'm listening FIXME */
-
-  int x1;                       // Xmin
-  int x2;                       // Xmax
-  int y1;                       // Ymin
-  int y2;                       // Ymax
-
-  char north_host[1024];
-  int north_port;
-  char south_host[1024];
-  int south_port;
-  char east_host[1024];
-  int east_port;
-  char west_host[1024];
-  int west_port;
-
-  int version;
-} node_data_t;
diff --git a/examples/gras/p2p/chord/chord.c b/examples/gras/p2p/chord/chord.c
deleted file mode 100644 (file)
index 528db0c..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "gras.h"
-
-static int closest_preceding_node(int id);
-static void check_predecessor(void);
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(chord, "Messages specific to this example");
-
-typedef enum msg_typus {
-  PING,
-  PONG,
-  GET_PRE,
-  REP_PRE,
-  GET_SUC,
-  REP_SUC,
-  STD,
-} msg_typus;
-
-/*XBT_DEFINE_TYPE(s_pbio,
-  struct s_pbio{
-    msg_typus type;
-    int dest;
-    char msg[1024];
-  };
-);
-typedef struct s_pbio pbio_t;*/
-
-/*XBT_DEFINE_TYPE(s_ping,*/
-struct s_ping {
-  int id;
-};
-/*);*/
-typedef struct s_ping ping_t;
-
-/*XBT_DEFINE_TYPE(s_pong,*/
-struct s_pong {
-  int id;
-  int failed;
-};
-/*);*/
-typedef struct s_pong pong_t;
-
-XBT_DEFINE_TYPE(s_notify, struct s_notify {
-                 int id; char host[1024]; int port;};);
-
-typedef struct s_notify notify_t;
-
-XBT_DEFINE_TYPE(s_get_suc, struct s_get_suc {
-                 int id;};);
-
-typedef struct s_get_suc get_suc_t;
-
-XBT_DEFINE_TYPE(s_rep_suc, struct s_rep_suc {
-                 int id; char host[1024]; int port;};);
-
-typedef struct s_rep_suc rep_suc_t;
-
-typedef struct finger_elem {
-  int id;
-  char host[1024];
-  int port;
-} finger_elem;
-
-
-
-static void register_messages()
-{
-/*  gras_msgtype_declare("chord",xbt_datadesc_by_symbol(s_pbio));*/
-  gras_msgtype_declare("chord_get_suc",
-                       xbt_datadesc_by_symbol(s_get_suc));
-  gras_msgtype_declare("chord_rep_suc",
-                       xbt_datadesc_by_symbol(s_rep_suc));
-  gras_msgtype_declare("chord_notify", xbt_datadesc_by_symbol(s_notify));
-}
-
-/* Global private data */
-typedef struct {
-  xbt_socket_t sock;           /* server socket on which I'm listening */
-  int id;                       /* my id number */
-  char host[1024];              /* my host name */
-  int port;                     /* port on which I'm listening FIXME */
-  int fingers;                  /* how many fingers */
-  finger_elem *finger;          /* finger table */
-  int next_to_fix;              /* next in the finger list to be checked */
-  int pre_id;                   /* predecessor id */
-  char pre_host[1024];          /* predecessor host */
-  int pre_port;                 /* predecessor port */
-} node_data_t;
-
-
-int node(int argc, char **argv);
-
-/*static int node_cb_chord_handler(xbt_socket_t expeditor,void *payload_data){
-  xbt_ex_t e;
-  pbio_t pbio_i=*(pbio_t*)payload_data;
-
-  node_data_t *globals=(node_data_t*)gras_userdata_get();
-
-  XBT_INFO(">>> %d : received %d message from %s to %d <<<",globals->id,pbio_i.type,xbt_socket_peer_name(expeditor),pbio_i.dest);
-
-
-
-}*/
-
-static int node_cb_get_suc_handler(gras_msg_cb_ctx_t ctx,
-                                   void *payload_data)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  get_suc_t incoming = *(get_suc_t *) payload_data;
-  rep_suc_t outgoing;
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  XBT_INFO("Received a get_successor message from %s for %d",
-        xbt_socket_peer_name(expeditor), incoming.id);
-  if ((globals->id == globals->finger[0].id) ||
-      (incoming.id > globals->id
-       && incoming.id <= globals->finger[0].id)) {
-    outgoing.id = globals->finger[0].id;
-    snprintf(outgoing.host, 1024, globals->finger[0].host);
-    outgoing.port = globals->finger[0].port;
-    XBT_INFO("My successor is his successor!");
-  } else {
-    xbt_socket_t temp_sock;
-    int contact = closest_preceding_node(incoming.id);
-    if (contact == -1) {
-      outgoing.id = globals->finger[0].id;
-      snprintf(outgoing.host, 1024, globals->finger[0].host);
-      outgoing.port = globals->finger[0].port;
-      XBT_INFO("My successor is his successor!");
-    } else {
-      get_suc_t asking;
-      asking.id = incoming.id;
-      TRY {
-        temp_sock = gras_socket_client(globals->finger[contact].host,
-                                       globals->finger[contact].port);
-      }
-      CATCH_ANONYMOUS {
-        RETHROWF("Unable to connect!: %s");
-      }
-      TRY {
-        gras_msg_send(temp_sock, "chord_get_suc", &asking);
-      }
-      CATCH_ANONYMOUS {
-        RETHROWF("Unable to ask!: %s");
-      }
-      gras_msg_wait(10., "chord_rep_suc", &temp_sock, &outgoing);
-    }
-  }
-
-  TRY {
-    gras_msg_send(expeditor, "chord_rep_suc", &outgoing);
-    XBT_INFO("Successor information sent!");
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("%s:Timeout sending successor information to %s: %s",
-             globals->host, xbt_socket_peer_name(expeditor));
-  }
-  gras_socket_close(expeditor);
-  return 0;
-}
-
-static int closest_preceding_node(int id)
-{
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  int i;
-  for (i = globals->fingers - 1; i >= 0; i--) {
-    if (globals->finger[i].id > globals->id && globals->finger[i].id < id) {
-      return (i);
-    }
-  }
-
-  return i;
-}
-
-static int node_cb_notify_handler(gras_msg_cb_ctx_t ctx,
-                                  void *payload_data)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  /*xbt_ex_t e; */
-  notify_t incoming = *(notify_t *) payload_data;
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  XBT_INFO("Received a notifying message from %s as %d",
-        xbt_socket_peer_name(expeditor), incoming.id);
-  if (globals->pre_id == -1 ||
-      (incoming.id > globals->pre_id && incoming.id < globals->id)) {
-    globals->pre_id = incoming.id;
-    snprintf(globals->pre_host, 1024, incoming.host);
-    globals->pre_port = incoming.port;
-    XBT_INFO("Set as my new predecessor!");
-  }
-  return 0;
-}
-
-static void fix_fingers()
-{
-  get_suc_t get_suc_msg;
-  xbt_socket_t temp_sock = NULL;
-  xbt_socket_t temp_sock2 = NULL;
-  rep_suc_t rep_suc_msg;
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-
-  TRY {
-    temp_sock = gras_socket_client(globals->host, globals->port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to contact known host: %s");
-  }
-
-  get_suc_msg.id = globals->id;
-  TRY {
-    gras_msg_send(temp_sock, "chord_get_suc", &get_suc_msg);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(temp_sock);
-    RETHROWF("Unable to contact known host to get successor!: %s");
-  }
-
-  TRY {
-    XBT_INFO("Waiting for reply!");
-    gras_msg_wait(6000, "chord_rep_suc", &temp_sock2, &rep_suc_msg);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("%s: Error waiting for successor:%s", globals->host);
-  }
-  globals->finger[0].id = rep_suc_msg.id;
-  snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
-  globals->finger[0].port = rep_suc_msg.port;
-  XBT_INFO("→ Finger %d fixed!", globals->next_to_fix);
-  gras_socket_close(temp_sock);
-
-  globals->next_to_fix = (++globals->next_to_fix == globals->fingers) ?
-      0 : globals->next_to_fix;
-}
-
-static void check_predecessor()
-{
-  node_data_t *globals = (node_data_t *) gras_userdata_get();
-  xbt_socket_t temp_sock;
-  ping_t ping;
-  pong_t pong;
-  xbt_ex_t e;
-  if (globals->pre_id == -1) {
-    return;
-  }
-  TRY {
-    temp_sock = gras_socket_client(globals->pre_host, globals->pre_port);
-  }
-  CATCH(e) {
-    globals->pre_id = -1;
-    globals->pre_host[0] = 0;
-    globals->pre_port = 0;
-    xbt_ex_free(e);
-  }
-
-  ping.id = 0;
-  TRY {
-    gras_msg_send(temp_sock, "chord_ping", &ping);
-  }
-  CATCH(e) {
-    globals->pre_id = -1;
-    globals->pre_host[0] = 0;
-    globals->pre_port = 0;
-    xbt_ex_free(e);
-  }
-  TRY {
-    gras_msg_wait(60, "chord_pong", &temp_sock, &pong);
-  }
-  CATCH(e) {
-    globals->pre_id = -1;
-    globals->pre_host[0] = 0;
-    globals->pre_port = 0;
-    xbt_ex_free(e);
-  }
-  gras_socket_close(temp_sock);
-}
-
-int node(int argc, char **argv)
-{
-  node_data_t *globals = NULL;
-  xbt_socket_t temp_sock = NULL;
-  xbt_socket_t temp_sock2 = NULL;
-  get_suc_t get_suc_msg;
-  rep_suc_t rep_suc_msg;
-
-  xbt_ex_t e;
-
-  int create = 0;
-  int other_port = -1;
-  char *other_host;
-  notify_t notify_msg;
-  int l;
-
-  /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-
-  gras_os_sleep((15 - gras_os_getpid()) * 20);
-
-  globals = gras_userdata_new(node_data_t);
-
-  globals->id = atoi(argv[1]);
-  globals->port = atoi(argv[2]);
-  globals->fingers = 0;
-  globals->finger = NULL;
-  globals->pre_id = -1;
-  globals->pre_host[0] = 0;
-  globals->pre_port = -1;
-
-  snprintf(globals->host, 1024, gras_os_myname());
-
-  if (argc == 3) {
-    create = 1;
-  } else {
-    other_host = xbt_strdup(argv[3]);
-    other_port = atoi(argv[4]);
-  }
-
-  globals->sock = gras_socket_server(globals->port);
-  gras_os_sleep(1.0);
-
-  register_messages();
-
-  globals->finger = (finger_elem *) calloc(1, sizeof(finger_elem));
-  XBT_INFO("Launching node %s:%d", globals->host, globals->port);
-  if (create) {
-    XBT_INFO("→Creating ring");
-    globals->finger[0].id = globals->id;
-    snprintf(globals->finger[0].host, 1024, globals->host);
-    globals->finger[0].port = globals->port;
-  } else {
-    XBT_INFO("→Known node %s:%d", other_host, other_port);
-    XBT_INFO("→Contacting to determine successor");
-    TRY {
-      temp_sock = gras_socket_client(other_host, other_port);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to contact known host: %s");
-    }
-
-    get_suc_msg.id = globals->id;
-    TRY {
-      gras_msg_send(temp_sock, "chord_get_suc", &get_suc_msg);
-    }
-    CATCH_ANONYMOUS {
-      gras_socket_close(temp_sock);
-      RETHROWF("Unable to contact known host to get successor!: %s");
-    }
-
-    TRY {
-      XBT_INFO("Waiting for reply!");
-      gras_msg_wait(10., "chord_rep_suc", &temp_sock2, &rep_suc_msg);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("%s: Error waiting for successor:%s", globals->host);
-    }
-    globals->finger[0].id = rep_suc_msg.id;
-    snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
-    globals->finger[0].port = rep_suc_msg.port;
-    XBT_INFO("→Got successor : %d-%s:%d", globals->finger[0].id,
-          globals->finger[0].host, globals->finger[0].port);
-    gras_socket_close(temp_sock);
-    TRY {
-      temp_sock = gras_socket_client(globals->finger[0].host,
-                                     globals->finger[0].port);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to contact successor: %s");
-    }
-
-    notify_msg.id = globals->id;
-    snprintf(notify_msg.host, 1024, globals->host);
-    notify_msg.port = globals->port;
-    TRY {
-      gras_msg_send(temp_sock, "chord_notify", &notify_msg);
-    }
-    CATCH_ANONYMOUS {
-      RETHROWF("Unable to notify successor! %s");
-    }
-  }
-
-  gras_cb_register("chord_get_suc", &node_cb_get_suc_handler);
-  gras_cb_register("chord_notify", &node_cb_notify_handler);
-  /*gras_cb_register("chord_ping",&node_cb_ping_handler); */
-  /* gras_timer_repeat(600.,fix_fingers); */
-  /*while(1){ */
-
-  for (l = 0; l < 50; l++) {
-    TRY {
-      gras_msg_handle(6000000.0);
-    }
-    CATCH(e) {
-      xbt_ex_free(e);
-    }
-  }
-  /*} */
-
-  gras_socket_close(globals->sock);
-  free(globals);
-  gras_exit();
-  XBT_INFO("Done");
-  return (0);
-}
diff --git a/examples/gras/p2p/chord/chord.xml b/examples/gras/p2p/chord/chord.xml
deleted file mode 100644 (file)
index a56db93..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
-  <process host="Gatien" function="node">
-    <argument value="48"/>           <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Boivin"/>       <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-<!--    <argument value="McGee"/>         known host -->
-<!--    <argument value="4000"/>          known port -->
-    <argument value="56"/>           <!-- +1 host number -->
-    <argument value="Laroche"/>      <!-- +1 host id -->
-    <argument value="56"/>           <!-- +2 host number -->
-    <argument value="Laroche"/>      <!-- +2 host id -->
-    <argument value="56"/>           <!-- +4 host number -->
-    <argument value="Laroche"/>      <!-- +4 host id -->
-<!--    <argument value="56"/>            +8 host number -->
-<!--    <argument value="Laroche"/>       +8 host id -->
-<!--    <argument value="56"/>            +16 host number -->
-<!--    <argument value="Laroche"/>       +16 host id -->
-<!--    <argument value="56"/>            +32 host number -->
-<!--    <argument value="Laroche"/>       +32 host id -->
-  </process>
-
-  <process host="McGee" function="node">
-    <argument value="42"/>           <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="iRMX"/>        <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="51"/>           <!-- +1 host number -->
-    <argument value="Gatien"/>       <!-- +1 host id -->
-    <argument value="51"/>           <!-- +2 host number -->
-    <argument value="Gatien"/>       <!-- +2 host id -->
-    <argument value="56"/>           <!-- +4 host number -->
-    <argument value="Laroche"/>      <!-- +4 host id -->
-    <argument value="56"/>           <!-- +8 host number -->
-    <argument value="Laroche"/>      <!-- +8 host id -->
-<!--    <argument value="56"/>            +16 host number -->
-<!--    <argument value="Laroche"/>       +16 host id -->
-<!--    <argument value="56"/>            +32 host number -->
-<!--    <argument value="Laroche"/>       +32 host id -->
-  </process>
-
-  <process host="iRMX" function="node">
-    <argument value="38"/>       <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Geoff"/>               <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="48"/>           <!-- +1 host number -->
-    <argument value="McGee"/>        <!-- +1 host id -->
-    <argument value="48"/>           <!-- +2 host number -->
-    <argument value="McGee"/>        <!-- +2 host id -->
-    <argument value="48"/>           <!-- +4 host number -->
-    <argument value="McGee"/>        <!-- +4 host id -->
-    <argument value="51"/>           <!-- +8 host number -->
-    <argument value="Gatien"/>       <!-- +8 host id -->
-    <argument value="56"/>           <!-- +16 host number -->
-    <argument value="Laroche"/>      <!-- +16 host id -->
-<!--    <argument value="56"/>            +32 host number -->
-<!--    <argument value="Laroche"/>       +32 host id -->
-  </process>
-
-  <process host="Geoff" function="node">
-    <argument value="32"/>           <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="TeX"/>         <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="38"/>           <!-- +1 host number -->
-    <argument value="Disney"/>       <!-- +1 host id -->
-    <argument value="38"/>           <!-- +2 host number -->
-    <argument value="Disney"/>       <!-- +2 host id -->
-    <argument value="38"/>           <!-- +4 host number -->
-    <argument value="Disney"/>       <!-- +4 host id -->
-    <argument value="42"/>           <!-- +8 host number -->
-    <argument value="iRMX"/>         <!-- +8 host id -->
-    <argument value="48"/>           <!-- +16 host number -->
-    <argument value="McGee"/>        <!-- +16 host id -->
-<!--    <argument value="56"/>            +32 host number -->
-<!--    <argument value="Laroche"/>       +32 host id -->
-  </process>
-
-  <process host="TeX" function="node">
-    <argument value="21"/>           <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Boivin"/>    <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="32"/>           <!-- +1 host number -->
-    <argument value="Geoff"/>        <!-- +1 host id -->
-    <argument value="32"/>           <!-- +2 host number -->
-    <argument value="Geoff"/>        <!-- +2 host id -->
-    <argument value="32"/>           <!-- +4 host number -->
-    <argument value="Geoff"/>        <!-- +4 host id -->
-    <argument value="32"/>           <!-- +8 host number -->
-    <argument value="Geoff"/>        <!-- +8 host id -->
-    <argument value="38"/>           <!-- +16 host number -->
-    <argument value="Disney"/>       <!-- +16 host id -->
-    <argument value="56"/>           <!-- +32 host number -->
-    <argument value="Laroche"/>      <!-- +32 host id -->
-  </process>
-
-  <process host="Jean_Yves" function="node">
-    <argument value="14"/>           <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Boivin"/>       <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="21"/>           <!-- +1 host number -->
-    <argument value="TeX"/>          <!-- +1 host id -->
-    <argument value="21"/>           <!-- +2 host number -->
-    <argument value="TeX"/>          <!-- +2 host id -->
-    <argument value="21"/>           <!-- +4 host number -->
-    <argument value="TeX"/>          <!-- +4 host id -->
-    <argument value="32"/>           <!-- +8 host number -->
-    <argument value="Geoff"/>        <!-- +8 host id -->
-    <argument value="32"/>           <!-- +16 host number -->
-    <argument value="Geoff"/>        <!-- +16 host id -->
-    <argument value="48"/>           <!-- +32 host number -->
-    <argument value="McGee"/>        <!-- +32 host id -->
-  </process>
-
-  <process host="Boivin" function="node">
-    <argument value="8"/>            <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-    <argument value="Jacquelin"/>    <!-- known host -->
-    <argument value="4000"/>         <!-- known port -->
-    <argument value="14"/>           <!-- +1 host number -->
-    <argument value="Jean_Yves"/>    <!-- +1 host id -->
-    <argument value="14"/>           <!-- +2 host number -->
-    <argument value="Jean_Yves"/>    <!-- +2 host id -->
-    <argument value="14"/>           <!-- +4 host number -->
-    <argument value="Jean_Yves"/>    <!-- +4 host id -->
-    <argument value="21"/>           <!-- +8 host number -->
-    <argument value="TeX"/>          <!-- +8 host id -->
-    <argument value="32"/>           <!-- +16 host number -->
-    <argument value="Geoff"/>        <!-- +16 host id -->
-    <argument value="42"/>           <!-- +32 host number -->
-    <argument value="iRMX"/>         <!-- +32 host id -->
-  </process>
-
-  <process host="Jacquelin" function="node">
-    <argument value="1"/>            <!-- my id -->
-    <argument value="4000"/>         <!-- my port -->
-  </process>
-
-</platform>
diff --git a/examples/gras/p2p/chord/test_rl.in b/examples/gras/p2p/chord/test_rl.in
deleted file mode 100755 (executable)
index 572f16d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#! @BASH@ -e
-if [ x@EXEEXT@ = x ] ; then 
-#  exenv="libtool --mode=execute valgrind --show-reachable=yes --run-libc-freeres=no "
-  exenv=$SG_TEST_EXENV
-else
-  exenv=wine
-fi
-    
-$exenv ./chord_node@EXEEXT@ 4002 $@ &
-sleep 1
-$exenv ./chord_node@EXEEXT@ 127.0.0.1 4002 $@
diff --git a/examples/gras/p2p/chord/test_sg.in b/examples/gras/p2p/chord/test_sg.in
deleted file mode 100755 (executable)
index c54aa51..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-if [ x@EXEEXT@ = x ] ; then 
-  exenv=$SG_TEST_EXENV
-else
-  exenv=wine
-fi
-
-exec $exenv ./chord_simulator @top_srcdir@/examples/msg/msg_platform.xml @srcdir@/chord_deployment.xml $@
diff --git a/examples/gras/ping/CMakeLists.txt b/examples/gras/ping/CMakeLists.txt
deleted file mode 100644 (file)
index 4ba3de8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(ping_simulator
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-add_executable(ping_client
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-add_executable(ping_server
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/ping.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator ping ${CMAKE_CURRENT_SOURCE_DIR}/ping.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(ping_simulator simgrid pthread m )
-  target_link_libraries(ping_client gras pthread m )
-  target_link_libraries(ping_server gras pthread m )
-else()
-  target_link_libraries(ping_simulator simgrid)
-  target_link_libraries(ping_client gras)
-  target_link_libraries(ping_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ping.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/ping/ping.h b/examples/gras/ping/ping.h
deleted file mode 100644 (file)
index ffd57cf..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#ifndef PING_COMMON_H
-#define PING_COMMON_H
-
-#include "gras.h"
-
-/* register messages which may be sent (common to client and server) */
-void ping_register_messages(void);
-
-/* Function prototypes */
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-#endif
diff --git a/examples/gras/ping/ping.xml b/examples/gras/ping/ping.xml
deleted file mode 100644 (file)
index e74a853..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="server">
-     <argument value="4000"/>       <!-- port number -->
-  </process>
-  <process host="Fafard" function="client">
-     <argument value="Tremblay"/>   <!-- server host -->
-     <argument value="4000"/>       <!-- port number -->
-  </process>
-</platform>
diff --git a/examples/gras/ping/ping_client.c b/examples/gras/ping/ping_client.c
deleted file mode 100644 (file)
index c60456d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "ping.h"
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(Ping);
-
-static xbt_socket_t try_gras_socket_client(const char *host, int port)
-{
-  volatile xbt_socket_t sock = NULL;
-  xbt_ex_t e;
-  TRY {
-    sock = gras_socket_client(host, port);
-  }
-  CATCH(e) {
-    if (e.category != system_error)
-      /* dunno what happened, let the exception go through */
-      RETHROWF("Unable to connect to the server: %s");
-    xbt_ex_free(e);
-  }
-  return sock;
-}
-
-int client(int argc, char *argv[])
-{
-  xbt_socket_t toserver = NULL;        /* peer */
-
-  xbt_socket_t from;
-  int ping, pong;
-
-  const char *host = "127.0.0.1";
-  int port = 4000;
-
-  /* 1. Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the server's address. The command line override defaults when specified */
-  if (argc == 3) {
-    host = argv[1];
-    port = atoi(argv[2]);
-  }
-
-  XBT_INFO("Launch client (server on %s:%d)", host, port);
-
-  /* 3. Create a socket to speak to the server */
-  while (!(toserver = try_gras_socket_client(host, port)))
-    gras_os_sleep(0.05);
-
-  XBT_INFO("Connected to %s:%d.", host, port);
-
-  /* 4. Register the messages.
-     See, it doesn't have to be done completely at the beginning, only before use */
-  ping_register_messages();
-
-  /* 5. Keep the user informed of what's going on */
-  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 6. Prepare and send the ping message to the server */
-  ping = 1234;
-  TRY {
-    gras_msg_send(toserver, "ping", &ping);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(toserver);
-    RETHROWF("Failed to send PING to server: %s");
-  }
-  XBT_INFO(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
-        ping, xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 7. Wait for the answer from the server, and deal with issues */
-  TRY {
-    gras_msg_wait(6000, "pong", &from, &pong);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(toserver);
-    RETHROWF("Why can't I get my PONG message like everyone else: %s");
-  }
-
-  /* 8. Keep the user informed of what's going on, again */
-  XBT_INFO(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
-        pong, xbt_socket_peer_name(from), xbt_socket_peer_port(from));
-
-  /* 9. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(toserver);
-  XBT_INFO("Done.");
-  gras_exit();
-  return 0;
-}                               /* end_of_client */
diff --git a/examples/gras/ping/ping_common.c b/examples/gras/ping/ping_common.c
deleted file mode 100644 (file)
index f0b6e49..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#include "ping.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(Ping, "Messages specific to this example");
-
-/* register messages which may be sent (common to client and server) */
-void ping_register_messages(void)
-{
-  gras_msgtype_declare("ping", xbt_datadesc_by_name("int"));
-  gras_msgtype_declare("pong", xbt_datadesc_by_name("int"));
-  XBT_INFO("Messages registered");
-}
diff --git a/examples/gras/ping/ping_server.c b/examples/gras/ping/ping_server.c
deleted file mode 100644 (file)
index ccb590c..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ping - ping/pong demo of GRAS features                                   */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "ping.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(Ping);
-
-/* Global private data */
-typedef struct {
-  xbt_socket_t sock;
-  int endcondition;
-} server_data_t;
-
-
-static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  /* 1. Get the payload into the msg variable, and retrieve my caller */
-  int msg = *(int *) payload;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  /* 2. Retrieve the server's state (globals) */
-
-  server_data_t *globals = (server_data_t *) gras_userdata_get();
-  globals->endcondition = 0;
-
-  /* 3. Log which client connected */
-  XBT_INFO(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
-        msg,
-        xbt_socket_peer_name(expeditor),
-        xbt_socket_peer_port(expeditor));
-
-  /* 4. Change the value of the msg variable */
-  msg = 4321;
-  /* 5. Send it back as payload of a pong message to the expeditor */
-  TRY {
-    gras_msg_send(expeditor, "pong", &msg);
-
-    /* 6. Deal with errors: add some details to the exception */
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(globals->sock);
-    RETHROWF("Unable answer with PONG: %s");
-  }
-
-  XBT_INFO(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
-
-  /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
-  globals->endcondition = 1;
-
-  /* 8. Tell GRAS that we consummed this message */
-  return 0;
-}                               /* end_of_server_cb_ping_handler */
-
-int server(int argc, char *argv[])
-{
-  server_data_t *globals;
-
-  int port = 4000;
-
-  /* 1. Init the GRAS infrastructure and declare my globals */
-  gras_init(&argc, argv);
-  globals = gras_userdata_new(server_data_t);
-
-  /* 2. Get the port I should listen on from the command line, if specified */
-  if (argc == 2) {
-    port = atoi(argv[1]);
-  }
-
-  XBT_INFO("Launch server (port=%d)", port);
-
-  /* 3. Create my master socket */
-  globals->sock = gras_socket_server(port);
-
-  /* 4. Register the known messages. This function is called twice here, but it's because
-     this file also acts as regression test, no need to do so yourself of course. */
-  ping_register_messages();
-  ping_register_messages();     /* just to make sure it works ;) */
-
-  /* 5. Register my callback */
-  gras_cb_register("ping", &server_cb_ping_handler);
-
-  XBT_INFO(">>>>>>>> Listening on port %d <<<<<<<<",
-        xbt_socket_my_port(globals->sock));
-  globals->endcondition = 0;
-
-  /* 6. Wait up to 10 minutes for an incoming message to handle */
-  gras_msg_handle(10.0);
-
-  /* 7. Housekeeping */
-  if (!globals->endcondition)
-    XBT_WARN
-        ("An error occured, the endcondition was not set by the callback");
-
-  /* 8. Free the allocated resources, and shut GRAS down */
-  gras_socket_close(globals->sock);
-  free(globals);
-  XBT_INFO("Done.");
-  gras_exit();
-
-  return 0;
-}                               /* end_of_server */
diff --git a/examples/gras/ping/test_rl.tesh b/examples/gras/ping/test_rl.tesh
deleted file mode 100755 (executable)
index 859ba97..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_ENV ./ping_server$EXEEXT 4302 --log=root.fmt=%P:%t%e%m%n
-> server:main Launch server (port=4302)
-> server:main Messages registered
-> server:main Messages registered
-> server:main >>>>>>>> Listening on port 4302 <<<<<<<<
-> server:main >>>>>>>> Got message PING(1234) from 127.0.0.1:5001 <<<<<<<<
-> server:main >>>>>>>> Answered with PONG(4321) <<<<<<<<
-> server:main Done.
-> server:main Exiting GRAS
-
-# give the server a chance to acquire the expected port number
-$ $SG_TEST_ENV sleep 1
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_ENV ./ping_client$EXEEXT 127.0.0.1 4302 --log=root.fmt=%P:%t%e%m%n
-> client:main Launch client (server on 127.0.0.1:4302)
-> client:main Connected to 127.0.0.1:4302.
-> client:main Messages registered
-> client:main >>>>>>>> Connected to server which is on 127.0.0.1:4302 <<<<<<<<
-> client:main >>>>>>>> Message PING(1234) sent to 127.0.0.1:4302 <<<<<<<<
-> client:main >>>>>>>> Got PONG(4321) from 127.0.0.1:4302 <<<<<<<<
-> client:main Done.
-> client:main Exiting GRAS
diff --git a/examples/gras/ping/test_sg_32.tesh b/examples/gras/ping/test_sg_32.tesh
deleted file mode 100644 (file)
index ff401a3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-p Runs the 'ping' test within the simulator (simulation times valid for 32bits architectures)
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
-> [  0.000195] (1:server@Tremblay) Messages registered
-> [  0.000195] (1:server@Tremblay) Messages registered
-> [  0.000195] (1:server@Tremblay) >>>>>>>> Listening on port 4000 <<<<<<<<
-> [  0.000195] (2:client@Fafard) Connected to Tremblay:4000.
-> [  0.000195] (2:client@Fafard) Messages registered
-> [  0.000195] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [  0.025904] (1:server@Tremblay) >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
-> [  0.025904] (2:client@Fafard) >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
-> [  0.051613] (1:server@Tremblay) >>>>>>>> Answered with PONG(4321) <<<<<<<<
-> [  0.051613] (1:server@Tremblay) Done.
-> [  0.051613] (1:server@Tremblay) Exiting GRAS
-> [  0.051613] (2:client@Fafard) >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
-> [  0.051613] (2:client@Fafard) Done.
-> [  0.051613] (2:client@Fafard) Exiting GRAS
diff --git a/examples/gras/ping/test_sg_64.tesh b/examples/gras/ping/test_sg_64.tesh
deleted file mode 100644 (file)
index bbc4c68..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-p Runs the 'ping' test within the simulator (simulation times valid for 64bits architectures)
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
-> [  0.000195] (1:server@Tremblay) Messages registered
-> [  0.000195] (1:server@Tremblay) Messages registered
-> [  0.000195] (1:server@Tremblay) >>>>>>>> Listening on port 4000 <<<<<<<<
-> [  0.000195] (2:client@Fafard) Connected to Tremblay:4000.
-> [  0.000195] (2:client@Fafard) Messages registered
-> [  0.000195] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [  0.025904] (1:server@Tremblay) >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
-> [  0.025904] (2:client@Fafard) >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
-> [  0.051613] (1:server@Tremblay) >>>>>>>> Answered with PONG(4321) <<<<<<<<
-> [  0.051613] (1:server@Tremblay) Done.
-> [  0.051613] (1:server@Tremblay) Exiting GRAS
-> [  0.051613] (2:client@Fafard) >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
-> [  0.051613] (2:client@Fafard) Done.
-> [  0.051613] (2:client@Fafard) Exiting GRAS
diff --git a/examples/gras/pmm/CMakeLists.txt b/examples/gras/pmm/CMakeLists.txt
deleted file mode 100644 (file)
index 46d8db7..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_slave.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_master.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(pmm_simulator ${CMAKE_CURRENT_BINARY_DIR}/_pmm_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/pmm.c)
-add_executable(pmm_slave     ${CMAKE_CURRENT_BINARY_DIR}/_pmm_slave.c ${CMAKE_CURRENT_SOURCE_DIR}/pmm.c)
-add_executable(pmm_master    ${CMAKE_CURRENT_BINARY_DIR}/_pmm_master.c ${CMAKE_CURRENT_SOURCE_DIR}/pmm.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_slave.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_pmm_master.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/pmm.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator pmm ${CMAKE_CURRENT_SOURCE_DIR}/pmm.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(pmm_simulator simgrid pthread m )
-  target_link_libraries(pmm_slave gras pthread m )
-  target_link_libraries(pmm_master gras pthread m )
-else()
-  target_link_libraries(pmm_simulator simgrid)
-  target_link_libraries(pmm_slave gras)
-  target_link_libraries(pmm_master gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/pmm.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/pmm.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/make_deployment.pl
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/pmm/make_deployment.pl b/examples/gras/pmm/make_deployment.pl
deleted file mode 100755 (executable)
index 6d8fe8e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-
-sub usage {
-    print STDERR <<EOH
-Usage: make_deployment.pl platform_file.xml nb_host 
-  
-This script generates a deployment file for the PMM program. It takes 
-a SimGrid platform file as first argument and the number of wanted peers as 
-second (optional) argument. If the amount of peers exceeds the amount of 
-available hosts in the deployment file, several peers will be placed on the
-same host.
-      
-EOH
-      ;
-    die "\n";
-}
-
-my $input    = shift @ARGV || usage();
-my $nb_slaves = shift @ARGV || "";
-# my $source   = shift || "";
-
-my @host;
-
-open IN,$input || die "Cannot open $input: $!\n";
-
-while (<IN>) {
-  next unless /<host id="([^"]*)"/; # "
-  
-  push @host, $1;
-}
-
-# map { print "$_\n" } @host;
-
-die "No host found in $input. Is it really a SimGrid platform file?\nCheck that you didn't pass a deployment file, for example.\n"
-  unless (scalar @host);
-
-if (! $nb_slaves) {
-    $nb_slaves = (scalar @host) - 1;
-}
-
-#
-# generate the file. Master first (quite logical, indeed)
-
-my $port_num = 4000;
-my $master = $host[0];
-
-print "<?xml version='1.0'?>\n";
-print "<!DOCTYPE platform SYSTEM \"simgrid.dtd\">\n";
-print "<platform version=\"2\">\n\n";
-print "  <!-- The master, argument :: port number -->\n";
-print "  <process host=\"$master\" function=\"master\">\n";
-print "    <argument value=\"$port_num\"/>\n";
-print "  </process>\n";
-
-# Start the slaves also
-# reset iterators
-my $it_host=1;
-
-for (my $i=0; $i<$nb_slaves; $i++) {
-  print "  <process host=\"".$host[$it_host]."\" function=\"slave\"><argument value=\"$master:$port_num\"/></process>\n";
-    
-  $it_host ++;
-  if ($it_host == scalar @host) {
-    $it_host = 0;
-  }
-}
-
-
-print "</platform>\n";
-
diff --git a/examples/gras/pmm/pmm.c b/examples/gras/pmm/pmm.c
deleted file mode 100644 (file)
index 38c834c..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-/* pmm - parallel matrix multiplication "double diffusion"                  */
-
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "gras.h"
-#include "xbt/matrix.h"
-#include "amok/peermanagement.h"
-
-#define PROC_MATRIX_SIZE 3
-#define NEIGHBOR_COUNT PROC_MATRIX_SIZE - 1
-#define SLAVE_COUNT (PROC_MATRIX_SIZE*PROC_MATRIX_SIZE)
-
-#define DATA_MATRIX_SIZE 18
-const int submatrix_size = DATA_MATRIX_SIZE / PROC_MATRIX_SIZE;
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(pmm, "Parallel Matrix Multiplication");
-
-/* struct for recovering results */
-XBT_DEFINE_TYPE(s_result, struct s_result {
-                 int linepos; int rowpos;
-                 xbt_matrix_t C XBT_ANNOTE(subtype, double);
-                 });
-
-typedef struct s_result result_t;
-
-/* struct to send initial data to slave */
-XBT_DEFINE_TYPE(s_pmm_assignment, struct s_pmm_assignment {
-                 int linepos;
-                 int rowpos;
-                 xbt_peer_t line[NEIGHBOR_COUNT];
-                 xbt_peer_t row[NEIGHBOR_COUNT];
-                 xbt_matrix_t A XBT_ANNOTE(subtype, double);
-                 xbt_matrix_t B XBT_ANNOTE(subtype, double);
-                 });
-
-typedef struct s_pmm_assignment s_pmm_assignment_t;
-
-/* register messages which may be sent (common to client and server) */
-static void register_messages(void)
-{
-  xbt_datadesc_type_t result_type;
-  xbt_datadesc_type_t pmm_assignment_type;
-
-  xbt_datadesc_set_const("NEIGHBOR_COUNT", NEIGHBOR_COUNT);
-  result_type = xbt_datadesc_by_symbol(s_result);
-  pmm_assignment_type = xbt_datadesc_by_symbol(s_pmm_assignment);
-
-  /* receive a final result from slave */
-  gras_msgtype_declare("result", result_type);
-
-  /* send from master to slave to assign a position and some data */
-  gras_msgtype_declare("pmm_slave", pmm_assignment_type);
-
-  /* send data between slaves */
-  gras_msgtype_declare("dataA",
-                       xbt_datadesc_matrix(xbt_datadesc_by_name
-                                            ("double"), NULL));
-  gras_msgtype_declare("dataB",
-                       xbt_datadesc_matrix(xbt_datadesc_by_name
-                                            ("double"), NULL));
-
-  /* synchronization message */
-  gras_msgtype_declare("pmm_sync", 0);
-}
-
-static xbt_socket_t try_gras_socket_client_from_string(const char *host)
-{
-  volatile xbt_socket_t sock = NULL;
-  xbt_ex_t e;
-  TRY {
-    sock = gras_socket_client_from_string(host);
-  }
-  CATCH(e) {
-    if (e.category != system_error)
-      /* dunno what happened, let the exception go through */
-      RETHROWF("Unable to connect to the server: %s");
-    xbt_ex_free(e);
-  }
-  return sock;
-}
-
-static void my_gras_msg_wait(double timeout, const char* msgt_want,
-                             xbt_socket_t* expeditor, void *payload,
-                             const char *error_msg)
-{
-  TRY {
-    gras_msg_wait(timeout, msgt_want, expeditor, payload);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("%s: %s", error_msg);
-  }
-}
-
-/* Function prototypes */
-int slave(int argc, char *argv[]);
-int master(int argc, char *argv[]);
-
-
-/* **********************************************************************
- * master code
- * **********************************************************************/
-
-/* Global private data */
-typedef struct {
-  int nbr_row, nbr_line;
-  int remaining_step;
-  int remaining_ack;
-} master_data_t;
-
-int master(int argc, char *argv[])
-{
-
-  int i;
-
-  xbt_matrix_t A, B, C;
-  result_t result;
-
-  xbt_socket_t from;
-
-  xbt_dynar_t peers;            /* group of slaves */
-  xbt_peer_t grid[SLAVE_COUNT]; /* The slaves as an array */
-  xbt_socket_t socket[SLAVE_COUNT];    /* sockets for brodcast to slaves */
-
-  /* Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-  amok_pm_init();
-  register_messages();
-
-  /* Initialize data matrices */
-  A = xbt_matrix_double_new_id(DATA_MATRIX_SIZE, DATA_MATRIX_SIZE);
-  B = xbt_matrix_double_new_seq(DATA_MATRIX_SIZE, DATA_MATRIX_SIZE);
-  C = xbt_matrix_double_new_zeros(DATA_MATRIX_SIZE, DATA_MATRIX_SIZE);
-
-  /* Create the connexions */
-  xbt_assert(argc > 1, "Usage: master <port>");
-  gras_socket_server(atoi(argv[1]));
-  peers = amok_pm_group_new("pmm");
-
-  /* friends, we're ready. Come and play */
-  XBT_INFO("Wait for peers for 2 sec");
-  gras_msg_handleall(2);
-  while (xbt_dynar_length(peers) < SLAVE_COUNT) {
-    XBT_INFO("Got only %ld pals (of %d). Wait 2 more seconds",
-        xbt_dynar_length(peers),SLAVE_COUNT);
-    gras_msg_handleall(2);
-  }
-  XBT_INFO("Good. Got %ld pals", xbt_dynar_length(peers));
-
-  for (i = 0; i < xbt_dynar_length(peers) && i < SLAVE_COUNT; i++) {
-    xbt_dynar_get_cpy(peers, i, &grid[i]);
-    socket[i] = gras_socket_client(grid[i]->name, grid[i]->port);
-  }
-  xbt_assert(i == SLAVE_COUNT,
-              "Not enough slaves for this setting (got %d of %d). Change the deployment file",
-              i, SLAVE_COUNT);
-
-  /* Kill surnumerous slaves */
-  for (i = SLAVE_COUNT; i < xbt_dynar_length(peers);) {
-    xbt_peer_t h;
-
-    xbt_dynar_remove_at(peers, i, &h);
-    XBT_INFO("Too much slaves. Killing %s:%d", h->name, h->port);
-    amok_pm_kill_hp(h->name, h->port);
-    free(h);
-  }
-
-
-  /* Assign job to slaves */
-  int row = 0, line = 0;
-  XBT_INFO("XXXXXXXXXXXXXXXXXXXXXX begin Multiplication");
-  for (i = 0; i < SLAVE_COUNT; i++) {
-    s_pmm_assignment_t assignment;
-    int j, k;
-
-    assignment.linepos = line;  // assigned line
-    assignment.rowpos = row;    // assigned row
-
-    /* Neiborhood */
-    for (j = 0, k = 0; j < PROC_MATRIX_SIZE; j++) {
-      if (i != j * PROC_MATRIX_SIZE + (row)) {
-        assignment.row[k] = grid[j * PROC_MATRIX_SIZE + (row)];
-        k++;
-      }
-    }
-    for (j = 0, k = 0; j < PROC_MATRIX_SIZE; j++) {
-      if (i != (line) * PROC_MATRIX_SIZE + j) {
-        assignment.line[k] = grid[(line) * PROC_MATRIX_SIZE + j];
-        k++;
-      }
-    }
-
-    assignment.A = xbt_matrix_new_sub(A,
-                                      submatrix_size, submatrix_size,
-                                      submatrix_size * line,
-                                      submatrix_size * row, NULL);
-    assignment.B =
-        xbt_matrix_new_sub(B, submatrix_size, submatrix_size,
-                           submatrix_size * line, submatrix_size * row,
-                           NULL);
-    row++;
-    if (row >= PROC_MATRIX_SIZE) {
-      row = 0;
-      line++;
-    }
-
-    gras_msg_send(socket[i], "pmm_slave", &assignment);
-    xbt_matrix_free(assignment.A);
-    xbt_matrix_free(assignment.B);
-  }
-
-  /* synchronize slaves */
-  for (i = 0; i < PROC_MATRIX_SIZE; i++) {
-    int j;
-    for (j = 0; j < SLAVE_COUNT; j++)
-      gras_msg_wait(600, "pmm_sync", NULL, NULL);
-    for (j = 0; j < SLAVE_COUNT; j++)
-      gras_msg_send(socket[j], "pmm_sync", NULL);
-  }
-
-  /* Retrieve the results */
-  for (i = 0; i < SLAVE_COUNT; i++) {
-    gras_msg_wait(6000, "result", &from, &result);
-    XBT_VERB("%d slaves are done already. Waiting for %d", i + 1,
-          SLAVE_COUNT);
-    xbt_matrix_copy_values(C, result.C, submatrix_size, submatrix_size,
-                           submatrix_size * result.linepos,
-                           submatrix_size * result.rowpos, 0, 0, NULL);
-    xbt_matrix_free(result.C);
-  }
-  /*    end of gather   */
-
-  if (xbt_matrix_double_is_seq(C))
-    XBT_INFO("XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations");
-  else {
-    XBT_WARN("the result seems wrong");
-    if (DATA_MATRIX_SIZE < 30) {
-      XBT_INFO("The Result of Multiplication is :");
-      xbt_matrix_dump(C, "C:res", 0, xbt_matrix_dump_display_double);
-    } else {
-      XBT_INFO("Matrix size too big (%d>30) to be displayed here",
-            DATA_MATRIX_SIZE);
-    }
-  }
-
-  amok_pm_group_shutdown("pmm");        /* Ok, we're out of here */
-
-  for (i = 0; i < SLAVE_COUNT; i++)
-    gras_socket_close(socket[i]);
-
-  xbt_matrix_free(A);
-  xbt_matrix_free(B);
-  xbt_matrix_free(C);
-  gras_exit();
-  return 0;
-}                               /* end_of_master */
-
-/* **********************************************************************
- * slave code
- * **********************************************************************/
-
-static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  /* Recover my initialized Data and My Position */
-  s_pmm_assignment_t assignment = *(s_pmm_assignment_t *) payload;
-  xbt_socket_t master = gras_msg_cb_ctx_from(ctx);
-
-  int step, l;
-  xbt_matrix_t bA = xbt_matrix_new(submatrix_size, submatrix_size,
-                                   sizeof(double), NULL);
-  xbt_matrix_t bB = xbt_matrix_new(submatrix_size, submatrix_size,
-                                   sizeof(double), NULL);
-
-  int myline, myrow;
-  xbt_matrix_t mydataA, mydataB;
-  xbt_matrix_t bC =
-      xbt_matrix_double_new_zeros(submatrix_size, submatrix_size);
-
-  result_t result;
-
-  xbt_socket_t from;           /* to exchange data with my neighbor */
-
-  /* sockets for brodcast to other slave */
-  xbt_socket_t socket_line[PROC_MATRIX_SIZE - 1];
-  xbt_socket_t socket_row[PROC_MATRIX_SIZE - 1];
-  memset(socket_line, 0, sizeof(socket_line));
-  memset(socket_row, 0, sizeof(socket_row));
-
-  int i;
-
-  gras_os_sleep(1);             /* wait for my pals */
-
-  myline = assignment.linepos;
-  myrow = assignment.rowpos;
-  mydataA = assignment.A;
-  mydataB = assignment.B;
-
-  if (gras_if_RL())
-    XBT_INFO("Receive my pos and assignment");
-  else
-    XBT_INFO("Receive my pos (%d,%d) and assignment", myline, myrow);
-
-  /* Get my neighborhood from the assignment message (skipping myself) */
-  for (i = 0; i < PROC_MATRIX_SIZE - 1; i++) {
-    socket_line[i] = gras_socket_client(assignment.line[i]->name,
-                                        assignment.line[i]->port);
-    xbt_peer_free(assignment.line[i]);
-  }
-  for (i = 0; i < PROC_MATRIX_SIZE - 1; i++) {
-    socket_row[i] = gras_socket_client(assignment.row[i]->name,
-                                       assignment.row[i]->port);
-    xbt_peer_free(assignment.row[i]);
-  }
-
-  for (step = 0; step < PROC_MATRIX_SIZE; step++) {
-    gras_msg_send(master, "pmm_sync", NULL);
-    gras_msg_wait(600, "pmm_sync", NULL, NULL);
-
-    /* a line brodcast */
-    if (myline == step) {
-      XBT_VERB("LINE: step(%d) = Myline(%d). Broadcast my data.", step,
-            myline);
-      for (l = 0; l < PROC_MATRIX_SIZE - 1; l++) {
-        XBT_VERB("LINE:   Send to %s", xbt_socket_peer_name(socket_row[l]));
-        gras_msg_send(socket_row[l], "dataB", &mydataB);
-      }
-
-
-      xbt_matrix_free(bB);
-      bB = xbt_matrix_new_sub(mydataB,
-                              submatrix_size, submatrix_size, 0, 0, NULL);
-    } else {
-      xbt_matrix_free(bB);
-      my_gras_msg_wait(600, "dataB", &from, &bB,
-                       "Can't get a data message from line");
-      XBT_VERB("LINE: step(%d) <> Myline(%d). Receive data from %s", step,
-            myline, xbt_socket_peer_name(from));
-    }
-
-    /* a row brodcast */
-    if (myrow == step) {
-      XBT_VERB("ROW: step(%d)=myrow(%d). Broadcast my data.", step, myrow);
-      for (l = 1; l < PROC_MATRIX_SIZE; l++) {
-        XBT_VERB("ROW:   Send to %s",
-              xbt_socket_peer_name(socket_line[l - 1]));
-        gras_msg_send(socket_line[l - 1], "dataA", &mydataA);
-      }
-      xbt_matrix_free(bA);
-      bA = xbt_matrix_new_sub(mydataA,
-                              submatrix_size, submatrix_size, 0, 0, NULL);
-    } else {
-      xbt_matrix_free(bA);
-      my_gras_msg_wait(1200, "dataA", &from, &bA,
-                       "Can't get a data message from row");
-      XBT_VERB("ROW: step(%d)<>myrow(%d). Receive data from %s", step, myrow,
-            xbt_socket_peer_name(from));
-    }
-    xbt_matrix_double_addmult(bA, bB, bC);
-
-  }
-
-  /* send Result to master */
-  result.C = bC;
-  result.linepos = myline;
-  result.rowpos = myrow;
-
-  TRY {
-    gras_msg_send(master, "result", &result);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Failed to send answer to server: %s");
-  }
-  XBT_VERB(">>>>>>>> Result sent to %s:%d <<<<<<<<",
-        xbt_socket_peer_name(master), xbt_socket_peer_port(master));
-  /*  Free the allocated resources, and shut GRAS down */
-
-  xbt_matrix_free(bA);
-  xbt_matrix_free(bB);
-  xbt_matrix_free(bC);
-
-  xbt_matrix_free(mydataA);
-  xbt_matrix_free(mydataB);
-  /* FIXME: some are said to be unknown 
-     gras_socket_close(master);
-     gras_socket_close(from);
-     for (l=0; l < PROC_MATRIX_SIZE-1; l++) {
-     if (socket_line[l])
-     gras_socket_close(socket_line[l]);
-     if (socket_row[l])
-     gras_socket_close(socket_row[l]); 
-     } */
-
-  return 0;
-}
-
-int slave(int argc, char *argv[])
-{
-  xbt_socket_t mysock;
-  xbt_socket_t master = NULL;
-  int rank;
-
-  /* Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-  amok_pm_init();
-  if (argc != 3 && argc != 2)
-    xbt_die("Usage: slave masterhost:masterport [rank]");
-  if (argc == 2)
-    rank = -1;
-  else
-    rank = atoi(argv[2]);
-
-  /*  Register the known messages and my callback */
-  register_messages();
-  gras_cb_register("pmm_slave", pmm_worker_cb);
-
-  /* Create the connexions */
-  mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  XBT_INFO("Sensor %d starting", rank);
-  while (!(master = try_gras_socket_client_from_string(argv[1])))
-    gras_os_sleep(0.5);
-
-  /* Join and run the group */
-  rank = amok_pm_group_join(master, "pmm");
-  amok_pm_mainloop(600);
-
-  /* housekeeping */
-  gras_socket_close(mysock);
-  //  gras_socket_close(master); Unknown
-  gras_exit();
-  return 0;
-}                               /* end_of_slave */
diff --git a/examples/gras/pmm/pmm.xml b/examples/gras/pmm/pmm.xml
deleted file mode 100644 (file)
index 7cb191a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
-  <process host="Jacquelin" function="master">
-     <argument value="4242"/>
-  </process>
-  
-  <process host="Boivin"    function="slave"><argument value="Jacquelin:4242"/><argument value="0"/></process>
-  <process host="Jean_Yves" function="slave"><argument value="Jacquelin:4242"/><argument value="1"/></process>
-  <process host="TeX"       function="slave"><argument value="Jacquelin:4242"/><argument value="2"/></process>
-  <process host="Geoff"     function="slave"><argument value="Jacquelin:4242"/><argument value="3"/></process>
-  <process host="Disney"    function="slave"><argument value="Jacquelin:4242"/><argument value="4"/></process>
-  <process host="iRMX"      function="slave"><argument value="Jacquelin:4242"/><argument value="5"/></process>
-  <process host="McGee"     function="slave"><argument value="Jacquelin:4242"/><argument value="6"/></process>
-  <process host="Gatien"    function="slave"><argument value="Jacquelin:4242"/><argument value="7"/></process>
-  <process host="Laroche"   function="slave"><argument value="Jacquelin:4242"/><argument value="8"/></process>
-</platform>
diff --git a/examples/gras/pmm/test_rl.tesh b/examples/gras/pmm/test_rl.tesh
deleted file mode 100755 (executable)
index ccd65ad..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Ignore the output of slaves since it depends on the order of connexion
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 0 --log=root.fmt:%m%n
-> Sensor 0 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 1 --log=root.fmt:%m%n
-> Sensor 1 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 2 --log=root.fmt:%m%n
-> Sensor 2 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 3 --log=root.fmt:%m%n
-> Sensor 3 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 4 --log=root.fmt:%m%n
-> Sensor 4 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 5 --log=root.fmt:%m%n
-> Sensor 5 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 6 --log=root.fmt:%m%n
-> Sensor 6 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 7 --log=root.fmt:%m%n
-> Sensor 7 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_slave$EXEEXT 127.0.0.1:4242 8 --log=root.fmt:%m%n
-> Sensor 8 starting
-> Receive my pos and assignment
-> Exiting GRAS
-
-! timeout no
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./pmm_master$EXEEXT 4242 --log=root.fmt:%m%n
-> Wait for peers for 2 sec
-> Good. Got 9 pals
-> XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
-> XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
-> Exiting GRAS
diff --git a/examples/gras/pmm/test_sg_32.tesh b/examples/gras/pmm/test_sg_32.tesh
deleted file mode 100644 (file)
index 61f1d78..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-! output sort 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%2i:%P@%h)%e%m%n"
-> [  0.000000] ( 0:@) Configuration change: Set 'network/crosstraffic' to '0'
-> [  0.000195] ( 1:master@Jacquelin) Wait for peers for 2 sec
-> [  0.000195] ( 2:slave@Boivin) Sensor 0 starting
-> [  0.000195] ( 3:slave@Jean_Yves) Sensor 1 starting
-> [  0.000195] ( 4:slave@TeX) Sensor 2 starting
-> [  0.000195] ( 5:slave@Geoff) Sensor 3 starting
-> [  0.000195] ( 6:slave@Disney) Sensor 4 starting
-> [  0.000195] ( 7:slave@iRMX) Sensor 5 starting
-> [  0.000195] ( 8:slave@McGee) Sensor 6 starting
-> [  0.000195] ( 9:slave@Gatien) Sensor 7 starting
-> [  0.000195] (10:slave@Laroche) Sensor 8 starting
-> [  3.601779] ( 1:master@Jacquelin) Got only 1 pals (of 9). Wait 2 more seconds
-> [  7.400400] ( 1:master@Jacquelin) Got only 4 pals (of 9). Wait 2 more seconds
-> [  9.400410] ( 1:master@Jacquelin) Got only 6 pals (of 9). Wait 2 more seconds
-> [ 13.504195] ( 1:master@Jacquelin) Got only 7 pals (of 9). Wait 2 more seconds
-> [ 15.667050] ( 1:master@Jacquelin) Good. Got 9 pals
-> [ 15.668806] ( 1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
-> [ 18.478552] (10:slave@Laroche) Receive my pos (0,0) and assignment
-> [ 19.532770] ( 2:slave@Boivin) Receive my pos (0,1) and assignment
-> [ 20.462558] ( 3:slave@Jean_Yves) Receive my pos (0,2) and assignment
-> [ 22.284313] ( 4:slave@TeX) Receive my pos (1,0) and assignment
-> [ 22.289915] ( 5:slave@Geoff) Receive my pos (1,1) and assignment
-> [ 24.122689] ( 6:slave@Disney) Receive my pos (1,2) and assignment
-> [ 27.181717] ( 7:slave@iRMX) Receive my pos (2,0) and assignment
-> [ 28.074555] ( 8:slave@McGee) Receive my pos (2,1) and assignment
-> [ 29.355457] ( 9:slave@Gatien) Receive my pos (2,2) and assignment
-> [ 91.389749] ( 1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
-> [ 93.190583] (10:slave@Laroche) Exiting GRAS
-> [ 94.239660] ( 2:slave@Boivin) Exiting GRAS
-> [ 95.164943] ( 3:slave@Jean_Yves) Exiting GRAS
-> [ 96.977725] ( 4:slave@TeX) Exiting GRAS
-> [ 96.983260] ( 5:slave@Geoff) Exiting GRAS
-> [ 98.806993] ( 6:slave@Disney) Exiting GRAS
-> [101.850845] ( 7:slave@iRMX) Exiting GRAS
-> [102.739392] ( 8:slave@McGee) Exiting GRAS
-> [104.014024] ( 1:master@Jacquelin) Exiting GRAS
-> [104.014024] ( 9:slave@Gatien) Exiting GRAS
diff --git a/examples/gras/pmm/test_sg_64.tesh b/examples/gras/pmm/test_sg_64.tesh
deleted file mode 100644 (file)
index ae06089..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#! ./tesh
-
-! output sort 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%2i:%P@%h)%e%m%n"
-> [  0.000000] ( 0:@) Configuration change: Set 'network/crosstraffic' to '0'
-> [  0.000195] ( 1:master@Jacquelin) Wait for peers for 2 sec
-> [  0.000195] ( 2:slave@Boivin) Sensor 0 starting
-> [  0.000195] ( 3:slave@Jean_Yves) Sensor 1 starting
-> [  0.000195] ( 4:slave@TeX) Sensor 2 starting
-> [  0.000195] ( 5:slave@Geoff) Sensor 3 starting
-> [  0.000195] ( 6:slave@Disney) Sensor 4 starting
-> [  0.000195] ( 7:slave@iRMX) Sensor 5 starting
-> [  0.000195] ( 8:slave@McGee) Sensor 6 starting
-> [  0.000195] ( 9:slave@Gatien) Sensor 7 starting
-> [  0.000195] (10:slave@Laroche) Sensor 8 starting
-> [  3.601779] ( 1:master@Jacquelin) Got only 1 pals (of 9). Wait 2 more seconds
-> [  7.400400] ( 1:master@Jacquelin) Got only 4 pals (of 9). Wait 2 more seconds
-> [  9.400410] ( 1:master@Jacquelin) Got only 6 pals (of 9). Wait 2 more seconds
-> [ 13.504195] ( 1:master@Jacquelin) Got only 7 pals (of 9). Wait 2 more seconds
-> [ 15.667050] ( 1:master@Jacquelin) Good. Got 9 pals
-> [ 15.668806] ( 1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
-> [ 18.478773] (10:slave@Laroche) Receive my pos (0,0) and assignment
-> [ 19.533121] ( 2:slave@Boivin) Receive my pos (0,1) and assignment
-> [ 20.463023] ( 3:slave@Jean_Yves) Receive my pos (0,2) and assignment
-> [ 22.285000] ( 4:slave@TeX) Receive my pos (1,0) and assignment
-> [ 22.290608] ( 5:slave@Geoff) Receive my pos (1,1) and assignment
-> [ 24.123607] ( 6:slave@Disney) Receive my pos (1,2) and assignment
-> [ 27.183009] ( 7:slave@iRMX) Receive my pos (2,0) and assignment
-> [ 28.075956] ( 8:slave@McGee) Receive my pos (2,1) and assignment
-> [ 29.357015] ( 9:slave@Gatien) Receive my pos (2,2) and assignment
-> [ 91.392661] ( 1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
-> [ 93.193495] (10:slave@Laroche) Exiting GRAS
-> [ 94.242571] ( 2:slave@Boivin) Exiting GRAS
-> [ 95.167854] ( 3:slave@Jean_Yves) Exiting GRAS
-> [ 96.980636] ( 4:slave@TeX) Exiting GRAS
-> [ 96.986171] ( 5:slave@Geoff) Exiting GRAS
-> [ 98.809904] ( 6:slave@Disney) Exiting GRAS
-> [101.853757] ( 7:slave@iRMX) Exiting GRAS
-> [102.742304] ( 8:slave@McGee) Exiting GRAS
-> [104.016936] ( 1:master@Jacquelin) Exiting GRAS
-> [104.016936] ( 9:slave@Gatien) Exiting GRAS
\ No newline at end of file
diff --git a/examples/gras/properties/CMakeLists.txt b/examples/gras/properties/CMakeLists.txt
deleted file mode 100644 (file)
index 946cf6c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_alice.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_bob.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-add_executable(properties_simulator ${CMAKE_CURRENT_BINARY_DIR}/_properties_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/properties.c)
-add_executable(properties_alice     ${CMAKE_CURRENT_BINARY_DIR}/_properties_alice.c ${CMAKE_CURRENT_SOURCE_DIR}/properties.c)
-add_executable(properties_bob       ${CMAKE_CURRENT_BINARY_DIR}/_properties_bob.c ${CMAKE_CURRENT_SOURCE_DIR}/properties.c)
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_alice.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_properties_bob.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/properties.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator properties ${CMAKE_CURRENT_SOURCE_DIR}/properties.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(properties_simulator simgrid pthread m )
-  target_link_libraries(properties_alice gras pthread m )
-  target_link_libraries(properties_bob gras pthread m )
-else()
-  target_link_libraries(properties_simulator simgrid)
-  target_link_libraries(properties_alice gras)
-  target_link_libraries(properties_bob gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/properties.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/properties.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/properties/properties.c b/examples/gras/properties/properties.c
deleted file mode 100644 (file)
index 9921498..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "gras.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Simple Property example");
-
-int alice(int argc, char *argv[]);
-int bob(int argc, char *argv[]);
-
-int alice(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-
-  /* Get the properties */
-  xbt_dict_t process_props = gras_process_properties();
-  xbt_dict_t host_props = gras_os_host_properties();
-
-  xbt_dict_cursor_t cursor = NULL;
-  char *key, *data;
-  _XBT_GNUC_UNUSED const char *value;
-
-  /* Let the other process change the host props */
-  gras_os_sleep(1);
-
-  XBT_INFO("== Dump all the properties of current host");
-  xbt_dict_foreach(host_props, cursor, key, data)
-      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
-
-  XBT_INFO("== Dump all the properties of alice");
-  xbt_dict_foreach(process_props, cursor, key, data)
-      if (!strncmp(key, "SG_TEST_", 8))
-    XBT_INFO("  Process property: '%s' has value: '%s'", key, data);
-
-  XBT_INFO("== Try to get a process property that does not exist");
-  value = gras_process_property_value("Nonexisting");
-  xbt_assert(!value, "nonexisting property exists!!");
-
-  /* Modify an existing property. First check it exists */
-  XBT_INFO("== Trying to modify a process property");
-  value = gras_process_property_value("new prop");
-  xbt_assert(!value, "Property 'new prop' exists before I add it!");
-  xbt_dict_set(process_props, "new prop", xbt_strdup("new value"), NULL);
-
-  /* Test if we have changed the value */
-  value = gras_process_property_value("new prop");
-  xbt_assert(!strcmp(value, "new value"),
-              "New property does have the value I've set ('%s' != 'new value')",
-              value);
-
-  gras_exit();
-  return 0;
-}
-
-int bob(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-
-  /* Get the properties */
-  xbt_dict_t host_props = gras_os_host_properties();
-  xbt_dict_cursor_t cursor = NULL;
-  char *key, *data;
-  _XBT_GNUC_UNUSED const char *value;
-
-  XBT_INFO("== Dump all the properties of host1");
-  xbt_dict_foreach(host_props, cursor, key, data)
-      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
-
-  XBT_INFO("== Try to get a property that does not exist");
-  value = gras_os_host_property_value("non existing key");
-  xbt_assert(value == NULL,
-              "The key 'non existing key' exists (with value '%s')!!",
-              value);
-
-  XBT_INFO
-      ("== Set a host property that alice will try to retrieve in SG (from bob->hello)");
-  xbt_dict_set(host_props, "from bob", xbt_strdup("hello"), NULL);
-
-  XBT_INFO("== Dump all the properties of host1 again to check the addition");
-  xbt_dict_foreach(host_props, cursor, key, data)
-      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
-
-  gras_os_sleep(1);             /* KILLME once bug on empty main is solved */
-  gras_exit();
-  return 0;
-}
diff --git a/examples/gras/properties/properties.xml b/examples/gras/properties/properties.xml
deleted file mode 100644 (file)
index 8edb595..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="host1" function="alice">
-    <prop id="SG_TEST_blah" value="blah"/>
-  </process>
-
-  <process host="host1" function="bob"  />
-</platform>
diff --git a/examples/gras/properties/test_rl.tesh b/examples/gras/properties/test_rl.tesh
deleted file mode 100755 (executable)
index 8f0a9a0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-! setenv SG_TEST_blah=blah
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_ENV ./properties_alice --log=root.fmt=%P:%t%e%m%n
-> alice:main == Dump all the properties of current host
-> alice:main == Dump all the properties of alice
-> alice:main   Process property: 'SG_TEST_blah' has value: 'blah'
-> alice:main == Try to get a process property that does not exist
-> alice:main == Trying to modify a process property
-> alice:main Exiting GRAS
-
-! setenv SG_TEST_blah=blah
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_ENV ./properties_bob --log=root.fmt=%P:%t%e%m%n
-> bob:main == Dump all the properties of host1
-> bob:main == Try to get a property that does not exist
-> bob:main == Set a host property that alice will try to retrieve in SG (from bob->hello)
-> bob:main == Dump all the properties of host1 again to check the addition
-> bob:main   Host property: 'from bob' has value: 'hello'
-> bob:main Exiting GRAS
diff --git a/examples/gras/properties/test_sg.tesh b/examples/gras/properties/test_sg.tesh
deleted file mode 100644 (file)
index 43b0fc6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures)
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (2:bob@host1) == Dump all the properties of host1
-> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
-> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_mem' has value: '4'
-> [  0.000000] (2:bob@host1) == Try to get a property that does not exist
-> [  0.000000] (2:bob@host1) == Set a host property that alice will try to retrieve in SG (from bob->hello)
-> [  0.000000] (2:bob@host1) == Dump all the properties of host1 again to check the addition
-> [  0.000000] (2:bob@host1)   Host property: 'from bob' has value: 'hello'
-> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
-> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_mem' has value: '4'
-> [  1.000000] (1:alice@host1) == Dump all the properties of current host
-> [  1.000000] (1:alice@host1)   Host property: 'from bob' has value: 'hello'
-> [  1.000000] (1:alice@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
-> [  1.000000] (1:alice@host1)   Host property: 'SG_TEST_mem' has value: '4'
-> [  1.000000] (1:alice@host1) == Dump all the properties of alice
-> [  1.000000] (1:alice@host1)   Process property: 'SG_TEST_blah' has value: 'blah'
-> [  1.000000] (1:alice@host1) == Try to get a process property that does not exist
-> [  1.000000] (1:alice@host1) == Trying to modify a process property
-> [  1.000000] (1:alice@host1) Exiting GRAS
-> [  1.000000] (2:bob@host1) Exiting GRAS
diff --git a/examples/gras/replay/do_simulation.pl b/examples/gras/replay/do_simulation.pl
deleted file mode 100755 (executable)
index 5d8301a..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-
-my $platfile = $ARGV[0] || die "Usage: $0 platfile daxfile\n";
-my $daxfile = $ARGV[1] || die "Usage: $0 platfile daxfile\n";
-
-sub title {
-    my $l = "XXXX $0: $_[0] XXXX";
-    my $l2 = $l;
-    $l2 =~ s/./X/g;
-    print STDERR "\n\n$l2\n$l\n$l2\n";
-}
-
-title("relaunching make");
-system qw(make -C ../../../src libsimgrid.la) and die "XXXX $0: make library failed: $?\n";  
-system qw(make -C ../../simdag dax/dax_test) and die "XXXX $0: make dax_test failed.\n";
-system qw(make replay_simulator) and die "XXXX $0: make replay_simulator failed.\n";
-
-###################################################
-my $tracefile = "$daxfile";
-$tracefile =~ s/\.xml$//;
-$tracefile .= ".trace";
-title("Regenerating the trace '$tracefile'");
-my @args = ("../../simdag/dax/dax_test", "$platfile", "$daxfile","$tracefile");
-system @args and die "XXXX $0: cannot regenerate the trace '$tracefile': $?\n";
-
-
-###################################################
-my $deployfile = "deploy_$platfile";
-$deployfile =~ s/\.xml$//;
-$deployfile .= "_".$daxfile;
-title("Generate a deployment file '$deployfile'");
-my %hosts;
-
-print STDERR  "$0: parsing the trace file '$tracefile'\n";
-open TRACE,"$tracefile" || die "$0: cannot open tracefile $tracefile: $!\n";
-while (<TRACE>) {
-    #    print "Seen $_";
-    next unless /compute/;
-    m/^\[.*?\] ([^ ]*) .*$/ || die "unparsable line: $_";
-    if (defined $hosts{$1}) {
-       $hosts{$1}+=1;
-    } else {
-       $hosts{$1}++;
-    }
-} 
-close TRACE;
-my @hostnames = sort keys %hosts;
-my $master = $hostnames[0];
-
-foreach my $host (@hostnames) {
-    if ($host ne $master && $hosts{$host} > 1) {
-       print STDERR "$host computes $hosts{$host} times!\n";
-    }
-}
-
-print STDERR  "$0: Generating the xml deployment file\n";
-open DEPLOY,">$deployfile";
-print DEPLOY "<?xml version='1.0'?>\n";
-print DEPLOY "<!DOCTYPE platform SYSTEM \"simgrid.dtd\">\n\n";
-print DEPLOY "<!-- File generated by \"$0 $tracefile\" at ".(localtime())." -->\n\n";
-print DEPLOY "<platform version=\"2\">\n";
-
-print DEPLOY "  <process host=\"$master\" function=\"master\">\n";
-print DEPLOY "    <argument value=\"$tracefile\" /> <!-- trace file -->\n";
-print DEPLOY "    <argument value=\"4500\"/>            <!-- port number -->\n";
-print DEPLOY "  </process>\n";
-
-foreach my $host (@hostnames) {
-    print DEPLOY "  <process host=\"$host\" function=\"worker\">";
-    print DEPLOY "<argument value=\"$master:4500\" />";
-    print DEPLOY "</process>\n";
-}
-
-print DEPLOY "</platform>\n";
-close DEPLOY;
-print STDERR  "$0: Xml deployment file generated\n";
-
-###################################################
-title("Replay this trace onto the simulator");
-system ("./replay_simulator","$platfile","$deployfile")
-  and die "Cannot replay the trace. Command was:\n./replay_simulator $platfile $deployfile\n";
-
-
-# 
\ No newline at end of file
diff --git a/examples/gras/replay/replay.c b/examples/gras/replay/replay.c
deleted file mode 100644 (file)
index 7509e4f..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/* Copyright (c) 2009, 2010. 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 example replays a trace as produced by examples/simdag/dax, or other means
- * This is mainly interesting when run on real platforms, to validate the results
- * given in the simulator when running SimDag.
- */
-
-#include "xbt/ex.h"
-#include "xbt/log.h"
-#include "xbt/str.h"
-#include "xbt/dynar.h"
-#include "xbt/synchro.h"
-#include "workload.h"
-#include "gras.h"
-#include "amok/peermanagement.h"
-#include <stdio.h>
-
-#include "simix/simix.h"
-
-int master(int argc, char *argv[]);
-int worker(int argc, char *argv[]);
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(replay, "Messages specific to this example");
-
-static void declare_msg()
-{
-  amok_pm_init();
-  xbt_workload_declare_datadesc();
-  gras_msgtype_declare("go", NULL);
-  gras_msgtype_declare("commands",
-                       xbt_datadesc_dynar(xbt_datadesc_by_name
-                                           ("xbt_workload_elm_t"),
-                                           xbt_workload_elm_free_voidp));
-  gras_msgtype_declare("chunk",
-                       xbt_datadesc_by_name("xbt_workload_data_chunk_t"));
-}
-
-int master(int argc, char *argv[])
-{
-
-  gras_init(&argc, argv);
-  declare_msg();
-
-
-  xbt_assert(argc == 3, "usage: replay_master tracefile port");
-  gras_socket_server(atoi(argv[2]));    /* open my master socket, even if I don't use it */
-  xbt_dynar_t peers = amok_pm_group_new("replay");      /* group of slaves */
-  xbt_peer_t peer;
-  xbt_dynar_t cmds = xbt_workload_parse_file(argv[1]);
-  xbt_workload_sort_who_date(cmds);
-  unsigned int cursor;
-  xbt_workload_elm_t cmd;
-  xbt_dict_cursor_t dict_cursor;
-
-  xbt_dict_t pals_int = xbt_dict_new_homogeneous(NULL);
-  xbt_dynar_foreach(cmds, cursor, cmd) {
-    int *p = xbt_dict_get_or_null(pals_int, cmd->who);
-    if (!p) {
-      p = (int *) 0xBEAF;
-      xbt_dict_set(pals_int, cmd->who, &p, NULL);
-    }
-  }
-
-  /* friends, we're ready. Come and play */
-  XBT_INFO("Wait for peers for a while. I need %d peers",
-        xbt_dict_length(pals_int));
-  while (xbt_dynar_length(peers) < xbt_dict_length(pals_int)) {
-    TRY {
-      gras_msg_handle(20);
-    }
-    CATCH_ANONYMOUS {
-      xbt_dynar_foreach(peers, cursor, peer) {
-        xbt_dict_remove(pals_int, peer->name);
-      }
-      char *peer_name;
-      void *data;
-      xbt_dict_foreach(pals_int, dict_cursor, peer_name, data) {
-        XBT_INFO("Peer %s didn't showed up", peer_name);
-      }
-      RETHROW;
-    }
-  }
-  XBT_INFO("Got my %ld peers", xbt_dynar_length(peers));
-  xbt_dict_free(&pals_int);
-
-  /* Check who came */
-  xbt_dict_t pals = xbt_dict_new_homogeneous(NULL);
-  xbt_socket_t pal;
-  xbt_dynar_foreach(peers, cursor, peer) {
-    //XBT_INFO("%s is here",peer->name);
-    xbt_socket_t sock = gras_socket_client(peer->name, peer->port);
-    xbt_dict_set(pals, peer->name, sock, NULL);
-  }
-  /* check that we have a dude for every element of the trace */
-  xbt_dynar_foreach(cmds, cursor, cmd) {
-    pal = xbt_dict_get_or_null(pals, cmd->who);
-    if (!pal) {
-      XBT_CRITICAL("Process %s didn't came! Abording!", cmd->who);
-      amok_pm_group_shutdown("replay");
-      xbt_dynar_free(&cmds);
-      gras_exit();
-      abort();
-    }
-  }
-  /* Send the commands to every pal */
-  char *pal_name;
-  xbt_dict_foreach(pals, dict_cursor, pal_name, pal) {
-    gras_msg_send(pal, "commands", &cmds);
-  }
-  XBT_INFO("Sent commands to every processes. Let them start now");
-  xbt_dict_cursor_t dict_it;
-  xbt_dict_foreach(pals, dict_it, pal_name, pal) {
-    gras_msg_send(pal, "go", NULL);
-  }
-  XBT_INFO("They should be started by now. Wait for their completion.");
-
-  for (cursor = 0; cursor < xbt_dynar_length(peers); cursor++) {
-    gras_msg_wait(-1, "go", NULL, NULL);
-  }
-
-  /* Done, exiting */
-  //amok_pm_group_shutdown("replay");
-  xbt_dynar_free(&cmds);
-  gras_exit();
-  return 0;
-}
-
-typedef struct {
-  xbt_dynar_t commands;
-  xbt_dict_t peers;
-  xbt_socket_t mysock;
-} s_worker_data_t, *worker_data_t;
-
-
-static xbt_socket_t get_peer_sock(char *peer)
-{
-  worker_data_t g = gras_userdata_get();
-  xbt_socket_t peer_sock = xbt_dict_get_or_null(g->peers, peer);
-  if (!peer_sock) {
-    XBT_INFO("Create a socket to %s", peer);
-    peer_sock = gras_socket_client(peer, 4000);
-    xbt_dict_set(g->peers, peer, peer_sock, NULL);      //gras_socket_close_voidp);
-  }
-  return peer_sock;
-}
-
-static int worker_commands_cb(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  worker_data_t g = gras_userdata_get();
-  g->commands = *(xbt_dynar_t *) payload;
-  return 0;
-}
-
-static void do_command(int rank, void *c)
-{
-  xbt_workload_elm_t cmd = *(xbt_workload_elm_t *) c;
-  xbt_workload_data_chunk_t chunk;
-
-  if (cmd->action == XBT_WORKLOAD_SEND) {
-    xbt_socket_t sock = get_peer_sock(cmd->str_arg);
-    chunk = xbt_workload_data_chunk_new((int) (cmd->d_arg));
-    XBT_INFO("Send %.f bytes to %s %s:%d", cmd->d_arg, cmd->str_arg,
-          xbt_socket_peer_name(sock), xbt_socket_peer_port(sock));
-    gras_msg_send_(sock, gras_msgtype_by_name("chunk"), &chunk);
-    XBT_INFO("Done sending %.f bytes to %s", cmd->d_arg, cmd->str_arg);
-
-  } else if (cmd->action == XBT_WORKLOAD_RECV) {
-    XBT_INFO("Recv %.f bytes from %s", cmd->d_arg, cmd->str_arg);
-    TRY {
-      gras_msg_wait(1000000, "chunk", NULL, &chunk);
-    }
-    CATCH_ANONYMOUS {
-      SIMIX_display_process_status();
-      RETHROWF("Exception while waiting for %f bytes from %s: %s",
-               cmd->d_arg, cmd->str_arg);
-    }
-    xbt_workload_data_chunk_free(chunk);
-    XBT_INFO("Done receiving %.f bytes from %s", cmd->d_arg, cmd->str_arg);
-
-  } else {
-    xbt_die("unknown command: %s", xbt_workload_elm_to_string(cmd));
-  }
-}
-
-int worker(int argc, char *argv[])
-{
-  xbt_ex_t e;
-  worker_data_t globals;
-  gras_init(&argc, argv);
-  declare_msg();
-  globals = gras_userdata_new(s_worker_data_t);
-  /* Create the connexions */
-  globals->mysock = gras_socket_server(4000);   /* FIXME: shouldn't be hardcoded */
-  xbt_socket_t master = NULL;
-  int connected = 0;
-
-  gras_cb_register("commands", worker_commands_cb);
-  globals->peers = xbt_dict_new_homogeneous(NULL);
-
-  if (gras_if_RL())
-    XBT_INFO("Sensor %s starting. Connecting to master on %s",
-          gras_os_myname(), argv[1]);
-  while (!connected) {
-    xbt_ex_t e;
-    TRY {
-      master = gras_socket_client_from_string(argv[1]);
-      connected = 1;
-    }
-    CATCH(e) {
-      if (e.category != system_error)
-        RETHROW;
-      xbt_ex_free(e);
-      XBT_INFO("Failed to connect. Retry in 0.5 second");
-      gras_os_sleep(0.5);
-    }
-  }
-  /* Join and run the group */
-  amok_pm_group_join(master, "replay", -1);
-  gras_msg_handle(60);          // command message
-  gras_msg_wait(60, "go", NULL, NULL);
-  {
-    worker_data_t g = gras_userdata_get();
-    unsigned int cursor;
-    xbt_workload_elm_t cmd;
-    const char *myname = gras_os_myname();
-    xbt_dynar_t cmd_to_go =
-        xbt_dynar_new(sizeof(xbt_workload_elm_t), NULL);
-
-    xbt_dynar_foreach(g->commands, cursor, cmd) {
-      if (!strcmp(cmd->who, myname)) {
-        char *c = xbt_workload_elm_to_string(cmd);
-        //      XBT_INFO("TODO: %s",c);
-        free(c);
-
-        switch (cmd->action) {
-        case XBT_WORKLOAD_COMPUTE:
-          /* If any communication were queued, do them in parallel */
-          if (!xbt_dynar_is_empty(cmd_to_go)) {
-            TRY {
-              xbt_dynar_dopar(cmd_to_go, do_command);
-              xbt_dynar_reset(cmd_to_go);
-            }
-            CATCH(e) {
-              SIMIX_display_process_status();
-              xbt_ex_free(e);
-            }
-            XBT_INFO("Communications all done");
-            xbt_dynar_reset(cmd_to_go);
-          }
-          XBT_INFO("Compute %.f flops", cmd->d_arg);
-          gras_cpu_burn(cmd->d_arg);
-          XBT_INFO("Done computing %.f flops", cmd->d_arg);
-          break;
-        case XBT_WORKLOAD_SEND:
-          /* Create the socket from main thread since it seems to fails when done from dopar thread */
-          get_peer_sock(cmd->str_arg);
-        case XBT_WORKLOAD_RECV:
-          /* queue communications for later realization in parallel */
-          xbt_dynar_push(cmd_to_go, &cmd);
-          break;
-        }
-      }
-    }
-    /* do in parallel any communication still queued */
-    XBT_INFO("Do %ld pending communications after end of TODO list",
-          xbt_dynar_length(cmd_to_go));
-    if (!xbt_dynar_is_empty(cmd_to_go)) {
-      xbt_dynar_dopar(cmd_to_go, do_command);
-      xbt_dynar_reset(cmd_to_go);
-    }
-  }
-
-  gras_msg_send(master, "go", NULL);
-//  amok_pm_group_leave(master, "replay");
-
-  gras_socket_close(globals->mysock);
-  xbt_dynar_free(&(globals->commands));
-  xbt_dict_free(&(globals->peers));
-  free(globals);
-
-  gras_exit();
-  return 0;
-}
diff --git a/examples/gras/replay/replay.xml b/examples/gras/replay/replay.xml
deleted file mode 100644 (file)
index 948461b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Dodge" function="master">
-     <argument value="Montage_25.trace" /> <!-- trace file -->
-     <argument value="4500"/>            <!-- port number -->
-  </process>
-  <process host="Bescherelle" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Browne" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Croteau" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Dodge" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Ethernet" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Fafard" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Fernand" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Gaston" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Intel" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jackson" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jacquelin" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jacques" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jean_Yves" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jill" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Jocelyne" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Juneau" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Kuenning" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Laroche" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Mathematica" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Monique" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Olivier" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Papineau" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Pronovost" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Provost" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="Stephen" function="worker"><argument value="Dodge:4500"/></process>
-  <process host="TeX" function="worker"><argument value="Dodge:4500"/></process>
-</platform>
diff --git a/examples/gras/replay/workload.h b/examples/gras/replay/workload.h
deleted file mode 100644 (file)
index 2d4372d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2009, 2010. 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 datatype stores a a trace as produced by examples/simdag/dax, or other means
- * It can be replayed in simulation with examples/msg/actions or on a real platform with
- * examples/gras/replay.
- */
-
-#ifndef XBT_WORKLOAD_H_
-#define XBT_WORKLOAD_H_
-
-#include "xbt/misc.h"
-#include "xbt/dynar.h"
-
-/* kind of elements */
-#define XBT_WORKLOAD_COMPUTE 0
-#define XBT_WORKLOAD_SEND 1
-#define XBT_WORKLOAD_RECV 2
-
-/* one command to do */
-typedef struct {
-  /* keep it in sync with function xbt_workload_declare_datadesc() */
-
-  char *who;                    /* the slave who should do it */
-  char *comment;                /* a comment placed at the end of the line, if any */
-  int action;                   /* 0: compute(darg flops); 1: send darg bytes to strarg; 2: recv darg bytes from strarg */
-  double date;                  /* when it occured when the trace was captured */
-  double d_arg;                 /* double argument, if any */
-  char *str_arg;                /* string argument, if any */
-} s_xbt_workload_elm_t, *xbt_workload_elm_t;
-
-XBT_PUBLIC(xbt_workload_elm_t) xbt_workload_elm_parse(char *line);
-XBT_PUBLIC(void) xbt_workload_elm_free(xbt_workload_elm_t cmd);
-XBT_PUBLIC(void) xbt_workload_elm_free_voidp(void *cmd);
-XBT_PUBLIC(char *) xbt_workload_elm_to_string(xbt_workload_elm_t cmd);
-XBT_PUBLIC(int) xbt_workload_elm_cmp_who_date(const void *_c1,
-                                              const void *_c2);
-XBT_PUBLIC(void) xbt_workload_sort_who_date(xbt_dynar_t c);
-XBT_PUBLIC(xbt_dynar_t) xbt_workload_parse_file(char *filename);
-
-XBT_PUBLIC(void) xbt_workload_declare_datadesc(void);
-
-
-typedef struct {
-  int size;
-  char *chunk;
-} s_xbt_workload_data_chunk_t, *xbt_workload_data_chunk_t;
-XBT_PUBLIC(xbt_workload_data_chunk_t) xbt_workload_data_chunk_new(int
-                                                                  size);
-XBT_PUBLIC(void) xbt_workload_data_chunk_free(xbt_workload_data_chunk_t c);
-
-#endif                          /* XBT_WORKLOAD_H_ */
diff --git a/examples/gras/replay/xbt_workload.c b/examples/gras/replay/xbt_workload.c
deleted file mode 100644 (file)
index f0ba47a..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Copyright (c) 2009, 2010. 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 datatype stores a a trace as produced by examples/simdag/dax, or other means
- * It can be replayed in simulation with examples/msg/actions or on a real platform with
- * examples/gras/replay.
- */
-
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
-#include "xbt/str.h"
-#include "workload.h"
-#include "gras/datadesc.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_workload, xbt,
-                                "Workload characterisation mecanisms");
-
-
-xbt_workload_elm_t xbt_workload_elm_parse(char *line)
-{
-  xbt_workload_elm_t res = xbt_new(s_xbt_workload_elm_t, 1);
-  res->date = -1;
-  res->comment = NULL;          /* it's not enough to memset for valgrind, apparently */
-  res->who = NULL;
-  res->str_arg = NULL;
-
-  xbt_dynar_t w = xbt_str_split(line, " ");
-
-  if (xbt_dynar_is_empty(w)) {
-    free(res);
-    xbt_dynar_free(&w);
-    return NULL;
-  }
-
-  char **words = xbt_dynar_get_ptr(w, 0);
-  int i = 0;
-  if (words[i][0] == '[') {
-    sscanf(words[i] + 1, "%lg", &(res->date));
-    i++;
-  }
-  res->who = xbt_strdup(words[i++]);
-  if (!strcmp(words[i], "recv")) {
-    res->action = XBT_WORKLOAD_RECV;
-    res->str_arg = xbt_strdup(words[++i]);
-    sscanf(words[++i], "%lg", &(res->d_arg));
-
-  } else if (!strcmp(words[i], "send")) {
-    res->action = XBT_WORKLOAD_SEND;
-    res->str_arg = xbt_strdup(words[++i]);
-    sscanf(words[++i], "%lg", &(res->d_arg));
-
-  } else if (!strcmp(words[i], "compute")) {
-    res->action = XBT_WORKLOAD_COMPUTE;
-    sscanf(words[++i], "%lg", &(res->d_arg));
-  } else {
-    xbt_die("Unparsable command: %s (in %s)", words[i], line);
-  }
-  i++;
-  if (words[i] && words[i][0] == '#') {
-    res->comment = xbt_strdup(strchr(line, '#') + 1);
-  }
-
-  xbt_dynar_free(&w);
-  return res;
-}
-
-void xbt_workload_elm_free(xbt_workload_elm_t cmd)
-{
-  if (!cmd)
-    return;
-  free(cmd->who);
-  free(cmd->comment);
-  free(cmd->str_arg);
-  free(cmd);
-}
-
-void xbt_workload_elm_free_voidp(void *cmd)
-{
-  xbt_workload_elm_free(*(xbt_workload_elm_t *) cmd);
-}
-
-char *xbt_workload_elm_to_string(xbt_workload_elm_t cmd)
-{
-  char res[2048];
-  char *addon;
-  res[0] = '\0';
-  if (cmd == NULL)
-    return xbt_strdup("(null command)");
-  if (cmd->date != -1) {
-    addon = bprintf("[%f] ", cmd->date);
-    strcat(res, addon);
-    free(addon);
-  }
-  addon = bprintf("'%s' ", cmd->who);
-  strcat(res, addon);
-  free(addon);
-
-  switch (cmd->action) {
-  case XBT_WORKLOAD_COMPUTE:
-    addon = bprintf("computed %f flops", cmd->d_arg);
-    strcat(res, addon);
-    free(addon);
-    break;
-  case XBT_WORKLOAD_SEND:
-    addon = bprintf("sent %f bytes to '%s'", cmd->d_arg, cmd->str_arg);
-    strcat(res, addon);
-    free(addon);
-    break;
-  case XBT_WORKLOAD_RECV:
-    addon =
-        bprintf("received %f bytes from '%s'", cmd->d_arg, cmd->str_arg);
-    strcat(res, addon);
-    free(addon);
-    break;
-  default:
-    xbt_die("Unknown command %d in '%s...'", cmd->action, res);
-  }
-  if (cmd->comment) {
-    addon = bprintf(" (comment: %s)", cmd->comment);
-    strcat(res, addon);
-    free(addon);
-  }
-  return xbt_strdup(res);
-}
-
-int xbt_workload_elm_cmp_who_date(const void *_c1, const void *_c2)
-{
-  xbt_workload_elm_t c1 = *(xbt_workload_elm_t *) _c1;
-  xbt_workload_elm_t c2 = *(xbt_workload_elm_t *) _c2;
-  if (!c1 || !c1->who)
-    return -1;
-  if (!c2 || !c2->who)
-    return 1;
-  int r = strcmp(c1->who, c2->who);
-  if (r)
-    return r;
-  if (c1->date == c2->date)
-    return 0;
-  if (c1->date < c2->date)
-    return -1;
-  return 1;
-}
-
-void xbt_workload_sort_who_date(xbt_dynar_t c)
-{
-  qsort(xbt_dynar_get_ptr(c, 0), xbt_dynar_length(c),
-        sizeof(xbt_workload_elm_t), xbt_workload_elm_cmp_who_date);
-}
-
-xbt_dynar_t xbt_workload_parse_file(char *filename)
-{
-  FILE *file_in;
-  file_in = fopen(filename, "r");
-  xbt_assert(file_in, "cannot open tracefile '%s'", filename);
-  char *str_in = xbt_str_from_file(file_in);
-  fclose(file_in);
-  xbt_dynar_t in = xbt_str_split(str_in, "\n");
-  free(str_in);
-  xbt_dynar_t cmds =
-      xbt_dynar_new(sizeof(xbt_workload_elm_t),
-                    xbt_workload_elm_free_voidp);
-
-  unsigned int cursor;
-  char *line;
-  xbt_dynar_foreach(in, cursor, line) {
-    xbt_workload_elm_t cmd = xbt_workload_elm_parse(line);
-    if (cmd)
-      xbt_dynar_push(cmds, &cmd);
-  }
-  xbt_dynar_shrink(cmds, 0);
-  xbt_dynar_free(&in);
-  return cmds;
-}
-
-
-void xbt_workload_declare_datadesc(void)
-{
-  xbt_datadesc_type_t ddt;
-
-  ddt = xbt_datadesc_struct("s_xbt_workload_elm_t");
-  xbt_datadesc_struct_append(ddt, "who", xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "comment",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "action", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(ddt, "date",
-                              xbt_datadesc_by_name("double"));
-  xbt_datadesc_struct_append(ddt, "d_arg",
-                              xbt_datadesc_by_name("double"));
-  xbt_datadesc_struct_append(ddt, "str_arg",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_close(ddt);
-
-  xbt_datadesc_ref("xbt_workload_elm_t", ddt);
-
-  ddt = xbt_datadesc_struct("s_xbt_workload_data_chunk_t");
-  xbt_datadesc_struct_append(ddt, "size", xbt_datadesc_by_name("int"));
-  xbt_datadesc_cb_field_push(ddt, "size");
-  xbt_datadesc_struct_append(ddt, "chunk",
-                              xbt_datadesc_ref_pop_arr
-                              (xbt_datadesc_by_name("char")));
-  xbt_datadesc_struct_close(ddt);
-
-  xbt_datadesc_ref("xbt_workload_data_chunk_t", ddt);
-}
-
-
-
-xbt_workload_data_chunk_t xbt_workload_data_chunk_new(int size)
-{
-  xbt_workload_data_chunk_t res = xbt_new0(s_xbt_workload_data_chunk_t, 1);
-  res->size = size - sizeof(res) - sizeof(int);
-  res->chunk = xbt_new(char, res->size);
-  return res;
-}
-
-void xbt_workload_data_chunk_free(xbt_workload_data_chunk_t c)
-{
-  free(c->chunk);
-  free(c);
-}
diff --git a/examples/gras/rpc/CMakeLists.txt b/examples/gras/rpc/CMakeLists.txt
deleted file mode 100644 (file)
index 063bb93..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_forwarder.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(rpc_simulator ${CMAKE_CURRENT_BINARY_DIR}/_rpc_simulator.c rpc.c)
-add_executable(rpc_client    ${CMAKE_CURRENT_BINARY_DIR}/_rpc_client.c    rpc.c)
-add_executable(rpc_forwarder ${CMAKE_CURRENT_BINARY_DIR}/_rpc_forwarder.c rpc.c)
-add_executable(rpc_server    ${CMAKE_CURRENT_BINARY_DIR}/_rpc_server.c    rpc.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_server.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_rpc_forwarder.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/rpc.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator rpc ${CMAKE_CURRENT_SOURCE_DIR}/rpc.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(rpc_simulator simgrid pthread m )
-  target_link_libraries(rpc_client gras pthread m )
-  target_link_libraries(rpc_forwarder gras pthread m )
-  target_link_libraries(rpc_server gras pthread m )
-else()
-  target_link_libraries(rpc_simulator simgrid)
-  target_link_libraries(rpc_client gras)
-  target_link_libraries(rpc_forwarder gras)
-  target_link_libraries(rpc_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/rpc.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/rpc.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/rpc/rpc.c b/examples/gras/rpc/rpc.c
deleted file mode 100644 (file)
index a12da53..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/* rpc - demo of the RPC features in GRAS                                   */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "gras.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(Rpc, "Messages specific to this example");
-
-/* register messages which may be sent (common to client and server) */
-static void register_messages(void)
-{
-  gras_msgtype_declare_rpc("plain ping",
-                           xbt_datadesc_by_name("int"),
-                           xbt_datadesc_by_name("int"));
-
-  gras_msgtype_declare_rpc("raise exception", NULL, NULL);
-  gras_msgtype_declare_rpc("forward exception", NULL, NULL);
-  gras_msgtype_declare("kill", NULL);
-}
-
-/* Function prototypes */
-int server(int argc, char *argv[]);
-int forwarder(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-#define exception_msg       "Error for the client"
-#define exception_raising() THROWF(unknown_error,42,exception_msg)
-
-static void exception_catching(void)
-{
-  int gotit = 0, i;
-  xbt_ex_t e;
-
-  for (i = 0; i < 5; i++) {
-    gotit = 0;
-    TRY {
-      exception_raising();
-    }
-    CATCH(e) {
-      gotit = 1;
-      xbt_assert(e.category == unknown_error,
-                 "Got wrong category: %d (instead of %d)", e.category,
-                 unknown_error);
-      xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
-      xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
-                 "Got wrong message: %s", e.msg);
-      xbt_ex_free(e);
-    }
-    if (!gotit) {
-      THROWF(unknown_error, 0, "Didn't got the remote exception!");
-    }
-  }
-}
-
-/* **********************************************************************
- * Client code
- * **********************************************************************/
-
-static void client_create_sockets(xbt_socket_t *toserver,
-                                  xbt_socket_t *toforwarder,
-                                  const char *srv_host, int srv_port,
-                                  const char *fwd_host, int fwd_port)
-{
-  TRY {
-    exception_catching();
-    *toserver = gras_socket_client(srv_host, srv_port);
-    *toforwarder = gras_socket_client(fwd_host, fwd_port);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to connect to the server: %s");
-  }
-}
-
-int client(int argc, char *argv[])
-{
-  xbt_ex_t e;
-  xbt_socket_t toserver = NULL;        /* peer */
-  xbt_socket_t toforwarder = NULL;     /* peer */
-
-  int ping, pong, i;
-  volatile int gotit = 0;
-
-
-  const char *host = "127.0.0.1";
-  int port = 4001;
-
-  memset(&e, 0, sizeof(xbt_ex_t));
-
-  /* 1. Init the GRAS's infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the server's address. The command line override defaults when specified */
-  if (argc == 5) {
-    host = argv[1];
-    port = atoi(argv[2]);
-  }
-  XBT_INFO("Launch client (server on %s:%d)", host, port);
-
-  exception_catching();
-
-  /* 3. Wait for the server & forwarder startup */
-  gras_os_sleep(2);
-
-  /* 4. Create a socket to speak to the server */
-  client_create_sockets(&toserver, &toforwarder,
-                        host, port, argv[3], atoi(argv[4]));
-  XBT_INFO("Connected to %s:%d.", host, port);
-
-
-  /* 5. Register the messages.
-     See, it doesn't have to be done completely at the beginning,
-     but only before use */
-  exception_catching();
-  register_messages();
-
-  /* 6. Keep the user informed of what's going on */
-  XBT_INFO("Connected to server which is on %s:%d",
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver));
-
-  /* 7. Prepare and send the ping message to the server */
-  ping = 1234;
-  TRY {
-    exception_catching();
-    gras_msg_rpccall(toserver, 6000.0, "plain ping", &ping, &pong);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(toserver);
-    RETHROWF("Failed to execute a PING rpc on the server: %s");
-  }
-  exception_catching();
-
-  /* 8. Keep the user informed of what's going on, again */
-  XBT_INFO("The answer to PING(%d) on %s:%d is PONG(%d)",
-        ping,
-        xbt_socket_peer_name(toserver), xbt_socket_peer_port(toserver),
-        pong);
-
-  /* 9. Call a RPC which raises an exception (to test exception propagation) */
-  XBT_INFO("Call the exception raising RPC");
-  TRY {
-    gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
-  }
-  CATCH(e) {
-    gotit = 1;
-    xbt_assert(e.category == unknown_error,
-                "Got wrong category: %d (instead of %d)",
-                e.category, unknown_error);
-    xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
-    xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
-                "Got wrong message: %s", e.msg);
-    XBT_INFO
-        ("Got the expected exception when calling the exception raising RPC");
-    xbt_ex_free(e);
-  }
-
-  if (!gotit)
-    THROWF(unknown_error, 0, "Didn't got the remote exception!");
-
-  XBT_INFO("Called the exception raising RPC");
-  exception_catching();
-
-  /* doxygen_ignore */
-  for (i = 0; i < 5; i++) {
-
-    XBT_INFO("Call the exception raising RPC (i=%d)", i);
-    TRY {
-      gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
-    }
-    CATCH(e) {
-      gotit = 1;
-      xbt_ex_free(e);
-    }
-    if (!gotit) {
-      THROWF(unknown_error, 0, "Didn't got the remote exception!");
-    }
-  }
-  /* doxygen_resume */
-
-  /* 9. Call a RPC which raises an exception (to test that exception propagation works) */
-  for (i = 0; i < 5; i++) {
-    XBT_INFO("Call the exception raising RPC on the forwarder (i=%d)", i);
-    TRY {
-      gras_msg_rpccall(toforwarder, 6000.0, "forward exception", NULL,
-                       NULL);
-    }
-    CATCH(e) {
-      gotit = 1;
-      xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
-      xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
-                 "Got wrong message: %s", e.msg);
-      xbt_assert(e.category == unknown_error,
-                 "Got wrong category: %d (instead of %d)",
-                 e.category, unknown_error);
-      XBT_INFO
-        ("Got the expected exception when calling the exception raising RPC");
-      xbt_ex_free(e);
-    }
-    if (!gotit) {
-      THROWF(unknown_error, 0, "Didn't got the remote exception!");
-    }
-    exception_catching();
-  }
-
-  XBT_INFO("Ask %s:%d to die", xbt_socket_peer_name(toforwarder),
-        xbt_socket_peer_port(toforwarder));
-  gras_msg_send(toforwarder, "kill", NULL);
-  XBT_INFO("Ask %s:%d to die", xbt_socket_peer_name(toserver),
-        xbt_socket_peer_port(toserver));
-  gras_msg_send(toserver, "kill", NULL);
-
-  /* 11. Cleanup the place before leaving */
-  gras_socket_close(toserver);
-  gras_socket_close(toforwarder);
-  XBT_INFO("Done.");
-  gras_exit();
-  return 0;
-}                               /* end_of_client */
-
-
-/* **********************************************************************
- * Forwarder code
- * **********************************************************************/
-typedef struct {
-  xbt_socket_t server;
-  int done;
-} s_forward_data_t, *forward_data_t;
-
-static int forwarder_cb_kill(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-  forward_data_t fdata;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  XBT_INFO("Asked to die by %s:%d", xbt_socket_peer_name(expeditor),
-        xbt_socket_peer_port(expeditor));
-  fdata = gras_userdata_get();
-  fdata->done = 1;
-  return 0;
-}
-
-static int forwarder_cb_forward_ex(gras_msg_cb_ctx_t ctx,
-                                   void *payload_data)
-{
-  forward_data_t fdata = gras_userdata_get();
-
-  XBT_INFO("Forward a request");
-  gras_msg_rpccall(fdata->server, 60, "raise exception", NULL, NULL);
-  return 0;
-}
-
-int forwarder(int argc, char *argv[])
-{
-  xbt_socket_t mysock;
-  int port;
-  forward_data_t fdata;
-
-  gras_init(&argc, argv);
-
-  xbt_assert(argc == 4);
-
-  fdata = gras_userdata_new(s_forward_data_t);
-  fdata->done = 0;
-  port = atoi(argv[1]);
-
-  XBT_INFO("Launch forwarder (port=%d)", port);
-  mysock = gras_socket_server(port);
-
-  gras_os_sleep(1);             /* wait for the server to be ready */
-  fdata->server = gras_socket_client(argv[2], atoi(argv[3]));
-
-  register_messages();
-  gras_cb_register("forward exception", &forwarder_cb_forward_ex);
-  gras_cb_register("kill", &forwarder_cb_kill);
-
-  while (!fdata->done) {
-    gras_msg_handle(600.0);
-  }
-
-  gras_socket_close(mysock);
-  gras_socket_close(fdata->server);
-  free(fdata);
-  XBT_INFO("Done.");
-  gras_exit();
-  return 0;
-}
-
-/* **********************************************************************
- * Server code
- * **********************************************************************/
-typedef struct {
-  xbt_socket_t server;
-  int done;
-} s_server_data_t, *server_data_t;
-
-static int server_cb_kill(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  server_data_t sdata;
-
-  XBT_INFO("Asked to die by %s:%d", xbt_socket_peer_name(expeditor),
-        xbt_socket_peer_port(expeditor));
-
-  sdata = gras_userdata_get();
-  sdata->done = 1;
-  return 0;
-}
-
-static int server_cb_raise_ex(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-  exception_raising();
-  return 0;
-}
-
-static int server_cb_ping(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-
-  /* 1. Get the payload into the msg variable, and retrieve who called us */
-  int msg = *(int *) payload_data;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  /* 2. Log which client connected */
-  XBT_INFO("Got message PING(%d) from %s:%d",
-        msg,
-        xbt_socket_peer_name(expeditor),
-        xbt_socket_peer_port(expeditor));
-
-  /* 4. Change the value of the msg variable */
-  msg = 4321;
-
-  /* 5. Return as result */
-  gras_msg_rpcreturn(6000, ctx, &msg);
-  XBT_INFO("Answered with PONG(4321)");
-
-  /* 6. Cleanups, if any */
-
-  /* 7. Tell GRAS that we consummed this message */
-  return 0;
-}                               /* end_of_server_cb_ping */
-
-
-int server(int argc, char *argv[])
-{
-  xbt_socket_t mysock;
-  server_data_t sdata;
-
-  int port = 4001;
-
-  /* 1. Init the GRAS infrastructure */
-  gras_init(&argc, argv);
-
-  /* 2. Get the port I should listen on from the command line, if specified */
-  if (argc == 2)
-    port = atoi(argv[1]);
-
-  sdata = gras_userdata_new(s_server_data_t);
-  sdata->done = 0;
-
-  XBT_INFO("Launch server (port=%d)", port);
-
-  /* 3. Create my master socket */
-  mysock = gras_socket_server(port);
-
-  /* 4. Register the known messages and register my callback */
-  register_messages();
-  gras_cb_register("plain ping", &server_cb_ping);
-  gras_cb_register("raise exception", &server_cb_raise_ex);
-  gras_cb_register("kill", &server_cb_kill);
-
-  XBT_INFO("Listening on port %d", xbt_socket_my_port(mysock));
-
-  /* 5. Wait for the ping incoming messages */
-
-  /** \bug if the server is gone before the forwarder tries to connect,
-     it dies awfully with the following message. The problem stands somewhere
-     at the interface between the xbt_socket_t and the msg mess. There is thus
-     no way for me to dive into this before this interface is rewritten
-==15875== Invalid read of size 4
-==15875==    at 0x408B805: find_port (transport_plugin_sg.c:68)
-==15875==    by 0x408BD64: gras_trp_sg_socket_client (transport_plugin_sg.c:115)
-==15875==    by 0x404A38B: gras_socket_client_ext (transport.c:255)
-==15875==    by 0x404A605: gras_socket_client (transport.c:288)
-==15875==    by 0x804B49D: forwarder (rpc.c:245)
-==15875==    by 0x80491FB: launch_forwarder (_rpc_simulator.c:52)
-==15875==    by 0x406780B: __context_wrapper (context.c:164)
-==15875==    by 0x41A6CB3: pthread_start_thread (manager.c:310)
-==15875==    by 0x42AA549: clone (clone.S:119)
-==15875==  Address 0x433B49C is 44 bytes inside a block of size 48 free'd
-==15875==    at 0x401CF46: free (vg_replace_malloc.c:235)
-==15875==    by 0x408F1FA: gras_process_exit (sg_process.c:117)
-==15875==    by 0x4049386: gras_exit (gras.c:64)
-==15875==    by 0x804B936: server (rpc.c:345)
-==15875==    by 0x80492B1: launch_server (_rpc_simulator.c:69)
-==15875==    by 0x406780B: __context_wrapper (context.c:164)
-==15875==    by 0x41A6CB3: pthread_start_thread (manager.c:310)
-==15875==    by 0x42AA549: clone (clone.S:119)
-  */
-  while (!sdata->done) {
-    gras_msg_handle(600.0);
-    exception_catching();
-  }
-
-  /* 8. Free the allocated resources, and shut GRAS down */
-  free(sdata);
-  gras_socket_close(mysock);
-  XBT_INFO("Done.");
-  gras_exit();
-
-  return 0;
-}                               /* end_of_server */
diff --git a/examples/gras/rpc/rpc.xml b/examples/gras/rpc/rpc.xml
deleted file mode 100644 (file)
index bb4a0cd..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="server">
-     <argument value="4000"/>       <!-- port number -->
-  </process>
-
-  <process host="Ginette" function="forwarder">
-     <argument value="4000"/>       <!-- self port number -->
-     <argument value="Tremblay"/>   <!-- server host -->
-     <argument value="4000"/>       <!-- server port number -->
-  </process>
-
-  <process host="Fafard" function="client">
-     <argument value="Tremblay"/>   <!-- server host -->
-     <argument value="4000"/>       <!-- server port number -->
-     <argument value="Ginette"/>   <!-- forwarder host -->
-     <argument value="4000"/>       <!-- forwarder port number -->
-  </process>
-</platform>
diff --git a/examples/gras/rpc/test_rl.tesh b/examples/gras/rpc/test_rl.tesh
deleted file mode 100755 (executable)
index 394c8fd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-! timeout 10
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./rpc_server$EXEEXT 4202 --log=root.fmt:%m%n $@
-> Launch server (port=4202)
-> Listening on port 4202
-> Got message PING(1234) from 127.0.0.1:5002
-> Answered with PONG(4321)
-> Asked to die by 127.0.0.1:5002
-> Done.
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./rpc_forwarder$EXEEXT 4203 127.0.0.1 4202 --log=root.fmt:%m%n $@
-> Launch forwarder (port=4203)
-> Forward a request
-> Forward a request
-> Forward a request
-> Forward a request
-> Forward a request
-> Asked to die by 127.0.0.1:5002
-> Done.
-> Exiting GRAS
-
-# give the server and the forwarder  a chance to acquire the expected port numbers
-$ $SG_TEST_EXENV sleep 1
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_EXENV ./rpc_client$EXEEXT 127.0.0.1 4202 127.0.0.1 4203 --log=root.fmt:%m%n $@
-> Launch client (server on 127.0.0.1:4202)
-> Connected to 127.0.0.1:4202.
-> Connected to server which is on 127.0.0.1:4202
-> The answer to PING(1234) on 127.0.0.1:4202 is PONG(4321)
-> Call the exception raising RPC
-> Got the expected exception when calling the exception raising RPC
-> Called the exception raising RPC
-> Call the exception raising RPC (i=0)
-> Call the exception raising RPC (i=1)
-> Call the exception raising RPC (i=2)
-> Call the exception raising RPC (i=3)
-> Call the exception raising RPC (i=4)
-> Call the exception raising RPC on the forwarder (i=0)
-> Got the expected exception when calling the exception raising RPC
-> Call the exception raising RPC on the forwarder (i=1)
-> Got the expected exception when calling the exception raising RPC
-> Call the exception raising RPC on the forwarder (i=2)
-> Got the expected exception when calling the exception raising RPC
-> Call the exception raising RPC on the forwarder (i=3)
-> Got the expected exception when calling the exception raising RPC
-> Call the exception raising RPC on the forwarder (i=4)
-> Got the expected exception when calling the exception raising RPC
-> Ask 127.0.0.1:4203 to die
-> Ask 127.0.0.1:4202 to die
-> Done.
-> Exiting GRAS
diff --git a/examples/gras/rpc/test_sg_32.tesh b/examples/gras/rpc/test_sg_32.tesh
deleted file mode 100644 (file)
index 4de2b24..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#! ./tesh
-
-# There is no timestamp in this test, because we exchange exceptions,
-# which contain not only the filename (which could change in case of
-# VPATH builds), but also the function name (which changes with the
-# optimization level: if inlining, gcc changes it).
-
-! timeout 10
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./rpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/rpc.xml "--log=root.fmt:[0]%e(%i:%P@%h)%e%m%n"
-> [0] (1:server@Tremblay) Launch server (port=4000)
-> [0] (1:server@Tremblay) Listening on port 4000
-> [0] (1:server@Tremblay) Got message PING(1234) from Fafard:5000
-> [0] (1:server@Tremblay) Answered with PONG(4321)
-> [0] (1:server@Tremblay) Asked to die by Fafard:5000
-> [0] (1:server@Tremblay) Done.
-> [0] (1:server@Tremblay) Exiting GRAS
-> [0] (2:forwarder@Ginette) Launch forwarder (port=4000)
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Asked to die by Fafard:5000
-> [0] (2:forwarder@Ginette) Done.
-> [0] (2:forwarder@Ginette) Exiting GRAS
-> [0] (3:client@Fafard) Launch client (server on Tremblay:4000)
-> [0] (3:client@Fafard) Connected to Tremblay:4000.
-> [0] (3:client@Fafard) Connected to server which is on Tremblay:4000
-> [0] (3:client@Fafard) The answer to PING(1234) on Tremblay:4000 is PONG(4321)
-> [0] (3:client@Fafard) Call the exception raising RPC
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Called the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC (i=0)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=1)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=2)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=3)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=4)
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=0)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=1)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=2)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=3)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=4)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Ask Ginette:4000 to die
-> [0] (3:client@Fafard) Ask Tremblay:4000 to die
-> [0] (3:client@Fafard) Done.
-> [0] (3:client@Fafard) Exiting GRAS
diff --git a/examples/gras/rpc/test_sg_64.tesh b/examples/gras/rpc/test_sg_64.tesh
deleted file mode 100755 (executable)
index 4de2b24..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#! ./tesh
-
-# There is no timestamp in this test, because we exchange exceptions,
-# which contain not only the filename (which could change in case of
-# VPATH builds), but also the function name (which changes with the
-# optimization level: if inlining, gcc changes it).
-
-! timeout 10
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./rpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/rpc.xml "--log=root.fmt:[0]%e(%i:%P@%h)%e%m%n"
-> [0] (1:server@Tremblay) Launch server (port=4000)
-> [0] (1:server@Tremblay) Listening on port 4000
-> [0] (1:server@Tremblay) Got message PING(1234) from Fafard:5000
-> [0] (1:server@Tremblay) Answered with PONG(4321)
-> [0] (1:server@Tremblay) Asked to die by Fafard:5000
-> [0] (1:server@Tremblay) Done.
-> [0] (1:server@Tremblay) Exiting GRAS
-> [0] (2:forwarder@Ginette) Launch forwarder (port=4000)
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Forward a request
-> [0] (2:forwarder@Ginette) Asked to die by Fafard:5000
-> [0] (2:forwarder@Ginette) Done.
-> [0] (2:forwarder@Ginette) Exiting GRAS
-> [0] (3:client@Fafard) Launch client (server on Tremblay:4000)
-> [0] (3:client@Fafard) Connected to Tremblay:4000.
-> [0] (3:client@Fafard) Connected to server which is on Tremblay:4000
-> [0] (3:client@Fafard) The answer to PING(1234) on Tremblay:4000 is PONG(4321)
-> [0] (3:client@Fafard) Call the exception raising RPC
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Called the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC (i=0)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=1)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=2)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=3)
-> [0] (3:client@Fafard) Call the exception raising RPC (i=4)
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=0)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=1)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=2)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=3)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Call the exception raising RPC on the forwarder (i=4)
-> [0] (3:client@Fafard) Got the expected exception when calling the exception raising RPC
-> [0] (3:client@Fafard) Ask Ginette:4000 to die
-> [0] (3:client@Fafard) Ask Tremblay:4000 to die
-> [0] (3:client@Fafard) Done.
-> [0] (3:client@Fafard) Exiting GRAS
diff --git a/examples/gras/spawn/CMakeLists.txt b/examples/gras/spawn/CMakeLists.txt
deleted file mode 100644 (file)
index 05f146d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_spawn_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_spawn_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(spawn_simulator ${CMAKE_CURRENT_BINARY_DIR}/_spawn_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/spawn.c)
-add_executable(spawn_server    ${CMAKE_CURRENT_BINARY_DIR}/_spawn_server.c ${CMAKE_CURRENT_SOURCE_DIR}/spawn.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_spawn_server.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_spawn_simulator.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/spawn.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator spawn ${CMAKE_CURRENT_SOURCE_DIR}/spawn.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(spawn_simulator simgrid pthread m )
-  target_link_libraries(spawn_server gras pthread m )
-else()
-  target_link_libraries(spawn_simulator simgrid)
-  target_link_libraries(spawn_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/spawn.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/spawn.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/spawn.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/spawn/spawn.c b/examples/gras/spawn/spawn.c
deleted file mode 100644 (file)
index f2d74b1..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* spawn - demo of the gras_agent_spawn function                            */
-
-/* The server process wants to compute all prime numbers between 0 and maxint.
-   For that, it spawns amount of child processes and communicate with them
-    through 2 queues (one for the things to do, and another for the things done).
-   Beware, using sockets to speak between main thread and spawned agent
-     is unreliable because they share the same incoming listener thread. */
-
-/* Copyright (c) 2010. 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. */
-
-#include "xbt/log.h"
-#include "xbt/strbuff.h"
-#include "gras.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(Spawn, "Messages specific to this example");
-
-/* defines an interval to be searched */
-typedef struct {
-  int min, max;
-  xbt_dynar_t primes;
-} s_work_chunk_t,*work_chunk_t;
-xbt_queue_t todo; /* The queue in which the server puts the work to do */
-xbt_queue_t done; /* the queue in which the workers puts the result of their work; */
-
-int worker(int argc, char *argv[]);
-int worker(int argc, char *argv[]) {
-  work_chunk_t chunk;
-  int moretodo = 1;
-  while (moretodo) {
-    xbt_ex_t e;
-    TRY {
-      xbt_queue_shift_timed(todo,&chunk,0);
-    }
-    CATCH(e) {
-      if (e.category != timeout_error) {
-        RETHROW;
-      }
-      moretodo = 0;
-    }
-    if (!moretodo)
-      break; // Do not break from within the CATCH, exceptions don't like it.
-
-    XBT_INFO("Got [%d;%d] to do",chunk->min,chunk->max);
-    GRAS_BENCH_ALWAYS_BEGIN();
-    int i;
-    for (i=chunk->min;i<chunk->max;i++) {
-      int j;
-      for (j=2;j<i;j++) {
-        if (i%j == 0) // not prime: j divides i perfectly
-          break;
-      }
-      if (j==i) // no divisor found: that's prime
-        xbt_dynar_push(chunk->primes,&i);
-    }
-    GRAS_BENCH_ALWAYS_END();
-    xbt_queue_push(done,&chunk);
-  }
-  XBT_INFO("No more work for me; bailing out");
-
-  return 0;
-}
-
-/* ********************************************************************** */
-/*  The server */
-/* ********************************************************************** */
-int server(int argc, char *argv[]);
-int server(int argc, char *argv[])
-{
-  int maxint = 1000;
-  int perchunk = 50;
-  int child_amount = 5;
-  char **worker_args;
-  int i;
-  work_chunk_t chunk;
-
-  gras_init(&argc, argv);
-
-  todo = xbt_queue_new(-1,sizeof(work_chunk_t));
-  done = xbt_queue_new(-1,sizeof(work_chunk_t));
-
-
-  XBT_INFO("Prepare some work");
-  for (i=0;i<maxint/perchunk;i++) {
-    chunk = xbt_new0(s_work_chunk_t,1);
-    chunk->min = i*perchunk;
-    chunk->max = (i+1)*perchunk;
-    chunk->primes = xbt_dynar_new(sizeof(int),NULL);
-    xbt_queue_push(todo,&chunk);
-  }
-
-  XBT_INFO("Spawn the kids");
-  for (i = 0; i < child_amount; i++) {
-    char *name = bprintf("child%d",i);
-    worker_args = xbt_new0(char *, 2);
-    worker_args[0] = xbt_strdup("child");
-    worker_args[1] = NULL;
-    gras_agent_spawn(name, worker, 1, worker_args, NULL);
-    free(name);
-  }
-
-  XBT_INFO("Fetch their answers");
-  for (i=0;i<maxint/perchunk;i++) {
-    work_chunk_t chunk;
-    xbt_strbuff_t buff = xbt_strbuff_new();
-    int first=1;
-    unsigned int cursor;
-    int data;
-    xbt_queue_pop(done,&chunk);
-    xbt_dynar_foreach(chunk->primes,cursor,data) {
-      char number[100];
-      sprintf(number,"%d",data);
-      if (first)
-        first = 0;
-      else
-        xbt_strbuff_append(buff,",");
-      xbt_strbuff_append(buff,number);
-    }
-    XBT_INFO("Primes in [%d,%d]: %s",chunk->min,chunk->max,buff->data);
-    xbt_strbuff_free(buff);
-  }
-  gras_os_sleep(.1);/* Let the childs detect that there is nothing more to do */
-  xbt_queue_free(&todo);
-  xbt_queue_free(&done);
-
-  gras_exit();
-
-  return 0;
-}
diff --git a/examples/gras/spawn/spawn.h b/examples/gras/spawn/spawn.h
deleted file mode 100644 (file)
index e08d91a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* spawn - demo of the gras_actor_spawn function                            */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#ifndef SPAWN_COMMON_H
-#define SPAWN_COMMON_H
-
-#include "gras.h"
-
-/* register messages which may be sent (common to client and server) */
-void spawn_register_messages(void);
-
-/* Function prototypes */
-int father(int argc, char *argv[]);
-int child(int argc, char *argv[]);
-
-#endif
diff --git a/examples/gras/spawn/spawn.xml b/examples/gras/spawn/spawn.xml
deleted file mode 100644 (file)
index dca9e59..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="server">
-     <argument value="100"/>        <!-- end of the search interval -->
-     <argument value="5"/>          <!-- number of childs -->
-  </process>
-</platform>
diff --git a/examples/gras/spawn/test_rl.tesh b/examples/gras/spawn/test_rl.tesh
deleted file mode 100755 (executable)
index d5a1a90..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-! output ignore
-$ $SG_TEST_ENV ./spawn_server$EXEEXT --log=root.fmt=%m%n
diff --git a/examples/gras/spawn/test_sg_32.tesh b/examples/gras/spawn/test_sg_32.tesh
deleted file mode 100755 (executable)
index adea079..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-p Runs the 'spawn' test within the simulator (simulation times valid for 32bits architectures)
-
-! output ignore
-$ $SG_TEST_EXENV ./spawn_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/spawn.xml
diff --git a/examples/gras/spawn/test_sg_64.tesh b/examples/gras/spawn/test_sg_64.tesh
deleted file mode 100755 (executable)
index ae99f98..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-p Runs the 'spawn' test within the simulator (simulation times valid for 64bits architectures)
-
-! output ignore
-$ $SG_TEST_EXENV ./spawn_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/spawn.xml
diff --git a/examples/gras/synchro/CMakeLists.txt b/examples/gras/synchro/CMakeLists.txt
deleted file mode 100644 (file)
index 6191bdf..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(synchro_simulator   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
-add_executable(synchro_philosopher ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator synchro ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(synchro_simulator simgrid pthread m )
-  target_link_libraries(synchro_philosopher gras pthread m )
-else()
-  target_link_libraries(synchro_simulator simgrid)
-  target_link_libraries(synchro_philosopher gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/synchro/philosopher.c b/examples/gras/synchro/philosopher.c
deleted file mode 100644 (file)
index 726f6b5..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/* philosopher - classical dinning philosopher as a demo xbt syncro stuff   */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#include "gras.h"
-#include "xbt/synchro.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(philo, "Logs of this example");
-
-
-/** Philosopher logic **/
-int lunch_amount = 10;
-int philosopher_amount;
-
-xbt_mutex_t mutex;
-xbt_cond_t *forks;
-
-#define THINKING 0
-#define EATING 1
-int *state;
-
-int *id;                        /* to pass a pointer to the threads without race condition */
-
-static void pickup(int id, int lunch)
-{
-  XBT_INFO("Thread %d gets hungry (lunch #%d)", id, lunch);
-  xbt_mutex_acquire(mutex);
-  while (state[(id + (philosopher_amount - 1)) % philosopher_amount] ==
-         EATING || state[(id + 1) % philosopher_amount] == EATING) {
-    xbt_cond_wait(forks[id], mutex);
-  }
-
-  state[id] = EATING;
-  xbt_assert(state[(id + (philosopher_amount - 1)) % philosopher_amount]
-              == THINKING
-              && state[(id + 1) % philosopher_amount] == THINKING,
-              "Philosopher %d eats at the same time that one of its neighbors!!!",
-              id);
-
-  xbt_mutex_release(mutex);
-  XBT_INFO("Thread %d eats", id);
-}
-
-static void putdown(int id)
-{
-  XBT_INFO("Thread %d is full", id);
-  xbt_mutex_acquire(mutex);
-  state[id] = THINKING;
-  xbt_cond_signal(forks
-                  [(id + (philosopher_amount - 1)) % philosopher_amount]);
-  xbt_cond_signal(forks[(id + 1) % philosopher_amount]);
-
-  xbt_mutex_release(mutex);
-  XBT_INFO("Thread %d thinks", id);
-}
-
-/*
- * Some additionnal code to let the father wait the childs
- */
-xbt_mutex_t mut_end;
-xbt_cond_t cond_end;
-int running_threads;
-
-xbt_mutex_t dead_end;
-
-/* Code ran by each thread */
-static void philo_thread(void *arg)
-{
-  int id = *(int *) arg;
-  int i;
-
-  for (i = 0; i < lunch_amount; i++) {
-    pickup(id, i);
-    gras_os_sleep(id / 100.0);  /* each philosopher sleeps and eat a time related to its ID */
-    putdown(id);
-    gras_os_sleep(id / 100.0);
-  }
-
-  xbt_mutex_acquire(mut_end);
-  running_threads--;
-  xbt_cond_signal(cond_end);
-  xbt_mutex_release(mut_end);
-
-  /* Enter an endless loop to test the killing facilities */
-  XBT_INFO
-      ("Thread %d tries to enter the dead-end; hopefully, the master will cancel it",
-       id);
-  xbt_mutex_acquire(dead_end);
-  XBT_INFO("Oops, thread %d reached the dead-end. Cancelation failed", id);
-}
-
-int philosopher(int argc, char *argv[]);
-int philosopher(int argc, char *argv[])
-{
-  int i;
-  xbt_thread_t *philosophers;
-
-  gras_init(&argc, argv);
-  xbt_assert(argc >= 2,
-              "This program expects one argument (the amount of philosophers)");
-
-  /* initializations of the philosopher mecanisms */
-  philosopher_amount = atoi(argv[1]);
-  state = xbt_new0(int, philosopher_amount);
-  id = xbt_new0(int, philosopher_amount);
-  forks = xbt_new(xbt_cond_t, philosopher_amount);
-  philosophers = xbt_new(xbt_thread_t, philosopher_amount);
-
-  mutex = xbt_mutex_init();
-  for (i = 0; i < philosopher_amount; i++) {
-    state[i] = THINKING;
-    id[i] = i;
-    forks[i] = xbt_cond_init();
-  }
-
-  /* setup the ending mecanism */
-  running_threads = philosopher_amount;
-  cond_end = xbt_cond_init();
-  mut_end = xbt_mutex_init();
-  dead_end = xbt_mutex_init();
-  xbt_mutex_acquire(dead_end);
-
-  XBT_INFO("Spawn the %d threads (%d lunches scheduled)", philosopher_amount,
-        lunch_amount);
-  /* spawn threads */
-  for (i = 0; i < philosopher_amount; i++) {
-    char *name = bprintf("thread %d", i);
-    philosophers[i] =
-        xbt_thread_create(name, philo_thread, &id[i],
-                          0 /*not joinable */ );
-    free(name);
-  }
-
-  /* wait for them */
-  xbt_mutex_acquire(mut_end);
-  while (running_threads)
-    xbt_cond_wait(cond_end, mut_end);
-  xbt_mutex_release(mut_end);
-
-  XBT_INFO("Cancel all childs");
-  /* nuke them threads */
-  for (i = 0; i < philosopher_amount; i++) {
-    xbt_thread_cancel(philosophers[i]);
-  }
-
-  xbt_mutex_release(dead_end);
-  gras_exit();
-  return 0;
-}
diff --git a/examples/gras/synchro/synchro.xml b/examples/gras/synchro/synchro.xml
deleted file mode 100644 (file)
index ea9ac4f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="philosopher">
-     <argument value="5"/>          <!-- amount of pals to create -->
-  </process>
-</platform>
diff --git a/examples/gras/synchro/test_rl.tesh b/examples/gras/synchro/test_rl.tesh
deleted file mode 100755 (executable)
index 8805e7b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-! output display
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_ENV ./synchro_philosopher${EXEEXT:=} 4 --log=root.fmt=%m%n
diff --git a/examples/gras/synchro/test_sg_32.tesh b/examples/gras/synchro/test_sg_32.tesh
deleted file mode 100644 (file)
index 993d90a..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-#! ./tesh
-p Runs the 'philosopher' test within the simulator
-
-! output sort 28
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./synchro_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/synchro.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:philosopher@Tremblay) Spawn the 5 threads (10 lunches scheduled)
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #0)
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #1)
-> [  0.000000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #0)
-> [  0.000000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #0)
-> [  0.000000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.000000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #0)
-> [  0.000000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #0)
-> [  0.000000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.020000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.020000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.020000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.030000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.030000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #2)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #3)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #4)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #5)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #6)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #7)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #8)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #9)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.040000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #1)
-> [  0.040000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #1)
-> [  0.040000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.040000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.040000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.060000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.060000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.060000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.060000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.070000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.070000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.080000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #2)
-> [  0.080000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.080000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #2)
-> [  0.080000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #1)
-> [  0.090000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.090000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.090000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.090000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.090000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.090000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.100000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #3)
-> [  0.110000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.110000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.110000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.120000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.120000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.120000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #1)
-> [  0.130000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #4)
-> [  0.130000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.130000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #3)
-> [  0.130000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.130000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.130000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.140000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.140000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.150000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #5)
-> [  0.150000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.160000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.160000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.160000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.160000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.160000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.170000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #6)
-> [  0.170000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #2)
-> [  0.170000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.180000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.180000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.180000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.190000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.190000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.190000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #2)
-> [  0.200000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #7)
-> [  0.200000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #4)
-> [  0.200000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.210000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.210000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.220000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.220000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.220000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.220000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.230000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.230000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.240000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #8)
-> [  0.240000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.240000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #5)
-> [  0.250000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.250000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.250000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.250000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.250000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.250000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #3)
-> [  0.250000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.260000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #9)
-> [  0.270000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.270000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.270000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.280000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.280000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.280000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #3)
-> [  0.290000] (1:thread 1@Tremblay) Thread 1 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.290000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #6)
-> [  0.290000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.290000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.290000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.310000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.310000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.310000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.330000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #7)
-> [  0.330000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #4)
-> [  0.340000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.340000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.340000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.340000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.360000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.360000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.370000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #4)
-> [  0.380000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #8)
-> [  0.380000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.380000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.380000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.400000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.400000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.400000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.420000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #9)
-> [  0.420000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #5)
-> [  0.430000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.430000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.430000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.430000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.450000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.450000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.460000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #5)
-> [  0.470000] (1:thread 2@Tremblay) Thread 2 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.470000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.470000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.470000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.500000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.500000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.510000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #6)
-> [  0.510000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.530000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #6)
-> [  0.550000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.550000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.550000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.580000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.580000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.590000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #7)
-> [  0.590000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.610000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #7)
-> [  0.630000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.630000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.630000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.660000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.660000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.670000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #8)
-> [  0.670000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.690000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #8)
-> [  0.710000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.710000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.710000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.740000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.740000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.750000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #9)
-> [  0.750000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.770000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #9)
-> [  0.790000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.790000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.790000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.820000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.820000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.830000] (1:thread 4@Tremblay) Thread 4 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.850000] (1:philosopher@Tremblay) Cancel all childs
-> [  0.850000] (1:philosopher@Tremblay) Exiting GRAS
-> [  0.850000] (1:thread 3@Tremblay) Thread 3 tries to enter the dead-end; hopefully, the master will cancel it
diff --git a/examples/gras/synchro/test_sg_64.tesh b/examples/gras/synchro/test_sg_64.tesh
deleted file mode 100755 (executable)
index 993d90a..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-#! ./tesh
-p Runs the 'philosopher' test within the simulator
-
-! output sort 28
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./synchro_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/synchro.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:philosopher@Tremblay) Spawn the 5 threads (10 lunches scheduled)
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #0)
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.000000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #1)
-> [  0.000000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #0)
-> [  0.000000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #0)
-> [  0.000000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.000000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #0)
-> [  0.000000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #0)
-> [  0.000000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.020000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.020000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.020000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.030000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.030000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #2)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #3)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #4)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #5)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #6)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #7)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #8)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 gets hungry (lunch #9)
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 eats
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 is full
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 thinks
-> [  0.040000] (1:thread 0@Tremblay) Thread 0 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.040000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #1)
-> [  0.040000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #1)
-> [  0.040000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.040000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.040000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.060000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.060000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.060000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.060000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.070000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.070000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.080000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #2)
-> [  0.080000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.080000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #2)
-> [  0.080000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #1)
-> [  0.090000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.090000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.090000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.090000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.090000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.090000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.100000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #3)
-> [  0.110000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.110000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.110000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.120000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.120000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.120000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #1)
-> [  0.130000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #4)
-> [  0.130000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.130000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #3)
-> [  0.130000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.130000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.130000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.140000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.140000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.150000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #5)
-> [  0.150000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.160000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.160000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.160000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.160000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.160000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.170000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #6)
-> [  0.170000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #2)
-> [  0.170000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.180000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.180000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.180000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.190000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.190000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.190000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #2)
-> [  0.200000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #7)
-> [  0.200000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #4)
-> [  0.200000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.210000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.210000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.220000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.220000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.220000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.220000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.230000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.230000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.240000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #8)
-> [  0.240000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.240000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #5)
-> [  0.250000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.250000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.250000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.250000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.250000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.250000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #3)
-> [  0.250000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.260000] (1:thread 1@Tremblay) Thread 1 gets hungry (lunch #9)
-> [  0.270000] (1:thread 1@Tremblay) Thread 1 eats
-> [  0.270000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.270000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.280000] (1:thread 1@Tremblay) Thread 1 is full
-> [  0.280000] (1:thread 1@Tremblay) Thread 1 thinks
-> [  0.280000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #3)
-> [  0.290000] (1:thread 1@Tremblay) Thread 1 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.290000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #6)
-> [  0.290000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.290000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.290000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.310000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.310000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.310000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.330000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #7)
-> [  0.330000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #4)
-> [  0.340000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.340000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.340000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.340000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.360000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.360000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.370000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #4)
-> [  0.380000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #8)
-> [  0.380000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.380000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.380000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.400000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.400000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.400000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.420000] (1:thread 2@Tremblay) Thread 2 gets hungry (lunch #9)
-> [  0.420000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #5)
-> [  0.430000] (1:thread 2@Tremblay) Thread 2 eats
-> [  0.430000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.430000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.430000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.450000] (1:thread 2@Tremblay) Thread 2 is full
-> [  0.450000] (1:thread 2@Tremblay) Thread 2 thinks
-> [  0.460000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #5)
-> [  0.470000] (1:thread 2@Tremblay) Thread 2 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.470000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.470000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.470000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.500000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.500000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.510000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #6)
-> [  0.510000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.530000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #6)
-> [  0.550000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.550000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.550000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.580000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.580000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.590000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #7)
-> [  0.590000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.610000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #7)
-> [  0.630000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.630000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.630000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.660000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.660000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.670000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #8)
-> [  0.670000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.690000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #8)
-> [  0.710000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.710000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.710000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.740000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.740000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.750000] (1:thread 4@Tremblay) Thread 4 gets hungry (lunch #9)
-> [  0.750000] (1:thread 4@Tremblay) Thread 4 eats
-> [  0.770000] (1:thread 3@Tremblay) Thread 3 gets hungry (lunch #9)
-> [  0.790000] (1:thread 3@Tremblay) Thread 3 eats
-> [  0.790000] (1:thread 4@Tremblay) Thread 4 is full
-> [  0.790000] (1:thread 4@Tremblay) Thread 4 thinks
-> [  0.820000] (1:thread 3@Tremblay) Thread 3 is full
-> [  0.820000] (1:thread 3@Tremblay) Thread 3 thinks
-> [  0.830000] (1:thread 4@Tremblay) Thread 4 tries to enter the dead-end; hopefully, the master will cancel it
-> [  0.850000] (1:philosopher@Tremblay) Cancel all childs
-> [  0.850000] (1:philosopher@Tremblay) Exiting GRAS
-> [  0.850000] (1:thread 3@Tremblay) Thread 3 tries to enter the dead-end; hopefully, the master will cancel it
diff --git a/examples/gras/tests.mk b/examples/gras/tests.mk
deleted file mode 100644 (file)
index 9a9bbc4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file factorize all the testing infrastructure for the GRAS examples
-#
-# it's made complicated by the facts that:
-#  - we use tesh, we need to find it back
-#  - we don't want to generate the test_* files with configure, so we
-#    have to declare some variables in front of the shell command
-#    running the test
-#  - we want to fully test the surf on the way. So, we have to ask for
-#    full precision timestamps in the tests. On the other hand,
-#    message size differ when we are on 32bits and when we are on
-#    64bits (obviously), so we have to maintain 2 tests per directory
-#    and pick the right one here.
-
-if GRAS_ARCH_32_BITS
-  TESTS= test_sg_32 test_rl
-test-sg: 
-       $(TESTS_ENVIRONMENT) test_sg_32
-else
-  TESTS= test_sg_64 test_rl
-test-sg: 
-       $(TESTS_ENVIRONMENT) test_sg_64
-endif
-
-test-rl: force
-       $(TESTS_ENVIRONMENT) test_rl
-TESTS_ENVIRONMENT=srcdir=$(srcdir) EXEEXT=$(EXEEXT) @top_builddir@/tools/tesh/tesh
-
-force:
-
-EXTRA_DIST+=test_rl test_sg_32 test_sg_64
-
-.PHONY: test_sg_32 test_SG_64 test_rl 
diff --git a/examples/gras/timer/CMakeLists.txt b/examples/gras/timer/CMakeLists.txt
deleted file mode 100644 (file)
index e41e5c5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/_timer_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_timer_client.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-add_executable(timer_simulator ${CMAKE_CURRENT_BINARY_DIR}/_timer_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/timer.c)
-add_executable(timer_client    ${CMAKE_CURRENT_BINARY_DIR}/_timer_client.c ${CMAKE_CURRENT_SOURCE_DIR}/timer.c)
-
-add_custom_command(
-  OUTPUT
-  ${CMAKE_CURRENT_BINARY_DIR}/_timer_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_timer_client.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/timer.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator timer ${CMAKE_CURRENT_SOURCE_DIR}/timer.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(timer_simulator simgrid pthread m )
-  target_link_libraries(timer_client gras pthread m )
-else()
-  target_link_libraries(timer_simulator simgrid)
-  target_link_libraries(timer_client gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/timer.xml
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/timer.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
diff --git a/examples/gras/timer/test_rl.tesh b/examples/gras/timer/test_rl.tesh
deleted file mode 100755 (executable)
index 0ba3d6e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-p This test is a bit long to run, since it setups timers and wait for them. Don't worry, that's expected
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./timer_client$EXEEXT --log=root.fmt:%m%n
-> Programming the repetitive_action with a frequency of 1.000000 sec
-> Programming the delayed_action for after 2.000000 sec
-> Have a rest
-> Canceling the delayed_action.
-> Re-programming the delayed_action for after 2.000000 sec
-> Repetitive_action has nothing to do yet
-> Repetitive_action has nothing to do yet
-> delayed_action setting globals->still_to_do to 5
-> repetitive_action decrementing globals->still_to_do. New value: 4
-> repetitive_action decrementing globals->still_to_do. New value: 3
-> repetitive_action decrementing globals->still_to_do. New value: 2
-> repetitive_action decrementing globals->still_to_do. New value: 1
-> repetitive_action decrementing globals->still_to_do. New value: 0
-> Exiting GRAS
diff --git a/examples/gras/timer/test_sg_32.tesh b/examples/gras/timer/test_sg_32.tesh
deleted file mode 100755 (executable)
index b71348a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./timer_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/timer.xml
-> [Fafard:client:(1) 0.000000] [test/INFO] Programming the repetitive_action with a frequency of 1.000000 sec
-> [Fafard:client:(1) 0.000000] [test/INFO] Programming the delayed_action for after 2.000000 sec
-> [Fafard:client:(1) 0.000000] [test/INFO] Have a rest
-> [Fafard:client:(1) 1.000000] [test/INFO] Canceling the delayed_action.
-> [Fafard:client:(1) 1.000000] [test/INFO] Re-programming the delayed_action for after 2.000000 sec
-> [Fafard:client:(1) 1.000000] [test/INFO] Repetitive_action has nothing to do yet
-> [Fafard:client:(1) 2.000000] [test/INFO] Repetitive_action has nothing to do yet
-> [Fafard:client:(1) 2.000000] [test/INFO] delayed_action setting globals->still_to_do to 5
-> [Fafard:client:(1) 3.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 4
-> [Fafard:client:(1) 4.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 3
-> [Fafard:client:(1) 5.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 2
-> [Fafard:client:(1) 6.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 1
-> [Fafard:client:(1) 7.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 0
-> [Fafard:client:(1) 7.000000] [gras/INFO] Exiting GRAS
diff --git a/examples/gras/timer/test_sg_64.tesh b/examples/gras/timer/test_sg_64.tesh
deleted file mode 100755 (executable)
index b71348a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ./timer_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/timer.xml
-> [Fafard:client:(1) 0.000000] [test/INFO] Programming the repetitive_action with a frequency of 1.000000 sec
-> [Fafard:client:(1) 0.000000] [test/INFO] Programming the delayed_action for after 2.000000 sec
-> [Fafard:client:(1) 0.000000] [test/INFO] Have a rest
-> [Fafard:client:(1) 1.000000] [test/INFO] Canceling the delayed_action.
-> [Fafard:client:(1) 1.000000] [test/INFO] Re-programming the delayed_action for after 2.000000 sec
-> [Fafard:client:(1) 1.000000] [test/INFO] Repetitive_action has nothing to do yet
-> [Fafard:client:(1) 2.000000] [test/INFO] Repetitive_action has nothing to do yet
-> [Fafard:client:(1) 2.000000] [test/INFO] delayed_action setting globals->still_to_do to 5
-> [Fafard:client:(1) 3.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 4
-> [Fafard:client:(1) 4.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 3
-> [Fafard:client:(1) 5.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 2
-> [Fafard:client:(1) 6.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 1
-> [Fafard:client:(1) 7.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 0
-> [Fafard:client:(1) 7.000000] [gras/INFO] Exiting GRAS
diff --git a/examples/gras/timer/timer.c b/examples/gras/timer/timer.c
deleted file mode 100644 (file)
index c2c16d2..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/* timer: repetitive and delayed actions                                    */
-
-/* Copyright (c) 2005, 2007, 2009, 2010. 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. */
-
-int client(int argc, char *argv[]);     /* Placed here to not bother doxygen inclusion */
-
-#include "gras.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this test");
-
-#define REPEAT_INTERVAL 1.0
-#define DELAY_INTERVAL 2.0
-#define LOOP_COUNT 5
-
-typedef struct {
-  int still_to_do;
-} my_globals;
-
-static void repetitive_action(void)
-{
-  my_globals *globals = (my_globals *) gras_userdata_get();
-
-  /* Stop if nothing to do yet */
-  if (globals->still_to_do <= 0) {
-    XBT_INFO("Repetitive_action has nothing to do yet");
-    return;
-  }
-
-  if (globals->still_to_do == 1) {
-    /* Unregister myself if I'm done */
-    gras_timer_cancel_repeat(REPEAT_INTERVAL, repetitive_action);
-  }
-
-  XBT_INFO
-      ("repetitive_action decrementing globals->still_to_do. New value: %d",
-       globals->still_to_do - 1);
-
-  globals->still_to_do--;       /* should be the last line of the action since value=0 stops the program */
-}                               /* end_of_repetitive_action */
-
-static void delayed_action(void)
-{
-  my_globals *globals = (my_globals *) gras_userdata_get();
-
-  XBT_INFO("delayed_action setting globals->still_to_do to %d", LOOP_COUNT);
-
-  globals->still_to_do = LOOP_COUNT;
-}                               /* end_of_delayed_action */
-
-int client(int argc, char *argv[])
-{
-  my_globals *globals;
-
-  gras_init(&argc, argv);
-  globals = gras_userdata_new(my_globals);
-  globals->still_to_do = -1;
-
-  XBT_INFO("Programming the repetitive_action with a frequency of %f sec",
-        REPEAT_INTERVAL);
-  gras_timer_repeat(REPEAT_INTERVAL, repetitive_action);
-
-  XBT_INFO("Programming the delayed_action for after %f sec", DELAY_INTERVAL);
-  gras_timer_delay(REPEAT_INTERVAL, delayed_action);
-
-  XBT_INFO("Have a rest");
-  gras_os_sleep(DELAY_INTERVAL / 2.0);
-
-  XBT_INFO("Canceling the delayed_action.");
-  gras_timer_cancel_delay(REPEAT_INTERVAL, delayed_action);
-
-  XBT_INFO("Re-programming the delayed_action for after %f sec",
-        DELAY_INTERVAL);
-  gras_timer_delay(REPEAT_INTERVAL, delayed_action);
-
-  while (globals->still_to_do == -1 ||  /* Before delayed action runs */
-         globals->still_to_do >
-         0 /* after delayed_action, and not enough repetitive_action */ ) {
-
-    XBT_DEBUG("Prepare to handle messages for 5 sec (still_to_do=%d)",
-           globals->still_to_do);
-    gras_msg_handle(5.0);
-  }
-  gras_exit();
-  xbt_free(globals);
-  return 0;
-}                               /* end_of_client */
diff --git a/examples/gras/timer/timer.xml b/examples/gras/timer/timer.xml
deleted file mode 100644 (file)
index 67a2e9f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Fafard" function="client"></process>
-</platform>
index 5385d66..c7d4a04 100644 (file)
 -rw-r--r-- 1 user user 705 2011-10-05 16:04 ./doc/simgrid/examples/smpi/split.c
 -rw-r--r-- 1 user user 1970 2011-10-05 16:04 ./doc/simgrid/examples/xbt/sem_basic.c
 -rw-r--r-- 1 user user 7207 2011-10-05 16:04 ./doc/simgrid/examples/xbt/sem_sched.c
 -rw-r--r-- 1 user user 705 2011-10-05 16:04 ./doc/simgrid/examples/smpi/split.c
 -rw-r--r-- 1 user user 1970 2011-10-05 16:04 ./doc/simgrid/examples/xbt/sem_basic.c
 -rw-r--r-- 1 user user 7207 2011-10-05 16:04 ./doc/simgrid/examples/xbt/sem_sched.c
--rw-r--r-- 1 user user 271 2011-10-05 16:04 ./doc/simgrid/examples/gras/properties/properties.xml
--rw-r--r-- 1 user user 2229 2011-10-05 16:04 ./doc/simgrid/examples/gras/properties/_properties_simulator.c
--rw-r--r-- 1 user user 811 2011-10-05 16:04 ./doc/simgrid/examples/gras/properties/_properties_alice.c
--rw-r--r-- 1 user user 805 2011-10-05 16:04 ./doc/simgrid/examples/gras/properties/_properties_bob.c
--rw-r--r-- 1 user user 3072 2011-10-05 16:04 ./doc/simgrid/examples/gras/properties/properties.c
--rw-r--r-- 1 user user 263 2011-10-05 16:04 ./doc/simgrid/examples/gras/synchro/synchro.xml
--rw-r--r-- 1 user user 4199 2011-10-05 16:04 ./doc/simgrid/examples/gras/synchro/philosopher.c
--rw-r--r-- 1 user user 817 2011-10-05 16:04 ./doc/simgrid/examples/gras/synchro/_synchro_philosopher.c
--rw-r--r-- 1 user user 1774 2011-10-05 16:04 ./doc/simgrid/examples/gras/synchro/_synchro_simulator.c
--rw-r--r-- 1 user user 3281 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc_client.c
--rw-r--r-- 1 user user 2223 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/_mmrpc_simulator.c
--rw-r--r-- 1 user user 5437 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc.c
--rw-r--r-- 1 user user 925 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc_common.c
--rw-r--r-- 1 user user 794 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/_mmrpc_server.c
--rw-r--r-- 1 user user 2174 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc_server.c
--rw-r--r-- 1 user user 416 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc.xml
--rw-r--r-- 1 user user 716 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/mmrpc.h
--rw-r--r-- 1 user user 794 2011-10-05 16:04 ./doc/simgrid/examples/gras/mmrpc/_mmrpc_client.c
--rw-r--r-- 1 user user 794 2011-10-05 16:04 ./doc/simgrid/examples/gras/spawn/_spawn_server.c
--rw-r--r-- 1 user user 322 2011-10-05 16:04 ./doc/simgrid/examples/gras/spawn/spawn.xml
--rw-r--r-- 1 user user 3857 2011-10-05 16:04 ./doc/simgrid/examples/gras/spawn/spawn.c
--rw-r--r-- 1 user user 1732 2011-10-05 16:04 ./doc/simgrid/examples/gras/spawn/_spawn_simulator.c
--rw-r--r-- 1 user user 786 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/_pmm_master.c
--rw-r--r-- 1 user user 783 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/_pmm_slave.c
--rw-r--r-- 1 user user 1222 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/pmm.xml
--rw-r--r-- 1 user user 2205 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/_pmm_simulator.c
--rw-r--r-- 1 user user 13241 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/pmm.c
--rw-r--r-- 1 user user 36437 2011-10-05 16:04 ./doc/simgrid/examples/gras/pmm/pmm_plateform.xml
--rw-r--r-- 1 user user 2205 2011-10-05 16:04 ./doc/simgrid/examples/gras/chrono/chrono.c
--rw-r--r-- 1 user user 2131 2011-10-05 16:04 ./doc/simgrid/examples/gras/chrono/chrono2.c
--rw-r--r-- 1 user user 180 2011-10-05 16:04 ./doc/simgrid/examples/gras/chrono/chrono.xml
--rw-r--r-- 1 user user 810 2011-10-05 16:04 ./doc/simgrid/examples/gras/chrono/_chrono_multiplier.c
--rw-r--r-- 1 user user 1762 2011-10-05 16:04 ./doc/simgrid/examples/gras/chrono/_chrono_simulator.c
--rw-r--r-- 1 user user 790 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/_ping_client.c
--rw-r--r-- 1 user user 729 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/ping_common.c
--rw-r--r-- 1 user user 3217 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/ping_server.c
--rw-r--r-- 1 user user 646 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/ping.h
--rw-r--r-- 1 user user 416 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/ping.xml
--rw-r--r-- 1 user user 2746 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/ping_client.c
--rw-r--r-- 1 user user 790 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/_ping_server.c
--rw-r--r-- 1 user user 2217 2011-10-05 16:04 ./doc/simgrid/examples/gras/ping/_ping_simulator.c
--rw-r--r-- 1 user user 795 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/rpc.xml
--rw-r--r-- 1 user user 12213 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/rpc.c
--rw-r--r-- 1 user user 786 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/_rpc_client.c
--rw-r--r-- 1 user user 795 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/_rpc_forwarder.c
--rw-r--r-- 1 user user 786 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/_rpc_server.c
--rw-r--r-- 1 user user 2720 2011-10-05 16:04 ./doc/simgrid/examples/gras/rpc/_rpc_simulator.c
--rw-r--r-- 1 user user 446 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/_ping_client.c
--rw-r--r-- 1 user user 243 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/ping_generator.lua
--rw-r--r-- 1 user user 729 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/ping_common.c
--rw-r--r-- 1 user user 2103 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/gras_platform_script.lua
--rw-r--r-- 1 user user 3217 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/ping_server.c
--rw-r--r-- 1 user user 646 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/ping.h
--rw-r--r-- 1 user user 2754 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/ping_client.c
--rw-r--r-- 1 user user 446 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/_ping_server.c
--rw-r--r-- 1 user user 1656 2011-10-05 16:04 ./doc/simgrid/examples/gras/console/_ping_simulator.c
--rw-r--r-- 1 user user 1457 2011-10-05 16:04 ./doc/simgrid/examples/gras/mutual_exclusion/simple_token/simple_token.xml
--rw-r--r-- 1 user user 850 2011-10-05 16:04 ./doc/simgrid/examples/gras/mutual_exclusion/simple_token/_simple_token_node.c
--rw-r--r-- 1 user user 5984 2011-10-05 16:04 ./doc/simgrid/examples/gras/mutual_exclusion/simple_token/simple_token.c
--rw-r--r-- 1 user user 1813 2011-10-05 16:04 ./doc/simgrid/examples/gras/mutual_exclusion/simple_token/_simple_token_simulator.c
--rw-r--r-- 1 user user 808 2011-10-05 16:04 ./doc/simgrid/examples/gras/all2all/_all2all_receiver.c
--rw-r--r-- 1 user user 2269 2011-10-05 16:04 ./doc/simgrid/examples/gras/all2all/all2all.xml
--rw-r--r-- 1 user user 802 2011-10-05 16:04 ./doc/simgrid/examples/gras/all2all/_all2all_sender.c
--rw-r--r-- 1 user user 4200 2011-10-05 16:04 ./doc/simgrid/examples/gras/all2all/all2all.c
--rw-r--r-- 1 user user 2247 2011-10-05 16:04 ./doc/simgrid/examples/gras/all2all/_all2all_simulator.c
--rw-r--r-- 1 user user 7311 2011-10-05 16:04 ./doc/simgrid/examples/gras/p2p/chord/chord.xml
--rw-r--r-- 1 user user 11076 2011-10-05 16:04 ./doc/simgrid/examples/gras/p2p/chord/chord.c
--rw-r--r-- 1 user user 1548 2011-10-05 16:04 ./doc/simgrid/examples/gras/p2p/can/can.xml
--rw-r--r-- 1 user user 12616 2011-10-05 16:04 ./doc/simgrid/examples/gras/p2p/can/can.c
--rw-r--r-- 1 user user 7176 2011-10-05 16:04 ./doc/simgrid/examples/gras/p2p/can/can_tests.c
--rw-r--r-- 1 user user 1732 2011-10-05 16:04 ./doc/simgrid/examples/gras/timer/_timer_simulator.c
--rw-r--r-- 1 user user 183 2011-10-05 16:04 ./doc/simgrid/examples/gras/timer/timer.xml
--rw-r--r-- 1 user user 794 2011-10-05 16:04 ./doc/simgrid/examples/gras/timer/_timer_client.c
--rw-r--r-- 1 user user 2823 2011-10-05 16:04 ./doc/simgrid/examples/gras/timer/timer.c
--rw-r--r-- 1 user user 8864 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/replay.c
--rw-r--r-- 1 user user 9663 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/Strassen.xml
--rw-r--r-- 1 user user 23087 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/Montage_25.xml
--rw-r--r-- 1 user user 6219 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/xbt_workload.c
--rw-r--r-- 1 user user 2523 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/replay.xml
--rw-r--r-- 1 user user 2088 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/_replay_simulator.c
--rw-r--r-- 1 user user 704 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/_replay_worker.c
--rw-r--r-- 1 user user 9358 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/ForkJoin_10_2.xml
--rw-r--r-- 1 user user 704 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/_replay_master.c
--rw-r--r-- 1 user user 289 2011-10-05 16:04 ./doc/simgrid/examples/gras/replay/sagittaire.xml
--rw-r--r-- 1 user user 810 2011-10-05 16:04 ./doc/simgrid/examples/amok/bandwidth/_bandwidth_sensor.c
--rw-r--r-- 1 user user 813 2011-10-05 16:04 ./doc/simgrid/examples/amok/bandwidth/_bandwidth_maestro.c
--rw-r--r-- 1 user user 476 2011-10-05 16:04 ./doc/simgrid/examples/amok/bandwidth/bandwidth.xml
--rw-r--r-- 1 user user 2253 2011-10-05 16:04 ./doc/simgrid/examples/amok/bandwidth/_bandwidth_simulator.c
--rw-r--r-- 1 user user 3977 2011-10-05 16:04 ./doc/simgrid/examples/amok/bandwidth/bandwidth.c
--rw-r--r-- 1 user user 592 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/saturate.xml
--rw-r--r-- 1 user user 806 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/_saturate_sensor.c
--rw-r--r-- 1 user user 4326 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/env.c
--rw-r--r-- 1 user user 97357 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/medium_platform.xml
--rw-r--r-- 1 user user 2247 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/_saturate_simulator.c
--rw-r--r-- 1 user user 809 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/_saturate_maestro.c
--rw-r--r-- 1 user user 7897 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/saturate.c
--rw-r--r-- 1 user user 2844 2011-10-05 16:04 ./doc/simgrid/examples/amok/saturate/medium_deployment.xml
--rw-r--r-- 1 user user 7625 2011-10-05 16:04 ./doc/simgrid/examples/amok/alnem/alnem.c
--rw-r--r-- 1 user user 1295 2011-10-05 16:04 ./doc/simgrid/examples/amok/alnem/alnem_builder.c
 -rw-r--r-- 1 user user 4582 2011-10-05 16:04 ./doc/simgrid/examples/msg/small_platform.xml
 -rw-r--r-- 1 user user 4805 2011-10-05 16:04 ./doc/simgrid/examples/msg/README
 -rw-r--r-- 1 user user 272 2011-10-05 16:04 ./doc/simgrid/examples/msg/properties/deployment_properties.xml
 -rw-r--r-- 1 user user 4582 2011-10-05 16:04 ./doc/simgrid/examples/msg/small_platform.xml
 -rw-r--r-- 1 user user 4805 2011-10-05 16:04 ./doc/simgrid/examples/msg/README
 -rw-r--r-- 1 user user 272 2011-10-05 16:04 ./doc/simgrid/examples/msg/properties/deployment_properties.xml
diff --git a/examples/temps-gras-stub.mk b/examples/temps-gras-stub.mk
deleted file mode 100644 (file)
index 76447d6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-## Generate the temp source files on need
-##
-
-$(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
-
-$(top_builddir)/tools/gras/gras_stub_generator@EXEEXT@:
-       make -C $(top_builddir)/tools/gras/ gras_stub_generator@EXEEXT@
-
-##
-## Cleanups
-CLEANFILES = _$(NAME)_simulator.c $(NAME).mk $(NAME).Makefile.local $(NAME).Makefile.remote $(NAME).deploy.sh \
-             $(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c)
-
-MOSTLYCLEANFILES = $(NAME).trace
diff --git a/include/amok/bandwidth.h b/include/amok/bandwidth.h
deleted file mode 100644 (file)
index 6f5ff0b..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/* amok_bandwidth - Bandwidth test facilities                               */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef AMOK_BANDWIDTH_H
-#define AMOK_BANDWIDTH_H
-
-/** \addtogroup AMOK_bw
- *  \brief Test the bandwidth between two nodes
- *
- *  This module allows you to retrieve the bandwidth between to arbitrary hosts
- *  and saturating the links leading to them, provided that they run some GRAS 
- *  process which initialized this module.
- * 
- * \htmlonly <h3>Bandwidth measurement</h3>\endhtmlonly
- * 
- *  Retrieving the bandwidth is usually done by active measurment: one send
- *  a packet of known size, time how long it needs to go back and forth,
- *  and you get the bandwidth in Kb/s available on the wire.
- * 
- *  This is not as easy as it first seems to do so in GRAS. The first issue
- *  is that GRAS messages can get buffered, or the receiver cannot be
- *  waiting for the message when it arrives. This results in extra delays
- *  impacting the measurement quality. You thus have to setup a rendez-vous
- *  protocol. The second issue is that GRAS message do have an header, so
- *  figuring out their size is not trivial. Moreover, they get converted
- *  when the sender and receiver processor architecture are different,
- *  inducing extra delays. For this, GRAS provide the so-called measurement
- *  sockets. On them, you can send raw data which is not converted (see
- *  \ref XBT_sock_meas). 
- *
- *  Solving all these problems is quite error prone and anoying, so we
- *  implemented this in the current module so that you don't have to do it
- *  yourself. The API is very simple. Use amok_bw_test() to get the BW
- *  between the local host and the specified peer, or amok_bw_request() to
- *  get the BW between two remote hosts. The elapsed time, as long as the
- *  achieved bandwidth is returned in the last arguments of the functions.
- * 
- *  All sizes are in bytes. The \a buf_size is the size of the buffer
- *   (this is a socket parameter set automatically). The \a exp_size is the
- *   amount of data to send during an experiment. \a msg_size is the size
- *   of each message sent. These values allow you to study phenomenon such
- *   as TCP slow start (which are not correctly modelized by \ref SURF_API,
- *   yet). They are mimicked from the NWS API, and default values could be
- *   buf_size=32k, msg_size=16k and exp_size=64k. That means that the
- *   socket will be prepared to accept 32k in its buffer and then four
- *   messages of 16k will be sent (so that the total amount of data equals
- *   64k). Of course, you can use other values if you want to. 
- * 
- *  \htmlonly
- * <center><img align=center src="amok_bw_test.png" alt="amok bandwidth measurement protocol"><br>
- * Fig 1: AMOK bandwidth measurement protocol.</center>
- * <h3>Link saturation</h3>
- * \endhtmlonly
- * 
- *  You sometimes want to try saturating some link during the network
- *  related experiments (at least, we did ;). This also can turn quite
- *  untrivial to do, unless you use this great module. You can either ask
- *  for the saturation between the current host and a distant one with
- *  amok_bw_saturate_begin() or between two distant hosts with
- *  amok_bw_saturate_start(). In any case, remember that gras actors
- *  (processes) are not interruptible. It means that an actor you
- *  instructed to participate to a link saturation experiment will not do
- *  anything else until it is to its end (either because the asked duration
- *  was done or because someone used amok_bw_saturate_stop() on the emitter
- *  end of the experiment).
- * 
- *  The following figure depicts the used protocol. Note that any
- *  handshaking messages internal messages are omitted for sake of
- *  simplicity. In this example, the experiment ends before the planned
- *  experiment duration is over because one host use the
- *  amok_bw_saturate_stop() function, but things are not really different
- *  if the experiment stops alone. Also, it is not mandatory that the host
- *  calling amok_bw_saturate_stop() is the same than the one which called
- *  amok_bw_saturate_start(), despite what is depicted here.
- * 
- *  \htmlonly
- * <center><img align=center src="amok_bw_sat.png" alt="amok bandwidth saturation protocol"><br>
- * Fig 2: AMOK link saturation protocol.</center>
- * \endhtmlonly
- *
- *  @{
- */
-
-/* module handling */
-
-XBT_PUBLIC(void) amok_bw_init(void);
-XBT_PUBLIC(void) amok_bw_exit(void);
-
-XBT_PUBLIC(void) amok_bw_test(xbt_socket_t peer,
-                              unsigned long int buf_size,
-                              unsigned long int msg_size,
-                              unsigned long int msg_amount,
-                              double min_duration,
-                              /*OUT*/ double *sec, double *bw);
-
-XBT_PUBLIC(void) amok_bw_request(const char *from_name,
-                                 unsigned int from_port,
-                                 const char *to_name, unsigned int to_port,
-                                 unsigned long int buf_size,
-                                 unsigned long int msg_size,
-                                 unsigned long int msg_amount,
-                                 double min_duration, /*OUT*/ double *sec,
-                                 double *bw);
-
-XBT_PUBLIC(double *) amok_bw_matrix(xbt_dynar_t hosts,  /* dynar of xbt_host_t */
-                                    int buf_size_bw, int msg_size_bw,
-                                    int msg_amount_bw,
-                                    double min_duration);
-
-/* ***************************************************************************
- * Link saturation
- * ***************************************************************************/
-
-
-XBT_PUBLIC(void) amok_bw_saturate_start(const char *from_name,
-                                        unsigned int from_port,
-                                        const char *to_name,
-                                        unsigned int to_port,
-                                        unsigned int msg_size,
-                                        double duration);
-
-XBT_PUBLIC(void) amok_bw_saturate_begin(const char *to_name,
-                                        unsigned int to_port,
-                                        unsigned int msg_size,
-                                        double duration,
-                                        /*out */ double *elapsed,
-                                        double *bw);
-
-XBT_PUBLIC(void) amok_bw_saturate_stop(const char *from_name,
-                                       unsigned int from_port,
-                                       /*out */ double *time, double *bw);
-
-/** @} */
-
-#endif                          /* AMOK_BANDWIDTH_H */
diff --git a/include/amok/base.h b/include/amok/base.h
deleted file mode 100644 (file)
index 8d115ac..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* amok_base - things needed in amok, but too small to constitute a module  */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2010. 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. */
-
-#ifndef AMOK_BASE_H
-#define AMOK_BASE_H
-
-#include "gras/messages.h"
-
-/* ****************************************************************************
- * The common types used as payload in the messages and their definitions
- * ****************************************************************************/
-
-/**
- * amok_result_t:
- *
- * how to report the result of an experiment
- */
-
-typedef struct {
-  unsigned int timestamp;
-  double value;
-} amok_result_t;
-
-XBT_PUBLIC(void) amok_base_init(void);
-XBT_PUBLIC(void) amok_base_exit(void);
-
-
-#endif                          /* AMOK_BASE_H */
diff --git a/include/amok/peermanagement.h b/include/amok/peermanagement.h
deleted file mode 100644 (file)
index 1f2fd7a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* amok peer management - servers main loop and remote peer stopping        */
-
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. 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. */
-
-#ifndef AMOK_PEER_MANAGEMENT_H
-#define AMOK_PEER_MANAGEMENT_H
-
-#include <gras.h>
-
-/** \addtogroup AMOK_pm
- *  \brief Managing remote servers
- * 
- * This module provide the main loop of servers designed to answer to
- * callbacks. They can furthermore be stopped remotely.  
- * 
- * This module is especially useful to program following the centralized
- * master/slave architecture. In this architecture, one of the processes
- * acts as a master dispatching orders to the others, which are called
- * slaves. 
-  
- * The source code of the <b>slaves</b> then only consists in:
- *   - declaring the gras datatypes (see \ref GRAS_dd)
- *   - declaring the messages (with gras_msgtype_declare() or gras_msgtype_declare_rpc())
- *   - attaching the right callbacks to the messages (with gras_cb_register())
- *   - declaring the right repetitive actions (see \ref GRAS_timer)
- *   - joining the group (with amok_pm_group_join(), so that the master now it)
- *   - entering the endless loop (with amok_pm_mainloop()). 
- * The <b>master</b>, on its side, should create declare the datatypes and
- * messages just like slaves. It should then create a group with
- * amok_pm_group_new().
- * Afterward, there is two solutions. 
- *   - If your master is a deamon which never stops itself (just like regular UNIX daemons), it should: 
- *      - register the needed callbacks to messages comming from slaves
- *      - register repetitive actions 
- *      - entering the main loop.
- *   - If the master is not a deamon, it should:
- *      - wait a moment for the slaves registration (using gras_msg_handleall())
- *      - run its algoritpm. For this, it may call RPC on slaves, or explicitely wait (with gras_msg_wait()) for the answers it expects.
-
- * \section AMOK_pm_compat Compatibility issues
- * 
- * The API described here is as of SimGrid 3.2 and higher. In version 3.1
- * (where this module were introduced), all functions were named amok_hm_*
- * This was because the module used to be named HostManagement, but it was
- * renamed before being released to betterly express its purpose.
- * Unfortunately, the rename was not done properly before version 3.2.
- * 
- * @{
- */
-
-/* module handling */
-XBT_PUBLIC(void) amok_pm_init(void);
-XBT_PUBLIC(void) amok_pm_exit(void);
-
-XBT_PUBLIC(void) amok_pm_mainloop(double timeOut);
-
-XBT_PUBLIC(void) amok_pm_kill_hp(char *name, int port);
-XBT_PUBLIC(void) amok_pm_kill(xbt_socket_t buddy);
-XBT_PUBLIC(void) amok_pm_kill_sync(xbt_socket_t buddy);
-
-XBT_PUBLIC(xbt_dynar_t) amok_pm_group_new(const char *group_name);
-XBT_PUBLIC(xbt_dynar_t) amok_pm_group_get(xbt_socket_t master,
-                                          const char *group_name);
-
-XBT_PUBLIC(int) amok_pm_group_join(xbt_socket_t master,
-                                   const char *group_name);
-XBT_PUBLIC(void) amok_pm_group_leave(xbt_socket_t master,
-                                     const char *group_name);
-
-
-XBT_PUBLIC(void) amok_pm_group_shutdown(const char *group_name);
-XBT_PUBLIC(void) amok_pm_group_shutdown_remote(xbt_socket_t master,
-                                               const char *group_name);
-
-
-/** @} */
-#endif                          /* AMOK_peer_MANAGEMENT_H */
diff --git a/include/gras.h b/include/gras.h
deleted file mode 100644 (file)
index ba1cd5a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* gras.h - Public interface to the GRAS                                    */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_H
-#define GRAS_H
-
-#include <xbt.h>                /* our toolbox */
-#include <xbt/ex.h>             /* There's a whole bunch of exception handling in GRAS */
-
-#include <gras/process.h>
-#include <gras/module.h>
-#include <gras/virtu.h>
-#include <gras/emul.h>
-
-#include <gras/transport.h>
-#include <gras/messages.h>
-#include <gras/timer.h>
-
-XBT_PUBLIC(void) gras_init(int *argc, char **argv);
-XBT_PUBLIC(void) gras_exit(void);
-
-#endif                          /* GRAS_H */
diff --git a/include/gras/emul.h b/include/gras/emul.h
deleted file mode 100644 (file)
index b71ee1f..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* gras/emul.h - public interface to emulation support                      */
-/*                (specific parts for SG or RL)                             */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_COND_H
-#define GRAS_COND_H
-
-#include "xbt/misc.h"           /* SG_BEGIN_DECL */
-
-SG_BEGIN_DECL()
-/** @addtogroup GRAS_emul
- *  @brief Code execution "emulation" and "virtualization".
- * 
- *  Emulation and virtualization words have a lot of different meanings in
- *  computer science. Here is what we mean, and what this module allows you
- *  to do (if it does not match your personal beliefs, I'm sorry):
- * 
- *  - Virtualization: Having some specific code for the simulation or for the reality
- *  - Emulation: Report within the simulator the execution time of your code
- * 
- *  \section GRAS_emul_virtualization Virtualization 
- * 
- *  The whole idea of GRAS is to share the same code between the simulator
- *  and the real implementation. But it is sometimes impossible, such as
- *  when you want to deal with the OS. As an example, you may want to add
- *  some extra delay before initiating a communication in RL to ensure that
- *  the receiver is listening. This is usually useless in SG since you have
- *  a much better control on process launch time.
- * 
- *  This would be done with the following snipet:
- *  \verbatim if (gras_if_RL()) 
-   gras_os_sleep(1);\endverbatim
- * 
- *  Please note that those are real functions and not pre-processor
- *  defines. This is to ensure that the same object code can be linked
- *  against the SG library or the RL one without recompilation.
- * 
- *  @{
- */
-/** \brief Returns true only if the program runs on real life */
-XBT_PUBLIC(int) gras_if_RL(void);
-
-/** \brief Returns true only if the program runs within the simulator */
-XBT_PUBLIC(int) gras_if_SG(void);
-
-/** @} */
-
-XBT_PUBLIC(int) gras_bench_always_begin(const char *location, int line);
-XBT_PUBLIC(int) gras_bench_always_end(void);
-XBT_PUBLIC(int) gras_bench_once_begin(const char *location, int line);
-XBT_PUBLIC(int) gras_bench_once_end(void);
-
-/** @addtogroup GRAS_emul
- *  \section GRAS_emul_timing Emulation
- *  
- *  For simulation accuracy, it is mandatory to report the execution time
- *  of your code into the simulator. For example, if your application is a
- *  parallel matrix multiplication, you naturally have to slow down the
- *  simulated hosts actually doing the computation.
- *  
- *  If you know beforehands how long each task will last, simply add a call
- *  to the gras_bench_fixed function described below. If not, you can have
- *  GRAS benchmarking your code automatically. Simply enclose the code to
- *  time between a macro GRAS_BENCH_*_BEGIN and GRAS_BENCH_*_END, and
- *  you're done. There is three pair of such macros, whose characteristics
- *  are summarized in the following table. 
- * 
- *  <table>
- *   <tr>
- *    <td><b>Name</b></td> 
- *    <td><b>Run on host machine?</b></td>
- *    <td><b>Benchmarked?</b></td>
- *    <td><b>Corresponding time reported to simulation?</b></td>
- *   </tr> 
- *   <tr>
- *    <td>GRAS_BENCH_ALWAYS_BEGIN()<br> 
- *        GRAS_BENCH_ALWAYS_END()</td> 
- *    <td>Each time</td>
- *    <td>Each time</td>
- *    <td>Each time</td>
- *   </tr>
- *   <tr>
- *    <td>GRAS_BENCH_ONCE_RUN_ONCE_BEGIN()<br> 
- *        GRAS_BENCH_ONCE_RUN_ONCE_END()</td>
- *    <td>Only first time</td>
- *    <td>Only first time</td>
- *    <td>Each time (with stored value)</td>
- *   </tr>
- *   <tr>
- *    <td>GRAS_BENCH_ONCE_RUN_ALWAYS_BEGIN()<br> 
- *        GRAS_BENCH_ONCE_RUN_ALWAYS_END()</td>
- *    <td>Each time</td>
- *    <td>Only first time</td>
- *    <td>Each time (with stored value)</td>
- *   </tr>
- *  </table>
- *  
- *  As you can see, whatever macro pair you use, the corresponding value is
- *  repported to the simulator. After all, that's what those macro are
- *  about ;)
- * 
- *  The GRAS_BENCH_ALWAYS_* macros are the simplest ones. Each time the
- *  corresponding block is encountered, the corresponding code is executed
- *  and timed. Then, the simulated host is given the corresponding amount
- *  of work.
- * 
- *  The GRAS_BENCH_ONCE_RUN_ONCE_* macros are good for cases where you know
- *  that your execution time is constant and where you don't care about the
- *  result in simulation mode. In our example, each sub-block
- *  multiplication takes exactly the same amount of work (time depends only
- *  on size, not on content), and the operation result can safely be
- *  ignored for algorithm result. Doing so allows you to considerably
- *  reduce the amount of computation needed when running on simulator.
- * 
- *  The GRAS_BENCH_ONCE_RUN_ALWAYS_* macros are good for cases where you
- *  know that each block will induce the same amount of work (you thus
- *  don't want to bench it each time), but you actually need the result (so
- *  you have to run it each time). You may ask why you don't use
- *  GRAS_BENCH_ONCE_RUN_ONCE_* macros in this case (why you save the
- *  benchmarking time).  The timing operation is not very intrusive by
- *  itself, but it has to be done in an exclusive way between the several
- *  GRAS threads (protected by mutex). So, the day where there will be
- *  threads in GRAS, this will do a big difference. Ok, I agree. For now,
- *  it makes no difference.
- * 
- *  <b>Caveats</b>
- * 
- *   - Blocks are automatically differenciated using the filename and line
- *     position at which the *_BEGIN part was called. Don't put two of them
- *     on the same line.
- * 
- *   - You cannot nest blocks. It would make no sense, either.
- * 
- *   - By the way, GRAS is not exactly designed for parallel algorithm such
- *     as parallel matrix multiplication but for distributed ones, you weirdo.
- *     But it's just an example ;)
- *  
- * @{
- */
-/** \brief Start benchmarking this code block
-    \hideinitializer */
-#define GRAS_BENCH_ALWAYS_BEGIN()           gras_bench_always_begin(__FILE__, __LINE__)
-/** \brief Stop benchmarking this code block
-    \hideinitializer */
-#define GRAS_BENCH_ALWAYS_END()             gras_bench_always_end()
-
-/** \brief Start benchmarking this code block if it has never been benchmarked, run it in any case
- *  \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ALWAYS_BEGIN()  gras_bench_once_begin(__FILE__, __LINE__)
-/** \brief Stop benchmarking this part of the code
-    \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ALWAYS_END()    gras_bench_once_end()
-
-/** \brief Start benchmarking this code block if it has never been benchmarked, ignore it if it was
-    \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ONCE_BEGIN()    if (gras_bench_once_begin(__FILE__, __LINE__)) {
-/** \brief Stop benchmarking this part of the code
-    \hideinitializer */
-#define GRAS_BENCH_ONCE_RUN_ONCE_END()      } gras_bench_once_end()
-
-XBT_PUBLIC(void) gras_cpu_burn(double flops);
-/** @} */
-
-SG_END_DECL()
-#endif                          /* GRAS_COND_H */
diff --git a/include/gras/messages.h b/include/gras/messages.h
deleted file mode 100644 (file)
index 56dde92..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/* messaging - high level communication (send/receive messages)             */
-/* module's public interface exported to end user.                          */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_MESSAGES_H
-#define GRAS_MESSAGES_H
-
-#include "gras/transport.h"
-#include "xbt/datadesc.h"
-#include "xbt/socket.h"
-
-SG_BEGIN_DECL()
-
-/** @addtogroup GRAS_msg
- *  @brief Defining messages and callbacks, and exchanging messages
- * 
- *  There is two way to receive messages in GRAS. The first one is to
- *  register a given function as callback to a given type of messages (see
- *  \ref gras_cb_register and associated section). But you can also
- *  explicitely wait for a given message with the \ref gras_msg_wait
- *  function.
- * 
- *  Usually, both ways are not intended to be mixed of a given type of
- *  messages. But if you do so, it shouldn't trigger any issue.  If the
- *  message arrives when gras_msg_wait is blocked, then it will be routed to
- *  it. If it arrives when before or after \ref gras_msg_wait, it will be
- *  passed to the callback.
- * 
- *  For an example of use, please refer to \ref GRAS_ex_ping. The archive
- *  contains much more examples, but their are not properly integrated into
- *  this documentation yet. 
- */
-/** @defgroup GRAS_msg_decl Message declaration and retrival 
- *  @ingroup  GRAS_msg
- *  
- *  GRAS messages can only accept one type of payload. See \ref GRAS_dd for
- *  more information on how to describe data in GRAS.
- *
- *  If you absolutely want use a message able to convey several datatypes,
- *  you can always say that it conveys a generic reference (see
- *  \ref xbt_datadesc_ref_generic).
- * 
- *  In order to ease the upgrade of GRAS applications, it is possible to \e
- *  version the messages, ie to add a version number to the message (by
- *  default, the version is set to 0). Any messages of the wrong version will
- *  be ignored by the applications not providing any specific callback for
- *  them.
- *  
- *  This mechanism (stolen from the dynamic loader one) should ensure you to
- *  change the semantic of a given message while still understanding the old
- *  one.
- */
-/** @{ */
-/** \brief Opaque type */
-typedef struct s_gras_msgtype *gras_msgtype_t;
-
-XBT_PUBLIC(void) gras_msgtype_declare(const char *name,
-                                      xbt_datadesc_type_t payload);
-XBT_PUBLIC(void) gras_msgtype_declare_v(const char *name,
-                                        short int version,
-                                        xbt_datadesc_type_t payload);
-
-XBT_PUBLIC(gras_msgtype_t) gras_msgtype_by_name(const char *name);
-XBT_PUBLIC(gras_msgtype_t) gras_msgtype_by_name_or_null(const char *name);
-XBT_PUBLIC(gras_msgtype_t) gras_msgtype_by_namev(const char *name,
-                                                 short int version);
-XBT_PUBLIC(gras_msgtype_t) gras_msgtype_by_id(int id);
-XBT_PUBLIC(const char *) gras_msgtype_get_name(gras_msgtype_t type);
-
-XBT_PUBLIC(void) gras_msgtype_dumpall(void);
-
-
-/** @} */
-/** @defgroup GRAS_msg_cb Callback declaration and use
- *  @ingroup  GRAS_msg
- * 
- *
- * This is how to register a given function so that it gets called when a
- * given type of message arrives.
- * 
- * You can register several callbacks to the same kind of messages, and
- * they will get stacked. The lastly added callback gets the message first.
- * If it consumes the message, it should return a true value when done. If
- * not, it should return 0, and the message will be passed to the second
- * callback of the stack, if any.
- * 
- * @{
- */
-
-  /** \brief Context of callbacks (opaque structure, created by the middleware only, never by user) */
-typedef struct s_gras_msg_cb_ctx *gras_msg_cb_ctx_t;
-
-XBT_PUBLIC(void) gras_msg_cb_ctx_free(gras_msg_cb_ctx_t ctx);
-XBT_PUBLIC(xbt_socket_t) gras_msg_cb_ctx_from(gras_msg_cb_ctx_t ctx);
-
-  /** \brief Type of message callback functions. 
-   *
-   * \param expeditor: a socket to contact who sent this message
-   * \param payload: the message itself
-   *
-   * \return true if the message was consumed by the callback, 
-   *  false if the message was refused by the callback (and should be 
-   *  passed to the next callback of the stack for this message)
-   *
-   * Once a such a function is registered to handle messages of a given
-   * type with \ref gras_cb_register(), it will be called each time such
-   * a message arrives (unless a gras_msg_wait() intercepts it on arrival).
-   *
-   * If the callback accepts the message, it should free it after use.
-   */
-typedef int (*gras_msg_cb_t) (gras_msg_cb_ctx_t ctx, void *payload);
-
- /**
-  * @brief Bind the given callback to the given message type (described by its name)
-  * @hideinitializer
-  * 
-  * Several callbacks can be attached to a given message type. The lastly added one will get the message first, and
-  * if it returns a non-null value, the message will be passed to the second one.
-  * And so on until one of the callbacks accepts the message.
-  * 
-  * Using gras_cb_register is a bit slower than using gras_cb_register_ since GRAS
-  * has to search for the given msgtype in the hash table, but you don't care in most case.
-  */
-#define gras_cb_register(msgtype_name, cb)   gras_cb_register_(gras_msgtype_by_name(msgtype_name),cb)
-
- /**
-  * @brief Unbind the given callback to the given message type (described by its name)
-  * @hideinitializer
-  * 
-  * Using gras_cb_unregister is a bit slower than using gras_cb_unregister_ since GRAS
-  * has to search for the given msgtype in the hash table, but you don't care in most case.
-  */
-#define gras_cb_unregister(msgtype_name, cb) gras_cb_unregister_(gras_msgtype_by_name(msgtype_name),cb)
-
-XBT_PUBLIC(void) gras_cb_register_(gras_msgtype_t msgtype,
-                                   gras_msg_cb_t cb);
-XBT_PUBLIC(void) gras_cb_unregister_(gras_msgtype_t msgtype,
-                                     gras_msg_cb_t cb);
-
-/** @} */
-
-/** @defgroup GRAS_msg_exchange Message exchange 
- *  @ingroup  GRAS_msg
- *
- */
-/** @{ */
-
-/** \brief Send the data pointed by \a payload as a message \a msgname on the \a sock
- *  @hideinitializer
- *
- * Using gras_msg_wait() is a bit slower than using gras_msg_wait_() since GRAS
- * has to search for the given msgtype in the hash table.
- */
-#define gras_msg_send(sock,name,payload) gras_msg_send_(sock,gras_msgtype_by_name(name),payload)
-XBT_PUBLIC(void) gras_msg_send_(xbt_socket_t sock,
-                                gras_msgtype_t msgtype, void *payload);
-
-/** \brief Waits for a message to come in over a given socket
- *  @hideinitializer
- * @param timeout: How long should we wait for this message.
- * @param msgt_want: type of awaited msg
- * @param[out] expeditor: where to create a socket to answer the incoming message
- * @param[out] payload: where to write the payload of the incoming message
- * @return the error code (or no_error).
- *
- * Every message of another type received before the one waited will be queued
- * and used by subsequent call to this function or gras_msg_handle().
- *
- * Using gras_msg_wait() is a bit slower than using gras_msg_wait_() since GRAS
- * has to search for the given msgtype in the hash table.
- */
-
-#define gras_msg_wait(timeout,msgt_want,expeditor,payload) gras_msg_wait_(timeout,gras_msgtype_by_name(msgt_want),expeditor,payload)
-XBT_PUBLIC(void) gras_msg_wait_(double timeout,
-                                gras_msgtype_t msgt_want,
-                                xbt_socket_t * expeditor, void *payload);
-XBT_PUBLIC(void) gras_msg_handleall(double period);
-XBT_PUBLIC(void) gras_msg_handle(double timeOut);
-
-/** @} */
-
-/** @defgroup GRAS_msg_rpc RPC specific functions
- *  @ingroup  GRAS_msg
- *
- * Remote Procedure Call (RPC) are a classical mecanism to request a service
- * from a remote host. Using this set of functions, you let GRAS doing most of
- * the work of sending the request, wait for an answer, make sure it is the
- * right answer from the right host and so on.  Any exception raised on the
- * server is also passed over the network to the client.
- * 
- * Callbacks are attached to RPC incoming messages the regular way using
- * \ref gras_cb_register.
- * 
- * For an example of use, check the examples/gras/rpc directory of the distribution.
- */
-/** @{ */
-
-/* declaration */
-XBT_PUBLIC(void) gras_msgtype_declare_rpc(const char *name,
-                                          xbt_datadesc_type_t
-                                          payload_request,
-                                          xbt_datadesc_type_t
-                                          payload_answer);
-
-XBT_PUBLIC(void) gras_msgtype_declare_rpc_v(const char *name,
-                                            short int version,
-                                            xbt_datadesc_type_t
-                                            payload_request,
-                                            xbt_datadesc_type_t
-                                            payload_answer);
-
-/* client side */
-
-/** @brief Conduct a RPC call
- *  @hideinitializer
- */
-#define gras_msg_rpccall(server,timeout,msg,req,ans) gras_msg_rpccall_(server,timeout,gras_msgtype_by_name(msg),req,ans)
-XBT_PUBLIC(void) gras_msg_rpccall_(xbt_socket_t server,
-                                   double timeOut,
-                                   gras_msgtype_t msgtype,
-                                   void *request, void *answer);
-XBT_PUBLIC(gras_msg_cb_ctx_t)
-
-/** @brief Launch a RPC call, but do not block for the answer
- *  @hideinitializer
- */
-#define gras_msg_rpc_async_call(server,timeout,msg,req) gras_msg_rpc_async_call_(server,timeout,gras_msgtype_by_name(msg),req)
-    gras_msg_rpc_async_call_(xbt_socket_t server,
-                         double timeOut,
-                         gras_msgtype_t msgtype, void *request);
-XBT_PUBLIC(void) gras_msg_rpc_async_wait(gras_msg_cb_ctx_t ctx,
-                                         void *answer);
-
-/* server side */
-XBT_PUBLIC(void) gras_msg_rpcreturn(double timeOut, gras_msg_cb_ctx_t ctx,
-                                    void *answer);
-
-
-/** @} */
-
-/** @defgroup GRAS_msg_exchangeadv Message exchange (advanced interface)
- *  @ingroup  GRAS_msg
- *
- */
-/** @{ */
-
-/** @brief Message kind (internal enum) */
-typedef enum {
-  e_gras_msg_kind_unknown = 0,
-
-  e_gras_msg_kind_oneway = 1,
-                               /**< good old regular messages */
-
-  e_gras_msg_kind_rpccall = 2,
-                               /**< RPC request */
-  /* HACK: e_gras_msg_kind_rpccall also designate RPC message *type* in 
-     msgtype_t, not only in msg_t */
-  e_gras_msg_kind_rpcanswer = 3,
-                               /**< RPC successful answer */
-  e_gras_msg_kind_rpcerror = 4,
-                               /**< RPC failure on server (payload=exception); should not leak to user-space */
-
-  /* future:
-     call cancel, and others
-     even after:
-     forwarding request and other application level routing stuff
-     group communication
-   */
-
-  e_gras_msg_kind_count = 5     /* sentinel, don't mess with */
-} e_gras_msg_kind_t;
-
-
-/** @brief Message instance (internal struct) */
-typedef struct {
-  xbt_socket_t expe;
-  e_gras_msg_kind_t kind;
-  gras_msgtype_t type;
-  unsigned long int ID;
-  void *payl;
-  int payl_size;
-} s_gras_msg_t, *gras_msg_t;
-
-typedef int (*gras_msg_filter_t) (gras_msg_t msg, void *ctx);
-
-#define gras_msg_wait_ext(timeout, msg, expe, filter, fctx,got) gras_msg_wait_ext_(timeout, gras_msgtype_by_name(msg), expe, filter, fctx,got)
-XBT_PUBLIC(void) gras_msg_wait_ext_(double timeout,
-                                    gras_msgtype_t msgt_want,
-                                    xbt_socket_t expe_want,
-                                    gras_msg_filter_t filter,
-                                    void *filter_ctx, gras_msg_t msg_got);
-
-XBT_PUBLIC(void) gras_msg_wait_or(double timeout,
-                                  xbt_dynar_t msgt_want,
-                                  gras_msg_cb_ctx_t * ctx,
-                                  int *msgt_got, void *payload);
-
-
-/* @} */
-
-SG_END_DECL()
-#endif                          /* GRAS_MSG_H */
diff --git a/include/gras/module.h b/include/gras/module.h
deleted file mode 100644 (file)
index d318e49..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (c) 2004, 2006, 2007, 2009, 2010. 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. */
-
-
-#ifndef GRAS_MODULE_H
-#define GRAS_MODULE_H
-
-#include <xbt.h>
-
-/* Function users of module should use */
-XBT_PUBLIC(void) gras_module_join(const char *name);
-XBT_PUBLIC(void) gras_module_leave(const char *name);
-
-
-/* Functions module implementor should use */
-XBT_PUBLIC(void) gras_module_add(const char *name, unsigned int data_size,
-                                 int *ID, void_f_void_t init_f,
-                                 void_f_void_t exit_f,
-                                 void_f_pvoid_t join_f,
-                                 void_f_pvoid_t leave_f);
-
-
-XBT_PUBLIC(void *) gras_moddata_by_id(unsigned int ID);
-
-
-#endif                          /* GRAS_MODULE_H */
diff --git a/include/gras/process.h b/include/gras/process.h
deleted file mode 100644 (file)
index 5fe6d6e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* gras/process.h - Manipulating data related to an host.                   */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_PROCESS_H
-#define GRAS_PROCESS_H
-
-#include "xbt/misc.h"           /* SG_BEGIN_DECL */
-#include "xbt/dict.h"
-
-SG_BEGIN_DECL()
-
-/** \addtogroup GRAS_globals
- * @{ */
-
-/** \brief Create a new thread */
-XBT_PUBLIC(void) gras_agent_spawn(const char *name, xbt_main_func_t code,
-                      int argc, char *argv[], xbt_dict_t properties);
-
-/** @} */
-
-/****************************************************************************/
-/* Manipulating User Data                                                   */
-/****************************************************************************/
-
-/** \addtogroup GRAS_globals
- *  \brief Handling global variables so that it works on simulator.
- * 
- * In GRAS, using globals is forbidden since the "processes" will
- * sometimes run as a thread inside the same process (namely, in
- * simulation mode). So, you have to put all globals in a structure, and
- * let GRAS handle it.
- * 
- * Use the \ref gras_userdata_new macro to create a new user data (or malloc it
- * and use \ref gras_userdata_set yourself), and \ref gras_userdata_get to
- * retrieve a reference to it.
- * 
- * 
- * For more info on this, you may want to check the relevant lesson of the GRAS tutorial online
- */
-/* @{ */
-
-/**
- * \brief Get the data associated with the current process.
- * \ingroup GRAS_globals
- */
-XBT_PUBLIC(void *) gras_userdata_get(void);
-
-/**
- * \brief Set the data associated with the current process.
- * \ingroup GRAS_globals
- */
-XBT_PUBLIC(void *) gras_userdata_set(void *ud);
-
-/** \brief Malloc and set the data associated with the current process.
- *
- * @warning gras_userdata_new() expects the pointed type, not the
- * pointer type. We know it'a a bit troublesome, but it seems like
- * the only solution since this macro has to compute the size to
- * malloc and should thus know the pointed type. 
- *
- * You'll find an example in the tutorial
- */
-#define gras_userdata_new(type) ((type*)gras_userdata_set(xbt_new0(type,1)))
-/* @} */
-
-SG_END_DECL()
-#endif                          /* GRAS_PROCESS_H */
diff --git a/include/gras/timer.h b/include/gras/timer.h
deleted file mode 100644 (file)
index 40c3062..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* timer - delayed and repetitive tasks                                     */
-/* module's public interface exported to end user.                          */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_TIMER_H
-#define GRAS_TIMER_H
-
-#include "xbt/misc.h"
-
-SG_BEGIN_DECL()
-
-/** @addtogroup GRAS_timer
- *  @brief Delayed and repetitive tasks
- *
- *  This is how to have a specific function called only once after the
- *  specified amount of time or a function executed every 5 mn until it gets 
- *  removed. In the UNIX world, this is comparable to <tt>at</tt> and 
- *  <tt>cron</tt>.
- *
- *  Note that this is very soft timers: the execution of the processes won't
- *  get interrupted at all. This is on purpose: the GRAS programming model
- *  is distributed sequential, so that users don't have to deal with mutexes
- *  and such within a specific process.
- *
- *  Timers are served by the gras_handle() function: if there is an elapsed 
- *  timer, the associated code gets executed before any incoming connexion 
- *  are checked. 
- *
- *  The section \ref GRAS_ex_timer constitutes a perfect example of these features.
- * 
- *  @{
- */
-XBT_PUBLIC(void) gras_timer_delay(double delay, void_f_void_t action);
-XBT_PUBLIC(void) gras_timer_repeat(double interval, void_f_void_t action);
-
-XBT_PUBLIC(void) gras_timer_cancel_delay(double interval,
-                                         void_f_void_t action);
-XBT_PUBLIC(void) gras_timer_cancel_repeat(double interval,
-                                          void_f_void_t action);
-
-XBT_PUBLIC(void) gras_timer_cancel_delay_all(void);
-XBT_PUBLIC(void) gras_timer_cancel_repeat_all(void);
-
-XBT_PUBLIC(void) gras_timer_cancel_all(void);
-
-/** @} */
-
-SG_END_DECL()
-#endif                          /* GRAS_TIMER_H */
diff --git a/include/gras/transport.h b/include/gras/transport.h
deleted file mode 100644 (file)
index cdddc2d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-
-/* transport - low level communication (send/receive bunches of bytes)      */
-/* module's public interface exported to end user.                          */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_TRANSPORT_H
-#define GRAS_TRANSPORT_H
-
-#include "xbt/socket.h"
-
-/** \addtogroup GRAS_sock
- *  \brief Socket handling
- *
- * The model of communications in GRAS is very close to the BSD socket one.
- * To get two hosts exchanging data, one of them need to open a
- * <i>server</i> socket on which it can listen for incoming messages and the
- * other one must connect a <i>client</i> socket onto the server one.
- *
- * The main difference is that you cannot exchange arbitrary bytes on
- * sockets, but messages. See the \ref GRAS_msg section for details.
- *
- * If you need an example of how to use sockets, check \ref GRAS_ex_ping.
- *
- */
-
-/** \defgroup GRAS_sock_create Socket creation functions
- *  \ingroup GRAS_sock
- *
- */
-/* @{*/
-
-/** \brief Simply create a client socket (to speak to a remote host) */
-XBT_PUBLIC(xbt_socket_t) gras_socket_client(const char *host,
-                                             unsigned short port);
-XBT_PUBLIC(xbt_socket_t) gras_socket_client_from_string(const char *host);
-/** \brief Simply create a server socket (to ear from remote hosts speaking to you) */
-XBT_PUBLIC(xbt_socket_t) gras_socket_server(unsigned short port);
-XBT_PUBLIC(void) gras_socket_close(xbt_socket_t sd);
-XBT_PUBLIC(void) gras_socket_close_voidp(void *sock);
-
-/** \brief Create a client socket, full interface to all relevant settings */
-XBT_PUBLIC(xbt_socket_t) gras_socket_client_ext(const char *host,
-                                                unsigned short port,
-                                                unsigned long int bufSize,
-                                                int measurement);
-/** \brief Create a server socket, full interface to all relevant settings */
-XBT_PUBLIC(xbt_socket_t) gras_socket_server_ext(unsigned short port,
-                                                unsigned long int bufSize,
-                                                int measurement);
-XBT_PUBLIC(xbt_socket_t)
-    gras_socket_server_range(unsigned short minport, unsigned short maxport,
-                             unsigned long int buf_size, int measurement);
-
-/* @}*/
-
-/** \defgroup GRAS_sock_file Using files as sockets
- *  \ingroup GRAS_sock
- * 
- *
- * For debugging purpose, it is possible to deal with files as if they were sockets.
- * It can even be useful to store stuff in a portable manner, but writing messages to a file
- * may be strange...
- * 
- * \bug Don't use '-' on windows. this file represents stdin or stdout, but I failed to deal with it on windows.
- */
-/* @{*/
-/* debuging functions */
-XBT_PUBLIC(xbt_socket_t) gras_socket_client_from_file(const char *path);
-XBT_PUBLIC(xbt_socket_t) gras_socket_server_from_file(const char *path);
-
-/* @} */
-
-void gras_trp_sg_setup(xbt_trp_plugin_t plug);
-void gras_trp_file_setup(xbt_trp_plugin_t plug);
-
-#endif                          /* GRAS_TRANSPORT_H */
diff --git a/include/gras/virtu.h b/include/gras/virtu.h
deleted file mode 100644 (file)
index c735cdf..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* gras/virtu.h - public interface to virtualization (cross-OS portability) */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_VIRTU_H
-#define GRAS_VIRTU_H
-
-#include "xbt/misc.h"           /* SG_BEGIN_DECL */
-#include "xbt/time.h"
-#include "xbt/dict.h"
-
-SG_BEGIN_DECL()
-
-/* Initialization of the simulation world. Do not call them in RL. 
-   Indeed, do not call them at all. Let gras_stub_generator do it for you. */
-XBT_PUBLIC(void) gras_global_init(int *argc, char **argv);
-XBT_PUBLIC(void) gras_create_environment(const char *file);
-XBT_PUBLIC(void) gras_function_register(const char *name, xbt_main_func_t code);
-XBT_PUBLIC(void) gras_function_register_default(xbt_main_func_t code);
-XBT_PUBLIC(void) gras_launch_application(const char *file);
-XBT_PUBLIC(void) gras_load_environment_script(const char *file);
-XBT_PUBLIC(void) gras_clean(void);
-XBT_PUBLIC(void) gras_main(void);
-
-
-/** @addtogroup GRAS_virtu  
- *  @brief System call abstraction layer.
- *
- *
- *  @{
- */
-
-/** @brief Get the current time
- *  @return number of second since the Epoch.
- *  (00:00:00 UTC, January 1, 1970 in Real Life, and begining of simulation in SG)
- */
-#define gras_os_time() xbt_time()
-/** @brief sleeps for the given amount of time.
- *  @param sec: number of seconds to sleep
- */
-#define gras_os_sleep(sec) xbt_sleep(sec)
-/** @brief get the fully-qualified name of the current host
- *
- * Returns the fully-qualified name of the host machine, or "localhost" if the name
- * cannot be determined.  Always returns the same value, so multiple calls
- * cause no problems.
- */
-XBT_PUBLIC(const char *) gras_os_myname(void);
-
-/** @brief returns the number on which this process is listening for incoming messages */
-XBT_PUBLIC(int) gras_os_myport(void);
-
-/** @brief get the uri of the current process
- *
- * Returns the concatenation of gras_os_myname():gras_os_myport(). Please do not free the result.
- */
-XBT_PUBLIC(const char *) gras_os_hostport(void);
-
-/** @brief get process identification
- *
- * Returns the process ID of the current process.  (This is often used
-   by routines that generate unique temporary file names.)
- */
-XBT_PUBLIC(int) gras_os_getpid(void);
-
-
-/* Properties related */
-XBT_PUBLIC(xbt_dict_t) gras_process_properties(void);
-XBT_PUBLIC(const char *) gras_process_property_value(const char *name);
-
-XBT_PUBLIC(xbt_dict_t) gras_os_host_properties(void);
-XBT_PUBLIC(const char *) gras_os_host_property_value(const char *name);
-
-/** @} */
-SG_END_DECL()
-#endif                          /* GRAS_VIRTU_H */
diff --git a/include/xbt/socket.h b/include/xbt/socket.h
deleted file mode 100644 (file)
index 3d568a7..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/* transport - low level communication (send/receive bunches of bytes)      */
-/* module's public interface exported to end user.                          */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef XBT_SOCKET_H
-#define XBT_SOCKET_H
-
-#include "xbt/misc.h"
-
-/** \addtogroup XBT_sock
- *  \brief Socket handling
- *
- * The model of communications in XBT is very close to the BSD socket one.
- * To get two hosts exchanging data, one of them needs to open a
- * <i>server</i> socket on which it can listen for incoming messages and the
- * other one must connect a <i>client</i> socket onto the server one.
- *
- * The main difference is that you cannot exchange arbitrary bytes on
- * sockets, but messages. See the \ref GRAS_msg section for details.
- *
- * If you need an example of how to use sockets, check \ref GRAS_ex_ping.
- */
-
-/** \defgroup XBT_sock_create Socket creation functions
- *  \ingroup XBT_sock
- *
- */
-/* @{*/
-/** \brief Opaque type describing a socket */
-typedef struct s_xbt_socket *xbt_socket_t;
-typedef struct s_xbt_trp_plugin s_xbt_trp_plugin_t, *xbt_trp_plugin_t;
-
-XBT_PUBLIC(void) xbt_socket_new(int incoming, xbt_socket_t* dst);
-XBT_PUBLIC(void) xbt_socket_new_ext(int incoming,
-                                    xbt_socket_t* dst,
-                                    xbt_trp_plugin_t plugin,
-                                    unsigned long int buf_size,
-                                    int measurement);
-XBT_PUBLIC(void*) xbt_socket_get_data(xbt_socket_t sock);
-XBT_PUBLIC(void) xbt_socket_set_data(xbt_socket_t sock, void* data);
-
-/** \brief Simply create a client socket (to speak to a remote host) */
-XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_client(const char *host,
-                                               unsigned short port);
-XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_client_from_string(const char *host);
-/** \brief Simply create a server socket (to ear from remote hosts speaking to you) */
-XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_server(unsigned short port);
-
-/** \brief Create a client socket, full interface to all relevant settings */
-XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_client_ext(const char *host,
-                                                   unsigned short port,
-                                                   unsigned long int bufSize,
-                                                   int measurement);
-/** \brief Create a server socket, full interface to all relevant settings */
-XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_server_ext(unsigned short portcp_t,
-                                                   unsigned long int bufSize,
-                                                   int measurement);
-XBT_PUBLIC(xbt_socket_t)
-    xbt_socket_tcp_server_range(unsigned short minport, unsigned short maxport,
-                                unsigned long int buf_size, int measurement);
-
-XBT_PUBLIC(void) xbt_socket_close(xbt_socket_t sd);
-XBT_PUBLIC(void) xbt_socket_close_voidp(void *sock);
-
-/* @}*/
-/** \defgroup XBT_sock_info Retrieving data about sockets and peers
- *  \ingroup XBT_sock
- * 
- * Who are you talking to? 
- */
-/* @{*/
-
-/** Get the port number on which this socket is connected on my side */
-XBT_PUBLIC(int) xbt_socket_my_port(xbt_socket_t sock);
-
-/** @brief Get the port number on which this socket is connected on remote side 
- *
- * This is the port declared on remote side with the
- * gras_socket_master() function (if any, or a random number being unique on
- * the remote host). If remote used gras_socket_master() more than once, the 
- * lastly declared number will be used here.
- *
- * Note to BSD sockets experts: With BSD sockets, the sockaddr 
- * structure allows you to retrieve the port of the client socket on
- * remote side, but it is of no use (from user perspective, it is
- * some random number above 6000). That is why XBT sockets differ
- * from BSD ones here. 
- */
-XBT_PUBLIC(int) xbt_socket_peer_port(xbt_socket_t sock);
-/** Get the host name of the remote side */
-XBT_PUBLIC(const char *) xbt_socket_peer_name(xbt_socket_t sock);
-/** Get the process name of the remote side */
-XBT_PUBLIC(const char *) xbt_socket_peer_proc(xbt_socket_t sock);
-/* @}*/
-
-/** \defgroup XBT_sock_meas Using measurement sockets
- *  \ingroup XBT_sock
- * 
- * You may want to use sockets not to exchange valuable data (in messages), 
- * but to conduct some bandwidth measurements and related experiments. If so, try those measurement sockets.
- * 
- * You can only use those functions on sockets opened with the "measurement" boolean set to true.
- * 
- */
-/* @{*/
-
-XBT_PUBLIC(int) xbt_socket_is_meas(xbt_socket_t sock);
-XBT_PUBLIC(void) xbt_socket_meas_send(xbt_socket_t peer,
-                                      unsigned int timeout,
-                                      unsigned long int msgSize,
-                                      unsigned long int msgAmount);
-XBT_PUBLIC(void) xbt_socket_meas_recv(xbt_socket_t peer,
-                                      unsigned int timeout,
-                                      unsigned long int msgSize,
-                                      unsigned long int msgAmount);
-XBT_PUBLIC(xbt_socket_t) xbt_socket_meas_accept(xbt_socket_t peer);
-
-/* @}*/
-
-/***
- *** Main user functions
- ***/
-/* stable if we know the storage will keep as is until the next trp_flush */
-XBT_PUBLIC(void) xbt_trp_send(xbt_socket_t sd, char *data, long int size,
-                             int stable);
-XBT_PUBLIC(void) xbt_trp_recv(xbt_socket_t sd, char *data, long int size);
-XBT_PUBLIC(void) xbt_trp_flush(xbt_socket_t sd);
-
-/* Find which socket needs to be read next */
-XBT_PUBLIC(xbt_socket_t) xbt_trp_select(double timeout);
-
-/* Set the peer process name (used by messaging layer) */
-XBT_PUBLIC(void) xbt_socket_peer_proc_set(xbt_socket_t sock,
-                                          char *peer_proc);
-
-/** \defgroup XBT_sock_plugin Plugin mechanism
- *  \ingroup XBT_sock
- *
- * XBT provides a TCP plugin that implements TCP sockets.
- * You can also write your own plugin if you need another socket
- * implementation.
- */
-/* @{*/
-
-/* A plugin type */
-
-struct s_xbt_trp_plugin {
-  char *name;
-
-  /* dst pointers are created and initialized with default values
-     before call to socket_client/server.
-     Retrieve the info you need from there. */
-  void (*socket_client) (xbt_trp_plugin_t self, const char *host, int port, xbt_socket_t dst);
-  void (*socket_server) (xbt_trp_plugin_t self, int port, xbt_socket_t dst);
-
-  xbt_socket_t (*socket_accept) (xbt_socket_t from);
-
-  /* Getting info about who's speaking */
-  int (*my_port) (xbt_socket_t sd);
-  int (*peer_port) (xbt_socket_t sd);
-  const char* (*peer_name) (xbt_socket_t sd);
-  const char* (*peer_proc) (xbt_socket_t sd);
-  void (*peer_proc_set) (xbt_socket_t sd, char* peer_proc);
-
-  /* socket_close() is responsible of telling the OS that the socket is over,
-     but should not free the socket itself (beside the specific part) */
-  void (*socket_close) (xbt_socket_t sd);
-
-  /* send/recv may be buffered */
-  void (*send) (xbt_socket_t sd,
-                const char *data,
-                unsigned long int size,
-                int stable /* storage will survive until flush */ );
-  int (*recv) (xbt_socket_t sd, char *data, unsigned long int size);
-  /* raw_send/raw_recv is never buffered (use it for measurement stuff) */
-  void (*raw_send) (xbt_socket_t sd,
-                    const char *data, unsigned long int size);
-  int (*raw_recv) (xbt_socket_t sd, char *data, unsigned long int size);
-
-  /* flush has to make sure that the pending communications are achieved */
-  void (*flush) (xbt_socket_t sd);
-
-  void *data;                   /* plugin-specific data */
-
-  /* exit is responsible for freeing data and telling to the OS that
-     this plugin is gone.
-     If exit is NULL, data gets brutally freed by the generic interface.
-     (i.e. an exit function is only needed when data contains pointers) */
-  void (*exit) (xbt_trp_plugin_t);
-};
-
-typedef void (*xbt_trp_setup_t) (xbt_trp_plugin_t dst);
-
-XBT_PUBLIC(void) xbt_trp_plugin_new(const char *name, xbt_trp_setup_t setup);
-XBT_PUBLIC(xbt_trp_plugin_t)
-    xbt_trp_plugin_get_by_name(const char *name);
-
-/* @}*/
-
-#endif                          /* XBT_SOCKET_H */
diff --git a/include/xbt/time.h b/include/xbt/time.h
deleted file mode 100644 (file)
index 6795b05..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* xbt/time.h -- Time tools                                                  */
-/* Usable in simulator, (or in real life when mixing with GRAS)             */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#include "xbt/misc.h"           /* SG_BEGIN_DECL */
-
-SG_BEGIN_DECL()
-
-/**
- *
- * Time management functions, returns the system time or sleeps a process. They work both on the simulated and real systems(GRAS). 
- */
-XBT_PUBLIC(double) xbt_time(void);
-XBT_PUBLIC(void) xbt_sleep(double sec);
-
-SG_END_DECL()
index e960c4a..c298083 100644 (file)
 
 SG_BEGIN_DECL()
 
 
 SG_BEGIN_DECL()
 
-    /* Get the PID of the current process */
-    XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid;
+/* Get the PID of the current (simulated) process */
+XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid;
+
+/* Current time */
+XBT_PUBLIC(double) xbt_time(void);
+
+    /* Get the name of the UNIX process englobing the world */
+    XBT_PUBLIC(const char*) xbt_os_procname(void);
+
+    /**
+     *
+     * Time management functions, returns the system time or sleeps a process. They work both on the simulated and real systems(GRAS).
+     */
+    XBT_PUBLIC(double) xbt_time(void);
+    XBT_PUBLIC(void) xbt_sleep(double sec);
+
 
 SG_END_DECL()
 #endif                          /* __XBT_VIRTU_H__ */
 
 SG_END_DECL()
 #endif                          /* __XBT_VIRTU_H__ */
diff --git a/src/amok/Bandwidth/bandwidth.c b/src/amok/Bandwidth/bandwidth.c
deleted file mode 100644 (file)
index 05ebc4e..0000000
+++ /dev/null
@@ -1,544 +0,0 @@
-/* amok_bandwidth - Bandwidth tests facilities                              */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "amok/Bandwidth/bandwidth_private.h"
-#include "gras/messages.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw, amok, "Bandwidth testing");
-
-
-/******************************
- * Stuff global to the module *
- ******************************/
-
-static short _amok_bw_initialized = 0;
-
-/** @brief module initialization; all participating nodes must run this */
-void amok_bw_init(void)
-{
-
-  if (!_amok_bw_initialized) {
-    amok_bw_bw_init();
-    amok_bw_sat_init();
-  }
-
-  amok_bw_bw_join();
-  amok_bw_sat_join();
-
-  _amok_bw_initialized++;
-}
-
-/** @brief module finalization */
-void amok_bw_exit(void)
-{
-  if (!_amok_bw_initialized)
-    return;
-
-  amok_bw_bw_leave();
-  amok_bw_sat_leave();
-
-  _amok_bw_initialized--;
-}
-
-/* ***************************************************************************
- * Bandwidth tests
- * ***************************************************************************/
-static int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload);
-static int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, void *payload);
-
-void amok_bw_bw_init()
-{
-  xbt_datadesc_type_t bw_request_desc, bw_res_desc;
-
-  /* Build the Bandwidth datatype descriptions */
-  bw_request_desc = xbt_datadesc_struct("s_bw_request_t");
-  xbt_datadesc_struct_append(bw_request_desc, "peer",
-                              xbt_datadesc_by_name("s_xbt_peer_t"));
-  xbt_datadesc_struct_append(bw_request_desc, "buf_size",
-                              xbt_datadesc_by_name("unsigned long int"));
-  xbt_datadesc_struct_append(bw_request_desc, "msg_size",
-                              xbt_datadesc_by_name("unsigned long int"));
-  xbt_datadesc_struct_append(bw_request_desc, "msg_amount",
-                              xbt_datadesc_by_name("unsigned long int"));
-  xbt_datadesc_struct_append(bw_request_desc, "min_duration",
-                              xbt_datadesc_by_name("double"));
-  xbt_datadesc_struct_close(bw_request_desc);
-  bw_request_desc = xbt_datadesc_ref("bw_request_t", bw_request_desc);
-
-  bw_res_desc = xbt_datadesc_struct("s_bw_res_t");
-  xbt_datadesc_struct_append(bw_res_desc, "timestamp",
-                              xbt_datadesc_by_name("unsigned int"));
-  xbt_datadesc_struct_append(bw_res_desc, "seconds",
-                              xbt_datadesc_by_name("double"));
-  xbt_datadesc_struct_append(bw_res_desc, "bw",
-                              xbt_datadesc_by_name("double"));
-  xbt_datadesc_struct_close(bw_res_desc);
-  bw_res_desc = xbt_datadesc_ref("bw_res_t", bw_res_desc);
-
-  gras_msgtype_declare_rpc("BW handshake", bw_request_desc,
-                           bw_request_desc);
-
-  gras_msgtype_declare_rpc("BW reask", bw_request_desc, NULL);
-  gras_msgtype_declare("BW stop", NULL);
-
-  gras_msgtype_declare_rpc("BW request", bw_request_desc, bw_res_desc);
-}
-
-void amok_bw_bw_join()
-{
-  gras_cb_register("BW request", &amok_bw_cb_bw_request);
-  gras_cb_register("BW handshake", &amok_bw_cb_bw_handshake);
-}
-
-void amok_bw_bw_leave()
-{
-  gras_cb_unregister("BW request", &amok_bw_cb_bw_request);
-  gras_cb_unregister("BW handshake", &amok_bw_cb_bw_handshake);
-}
-
-/**
- * \brief bandwidth measurement between localhost and \e peer
- * 
- * \arg peer: A (regular) socket at which the the host with which we should conduct the experiment can be contacted
- * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
- * \arg msg_size: Size of each message sent. 
- * \arg msg_amount: Amount of such messages to exchange 
- * \arg min_duration: The minimum wanted duration. When the test message is too little, you tend to measure the latency. This argument allows you to force the test to take at least, say one second.
- * \arg sec: where the result (in seconds) should be stored. If the experiment was done several times because the first one was too short, this is the timing of the last run only.
- * \arg bw: observed Bandwidth (in byte/s) 
- *
- * Conduct a bandwidth test from the local process to the given peer.
- * This call is blocking until the end of the experiment.
- *
- * If the asked experiment lasts less than \a min_duration, another one will be
- * launched (and others, if needed). msg_size will be multiplicated by
- * MIN(20, (\a min_duration / measured_duration) *1.1) (plus 10% to be sure to eventually
- * reach the \a min_duration). In that case, the reported bandwidth and
- * duration are the ones of the last run. \a msg_size cannot go over 64Mb
- * because we need to malloc a block of this size in RL to conduct the
- * experiment, and we still don't want to visit the swap. In such case, the 
- * number of messages is increased instead of their size.
- *
- * Results are reported in last args, and sizes are in byte.
- * 
- * @warning: in SimGrid version 3.1 and previous, the experiment size were specified
- *           as the total amount of data to send and the msg_size. This
- *           was changed for the fool wanting to send more than MAXINT
- *           bytes in a fat pipe.
- * 
- */
-void amok_bw_test(xbt_socket_t peer,
-                  unsigned long int buf_size,
-                  unsigned long int msg_size,
-                  unsigned long int msg_amount,
-                  double min_duration, /*OUT*/ double *sec, double *bw)
-{
-
-  /* Measurement sockets for the experiments */
-  volatile xbt_socket_t measMasterIn = NULL, measIn, measOut = NULL;
-  volatile int port;
-  bw_request_t request, request_ack;
-  xbt_ex_t e;
-  int first_pass;
-
-  for (port = 5000; port < 10000 && measMasterIn == NULL; port++) {
-    TRY {
-      measMasterIn = gras_socket_server_ext(++port, buf_size, 1);
-    }
-    CATCH(e) {
-      measMasterIn = NULL;
-      if (port == 10000 - 1) {
-        RETHROWF("Error caught while opening a measurement socket: %s");
-      } else {
-        xbt_ex_free(e);
-      }
-    }
-  }
-
-  request = xbt_new0(s_bw_request_t, 1);
-  request->buf_size = buf_size;
-  request->msg_size = msg_size;
-  request->msg_amount = msg_amount;
-  request->peer.name = NULL;
-  request->peer.port = xbt_socket_my_port(measMasterIn);
-  XBT_DEBUG
-      ("Handshaking with %s:%d to connect it back on my %d (bufsize=%lu, msg_size=%lu, msg_amount=%lu)",
-       xbt_socket_peer_name(peer), xbt_socket_peer_port(peer),
-       request->peer.port, request->buf_size, request->msg_size,
-       request->msg_amount);
-
-  TRY {
-    gras_msg_rpccall(peer, 15, "BW handshake", &request, &request_ack);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Error encountered while sending the BW request: %s");
-  }
-  measIn = xbt_socket_meas_accept(measMasterIn);
-
-  TRY {
-    measOut = gras_socket_client_ext(xbt_socket_peer_name(peer),
-                                     request_ack->peer.port,
-                                     request->buf_size, 1);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF
-        ("Error encountered while opening the measurement socket to %s:%d for BW test: %s",
-         xbt_socket_peer_name(peer), request_ack->peer.port);
-  }
-  XBT_DEBUG
-      ("Got ACK; conduct the experiment (msg_size = %lu, msg_amount=%lu)",
-       request->msg_size, request->msg_amount);
-
-  *sec = 0;
-  first_pass = 1;
-  do {
-    if (first_pass == 0) {
-      double meas_duration = *sec;
-      double increase;
-      if (*sec != 0.0) {
-        increase = (min_duration / meas_duration) * 1.1;
-      } else {
-        increase = 4;
-      }
-      /* Do not increase the exp size too fast since our decision would be based on wrong measurements */
-      if (increase > 20)
-        increase = 20;
-
-      request->msg_size = request->msg_size * increase;
-
-      /* Do not do too large experiments messages or the sensors 
-         will start to swap to store one of them.
-         And then increase the number of messages to compensate (check for overflow there, too) */
-      if (request->msg_size > 64 * 1024 * 1024) {
-        unsigned long int new_amount =
-            ((request->msg_size / ((double) 64 * 1024 * 1024))
-             * request->msg_amount) + 1;
-
-        xbt_assert(new_amount > request->msg_amount,
-                    "Overflow on the number of messages! You must have a *really* fat pipe. Please fix your platform");
-        request->msg_amount = new_amount;
-
-        request->msg_size = 64 * 1024 * 1024;
-      }
-
-      XBT_VERB
-          ("The experiment was too short (%f sec<%f sec). Redo it with msg_size=%lu (nb_messages=%lu) (got %fMb/s)",
-           meas_duration, min_duration, request->msg_size,
-           request->msg_amount,
-           ((double) request->msg_size) * ((double) request->msg_amount /
-                                           (*sec) / 1024.0 / 1024.0));
-
-      gras_msg_rpccall(peer, 60, "BW reask", &request, NULL);
-    }
-
-    first_pass = 0;
-    *sec = gras_os_time();
-    TRY {
-      xbt_socket_meas_send(measOut, 120, request->msg_size,
-                            request->msg_amount);
-      XBT_DEBUG("Data sent. Wait ACK");
-      xbt_socket_meas_recv(measIn, 120, 1, 1);
-    }
-    CATCH_ANONYMOUS {
-      gras_socket_close(measOut);
-      gras_socket_close(measMasterIn);
-      gras_socket_close(measIn);
-      RETHROWF("Unable to conduct the experiment: %s");
-    }
-    *sec = gras_os_time() - *sec;
-    if (*sec != 0.0) {
-      *bw =
-          ((double) request->msg_size) * ((double) request->msg_amount) /
-          (*sec);
-    }
-    XBT_DEBUG("Experiment done ; it took %f sec", *sec);
-    if (*sec <= 0) {
-      XBT_CRITICAL("Nonpositive value (%f) found for BW test time.", *sec);
-    }
-
-  } while (*sec < min_duration);
-
-  XBT_DEBUG
-      ("This measurement was long enough (%f sec; found %f b/s). Stop peer",
-       *sec, *bw);
-  gras_msg_send(peer, "BW stop", NULL);
-
-  free(request_ack);
-  free(request);
-  if (measIn != measMasterIn)
-    gras_socket_close(measIn);
-  gras_socket_close(measMasterIn);
-  gras_socket_close(measOut);
-}
-
-
-/* Callback to the "BW handshake" message: 
-   opens a server measurement socket,
-   indicate its port in an "BW handshaked" message,
-   receive the corresponding data on the measurement socket, 
-   close the measurement socket
-
-   sizes are in byte
-*/
-int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  volatile xbt_socket_t measMasterIn = NULL,  measIn = NULL, measOut = NULL;
-  volatile bw_request_t request = *(bw_request_t *) payload;
-  bw_request_t answer;
-  xbt_ex_t e;
-  volatile int port;
-  volatile int tooshort = 1;
-  gras_msg_cb_ctx_t ctx_reask;
-  static xbt_dynar_t msgtwaited = NULL;
-
-  XBT_DEBUG
-      ("Handshaked to connect to %s:%d (sizes: buf=%lu msg=%lu msg_amount=%lu)",
-       xbt_socket_peer_name(expeditor), request->peer.port,
-       request->buf_size, request->msg_size, request->msg_amount);
-
-  /* Build our answer */
-  answer = xbt_new0(s_bw_request_t, 1);
-
-  for (port = 6000; port <= 10000 && measMasterIn == NULL; port++) {
-    TRY {
-      measMasterIn = gras_socket_server_ext(port, request->buf_size, 1);
-    }
-    CATCH(e) {
-      measMasterIn = NULL;
-      if (port < 10000)
-        xbt_ex_free(e);
-      else
-        /* FIXME: tell error to remote */
-        RETHROWF
-            ("Error encountered while opening a measurement server socket: %s");
-    }
-  }
-
-  answer->buf_size = request->buf_size;
-  answer->msg_size = request->msg_size;
-  answer->msg_amount = request->msg_amount;
-  answer->peer.port = xbt_socket_my_port(measMasterIn);
-
-  TRY {
-    gras_msg_rpcreturn(60, ctx, &answer);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(measMasterIn);
-    /* FIXME: tell error to remote */
-    RETHROWF("Error encountered while sending the answer: %s");
-  }
-
-
-  /* Don't connect asap to leave time to other side to enter the accept() */
-  TRY {
-    measOut = gras_socket_client_ext(xbt_socket_peer_name(expeditor),
-                                     request->peer.port,
-                                     request->buf_size, 1);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF
-        ("Error encountered while opening a measurement socket back to %s:%d : %s",
-         xbt_socket_peer_name(expeditor), request->peer.port);
-    /* FIXME: tell error to remote */
-  }
-
-  TRY {
-    measIn = xbt_socket_meas_accept(measMasterIn);
-    XBT_DEBUG
-        ("BW handshake answered. buf_size=%lu msg_size=%lu msg_amount=%lu port=%d",
-         answer->buf_size, answer->msg_size, answer->msg_amount,
-         answer->peer.port);
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(measMasterIn);
-    gras_socket_close(measIn);
-    gras_socket_close(measOut);
-    /* FIXME: tell error to remote ? */
-    RETHROWF("Error encountered while opening the meas socket: %s");
-  }
-
-  if (!msgtwaited) {
-    msgtwaited = xbt_dynar_new(sizeof(gras_msgtype_t), NULL);
-    xbt_dynar_push(msgtwaited, gras_msgtype_by_name("BW stop"));
-    xbt_dynar_push(msgtwaited, gras_msgtype_by_name("BW reask"));
-  }
-
-  while (tooshort) {
-    void *payloadgot;
-    int msggot;
-    TRY {
-      xbt_socket_meas_recv(measIn, 120, request->msg_size,
-                            request->msg_amount);
-      xbt_socket_meas_send(measOut, 120, 1, 1);
-    }
-    CATCH_ANONYMOUS {
-      gras_socket_close(measMasterIn);
-      gras_socket_close(measIn);
-      gras_socket_close(measOut);
-      /* FIXME: tell error to remote ? */
-      RETHROWF("Error encountered while receiving the experiment: %s");
-    }
-    gras_msg_wait_or(60, msgtwaited, &ctx_reask, &msggot, &payloadgot);
-    switch (msggot) {
-    case 0:                    /* BW stop */
-      tooshort = 0;
-      break;
-    case 1:                    /* BW reask */
-      tooshort = 1;
-      free(request);
-      request = (bw_request_t) payloadgot;
-      XBT_VERB("Return the reasking RPC");
-      gras_msg_rpcreturn(60, ctx_reask, NULL);
-    }
-    gras_msg_cb_ctx_free(ctx_reask);
-  }
-
-  if (measIn != measMasterIn)
-    gras_socket_close(measMasterIn);
-  gras_socket_close(measIn);
-  gras_socket_close(measOut);
-  free(answer);
-  free(request);
-  XBT_VERB("BW experiment done.");
-  return 0;
-}
-
-/**
- * \brief request a bandwidth measurement between two remote peers
- *
- * \arg from_name: Name of the first peer 
- * \arg from_port: port on which the first process is listening for messages
- * \arg to_name: Name of the second peer 
- * \arg to_port: port on which the second process is listening (for messages, do not 
- * give a measurement socket here. The needed measurement sockets will be created 
- * automatically and negociated between the peers)
- * \arg buf_size: Size of the socket buffer. If 0, a sain default is used (32k, but may change)
- * \arg msg_size: Size of each message sent. 
- * \arg msg_amount: Amount of such data to exchange
- * \arg sec: where the result (in seconds) should be stored.
- * \arg bw: observed Bandwidth (in byte/s)
- *
- * Conduct a bandwidth test from the process from_peer:from_port to to_peer:to_port.
- * This call is blocking until the end of the experiment.
- *
- * @warning: in SimGrid version 3.1 and previous, the experiment size were specified
- *           as the total amount of data to send and the msg_size. This
- *           was changed for the fool wanting to send more than MAXINT
- *           bytes in a fat pipe.
- * 
- * Results are reported in last args, and sizes are in bytes.
- */
-void amok_bw_request(const char *from_name, unsigned int from_port,
-                     const char *to_name, unsigned int to_port,
-                     unsigned long int buf_size,
-                     unsigned long int msg_size,
-                     unsigned long int msg_amount,
-                     double min_duration, /*OUT*/ double *sec, double *bw)
-{
-
-  xbt_socket_t sock;
-  /* The request */
-  bw_request_t request;
-  bw_res_t result;
-  request = xbt_new0(s_bw_request_t, 1);
-  request->buf_size = buf_size;
-  request->msg_size = msg_size;
-  request->msg_amount = msg_amount;
-  request->min_duration = min_duration;
-
-
-  request->peer.name = (char *) to_name;
-  request->peer.port = to_port;
-
-
-  sock = gras_socket_client(from_name, from_port);
-
-
-
-  XBT_DEBUG("Ask for a BW test between %s:%u and %s:%u", from_name, from_port,
-         to_name, to_port);
-  gras_msg_rpccall(sock, 20 * 60, "BW request", &request, &result);
-
-  if (sec)
-    *sec = result->sec;
-  if (bw)
-    *bw = result->bw;
-
-  XBT_VERB("BW test (%s:%u -> %s:%u) took %f sec (%f kb/s)",
-        from_name, from_port, to_name, to_port,
-        result->sec, ((double) result->bw) / 1024.0);
-
-  gras_socket_close(sock);
-  free(result);
-  free(request);
-}
-
-int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, void *payload)
-{
-
-  /* specification of the test to run, and our answer */
-  bw_request_t request = *(bw_request_t *) payload;
-  bw_res_t result = xbt_new0(s_bw_res_t, 1);
-  xbt_socket_t peer, asker;
-
-  asker = gras_msg_cb_ctx_from(ctx);
-  XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %lu %lu)",
-        xbt_socket_peer_name(asker), xbt_socket_peer_port(asker),
-        request->peer.name, request->peer.port,
-        request->msg_size, request->msg_amount);
-  peer = gras_socket_client(request->peer.name, request->peer.port);
-  amok_bw_test(peer,
-               request->buf_size, request->msg_size, request->msg_amount,
-               request->min_duration, &(result->sec), &(result->bw));
-
-  gras_msg_rpcreturn(240, ctx, &result);
-
-  gras_os_sleep(1);
-  gras_socket_close(peer);      /* FIXME: it should be blocking in RL until everything is sent */
-  free(request->peer.name);
-  free(request);
-  free(result);
-
-  return 0;
-}
-
-/** \brief builds a matrix of results of bandwidth measurement
- * 
- * @warning: in SimGrid version 3.1 and previous, the experiment size were specified
- *           as the total amount of data to send and the msg_size. This
- *           was changed for the fool wanting to send more than MAXINT
- *           bytes in a fat pipe.
- */
-double *amok_bw_matrix(xbt_dynar_t peers,
-                       int buf_size_bw, int msg_size_bw, int msg_amount_bw,
-                       double min_duration)
-{
-  double sec;
-  /* construction of matrices for bandwith and latency */
-
-
-  unsigned int i, j;
-  int len = xbt_dynar_length(peers);
-
-  double *matrix_res = xbt_new0(double, len * len);
-  xbt_peer_t p1, p2;
-
-  xbt_dynar_foreach(peers, i, p1) {
-    xbt_dynar_foreach(peers, j, p2) {
-      if (i != j) {
-        /* Mesurements of Bandwidth */
-        amok_bw_request(p1->name, p1->port, p2->name, p2->port,
-                        buf_size_bw, msg_size_bw, msg_amount_bw,
-                        min_duration, &sec, &matrix_res[i * len + j]);
-      }
-    }
-  }
-  return matrix_res;
-}
diff --git a/src/amok/Bandwidth/bandwidth_private.h b/src/amok/Bandwidth/bandwidth_private.h
deleted file mode 100644 (file)
index aa3097a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* bandwidth - network bandwidth tests facilities                           */
-
-/* module's private interface masked even to other parts of AMOK.           */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-
-#ifndef AMOK_BANDWIDTH_PRIVATE_H
-#define AMOK_BANDWIDTH_PRIVATE_H
-
-#include "gras.h"
-#include "amok/bandwidth.h"
-
-void amok_bw_bw_init(void);     /* Must be called only once per node */
-void amok_bw_bw_join(void);     /* Each process must run it */
-void amok_bw_bw_leave(void);    /* Each process must run it */
-
-void amok_bw_sat_init(void);    /* Must be called only once per node */
-void amok_bw_sat_join(void);    /* Each process must run it */
-void amok_bw_sat_leave(void);   /* Each process must run it */
-
-/***
- * Plain bandwidth measurement stuff
- ***/
-
-/* Request for a BW experiment.
- * If peer==NULL, it should be between the sender and the receiver.
- * If not, it should be between between the receiver and peer (3-tiers).
- */
-typedef struct {
-  s_xbt_peer_t peer;            /* peer+raw socket to use */
-  unsigned long int buf_size;
-  unsigned long int msg_size;
-  unsigned long int msg_amount;
-  double min_duration;
-} s_bw_request_t, *bw_request_t;
-
-/* Result of a BW experiment (payload when answering). */
-typedef struct {
-  unsigned int timestamp;
-  double sec;
-  double bw;
-} s_bw_res_t, *bw_res_t;
-
-
-/***
- * Saturation stuff
- ***/
-
-/* Description of a saturation experiment (payload asking some peer to collaborate for that)
- */
-typedef struct {
-  s_xbt_peer_t peer;            /* peer+raw socket to use */
-  unsigned int msg_size;
-  unsigned int duration;
-} s_sat_request_t, *sat_request_t;
-
-void amok_bw_sat_start(const char *from_name, unsigned int from_port,
-                       const char *to_name, unsigned int to_port,
-                       unsigned int msg_size, unsigned int duration);
-
-#endif                          /* AMOK_BANDWIDTH_PRIVATE_H */
diff --git a/src/amok/Bandwidth/saturate.c b/src/amok/Bandwidth/saturate.c
deleted file mode 100644 (file)
index fc374dd..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-/* amok_saturate - Link saturating facilities (for ALNeM's BW testing)      */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "amok/Bandwidth/bandwidth_private.h"
-#include "gras/Msg/msg_private.h"       /* FIXME: This mucks with contextes to answer RPC directly */
-#include "xbt/ex.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_bw_sat, amok_bw,
-                                "Everything concerning the SATuration part of the amok_bw module");
-
-static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload);
-static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload);
-
-
-void amok_bw_sat_init(void)
-{
-  xbt_datadesc_type_t bw_res_desc = xbt_datadesc_by_name("bw_res_t");
-  xbt_datadesc_type_t sat_request_desc;
-  /* Build the saturation datatype descriptions */
-
-  sat_request_desc = xbt_datadesc_struct("s_sat_request_desc_t");
-  xbt_datadesc_struct_append(sat_request_desc, "peer",
-                              xbt_datadesc_by_name("s_xbt_peer_t"));
-  xbt_datadesc_struct_append(sat_request_desc, "msg_size",
-                              xbt_datadesc_by_name("unsigned int"));
-  xbt_datadesc_struct_append(sat_request_desc, "duration",
-                              xbt_datadesc_by_name("unsigned int"));
-  xbt_datadesc_struct_close(sat_request_desc);
-  sat_request_desc = xbt_datadesc_ref("sat_request_t", sat_request_desc);
-
-  /* Register the saturation messages */
-  gras_msgtype_declare_rpc("amok_bw_sat start", sat_request_desc, NULL);
-  gras_msgtype_declare_rpc("amok_bw_sat begin", sat_request_desc,
-                           sat_request_desc);
-  gras_msgtype_declare_rpc("amok_bw_sat stop", NULL, bw_res_desc);
-
-}
-
-void amok_bw_sat_join(void)
-{
-  gras_cb_register("amok_bw_sat start", &amok_bw_cb_sat_start);
-  gras_cb_register("amok_bw_sat begin", &amok_bw_cb_sat_begin);
-}
-
-void amok_bw_sat_leave(void)
-{
-  gras_cb_unregister("amok_bw_sat start", &amok_bw_cb_sat_start);
-  gras_cb_unregister("amok_bw_sat begin", &amok_bw_cb_sat_begin);
-}
-
-/* ***************************************************************************
- * Link saturation
- * ***************************************************************************/
-
-/**
- * @brief Ask 'from_name:from_port' to stop saturating going to to_name:to_name.
- *
- * @param from_name: Name of the peer we are asking to do a experiment with (to_name:to_port)
- * @param from_port: port on which the process we are asking for an experiment is listening
- * (for message, do not give a raw socket here. The needed raw socket will be negociated 
- * between the peers)
- * @param to_name: Name of the peer with which we should conduct the experiment
- * @param to_port: port on which the peer process is listening for message
- * @param msg_size: Size of each message sent.
- * @param duration: How long in maximum should be the saturation.
- *
- * Ask the process 'from_name:from_port' to start to saturate the link between itself
- * and to_name:to_name.
- */
-void amok_bw_saturate_start(const char *from_name, unsigned int from_port,
-                            const char *to_name, unsigned int to_port,
-                            unsigned int msg_size, double duration)
-{
-  xbt_socket_t sock;
-  sat_request_t request = xbt_new(s_sat_request_t, 1);
-
-  XBT_VERB("Start from_name %s:%u -> to_name %s:%u",
-        from_name, from_port, to_name, to_port);
-  sock = gras_socket_client(from_name, from_port);
-
-  request->peer.name = (char *) to_name;
-  request->peer.port = to_port;
-
-  request->duration = duration;
-  request->msg_size = msg_size;
-
-  gras_msg_rpccall(sock, 60, "amok_bw_sat start", &request, NULL);
-
-  free(request);
-  gras_socket_close(sock);
-}
-
-/* Asked to begin a saturation */
-static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  sat_request_t request = *(sat_request_t *) payload;
-  xbt_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-
-  XBT_VERB("Asked by %s:%d to start a saturation to %s:%d",
-        xbt_socket_peer_name(expeditor), xbt_socket_peer_port(expeditor),
-        request->peer.name, request->peer.port);
-
-  gras_msg_rpcreturn(60, ctx, NULL);
-
-  amok_bw_saturate_begin(request->peer.name, request->peer.port,
-                         request->msg_size, request->duration, NULL, NULL);
-
-  free(request->peer.name);
-
-  free(request);
-  return 0;
-}
-
-/**
- * @brief Start saturating between the current process and the designated peer
- *
- * Note that the only way to break this function before the end of the timeout
- * is to have a remote peer calling amok_bw_saturate_stop to this process.
- *
- * If duration=0, the experiment will never timeout (you then have to manually
- * stop it).
- * 
- * If msg_size=0, the size will be automatically computed to make sure that
- * each of the messages occupy the connexion one second
- */
-void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
-                            volatile unsigned int msg_size, double duration,
-                            /*out */ double *elapsed_res, double *bw_res)
-{
-
-  xbt_ex_t e;
-
-  xbt_socket_t peer_cmd = gras_socket_client(to_name, to_port);
-  gras_msg_cb_ctx_t ctx;
-
-  xbt_socket_t meas;
-
-  s_gras_msg_t msg_got;
-
-  volatile unsigned int packet_sent = 0;
-  double start, elapsed = -1;   /* timer */
-  double bw;
-
-  volatile int saturate_further;        /* boolean in the main loop */
-
-  /* Negociate the saturation with the peer */
-  sat_request_t request = xbt_new(s_sat_request_t, 1);
-
-  XBT_DEBUG("Begin to saturate to %s:%u", to_name, to_port);
-  memset(&msg_got, 0, sizeof(msg_got));
-
-  request->msg_size = msg_size;
-  request->duration = duration;
-  request->peer.name = NULL;
-  request->peer.port = 0;
-
-
-  /* Size autodetection on need */
-  if (!msg_size) {
-    double bw;
-    double sec;
-    amok_bw_test(peer_cmd, 0,   /* check buffsize yourself */
-                 512 * 1024,    /* 512k as first guess */
-                 1,             /* One packet only */
-                 1,             /* at least one sec */
-                 &sec, &bw);
-    msg_size = request->msg_size = (int) bw;
-    XBT_DEBUG("Saturate with packets of %u bytes", request->msg_size);
-  }
-
-  /* Launch the saturation */
-
-  ctx =
-      gras_msg_rpc_async_call(peer_cmd, 60, "amok_bw_sat begin", &request);
-  free(request);
-  gras_msg_rpc_async_wait(ctx, &request);
-  meas = gras_socket_client_ext(to_name, request->peer.port,
-                                0 /*bufsize: auto */ ,
-                                1 /*meas: true */ );
-
-  free(request);
-
-  gras_socket_close(peer_cmd);
-  XBT_INFO("Saturation(%s:%d->%s:%u) started", gras_os_myname(),
-        gras_os_myport(), to_name, to_port);
-
-  /* Start experiment */
-  start = gras_os_time();
-
-  do {
-    /* do send it */
-    xbt_socket_meas_send(meas, 120, msg_size, 1);
-    packet_sent++;
-
-    /* Check whether someone asked us to stop saturation */
-    saturate_further = 0;
-    TRY {
-      gras_msg_wait_ext(0 /*no wait */ , "amok_bw_sat stop",
-                        NULL /* accept any sender */ ,
-                        NULL, NULL,     /* No specific filter */
-                        &msg_got);
-    }
-    CATCH(e) {
-      if (e.category == timeout_error) {
-        saturate_further = 1;
-        memset(&msg_got, 0, sizeof(msg_got));   /* may be overprotectiv here */
-      }
-      xbt_ex_free(e);
-    }
-
-    /* Check whether the experiment has to be terminated by now */
-    elapsed = gras_os_time() - start;
-    XBT_DEBUG("elapsed %f duration %f (msg_size=%u)", elapsed, duration,
-           msg_size);
-
-  } while (saturate_further && (duration == 0 || elapsed < duration));
-
-  bw = ((double) (packet_sent * msg_size)) / elapsed;
-
-  if (elapsed_res)
-    *elapsed_res = elapsed;
-  if (bw_res)
-    *bw_res = bw;
-
-  /* If someone stopped us, inform him about the achieved bandwidth */
-  if (msg_got.expe) {
-    bw_res_t answer = xbt_new(s_bw_res_t, 1);
-    s_gras_msg_cb_ctx_t ctx;
-
-    XBT_INFO("Saturation from %s:%d to %s:%u stopped by %s:%d",
-          gras_os_myname(), gras_os_myport(), to_name, to_port,
-          xbt_socket_peer_name(msg_got.expe),
-          xbt_socket_peer_port(msg_got.expe));
-    answer->timestamp = gras_os_time();
-    answer->sec = elapsed;
-    answer->bw = bw;
-
-    ctx.expeditor = msg_got.expe;
-    ctx.ID = msg_got.ID;
-    ctx.msgtype = msg_got.type;
-
-    gras_msg_rpcreturn(60, &ctx, &answer);
-    free(answer);
-  } else {
-    XBT_INFO
-        ("Saturation from %s:%d to %s:%u elapsed after %f sec (achieving %f kb/s)",
-         gras_os_myname(), gras_os_myport(), to_name, to_port, elapsed,
-         bw / 1024.0);
-  }
-
-  gras_socket_close(meas);
-}
-
-/* Sender will saturate link to us */
-static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  sat_request_t request = *(sat_request_t *) payload;
-  sat_request_t answer = xbt_new0(s_sat_request_t, 1);
-  volatile int saturate_further = 1;
-  xbt_ex_t e;
-  volatile xbt_socket_t measMaster = NULL, meas = NULL;
-  volatile xbt_socket_t from = gras_msg_cb_ctx_from(ctx);
-
-  volatile int port = 6000;
-  while (port <= 10000 && measMaster == NULL) {
-    TRY {
-      measMaster = gras_socket_server_ext(port, 0 /*bufsize: auto */ ,
-                                          1 /*meas: true */ );
-    }
-    CATCH(e) {
-      measMaster = NULL;
-      if (port < 10000)
-        xbt_ex_free(e);
-      else
-        RETHROWF
-            ("Error encountered while opening a measurement server socket: %s");
-    }
-    if (measMaster == NULL)
-      port++;                   /* prepare for a new loop */
-  }
-  answer->peer.port = port;
-
-  gras_msg_rpcreturn(60, ctx, &answer);
-  free(answer);
-
-  gras_os_sleep(5);             /* Wait for the accept */
-
-  TRY {
-    meas = xbt_socket_meas_accept(measMaster);
-    XBT_DEBUG("saturation handshake answered");
-  }
-  CATCH_ANONYMOUS {
-    gras_socket_close(measMaster);
-    RETHROWF("Error during saturation handshake: %s");
-  }
-
-  while (saturate_further) {
-    TRY {
-      xbt_socket_meas_recv(meas, 5, request->msg_size, 1);
-    }
-    CATCH(e) {
-      saturate_further = 0;
-      xbt_ex_free(e);
-    }
-  }
-  XBT_INFO("Saturation comming from %s:%d stopped on %s:%d",
-        xbt_socket_peer_name(from), xbt_socket_peer_port(from),
-        gras_os_myname(), gras_os_myport());
-
-  gras_socket_close(meas);
-  if (gras_if_RL())             /* On SG, accepted=master */
-    gras_socket_close(measMaster);
-  free(request);
-  return 0;
-}
-
-/**
- * @brief Ask 'from_name:from_port' to stop any saturation experiments
- * @param from_name: Name of the peer we are asking to do a experiment with (to_name:to_port)
- * @param from_port: port on which the process we are asking for an experiment is listening
- * @param time: the duration of the experiment
- * @param bw: the achieved bandwidth
- *
- */
-void amok_bw_saturate_stop(const char *from_name, unsigned int from_port,
-                           /*out */ double *time, double *bw)
-{
-  xbt_socket_t sock = gras_socket_client(from_name, from_port);
-  bw_res_t answer;
-  XBT_VERB("Ask %s:%u to stop the saturation", from_name, from_port);
-  TRY {
-    gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Cannot ask %s:%u to stop saturation: %s", from_name, from_port);
-  }
-  gras_socket_close(sock);
-  if (time)
-    *time = answer->sec;
-  if (bw)
-    *bw = answer->bw;
-  free(answer);
-}
diff --git a/src/amok/PeerManagement/peermanagement.c b/src/amok/PeerManagement/peermanagement.c
deleted file mode 100644 (file)
index a04cfc9..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/* amok peer management - servers main loop and remote peer stopping        */
-
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/sysdep.h"
-#include "xbt/peer.h"
-#include "amok/peermanagement.h"
-
-#include "amok/amok_modinter.h" /* prototype of my module declaration */
-#include "gras/module.h"        /* module mecanism */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(amok_pm, amok, "peer management");
-
-
-/* data management */
-int amok_pm_moddata_id = -1;
-typedef struct {
-  int done;
-  xbt_dict_t groups;
-} s_amok_pm_moddata_t, *amok_pm_moddata_t;
-
-/* Message callbacks */
-static int amok_pm_cb_kill(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  g->done = 1;
-  return 0;
-}
-
-static int amok_pm_cb_killrpc(gras_msg_cb_ctx_t ctx, void *payload_data)
-{
-
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  g->done = 1;
-  gras_msg_rpcreturn(30, ctx, NULL);
-  return 0;
-}
-
-static int amok_pm_cb_get(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  char *name = *(void **) payload;
-  xbt_dynar_t res = xbt_dict_get(g->groups, name);
-
-  gras_msg_rpcreturn(30, ctx, &res);
-  return 0;
-}
-
-static int amok_pm_cb_join(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  char *group_name = *(char **) payload;
-  xbt_dynar_t group = xbt_dict_get(g->groups, group_name);
-  int rank;
-
-  xbt_socket_t exp = gras_msg_cb_ctx_from(ctx);
-  xbt_peer_t dude = xbt_peer_new(xbt_socket_peer_name(exp),
-                                 xbt_socket_peer_port(exp));
-
-  rank = xbt_dynar_length(group);
-  xbt_dynar_push(group, &dude);
-  XBT_VERB("Contacted by %s:%d. Give it rank #%d", dude->name, dude->port,
-        rank);
-
-  gras_msg_rpcreturn(10, ctx, &rank);
-  free(group_name);
-  return 0;
-}
-
-static int amok_pm_cb_leave(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  char *name = *(void **) payload;
-  xbt_dynar_t group = xbt_dict_get(g->groups, name);
-
-  xbt_socket_t exp = gras_msg_cb_ctx_from(ctx);
-  xbt_peer_t dude = xbt_peer_new(xbt_socket_peer_name(exp),
-                                 xbt_socket_peer_port(exp));
-
-  unsigned int cpt;
-  xbt_peer_t peer_it;
-
-  xbt_dynar_foreach(group, cpt, peer_it) {
-    if (!strcmp(peer_it->name, dude->name) && peer_it->port == dude->port) {
-      xbt_dynar_cursor_rm(group, &cpt);
-      goto end;
-    }
-  }
-  XBT_WARN("Asked to remove %s:%d from group '%s', but not found. Ignoring",
-        dude->name, dude->port, name);
-
-end:
-  gras_msg_rpcreturn(30, ctx, NULL);
-  return 0;
-}
-
-static int amok_pm_cb_shutdown(gras_msg_cb_ctx_t ctx, void *payload)
-{
-  char *name = *(void **) payload;
-  amok_pm_group_shutdown(name);
-
-  gras_msg_rpcreturn(30, ctx, NULL);
-  return 0;
-}
-
-/** \brief Enter the main loop of the program. It won't return until we get a kill message. */
-void amok_pm_mainloop(double timeOut)
-{
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-
-  while (!g->done) {
-    gras_msg_handle(timeOut);
-  }
-}
-
-/** \brief kill a buddy identified by its peername and port. Note that it is not removed from any group it may belong to. */
-void amok_pm_kill_hp(char *name, int port)
-{
-  xbt_socket_t sock = gras_socket_client(name, port);
-  amok_pm_kill(sock);
-  gras_socket_close(sock);
-}
-
-/** \brief kill a buddy to which we have a socket already. Note that it is not removed from any group it may belong to. */
-void amok_pm_kill(xbt_socket_t buddy)
-{
-  gras_msg_send(buddy, "amok_pm_kill", NULL);
-}
-
-/** \brief kill syncronously a buddy (do not return before its death). Note that it is not removed from any group it may belong to. */
-void amok_pm_kill_sync(xbt_socket_t buddy)
-{
-  gras_msg_rpccall(buddy, 30, "amok_pm_killrpc", NULL, NULL);
-}
-
-
-/** \brief create a new peermanagement group located on local peer 
- *
- * The dynar elements are of type xbt_peer_t
- */
-xbt_dynar_t amok_pm_group_new(const char *group_name)
-{
-  amok_pm_moddata_t g;
-  xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_peer_t),
-                                  xbt_peer_free_voidp);
-
-  xbt_assert(amok_pm_moddata_id != -1, "Run amok_pm_init first!");
-  g = gras_moddata_by_id(amok_pm_moddata_id);
-
-  XBT_DEBUG("retrieved groups=%p", g->groups);
-
-  xbt_dict_set(g->groups, group_name, res, NULL);       /*FIXME: leaking xbt_dynar_free_voidp); */
-  XBT_VERB("Group %s created", group_name);
-
-  return res;
-}
-
-/** \brief retrieve all members of the given remote group */
-xbt_dynar_t amok_pm_group_get(xbt_socket_t master, const char *group_name)
-{
-  xbt_dynar_t res;
-
-  gras_msg_rpccall(master, 30, "amok_pm_get", &group_name, &res);
-  return res;
-}
-
-/** \brief add current peer to the given remote group 
- *
- * Returns the rank of the process in the group.
- */
-int amok_pm_group_join(xbt_socket_t master, const char *group_name)
-{
-  int rank;
-  XBT_VERB("Join group '%s' on %s:%d",
-        group_name, xbt_socket_peer_name(master),
-        xbt_socket_peer_port(master));
-  gras_msg_rpccall(master, 30, "amok_pm_join", &group_name, &rank);
-  XBT_VERB("Joined group '%s' on %s:%d. Got rank %d",
-        group_name, xbt_socket_peer_name(master),
-        xbt_socket_peer_port(master), rank);
-  return rank;
-}
-
-/** \brief remove current peer from the given remote group if found
- *
- * If not found, call is ignored 
- */
-void amok_pm_group_leave(xbt_socket_t master, const char *group_name)
-{
-  gras_msg_rpccall(master, 30, "amok_pm_leave", &group_name, NULL);
-  XBT_VERB("Leaved group '%s' on %s:%d",
-        group_name, xbt_socket_peer_name(master),
-        xbt_socket_peer_port(master));
-}
-
-/** \brief stops all members of the given local group */
-void amok_pm_group_shutdown(const char *group_name)
-{
-  amok_pm_moddata_t g = gras_moddata_by_id(amok_pm_moddata_id);
-  xbt_dynar_t group = xbt_dict_get(g->groups, group_name);
-
-  unsigned int cpt;
-  xbt_peer_t peer_it;
-
-  xbt_dynar_foreach(group, cpt, peer_it) {
-    amok_pm_kill_hp(peer_it->name, peer_it->port);
-  }
-
-  xbt_dynar_free(&group);
-  xbt_dict_remove(g->groups, group_name);
-}
-
-/** \brief stops all members of the given remote group */
-void amok_pm_group_shutdown_remote(xbt_socket_t master,
-                                   const char *group_name)
-{
-  gras_msg_rpccall(master, 30, "amok_pm_shutdown", &group_name, NULL);
-}
-
-
-/* *
- * *
- * * Module management functions
- * *
- * */
-
-
-
-static void _amok_pm_init(void)
-{
-  /* no world-wide globals */
-  /* Datatype and message declarations */
-  xbt_datadesc_type_t pm_group_type =
-      xbt_datadesc_dynar(xbt_datadesc_by_name("xbt_peer_t"),
-                          xbt_peer_free_voidp);
-
-  gras_msgtype_declare("amok_pm_kill", NULL);
-  gras_msgtype_declare_rpc("amok_pm_killrpc", NULL, NULL);
-
-  gras_msgtype_declare_rpc("amok_pm_get",
-                           xbt_datadesc_by_name("string"), pm_group_type);
-  gras_msgtype_declare_rpc("amok_pm_join", xbt_datadesc_by_name("string"),
-                           xbt_datadesc_by_name("int"));
-  gras_msgtype_declare_rpc("amok_pm_leave",
-                           xbt_datadesc_by_name("string"), NULL);
-
-  gras_msgtype_declare_rpc("amok_pm_shutdown",
-                           xbt_datadesc_by_name("string"), NULL);
-}
-
-static void _amok_pm_join(void *p)
-{
-  /* moddata management */
-  amok_pm_moddata_t mod = (amok_pm_moddata_t) p;
-
-  mod->groups = NULL;
-
-  mod->done = 0;
-  mod->groups = xbt_dict_new_homogeneous(NULL);
-
-  /* callbacks */
-  gras_cb_register("amok_pm_kill", &amok_pm_cb_kill);
-  gras_cb_register("amok_pm_killrpc", &amok_pm_cb_killrpc);
-
-  gras_cb_register("amok_pm_get", &amok_pm_cb_get);
-  gras_cb_register("amok_pm_join", &amok_pm_cb_join);
-  gras_cb_register("amok_pm_leave", &amok_pm_cb_leave);
-  gras_cb_register("amok_pm_shutdown", &amok_pm_cb_shutdown);
-}
-
-static void _amok_pm_exit(void)
-{
-  /* no world-wide globals */
-}
-
-static void _amok_pm_leave(void *p)
-{
-  /* moddata */
-  amok_pm_moddata_t mod = (amok_pm_moddata_t) p;
-
-  xbt_dict_free(&mod->groups);
-
-  /* callbacks */
-  gras_cb_unregister("amok_pm_kill", &amok_pm_cb_kill);
-  gras_cb_unregister("amok_pm_killrpc", &amok_pm_cb_killrpc);
-
-  gras_cb_unregister("amok_pm_get", &amok_pm_cb_get);
-  gras_cb_unregister("amok_pm_join", &amok_pm_cb_join);
-  gras_cb_unregister("amok_pm_leave", &amok_pm_cb_leave);
-  gras_cb_unregister("amok_pm_shutdown", &amok_pm_cb_shutdown);
-}
-
-void amok_pm_modulecreate()
-{
-  gras_module_add("amok_pm", sizeof(s_amok_pm_moddata_t),
-                  &amok_pm_moddata_id, _amok_pm_init, _amok_pm_exit,
-                  _amok_pm_join, _amok_pm_leave);
-}
-
-
-
-/* *
- * *
- * * Old module functions (kept for compatibility)
- * *
- * */
-/** \brief Initialize the peer management module. Every process must run it before use */
-void amok_pm_init()
-{
-  gras_module_join("amok_pm");
-}
-
-/** \brief Finalize the peer management module. Every process should run it after use */
-void amok_pm_exit()
-{
-  gras_module_leave("amok_pm");
-}
diff --git a/src/amok/amok_base.c b/src/amok/amok_base.c
deleted file mode 100644 (file)
index a1a8602..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* base - several addons to do specific stuff not in GRAS itself            */
-
-/* Copyright (c) 2006, 2009, 2010. 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. */
-
-#include "gras.h"
-#include "amok/amok_modinter.h"
-
-XBT_LOG_NEW_SUBCATEGORY(amok, XBT_LOG_ROOT_CAT, "All AMOK categories");
-
-void amok_init(void)
-{
-
-  /* Create all the modules */
-  amok_pm_modulecreate();
-}
-
-void amok_exit(void)
-{
-  /* FIXME: No real module mechanism in GRAS so far, nothing to do. */
-}
diff --git a/src/amok/amok_modinter.h b/src/amok/amok_modinter.h
deleted file mode 100644 (file)
index 96c8374..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* amok modinter - interface to AMOK modules initialization and such        */
-
-/* Copyright (c) 2006, 2007, 2010. 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. */
-
-#ifndef AMOK_BASE_H
-#define AMOK_BASE_H
-
-void amok_init(void);
-void amok_exit(void);
-
-/* module creation functions */
-void amok_pm_modulecreate(void);
-
-#endif                          /* AMOK_BASE_H */
diff --git a/src/gras/Msg/gras_msg_exchange.c b/src/gras/Msg/gras_msg_exchange.c
deleted file mode 100644 (file)
index 3491586..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-/* gras message exchanges                                                   */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/ex_interface.h"
-#include "xbt/socket.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Virtu/virtu_interface.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_msg);
-
-
-char _GRAS_header[6];
-const char *e_gras_msg_kind_names[e_gras_msg_kind_count] =
-    { "UNKNOWN", "ONEWAY", "RPC call", "RPC answer", "RPC error" };
-
-
-/** \brief Waits for a message to come in over a given socket.
- *
- * @param timeout: How long should we wait for this message.
- * @param msgt_want: type of awaited msg (or NULL if I'm enclined to accept any message)
- * @param expe_want: awaited expeditot (match on hostname, not port; NULL if not relevant)
- * @param filter: function returning true or false when passed a payload. Messages for which it returns false are not selected. (NULL if not relevant)
- * @param filter_ctx: context passed as second argument of the filter (a pattern to match?)
- * @param[out] msg_got: where to write the message we got
- *
- * Every message of another type received before the one waited will be queued
- * and used by subsequent call to this function or gras_msg_handle().
- */
-
-void
-gras_msg_wait_ext_(double timeout,
-                   gras_msgtype_t msgt_want,
-                   xbt_socket_t expe_want,
-                   gras_msg_filter_t filter,
-                   void *filter_ctx, gras_msg_t msg_got)
-{
-
-  s_gras_msg_t msg;
-  double start, now;
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cpt;
-
-  xbt_assert(msg_got, "msg_got is an output parameter");
-
-  start = gras_os_time();
-  XBT_VERB("Waiting for message '%s' for %fs",
-        msgt_want ? msgt_want->name : "(any)", timeout);
-
-  xbt_dynar_foreach(pd->msg_waitqueue, cpt, msg) {
-    if ((!msgt_want || (msg.type->code == msgt_want->code))
-        && (!expe_want || (!strcmp(xbt_socket_peer_name(msg.expe),
-                                   xbt_socket_peer_name(expe_want))))
-        && (!filter || filter(&msg, filter_ctx))) {
-
-      memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
-      xbt_dynar_cursor_rm(pd->msg_waitqueue, &cpt);
-      XBT_VERB("The waited message was queued");
-      return;
-    }
-  }
-
-  xbt_dynar_foreach(pd->msg_queue, cpt, msg) {
-    if ((!msgt_want || (msg.type->code == msgt_want->code))
-        && (!expe_want || (!strcmp(xbt_socket_peer_name(msg.expe),
-                                   xbt_socket_peer_name(expe_want))))
-        && (!filter || filter(&msg, filter_ctx))) {
-
-      memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
-      xbt_dynar_cursor_rm(pd->msg_queue, &cpt);
-      XBT_VERB("The waited message was queued");
-      return;
-    }
-  }
-
-  while (1) {
-    int need_restart;
-    xbt_ex_t e;
-
-  restart_receive:             /* Goto here when the receive of a message failed */
-    need_restart = 0;
-    now = gras_os_time();
-    memset(&msg, 0, sizeof(msg));
-
-    TRY {
-      xbt_queue_shift_timed(pd->msg_received, &msg,
-                            timeout ? timeout - now + start : 0);
-    }
-    CATCH(e) {
-      if (e.category == system_error &&
-          !strncmp("Socket closed by remote side", e.msg,
-                   strlen("Socket closed by remote side"))) {
-        xbt_ex_free(e);
-        need_restart = 1;
-      } else {
-        RETHROW;
-      }
-    }
-    if (need_restart)
-      goto restart_receive;
-
-    XBT_DEBUG("Got a message from the socket");
-
-    if ((!msgt_want || (msg.type->code == msgt_want->code))
-        && (!expe_want || (!strcmp(xbt_socket_peer_name(msg.expe),
-                                   xbt_socket_peer_name(expe_want))))
-        && (!filter || filter(&msg, filter_ctx))) {
-
-      memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
-      XBT_DEBUG("Message matches expectations. Use it.");
-      return;
-    }
-    XBT_DEBUG("Message does not match expectations. Queue it.");
-
-    /* not expected msg type. Queue it for later */
-    xbt_dynar_push(pd->msg_queue, &msg);
-
-    now = gras_os_time();
-    if (now - start + 0.001 > timeout) {
-      THROWF(timeout_error, now - start + 0.001 - timeout,
-             "Timeout while waiting for msg '%s'",
-             msgt_want ? msgt_want->name : "(any)");
-    }
-  }
-
-  THROW_IMPOSSIBLE;
-}
-
-/** \brief Waits for a message to come in over a given socket.
- *
- * @param timeout: How long should we wait for this message.
- * @param msgt_want: type of awaited msg
- * @param[out] expeditor: where to create a socket to answer the incoming message
- * @param[out] payload: where to write the payload of the incoming message
- * @return the error code (or no_error).
- *
- * Every message of another type received before the one waited will be queued
- * and used by subsequent call to this function or gras_msg_handle().
- */
-void
-gras_msg_wait_(double timeout,
-               gras_msgtype_t msgt_want,
-               xbt_socket_t * expeditor, void *payload)
-{
-  s_gras_msg_t msg;
-
-  gras_msg_wait_ext_(timeout, msgt_want, NULL, NULL, NULL, &msg);
-
-  if (msgt_want->ctn_type) {
-    xbt_assert(payload,
-                "Message type '%s' convey a payload that you must accept",
-                msgt_want->name);
-  } else {
-    xbt_assert(!payload,
-                "No payload was declared for message type '%s' (don't expect one)",
-                msgt_want->name);
-  }
-
-  if (payload) {
-    memcpy(payload, msg.payl, msg.payl_size);
-    free(msg.payl);
-  }
-
-  if (expeditor)
-    *expeditor = msg.expe;
-}
-
-static int gras_msg_wait_or_filter(gras_msg_t msg, void *ctx)
-{
-  xbt_dynar_t dyn = (xbt_dynar_t) ctx;
-  int res = xbt_dynar_member(dyn, msg->type);
-  if (res)
-    XBT_VERB("Got matching message (type=%s)", msg->type->name);
-  else
-    XBT_VERB("Got message not matching our expectations");
-  return res;
-}
-
-/** \brief Waits for a message to come in over a given socket.
- *
- * @param timeout: How long should we wait for this message.
- * @param msgt_want: a dynar containing all accepted message type
- * @param[out] ctx: the context of received message (in case it's a RPC call we want to answer to)
- * @param[out] msgt_got: indice in the dynar of the type of the received message
- * @param[out] payload: where to write the payload of the incoming message
- * @return the error code (or no_error).
- *
- * Every message of a type not in the accepted list received before the one
- * waited will be queued and used by subsequent call to this function or
- * gras_msg_handle().
- *
- * If you are interested in the context, pass the address of a s_gras_msg_cb_ctx_t variable.
- */
-void gras_msg_wait_or(double timeout,
-                      xbt_dynar_t msgt_want,
-                      gras_msg_cb_ctx_t * ctx, int *msgt_got,
-                      void *payload)
-{
-  s_gras_msg_t msg;
-
-  XBT_VERB("Wait %f seconds for several message types", timeout);
-  gras_msg_wait_ext_(timeout,
-                     NULL, NULL,
-                     &gras_msg_wait_or_filter, (void *) msgt_want, &msg);
-
-  if (msg.type->ctn_type) {
-    xbt_assert(payload,
-                "Message type '%s' convey a payload you must accept",
-                msg.type->name);
-  }
-  /* don't check the other side since some of the types may have a payload */
-  if (payload && msg.type->ctn_type) {
-    memcpy(payload, msg.payl, msg.payl_size);
-    free(msg.payl);
-  }
-
-  if (ctx)
-    *ctx = gras_msg_cb_ctx_new(msg.expe, msg.type, msg.ID,
-                               (msg.kind == e_gras_msg_kind_rpccall), 60);
-
-  if (msgt_got)
-    *msgt_got = xbt_dynar_search(msgt_want, msg.type);
-}
-
-
-/** \brief Send the data pointed by \a payload as a message of type
- * \a msgtype to the peer \a sock */
-void gras_msg_send_(xbt_socket_t sock, gras_msgtype_t msgtype,
-                    void *payload)
-{
-
-  if (msgtype->ctn_type) {
-    xbt_assert(payload,
-                "Message type '%s' convey a payload you must provide",
-                msgtype->name);
-  } else {
-    xbt_assert(!payload,
-                "No payload was declared for message type '%s'",
-                msgtype->name);
-  }
-
-  XBT_DEBUG("Send a oneway message of type '%s'. Payload=%p",
-         msgtype->name, payload);
-  gras_msg_send_ext(sock, e_gras_msg_kind_oneway, 0, msgtype, payload);
-  XBT_VERB("Sent a oneway message of type '%s'. Payload=%p",
-        msgtype->name, payload);
-}
-
-/** @brief Handle all messages arriving within the given period
- *
- * @param period: How long to wait for incoming messages (in seconds)
- *
- * Messages are dealed with just like gras_msg_handle() would do. The
- * difference is that gras_msg_handle() handles at most one message (or wait up
- * to timeout second when no message arrives) while this function handles any
- * amount of messages, and lasts the given period in any case.
- */
-void gras_msg_handleall(double period)
-{
-  xbt_ex_t e;
-  double begin = gras_os_time();
-  double now;
-
-  do {
-    now = gras_os_time();
-    TRY {
-      if (period - now + begin > 0)
-        gras_msg_handle(period - now + begin);
-    }
-    CATCH(e) {
-      if (e.category != timeout_error)
-        RETHROWF("Error while waiting for messages: %s");
-      xbt_ex_free(e);
-    }
-    /* Epsilon to avoid numerical stability issues were the waited interval is so small that the global clock cannot notice the increment */
-  } while (period - now + begin > 0);
-}
-
-/** @brief Handle an incoming message or timer (or wait up to \a timeOut seconds)
- *
- * @param timeOut: How long to wait for incoming messages (in seconds)
- * @return the error code (or no_error).
- *
- * Any message arriving in the given interval is passed to the callbacks.
- *
- * @sa gras_msg_handleall().
- */
-void gras_msg_handle(volatile double timeOut)
-{
-
-  double untiltimer;
-
-  unsigned int cpt;
-  volatile int ran_ok;
-
-  s_gras_msg_t msg;
-
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  gras_cblist_t *list = NULL;
-  gras_msg_cb_t cb;
-  s_gras_msg_cb_ctx_t ctx;
-
-  volatile int timerexpected, timeouted;
-  xbt_ex_t e;
-
-  XBT_VERB("Handling message within the next %.2fs", timeOut);
-
-  untiltimer = gras_msg_timer_handle();
-  XBT_DEBUG("Next timer in %f sec", untiltimer);
-  if (untiltimer == 0.0) {
-    /* A timer was already elapsed and handled */
-    return;
-  }
-  if (untiltimer != -1.0) {
-    timerexpected = 1;
-    timeOut = MIN(timeOut, untiltimer);
-  } else {
-    timerexpected = 0;
-  }
-
-  /* get a message (from the queue or from the net) */
-  timeouted = 0;
-  if (!xbt_dynar_is_empty(pd->msg_queue)) {
-    XBT_DEBUG("Get a message from the queue");
-    xbt_dynar_shift(pd->msg_queue, &msg);
-  } else {
-    TRY {
-      xbt_queue_shift_timed(pd->msg_received, &msg, timeOut);
-      //      msg.expe = gras_trp_select(timeOut);
-    }
-    CATCH(e) {
-      if (e.category != timeout_error)
-        RETHROW;
-      XBT_DEBUG("Damn. Timeout while getting a message from the queue");
-      xbt_ex_free(e);
-      timeouted = 1;
-    }
-  }
-
-  if (timeouted) {
-    if (timerexpected) {
-
-      /* A timer elapsed before the arrival of any message even if we select()ed a bit */
-      untiltimer = gras_msg_timer_handle();
-      if (untiltimer == 0.0) {
-        /* we served a timer, we're done */
-        return;
-      } else {
-        xbt_assert(untiltimer > 0, "Negative timer (%f). I'm 'puzzeled'",
-                    untiltimer);
-        XBT_WARN
-            ("No timer elapsed, in contrary to expectations (next in %f sec)",
-             untiltimer);
-        THROWF(timeout_error, 0,
-               "No timer elapsed, in contrary to expectations (next in %f sec)",
-               untiltimer);
-      }
-
-    } else {
-      /* select timeouted, and no timer elapsed. Nothing to do */
-      THROWF(timeout_error, 0, "No new message or timer (delay was %f)",
-             timeOut);
-    }
-
-  }
-
-  /* A message was already there or arrived in the meanwhile. handle it */
-  xbt_dynar_foreach(pd->cbl_list, cpt, list) {
-    if (list->id == msg.type->code) {
-      break;
-    } else {
-      list = NULL;
-    }
-  }
-  if (!list) {
-    XBT_INFO
-        ("No callback for message '%s' (type:%s) from %s:%d. Queue it for later gras_msg_wait() use.",
-         msg.type->name, e_gras_msg_kind_names[msg.kind],
-         xbt_socket_peer_name(msg.expe), xbt_socket_peer_port(msg.expe));
-    xbt_dynar_push(pd->msg_waitqueue, &msg);
-    return;                     /* FIXME: maybe we should call ourselves again until the end of the timer or a proper msg is got */
-  }
-
-  ctx.expeditor = msg.expe;
-  ctx.ID = msg.ID;
-  ctx.msgtype = msg.type;
-  ctx.answer_due = (msg.kind == e_gras_msg_kind_rpccall);
-
-  switch (msg.kind) {
-  case e_gras_msg_kind_oneway:
-  case e_gras_msg_kind_rpccall:
-    ran_ok = 0;
-    TRY {
-      xbt_dynar_foreach(list->cbs, cpt, cb) {
-        volatile unsigned int cpt2 = cpt;
-        if (!ran_ok) {
-          XBT_DEBUG
-              ("Use the callback #%u (@%p) for incoming msg '%s' (payload_size=%d)",
-               cpt + 1, cb, msg.type->name, msg.payl_size);
-          if (!cb(&ctx, msg.payl)) {
-            /* cb handled the message */
-            free(msg.payl);
-            ran_ok = 1;
-          }
-        }
-        cpt = cpt2;
-      }
-    }
-    CATCH(e) {
-      free(msg.payl);
-      if (msg.type->kind == e_gras_msg_kind_rpccall) {
-        char *old_file = e.file;
-        /* The callback raised an exception, propagate it on the network */
-        if (!e.remote) {
-          /* Make sure we reduce the file name to its basename to avoid issues in tests */
-          char *new_file = strrchr(e.file, '/');
-          if (new_file)
-            e.file = new_file;
-          /* the exception is born on this machine */
-          e.host = (char *) gras_os_myname();
-          xbt_ex_setup_backtrace(&e);
-        }
-        XBT_VERB
-            ("Propagate %s exception ('%s') from '%s' RPC cb back to %s:%d",
-             (e.remote ? "remote" : "local"), e.msg, msg.type->name,
-             xbt_socket_peer_name(msg.expe),
-             xbt_socket_peer_port(msg.expe));
-        if (XBT_LOG_ISENABLED(gras_msg, xbt_log_priority_verbose))
-          xbt_ex_display(&e);
-        gras_msg_send_ext(msg.expe, e_gras_msg_kind_rpcerror,
-                          msg.ID, msg.type, &e);
-        e.file = old_file;
-        xbt_ex_free(e);
-        ctx.answer_due = 0;
-        ran_ok = 1;
-      } else {
-        RETHROWF
-            ("Callback #%u (@%p) to message '%s' (payload size: %d) raised an exception: %s",
-             cpt + 1, cb, msg.type->name, msg.payl_size);
-      }
-    }
-
-    xbt_assert(!ctx.answer_due,
-                "Bug in user code: RPC callback to message '%s' didn't call gras_msg_rpcreturn",
-                msg.type->name);
-    if (ctx.answer_due)
-      XBT_CRITICAL
-          ("BUGS BOTH IN USER CODE (RPC callback to message '%s' didn't call gras_msg_rpcreturn) "
-           "AND IN SIMGRID (process wasn't killed by an assert)",
-           msg.type->name);
-    if (!ran_ok)
-      THROWF(mismatch_error, 0,
-             "Message '%s' refused by all registered callbacks (maybe your callback misses a 'return 0' at the end)",
-             msg.type->name);
-    /* FIXME: xbt_datadesc_free not implemented => leaking the payload */
-    break;
-
-
-  case e_gras_msg_kind_rpcanswer:
-    XBT_INFO("Unexpected RPC answer discarded (type: %s; from:%s:%d)",
-          msg.type->name, xbt_socket_peer_name(msg.expe),
-          xbt_socket_peer_port(msg.expe));
-    XBT_WARN
-        ("FIXME: xbt_datadesc_free not implemented => leaking the payload");
-    return;
-
-  case e_gras_msg_kind_rpcerror:
-    XBT_INFO("Unexpected RPC error discarded (type: %s; from:%s:%d)",
-          msg.type->name, xbt_socket_peer_name(msg.expe),
-          xbt_socket_peer_port(msg.expe));
-    XBT_WARN
-        ("FIXME: xbt_datadesc_free not implemented => leaking the payload");
-    return;
-
-  default:
-    THROWF(unknown_error, 0,
-           "Cannot handle messages of kind %d yet", (int)msg.type->kind);
-  }
-
-}
diff --git a/src/gras/Msg/gras_msg_listener.c b/src/gras/Msg/gras_msg_listener.c
deleted file mode 100644 (file)
index 0dcc36f..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Thread in charge of listening the network and queuing incoming messages  */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "gras/Msg/msg_private.h"
-#include "gras/Transport/transport_private.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_msg_read, gras_msg,
-                                "Message reader thread");
-
-#include "xbt/ex.h"
-#include "xbt/queue.h"
-#include "xbt/synchro.h"
-
-#include "gras/Transport/transport_interface.h" /* gras_select */
-
-typedef struct s_gras_msg_listener_ {
-  xbt_thread_t listener; /* keep this first, gras_socket_im_the_server() does funky transtyping in sg_msg.c */
-  xbt_queue_t incoming_messages;       /* messages received from the wire and still to be used by master */
-  xbt_queue_t socks_to_close;   /* let the listener close the sockets, since it may be selecting on them. Darwin don't like this trick */
-  xbt_socket_t wakeup_sock_listener_side;
-  xbt_socket_t wakeup_sock_master_side;
-  int port; /* The port on which the listener opened the command socket */
-  xbt_mutex_t init_mutex;       /* both this mutex and condition are used at initialization to make sure that */
-  xbt_cond_t init_cond;         /* the main thread speaks to the listener only once it is started (FIXME: It would be easier using a semaphore, if only semaphores were in xbt_synchro) */
-} s_gras_msg_listener_t;
-
-#include "gras/Virtu/virtu_private.h" /* gras_procdata_t */
-static void listener_function(void *p)
-{
-  gras_msg_listener_t me = (gras_msg_listener_t) p;
-  gras_msg_t msg;
-  xbt_ex_t e;
-  gras_msgtype_t msg_wakeup_listener_t =
-      gras_msgtype_by_name("_wakeup_listener");
-  XBT_DEBUG("I'm the listener");
-
-  /* get a free socket for the receiving part of the listener */
-  me->wakeup_sock_listener_side =NULL;
-  for (me->port = 5000; me->port < 6000; me->port++) {
-    TRY {
-      me->wakeup_sock_listener_side = gras_socket_server_ext(me->port, -1, 0);
-    }
-    CATCH(e) {
-      if (me->port == 6000)
-        RETHROW;
-      xbt_ex_free(e);
-    }
-    if (me->wakeup_sock_listener_side)
-      break;
-  }
-
-  /* wake up the launcher */
-  xbt_mutex_acquire(me->init_mutex);
-  xbt_cond_signal(me->init_cond);
-  xbt_mutex_release(me->init_mutex);
-
-  /* Main loop */
-  while (1) {
-    msg = gras_msg_recv_any();
-    if (msg->type != msg_wakeup_listener_t) {
-    /* Cannot display who sent this since in SG, xbt_socket_peer_* wont work:
-       I'm not the user process but I'm just the listener. Too bad */
-      XBT_VERB("Got a '%s' message (%s) from sock %p. Queue it for handling by main thread",
-            gras_msgtype_get_name(msg->type),e_gras_msg_kind_names[msg->kind],msg->expe);
-      xbt_queue_push(me->incoming_messages, msg);
-    } else {
-      char got = *(char *) msg->payl;
-      if (got == '1') {
-        XBT_VERB("Asked to get awake");
-        free(msg->payl);
-        free(msg);
-      } else {
-        XBT_VERB("Asked to die");
-        //gras_socket_close(me->wakeup_sock_listener_side);
-        free(msg->payl);
-        free(msg);
-        return;
-      }
-    }
-    /* empty the list of sockets to trash */
-    TRY {
-      while (1) {
-        int sock;
-        xbt_queue_shift_timed(me->socks_to_close, &sock, 0);
-        if (tcp_close(sock) < 0) {
-#ifdef _XBT_WIN32
-          XBT_WARN("error while closing tcp socket %d: %d\n", sock,
-                sock_errno);
-#else
-          XBT_WARN("error while closing tcp socket %d: %d (%s)\n",
-                sock, sock_errno, sock_errstr(sock_errno));
-#endif
-        }
-      }
-    }
-    CATCH(e) {
-      if (e.category != timeout_error)
-        RETHROW;
-      xbt_ex_free(e);
-    }
-  }
-}
-
-gras_msg_listener_t gras_msg_listener_launch(xbt_queue_t msg_received)
-{
-  gras_msg_listener_t arg = xbt_new0(s_gras_msg_listener_t, 1);
-
-  XBT_VERB("Launch listener");
-  arg->incoming_messages = msg_received;
-  arg->socks_to_close = xbt_queue_new(0, sizeof(int));
-  arg->init_mutex = xbt_mutex_init();
-  arg->init_cond = xbt_cond_init();
-
-  /* declare the message used to awake the listener from the master */
-  gras_msgtype_declare("_wakeup_listener", xbt_datadesc_by_name("char"));
-
-  /* actually start the thread, and */
-  /* wait for the listener to initialize before we connect to its socket */
-  xbt_mutex_acquire(arg->init_mutex);
-  arg->listener =
-      xbt_thread_create("listener", listener_function, arg,
-                        1 /*joinable */ );
-  xbt_cond_wait(arg->init_cond, arg->init_mutex);
-  xbt_mutex_release(arg->init_mutex);
-  xbt_cond_destroy(arg->init_cond);
-  xbt_mutex_destroy(arg->init_mutex);
-
-  /* Connect the other part of the socket */
-  arg->wakeup_sock_master_side =
-      gras_socket_client(gras_os_myname(),
-                         arg->port);
-  return arg;
-}
-
-#include "gras/Virtu/virtu_private.h"   /* procdata_t content */
-void gras_msg_listener_shutdown()
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  char kill = '0';
-  XBT_DEBUG("Listener quit");
-
-  if (pd->listener)
-    gras_msg_send(pd->listener->wakeup_sock_master_side,
-                  "_wakeup_listener", &kill);
-
-  xbt_thread_join(pd->listener->listener);
-
-  //  gras_socket_close(pd->listener->wakeup_sock_master_side); FIXME: uncommenting this leads to deadlock at terminaison
-  xbt_queue_free(&pd->listener->incoming_messages);
-  xbt_queue_free(&pd->listener->socks_to_close);
-  xbt_free(pd->listener);
-}
-
-void gras_msg_listener_awake()
-{
-  gras_procdata_t *pd;
-  char c = '1';
-
-  XBT_DEBUG("Awaking the listener");
-  pd = gras_procdata_get();
-  if (pd->listener) {
-    gras_msg_send(pd->listener->wakeup_sock_master_side,
-                  "_wakeup_listener", &c);
-  }
-}
-
-void gras_msg_listener_close_socket(int sd)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  if (pd->listener) {
-    xbt_queue_push(pd->listener->socks_to_close, &sd);
-    gras_msg_listener_awake();
-  } else {
-    /* do it myself */
-    tcp_close(sd);
-  }
-}
diff --git a/src/gras/Msg/gras_msg_mod.c b/src/gras/Msg/gras_msg_mod.c
deleted file mode 100644 (file)
index 04f3718..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* gras message types handling                                              */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Virtu/virtu_interface.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_msg);
-
-extern xbt_set_t _gras_msgtype_set;
-
-/*
- * Creating procdata for this module
- */
-static void *gras_msg_procdata_new(void)
-{
-  gras_msg_procdata_t res = xbt_new(s_gras_msg_procdata_t, 1);
-
-  res->name = xbt_strdup("gras_msg");
-  res->name_len = 0;
-  res->msg_queue = xbt_dynar_new(sizeof(s_gras_msg_t), NULL);
-  res->msg_waitqueue = xbt_dynar_new(sizeof(s_gras_msg_t), NULL);
-  res->cbl_list = xbt_dynar_new(sizeof(gras_cblist_t *), gras_cbl_free);
-  res->timers = xbt_dynar_new(sizeof(s_gras_timer_t), NULL);
-  res->msg_to_receive_queue = xbt_fifo_new();
-  res->msg_to_receive_queue_meas = xbt_fifo_new();
-  res->msg_received = xbt_queue_new(0, sizeof(s_gras_msg_t));
-
-  return (void *) res;
-}
-
-/*
- * Freeing procdata for this module
- */
-static void gras_msg_procdata_free(void *data)
-{
-  gras_msg_procdata_t res = (gras_msg_procdata_t) data;
-
-  xbt_dynar_free(&(res->msg_queue));
-  xbt_dynar_free(&(res->msg_waitqueue));
-  xbt_dynar_free(&(res->cbl_list));
-  xbt_dynar_free(&(res->timers));
-  xbt_fifo_free(res->msg_to_receive_queue);
-  xbt_fifo_free(res->msg_to_receive_queue_meas);
-
-  free(res->name);
-  free(res);
-}
-
-/*
- * Module registration
- */
-int gras_msg_libdata_id;
-void gras_msg_register()
-{
-  gras_msg_libdata_id =
-      gras_procdata_add("gras_msg", gras_msg_procdata_new,
-                        gras_msg_procdata_free);
-}
-
-/*
- * Initialize this submodule.
- */
-void gras_msg_init(void)
-{
-  /* only initialize once */
-  if (_gras_msgtype_set != NULL)
-    return;
-
-  XBT_VERB("Initializing Msg");
-
-  _gras_msgtype_set = xbt_set_new();
-
-  memcpy(_GRAS_header, "GRAS", 4);
-  _GRAS_header[4] = GRAS_PROTOCOL_VERSION;
-  _GRAS_header[5] = (char) GRAS_THISARCH;
-
-  gras_msg_ctx_mallocator =
-      xbt_mallocator_new(1000,
-                         gras_msg_ctx_mallocator_new_f,
-                         gras_msg_ctx_mallocator_free_f,
-                         gras_msg_ctx_mallocator_reset_f);
-}
-
-/*
- * Finalize the msg module
- */
-void gras_msg_exit(void)
-{
-  XBT_VERB("Exiting Msg");
-  xbt_set_free(&_gras_msgtype_set);
-
-  xbt_mallocator_free(gras_msg_ctx_mallocator);
-}
diff --git a/src/gras/Msg/gras_msg_types.c b/src/gras/Msg/gras_msg_types.c
deleted file mode 100644 (file)
index 8d43297..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/* gras message types and callback registering and retrieving               */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Virtu/virtu_interface.h"
-#include "xbt/datadesc/datadesc_interface.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_msg, gras, "High level messaging");
-
-xbt_set_t _gras_msgtype_set = NULL;
-
-
-/* ******************************************************************** */
-/*                      MESSAGE TYPES                                   */
-/* ******************************************************************** */
-
-
-/* Reclamed memory */
-void gras_msgtype_free(void *t)
-{
-  gras_msgtype_t msgtype = (gras_msgtype_t) t;
-  if (msgtype) {
-    free(msgtype->name);
-    free(msgtype);
-  }
-}
-
-/**
- * Dump all declared message types (debugging purpose)
- */
-void gras_msgtype_dumpall(void)
-{
-  xbt_set_cursor_t cursor;
-  gras_msgtype_t msgtype = NULL;
-
-  XBT_INFO("Dump of all registered messages:");
-  xbt_set_foreach(_gras_msgtype_set, cursor, msgtype) {
-    XBT_INFO("  Message name: %s (v%d) %s; %s%s%s",
-          msgtype->name, msgtype->version,
-          e_gras_msg_kind_names[msgtype->kind],
-          xbt_datadesc_get_name(msgtype->ctn_type),
-          (msgtype->kind == e_gras_msg_kind_rpccall ? " -> " : ""),
-          (msgtype->kind ==
-           e_gras_msg_kind_rpccall ?
-           xbt_datadesc_get_name(msgtype->answer_type) : ""));
-  }
-}
-
-
-/**
- * make_namev:
- *
- * Returns the versionned name of the message.
- *   It's a newly allocated string, make sure to free it.
- */
-static char *make_namev(const char *name, short int ver)
-{
-  if (!ver)
-    return xbt_strdup(name);
-
-  return bprintf("%s_v%d", name, ver);
-}
-
-/* Internal function doing the crude work of registering messages */
-void
-gras_msgtype_declare_ext(const char *name,
-                         short int version,
-                         e_gras_msg_kind_t kind,
-                         xbt_datadesc_type_t payload_request,
-                         xbt_datadesc_type_t payload_answer)
-{
-
-  gras_msgtype_t msgtype = NULL;
-  char *namev = make_namev(name, version);
-
-  msgtype = (gras_msgtype_t) xbt_set_get_by_name_or_null(
-      _gras_msgtype_set, (const char*) namev);
-
-  if (msgtype != NULL) {
-    XBT_DEBUG
-        ("Re-register version %d of message '%s' (same kind & payload, ignored).",
-         version, name);
-    xbt_assert(msgtype->kind == kind,
-                "Message %s re-registered as a %s (it was known as a %s)",
-                namev, e_gras_msg_kind_names[kind],
-                e_gras_msg_kind_names[msgtype->kind]);
-    xbt_assert(!xbt_datadesc_type_cmp
-                (msgtype->ctn_type, payload_request),
-                "Message %s re-registered with another payload (%s was %s)",
-                namev, xbt_datadesc_get_name(payload_request),
-                xbt_datadesc_get_name(msgtype->ctn_type));
-
-    xbt_assert(!xbt_datadesc_type_cmp
-                (msgtype->answer_type, payload_answer),
-                "Message %s re-registered with another answer payload (%s was %s)",
-                namev, xbt_datadesc_get_name(payload_answer),
-                xbt_datadesc_get_name(msgtype->answer_type));
-
-    xbt_free(namev);
-    return;                     /* do really ignore it */
-  }
-
-  XBT_VERB("Register version %d of message '%s' "
-        "(payload: %s; answer payload: %s).",
-        version, name, xbt_datadesc_get_name(payload_request),
-        xbt_datadesc_get_name(payload_answer));
-
-  msgtype = xbt_new(s_gras_msgtype_t, 1);
-  msgtype->name = namev;
-  msgtype->name_len = strlen(namev);
-  msgtype->version = version;
-  msgtype->kind = kind;
-  msgtype->ctn_type = payload_request;
-  msgtype->answer_type = payload_answer;
-
-  xbt_set_add(_gras_msgtype_set, (xbt_set_elm_t) msgtype,
-              &gras_msgtype_free);
-}
-
-
-/** @brief declare a new message type of the given name. It only accepts the given datadesc as payload
- *
- * @param name: name as it should be used for logging messages (must be uniq)
- * @param payload: datadescription of the payload
- */
-void gras_msgtype_declare(const char *name, xbt_datadesc_type_t payload)
-{
-  gras_msgtype_declare_ext(name, 0, e_gras_msg_kind_oneway, payload, NULL);
-}
-
-
-
-/** @brief declare a new versionned message type of the given name and payload
- *
- * @param name: name as it should be used for logging messages (must be uniq)
- * @param version: something like versionning symbol
- * @param payload: datadescription of the payload
- *
- * Registers a message to the GRAS mechanism. Use this version instead of
- * gras_msgtype_declare when you change the semantic or syntax of a message and
- * want your programs to be able to deal with both versions. Internally, each
- * will be handled as an independent message type, so you can register
- * differents for each of them.
- */
-void
-gras_msgtype_declare_v(const char *name,
-                       short int version, xbt_datadesc_type_t payload)
-{
-
-  gras_msgtype_declare_ext(name, version,
-                           e_gras_msg_kind_oneway, payload, NULL);
-}
-
-/** @brief retrieve an existing message type from its name (raises an exception if it does not exist). */
-gras_msgtype_t gras_msgtype_by_name(const char *name)
-{
-  return gras_msgtype_by_namev(name, 0);
-}
-
-/** @brief retrieve an existing message type from its name (or NULL if it does not exist). */
-gras_msgtype_t gras_msgtype_by_name_or_null(const char *name)
-{
-  xbt_ex_t e;
-  gras_msgtype_t res = NULL;
-
-  TRY {
-    res = gras_msgtype_by_namev(name, 0);
-  }
-  CATCH(e) {
-    res = NULL;
-    xbt_ex_free(e);
-  }
-  return res;
-}
-
-/** @brief retrieve an existing message type from its name and version. */
-gras_msgtype_t gras_msgtype_by_namev(const char *name, short int version)
-{
-  gras_msgtype_t res = NULL;
-  char *namev = make_namev(name, version);
-
-  res = (gras_msgtype_t) xbt_set_get_by_name_or_null(_gras_msgtype_set, namev);
-  free(namev);
-
-  if (res == NULL)
-    THROWF(not_found_error, 0, "No registered message of that name: %s",
-           name);
-
-  return res;
-}
-
-/** @brief retrieve an existing message type from its name and version. */
-gras_msgtype_t gras_msgtype_by_id(int id)
-{
-  return (gras_msgtype_t) xbt_set_get_by_id(_gras_msgtype_set, id);
-}
-
-/* ******************************************************************** */
-/*                         GETTERS                                      */
-/* ******************************************************************** */
-
-XBT_INLINE const char *gras_msgtype_get_name(gras_msgtype_t type)
-{
-  return type->name;
-}
-
-
-/* ******************************************************************** */
-/*                        CALLBACKS                                     */
-/* ******************************************************************** */
-void gras_cbl_free(void *data)
-{
-  gras_cblist_t *list = *(void **) data;
-  if (list) {
-    xbt_dynar_free(&(list->cbs));
-    free(list);
-  }
-}
-
-/** \brief Bind the given callback to the given message type
- *
- * Several callbacks can be attached to a given message type.
- * The lastly added one will get the message first, and
- * if it returns a non-null value, the message will be passed to the
- * second one. And so on until one of the callbacks accepts the message.
- */
-void gras_cb_register_(gras_msgtype_t msgtype, gras_msg_cb_t cb)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  gras_cblist_t *list = NULL;
-  unsigned int cpt;
-
-  XBT_DEBUG("Register %p as callback to '%s'", cb, msgtype->name);
-
-  /* search the list of cb for this message on this host (creating if NULL) */
-  xbt_dynar_foreach(pd->cbl_list, cpt, list) {
-    if (list->id == msgtype->code) {
-      break;
-    } else {
-      list = NULL;
-    }
-  }
-  if (!list) {
-    /* First cb? Create room */
-    list = xbt_new(gras_cblist_t, 1);
-    list->id = msgtype->code;
-    list->cbs = xbt_dynar_new(sizeof(gras_msg_cb_t), NULL);
-    xbt_dynar_push(pd->cbl_list, &list);
-  }
-
-  /* Insert the new one into the set */
-  xbt_dynar_insert_at(list->cbs, 0, &cb);
-}
-
-/** \brief Unbind the given callback from the given message type */
-void gras_cb_unregister_(gras_msgtype_t msgtype, gras_msg_cb_t cb)
-{
-
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  gras_cblist_t *list;
-  gras_msg_cb_t cb_cpt;
-  unsigned int cpt;
-  int found = 0;
-
-  /* search the list of cb for this message on this host */
-  xbt_dynar_foreach(pd->cbl_list, cpt, list) {
-    if (list->id == msgtype->code) {
-      break;
-    } else {
-      list = NULL;
-    }
-  }
-
-  /* Remove it from the set */
-  if (list) {
-    xbt_dynar_foreach(list->cbs, cpt, cb_cpt) {
-      if (cb == cb_cpt) {
-        xbt_dynar_cursor_rm(list->cbs, &cpt);
-        found = 1;
-      }
-    }
-  }
-  if (!found)
-    XBT_VERB("Ignoring removal of unexisting callback to msg id %u",
-          msgtype->code);
-}
-
-/** \brief Retrieve the expeditor of the message */
-xbt_socket_t gras_msg_cb_ctx_from(gras_msg_cb_ctx_t ctx)
-{
-  return ctx->expeditor;
-}
-
-/* \brief Creates a new message exchange context (user should never have to) */
-gras_msg_cb_ctx_t gras_msg_cb_ctx_new(xbt_socket_t expe,
-                                      gras_msgtype_t msgtype,
-                                      unsigned long int ID,
-                                      int answer_due, double timeout)
-{
-  gras_msg_cb_ctx_t res = xbt_new(s_gras_msg_cb_ctx_t, 1);
-  res->expeditor = expe;
-  res->msgtype = msgtype;
-  res->ID = ID;
-  res->timeout = timeout;
-  res->answer_due = answer_due;
-
-  return res;
-}
-
-/* \brief Frees a message exchange context
- *
- * This function is mainly useful with \ref gras_msg_wait_or, ie seldom.
- */
-void gras_msg_cb_ctx_free(gras_msg_cb_ctx_t ctx)
-{
-  free(ctx);
-}
diff --git a/src/gras/Msg/msg_interface.h b/src/gras/Msg/msg_interface.h
deleted file mode 100644 (file)
index 68d1399..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* messaging - high level communication (send/receive messages)             */
-
-/* module's public interface exported within GRAS, but not to end user.     */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_MSG_INTERFACE_H
-#define GRAS_MSG_INTERFACE_H
-
-#include "gras/transport.h"
-#include "xbt/fifo.h"
-#include "xbt/dynar.h"
-#include "xbt/queue.h"
-
-/*
- * Data of this module specific to each process
- * (used by sg_process.c to check some usual errors at the end of the simulation)
- * FIXME: it could be cleaned up ?
- */
-typedef struct {
-  /* set headers */
-  unsigned int ID;
-  char *name;
-  unsigned int name_len;
-
-  /* queue storing the msgs got while msg_wait'ing for something else. Reuse them ASAP. */
-  xbt_dynar_t msg_queue;        /* elm type: s_gras_msg_t */
-
-  /* queue storing the msgs without callback got when handling. Feed them to wait() */
-  xbt_dynar_t msg_waitqueue;    /* elm type: s_gras_msg_t */
-
-  /* registered callbacks for each message */
-  xbt_dynar_t cbl_list;         /* elm type: gras_cblist_t */
-
-  /* registered timers */
-  xbt_dynar_t timers;           /* elm type: s_gras_timer_t */
-
-  /* queue storing the msgs that have to received and the process synchronization made (wait the surf action done) */
-  xbt_fifo_t msg_to_receive_queue;      /* elm type: s_gras_msg_t */
-  xbt_fifo_t msg_to_receive_queue_meas; /* elm type: s_gras_msg_t */
-  xbt_queue_t msg_received;
-
-} s_gras_msg_procdata_t, *gras_msg_procdata_t;
-
-
-void gras_msg_send_namev(xbt_socket_t sock,
-                         const char *namev, void *payload);
-void gras_msg_listener_awake(void);
-void gras_msg_listener_close_socket(int sd);
-
-#define GRAS_PROTOCOL_VERSION '\2';
-/* The difference between GRAS_PROTOCOL_VERSION=\1 (in SimGrid 3.6.1) and \2 (afterward) is that 
-   the architectures were renumbered (GRAS_THISARCH were shifted by 1) to insert WIN64 near to WIN32. 
-   See commit 27cbb00affed384593925fc5af6d5533d0a7ef09 */
-
-
-#endif                          /* GRAS_MSG_INTERFACE_H */
diff --git a/src/gras/Msg/msg_private.h b/src/gras/Msg/msg_private.h
deleted file mode 100644 (file)
index b79897a..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/* messaging - high level communication (send/receive messages)             */
-
-/* module's private interface masked even to other parts of GRAS.           */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_MESSAGE_PRIVATE_H
-#define GRAS_MESSAGE_PRIVATE_H
-
-#include "portable.h"
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/dynar.h"
-#include "xbt/queue.h"
-#include "xbt/set.h"
-#include "gras/transport.h"
-#include "xbt/datadesc.h"
-#include "gras/virtu.h"
-
-#include "gras/messages.h"
-#include "gras/timer.h"
-#include "gras_modinter.h"
-
-#include "gras/Msg/msg_interface.h"
-
-extern char _GRAS_header[6];
-
-extern int gras_msg_libdata_id; /* The identifier of our libdata */
-
-extern const char *e_gras_msg_kind_names[e_gras_msg_kind_count];
-
-/* declare either regular messages or RPC or whatever */
-void
-gras_msgtype_declare_ext(const char *name,
-                         short int version,
-                         e_gras_msg_kind_t kind,
-                         xbt_datadesc_type_t payload_request,
-                         xbt_datadesc_type_t payload_answer);
-
-/**
- * gras_msgtype_t:
- *
- * Message type descriptor. There one of these for each registered version.
- */
-typedef struct s_gras_msgtype {
-  /* headers for the data set */
-  unsigned int code;
-  char *name;
-  unsigned int name_len;
-
-  /* payload */
-  short int version;
-  e_gras_msg_kind_t kind;
-  xbt_datadesc_type_t ctn_type;
-  xbt_datadesc_type_t answer_type;     /* only used for RPC */
-} s_gras_msgtype_t;
-
-extern xbt_set_t _gras_msgtype_set;     /* of gras_msgtype_t */
-void gras_msgtype_free(void *msgtype);
-
-
-/* functions to extract msg from socket or put it on wire (depend RL vs SG) */
-gras_msg_t gras_msg_recv_any(void);     /* Get first message arriving */
-void gras_msg_recv(xbt_socket_t sock, gras_msg_t msg /*OUT*/);
-void gras_msg_send_ext(xbt_socket_t sock,
-                       e_gras_msg_kind_t kind,
-                       unsigned long int ID,
-                       gras_msgtype_t msgtype, void *payload);
-
-/* The thread in charge of receiving messages and queuing them */
-typedef struct s_gras_msg_listener_ *gras_msg_listener_t;
-gras_msg_listener_t gras_msg_listener_launch(xbt_queue_t msg_exchange);
-/* The caller has the responsability to cleanup the queues himself */
-void gras_msg_listener_shutdown(void);
-
-/**
- * gras_cblist_t:
- *
- * association between msg ID and cb list for a given process
- */
-struct s_gras_cblist {
-  long int id;
-  xbt_dynar_t cbs;              /* of gras_msg_cb_t */
-};
-
-typedef struct s_gras_cblist gras_cblist_t;
-void gras_cbl_free(void *);     /* used to free the memory at the end */
-void gras_cblist_free(void *cbl);
-
-/**
- * gras_msg_cb_ctx_t:
- *
- * Context associated to a given callback (to either regular message or RPC)
- */
-struct s_gras_msg_cb_ctx {
-  xbt_socket_t expeditor;
-  gras_msgtype_t msgtype;
-  unsigned long int ID;
-  double timeout;
-  int answer_due;               /* Whether the callback is expected to return a result (for sanity checks) */
-};
-typedef struct s_gras_msg_cb_ctx s_gras_msg_cb_ctx_t;
-
-/* ********* *
- * * TIMER * *
- * ********* */
-typedef struct {
-  double expiry;
-  double period;
-  void_f_void_t action;
-  int repeat;
-} s_gras_timer_t, *gras_timer_t;
-
-/* returns 0 if it handled a timer, or the delay until next timer, or -1 if no armed timer */
-double gras_msg_timer_handle(void);
-
-gras_msg_cb_ctx_t gras_msg_cb_ctx_new(xbt_socket_t expe,
-                                      gras_msgtype_t msgtype,
-                                      unsigned long int ID,
-                                      int answer_due, double timeout);
-
-
-
-/* We deploy a mallocator on the RPC contextes */
-#include "xbt/mallocator.h"
-extern xbt_mallocator_t gras_msg_ctx_mallocator;
-void *gras_msg_ctx_mallocator_new_f(void);
-#define gras_msg_ctx_mallocator_free_f xbt_free_f
-void gras_msg_ctx_mallocator_reset_f(void *dict);
-
-
-#endif                          /* GRAS_MESSAGE_PRIVATE_H */
diff --git a/src/gras/Msg/rl_msg.c b/src/gras/Msg/rl_msg.c
deleted file mode 100644 (file)
index d19d7bb..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/* messaging - Function related to messaging code specific to RL            */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/datadesc.h"
-#include "xbt/datadesc/datadesc_interface.h"
-#include "xbt/socket.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Transport/transport_interface.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_msg);
-
-void gras_msg_recv(xbt_socket_t sock, gras_msg_t msg);
-
-gras_msg_t gras_msg_recv_any(void)
-{
-  gras_msg_t msg = xbt_new0(s_gras_msg_t, 1);
-  msg->expe = gras_trp_select(-1);
-  XBT_DEBUG("Select returned something");
-  gras_msg_recv(msg->expe, msg);
-  return msg;
-}
-
-void gras_msg_send_ext(xbt_socket_t sock,
-                       e_gras_msg_kind_t kind,
-                       unsigned long int ID,
-                       gras_msgtype_t msgtype, void *payload)
-{
-
-  static xbt_datadesc_type_t string_type = NULL;
-  static xbt_datadesc_type_t ulong_type = NULL;
-  char c_kind = (char) kind;
-
-  xbt_assert(msgtype, "Cannot send the NULL message");
-
-  if (!string_type) {
-    string_type = xbt_datadesc_by_name("string");
-    xbt_assert(string_type);
-  }
-  if (!ulong_type) {
-    ulong_type = xbt_datadesc_by_name("unsigned long int");
-    xbt_assert(ulong_type);
-  }
-
-  XBT_DEBUG("send '%s' to %s:%d", msgtype->name,
-         xbt_socket_peer_name(sock), xbt_socket_peer_port(sock));
-  xbt_trp_send(sock, _GRAS_header, 6, 1 /* stable */ );
-  xbt_trp_send(sock, &c_kind, 1, 1 /* stable */ );
-  switch (kind) {
-  case e_gras_msg_kind_oneway:
-    break;
-
-  case e_gras_msg_kind_rpccall:
-  case e_gras_msg_kind_rpcanswer:
-  case e_gras_msg_kind_rpcerror:
-    xbt_datadesc_send(sock, ulong_type, &ID);
-    break;
-
-  default:
-    THROWF(unknown_error, 0, "Unknown msg kind %d", (int)kind);
-  }
-
-  xbt_datadesc_send(sock, string_type, &msgtype->name);
-  if (kind == e_gras_msg_kind_rpcerror) {
-    /* error on remote host, carfull, payload is an exception */
-    xbt_datadesc_send(sock, xbt_datadesc_by_name("ex_t"), payload);
-  } else if (kind == e_gras_msg_kind_rpcanswer) {
-    if (msgtype->answer_type)
-      xbt_datadesc_send(sock, msgtype->answer_type, payload);
-  } else {
-    /* regular message */
-    if (msgtype->ctn_type)
-      xbt_datadesc_send(sock, msgtype->ctn_type, payload);
-  }
-
-  xbt_trp_flush(sock);
-}
-
-const char *hexa_str(unsigned char *data, int size, int downside);
-
-
-/*
- * receive the next message on the given socket.
- */
-void gras_msg_recv(xbt_socket_t sock, gras_msg_t msg)
-{
-
-  xbt_ex_t e;
-  static xbt_datadesc_type_t string_type = NULL;
-  static xbt_datadesc_type_t ulong_type = NULL;
-  char header[6];
-  int cpt;
-  int r_arch;
-  char *msg_name = NULL;
-  char c_kind;
-
-  xbt_assert(!xbt_socket_is_meas(sock),
-              "Asked to receive a message on the measurement socket %p",
-              sock);
-  if (!string_type) {
-    string_type = xbt_datadesc_by_name("string");
-    xbt_assert(string_type);
-  }
-  if (!ulong_type) {
-    ulong_type = xbt_datadesc_by_name("unsigned long int");
-    xbt_assert(ulong_type);
-  }
-
-
-  TRY {
-    xbt_trp_recv(sock, header, 6);
-    xbt_trp_recv(sock, &c_kind, 1);
-    msg->kind = (e_gras_msg_kind_t) c_kind;
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF
-        ("Exception caught while trying to get the message header: %s");
-  }
-
-  for (cpt = 0; cpt < 4; cpt++)
-    if (header[cpt] != _GRAS_header[cpt])
-      THROWF(mismatch_error, 0,
-             "Incoming bytes do not look like a GRAS message (header='%s'  not '%.4s')",
-             hexa_str((unsigned char *) header, 4, 0), _GRAS_header);
-  if (header[4] != _GRAS_header[4])
-    THROWF(mismatch_error, 0, "GRAS protocol mismatch (got %d, use %d)",
-           (int) header[4], (int) _GRAS_header[4]);
-  r_arch = (int) header[5];
-
-  switch (msg->kind) {
-  case e_gras_msg_kind_oneway:
-    break;
-
-  case e_gras_msg_kind_rpccall:
-  case e_gras_msg_kind_rpcanswer:
-  case e_gras_msg_kind_rpcerror:
-    xbt_datadesc_recv(sock, ulong_type, r_arch, &msg->ID);
-    break;
-
-  default:
-    THROW_IMPOSSIBLE;
-  }
-
-  xbt_datadesc_recv(sock, string_type, r_arch, &msg_name);
-  XBT_DEBUG
-      ("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)",
-       msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4],
-       xbt_datadesc_arch_name(r_arch));
-
-  TRY {
-    msg->type =
-        (gras_msgtype_t) xbt_set_get_by_name(_gras_msgtype_set, msg_name);
-  }
-  CATCH(e) {
-    /* FIXME: Survive unknown messages */
-    if (e.category == not_found_error) {
-      xbt_ex_free(e);
-      THROWF(not_found_error, 0,
-             "Received an unknown message: %s (FIXME: should survive to these)",
-             msg_name);
-    } else
-      RETHROWF
-          ("Exception caught while retrieving the type associated to messages '%s' : %s",
-           msg_name);
-  }
-  free(msg_name);
-
-  if (msg->kind == e_gras_msg_kind_rpcerror) {
-    /* error on remote host. Carfull with that exception, eugene */
-    msg->payl_size = xbt_datadesc_size(xbt_datadesc_by_name("ex_t"));
-    msg->payl = xbt_malloc(msg->payl_size);
-    xbt_datadesc_recv(sock, xbt_datadesc_by_name("ex_t"), r_arch,
-                       msg->payl);
-
-  } else if (msg->kind == e_gras_msg_kind_rpcanswer) {
-    /* answer to RPC */
-    if (msg->type->answer_type) {
-      msg->payl_size = xbt_datadesc_size(msg->type->answer_type);
-      xbt_assert(msg->payl_size > 0,
-                  "%s %s",
-                  "Dynamic array as payload is forbided for now (FIXME?).",
-                  "Reference to dynamic array is allowed.");
-      msg->payl = xbt_malloc(msg->payl_size);
-      xbt_datadesc_recv(sock, msg->type->answer_type, r_arch, msg->payl);
-    } else {
-      msg->payl = NULL;
-      msg->payl_size = 0;
-    }
-  } else {
-    /* regular message */
-    if (msg->type->ctn_type) {
-      msg->payl_size = xbt_datadesc_size(msg->type->ctn_type);
-      xbt_assert(msg->payl_size > 0,
-                  "%s %s",
-                  "Dynamic array as payload is forbided for now (FIXME?).",
-                  "Reference to dynamic array is allowed.");
-      msg->payl = xbt_malloc(msg->payl_size);
-      xbt_datadesc_recv(sock, msg->type->ctn_type, r_arch, msg->payl);
-    } else {
-      msg->payl = NULL;
-      msg->payl_size = 0;
-    }
-  }
-}
diff --git a/src/gras/Msg/rpc.c b/src/gras/Msg/rpc.c
deleted file mode 100644 (file)
index 53fffc3..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/* rpc - RPC implementation on top of GRAS messages                         */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "gras/Msg/msg_private.h"
-
-xbt_set_t _gras_rpctype_set = NULL;
-xbt_dynar_t _gras_rpc_cancelled = NULL;
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_msg_rpc, gras_msg, "RPC mecanism");
-
-
-/** @brief declare a new versionned RPC type of the given name and payloads
- *
- * @param name: name as it should be used for logging messages (must be uniq)
- * @param payload_request: datatype of request
- * @param payload_answer: datatype of answer
- *
- * Registers a new RPC message to the GRAS mechanism. RPC are constituted of a pair
- * of messages.
- */
-void
-gras_msgtype_declare_rpc(const char *name,
-                         xbt_datadesc_type_t payload_request,
-                         xbt_datadesc_type_t payload_answer)
-{
-
-  gras_msgtype_declare_ext(name, 0,
-                           e_gras_msg_kind_rpccall,
-                           payload_request, payload_answer);
-
-}
-
-/** @brief declare a new versionned RPC type of the given name and payloads
- *
- * @param name: name as it should be used for logging messages (must be uniq)
- * @param version: something like versionning symbol
- * @param payload_request: datatype of request
- * @param payload_answer: datatype of answer
- *
- * Registers a new RPC message to the GRAS mechanism. RPC are constituted of a pair
- * of messages.
- *
- * Use this version instead of gras_rpctype_declare when you change the
- * semantic or syntax of a message and want your programs to be able to deal
- * with both versions. Internally, each will be handled as an independent
- * message type, so you can register differents for each of them.
- */
-void
-gras_msgtype_declare_rpc_v(const char *name,
-                           short int version,
-                           xbt_datadesc_type_t payload_request,
-                           xbt_datadesc_type_t payload_answer)
-{
-
-  gras_msgtype_declare_ext(name, version,
-                           e_gras_msg_kind_rpccall,
-                           payload_request, payload_answer);
-
-}
-
-static unsigned long int last_msg_ID = 0;
-
-static int msgfilter_rpcID(gras_msg_t msg, void *ctx)
-{
-  unsigned long int ID = *(unsigned long int *) ctx;
-  int res = msg->ID == ID &&
-      (msg->kind == e_gras_msg_kind_rpcanswer
-       || msg->kind == e_gras_msg_kind_rpcerror);
-  unsigned int cursor;
-  gras_msg_cb_ctx_t rpc_ctx;
-
-
-  XBT_DEBUG
-      ("Filter a message of ID %lu, type '%s' and kind '%s'. Waiting for ID=%lu. %s",
-       msg->ID, msg->type->name, e_gras_msg_kind_names[msg->kind], ID,
-       res ? "take it" : "reject");
-
-  if (res && !_gras_rpc_cancelled)
-    return res;
-
-  /* Check whether it is an old answer to a message we already canceled */
-  xbt_dynar_foreach(_gras_rpc_cancelled, cursor, rpc_ctx) {
-    if (msg->ID == rpc_ctx->ID && msg->kind == e_gras_msg_kind_rpcanswer) {
-      XBT_VERB
-          ("Got an answer to the already canceled (timeouted?) RPC %lu. Ignore it (leaking the payload!).",
-           msg->ID);
-      xbt_dynar_cursor_rm(_gras_rpc_cancelled, &cursor);
-      return 1;
-    }
-  }
-
-  return res;
-}
-
-/* Mallocator cruft */
-xbt_mallocator_t gras_msg_ctx_mallocator = NULL;
-void *gras_msg_ctx_mallocator_new_f(void)
-{
-  return xbt_new0(s_gras_msg_cb_ctx_t, 1);
-}
-
-void gras_msg_ctx_mallocator_reset_f(void *ctx)
-{
-  memset(ctx, 0, sizeof(s_gras_msg_cb_ctx_t));
-}
-
-/** @brief Launch a RPC call, but do not block for the answer */
-gras_msg_cb_ctx_t
-gras_msg_rpc_async_call_(xbt_socket_t server,
-                         double timeOut,
-                         gras_msgtype_t msgtype, void *request)
-{
-  gras_msg_cb_ctx_t ctx = xbt_mallocator_get(gras_msg_ctx_mallocator);
-
-  if (msgtype->ctn_type) {
-    xbt_assert(request,
-                "RPC type '%s' convey a payload you must provide",
-                msgtype->name);
-  } else {
-    xbt_assert(!request,
-                "No payload was declared for RPC type '%s'",
-                msgtype->name);
-  }
-
-  ctx->ID = last_msg_ID++;
-  ctx->expeditor = server;
-  ctx->msgtype = msgtype;
-  ctx->timeout = timeOut;
-
-  XBT_VERB("Send to %s:%d a RPC of type '%s' (ID=%lu)",
-        xbt_socket_peer_name(server),
-        xbt_socket_peer_port(server), msgtype->name, ctx->ID);
-
-  gras_msg_send_ext(server, e_gras_msg_kind_rpccall, ctx->ID, msgtype,
-                    request);
-
-  return ctx;
-}
-
-/** @brief Wait the answer of a RPC call previously launched asynchronously */
-void gras_msg_rpc_async_wait(gras_msg_cb_ctx_t ctx, void *answer)
-{
-  xbt_ex_t e;
-  s_gras_msg_t received;
-
-  if (ctx->msgtype->answer_type) {
-    xbt_assert(answer,
-                "Answers to RPC '%s' convey a payload you must accept",
-                ctx->msgtype->name);
-  } else {
-    xbt_assert(!answer,
-                "No payload was declared for answers to RPC '%s'",
-                ctx->msgtype->name);
-  }
-
-  TRY {
-    /* The filter returns 1 when we eat an old RPC answer to something canceled */
-    do {
-      gras_msg_wait_ext_(ctx->timeout,
-                         ctx->msgtype, NULL, msgfilter_rpcID, &ctx->ID,
-                         &received);
-    } while (received.ID != ctx->ID);
-
-  }
-  CATCH(e) {
-    if (!_gras_rpc_cancelled)
-      _gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx), NULL);
-    xbt_dynar_push(_gras_rpc_cancelled, &ctx);
-    XBT_INFO
-        ("canceled RPC %lu pushed onto the stack (%s from %s:%d) Reason: %s",
-         ctx->ID, ctx->msgtype->name,
-         xbt_socket_peer_name(ctx->expeditor),
-         xbt_socket_peer_port(ctx->expeditor), e.msg);
-    RETHROW;
-  }
-
-  xbt_mallocator_release(gras_msg_ctx_mallocator, ctx);
-  if (received.kind == e_gras_msg_kind_rpcerror) {
-    xbt_ex_t e;
-    memcpy(&e, received.payl, received.payl_size);
-    free(received.payl);
-    XBT_VERB("Raise a remote exception cat:%d coming from %s (%s)",
-             (int)e.category, e.host, e.msg);
-    __xbt_running_ctx_fetch()->exception.msg = e.msg;
-    __xbt_running_ctx_fetch()->exception.category = e.category;
-    __xbt_running_ctx_fetch()->exception.value = e.value;
-    __xbt_running_ctx_fetch()->exception.remote = 1;
-    __xbt_running_ctx_fetch()->exception.host = e.host;
-    __xbt_running_ctx_fetch()->exception.procname = e.procname;
-    __xbt_running_ctx_fetch()->exception.pid = e.pid;
-    __xbt_running_ctx_fetch()->exception.file = e.file;
-    __xbt_running_ctx_fetch()->exception.line = e.line;
-    __xbt_running_ctx_fetch()->exception.func = e.func;
-    __xbt_running_ctx_fetch()->exception.used = e.used;
-    __xbt_running_ctx_fetch()->exception.bt_strings = e.bt_strings;
-    memset((void*)&__xbt_running_ctx_fetch()->exception.bt, 0,
-           sizeof(__xbt_running_ctx_fetch()->exception.bt));
-    DO_THROW(__xbt_running_ctx_fetch());
-  }
-  memcpy(answer, received.payl, received.payl_size);
-  free(received.payl);
-}
-
-/** @brief Conduct a RPC call */
-void gras_msg_rpccall_(xbt_socket_t server,
-                       double timeout,
-                       gras_msgtype_t msgtype, void *request, void *answer)
-{
-
-  gras_msg_cb_ctx_t ctx;
-
-  ctx = gras_msg_rpc_async_call_(server, timeout, msgtype, request);
-  gras_msg_rpc_async_wait(ctx, answer);
-}
-
-
-/** @brief Return the result of a RPC call
- *
- * It done before the actual return of the callback so that the callback can do
- * some cleanups before leaving.
- */
-
-void gras_msg_rpcreturn(double timeOut, gras_msg_cb_ctx_t ctx,
-                        void *answer)
-{
-  xbt_assert(ctx->answer_due,
-              "RPC return not allowed here. Either not a RPC message or already returned a result");
-  ctx->answer_due = 0;
-  XBT_DEBUG("Return to RPC '%s' from %s:%d (tOut=%f, payl=%p)",
-         ctx->msgtype->name,
-         xbt_socket_peer_name(ctx->expeditor),
-         xbt_socket_peer_port(ctx->expeditor), timeOut, answer);
-  gras_msg_send_ext(ctx->expeditor, e_gras_msg_kind_rpcanswer, ctx->ID,
-                    ctx->msgtype, answer);
-}
diff --git a/src/gras/Msg/sg_msg.c b/src/gras/Msg/sg_msg.c
deleted file mode 100644 (file)
index 78d510d..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/* messaging - Function related to messaging code specific to SG            */
-
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/xbt_socket_private.h" /* FIXME */
-#include "xbt/datadesc.h"
-#include "xbt/datadesc/datadesc_interface.h" /* FIXME */
-#include "gras/Virtu/virtu_sg.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Transport/transport_interface.h" /* gras_trp_chunk_send/recv */
-#include "gras/Transport/transport_private.h"   /* sock->data */
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_msg);
-
-typedef void *gras_trp_bufdata_;
-#include "simgrid/simix.h"
-#include "simix/smx_private.h"
-
-/* Yeah, the following is awfull, breaking the encapsulation of at least 3 modules
- * at the same time, but I'm tracking this bug since too long now, I want it dead. now.
- * Sorry, Mt.
- */
-typedef struct {
-  xbt_thread_t listener;
-} *fake_gras_msg_listener_t;
-typedef struct {
-  smx_process_t s_process;
-} *fake_xbt_thread_t;
-
-int gras_socket_im_the_server(xbt_socket_t sock)
-{
-  gras_trp_sg_sock_data_t sock_data = sock->data;
-  gras_procdata_t* pd;
-  gras_msg_listener_t l;
-  xbt_thread_t listener_thread;
-  smx_process_t server_listener_process=NULL;
-  smx_process_t client_listener_process = NULL;
-
-  XBT_VERB("Am I the server of socket %p (client = %p, server = %p) ? process self: %p", sock, sock_data->client, sock_data->server, SIMIX_process_self());
-
-  if (sock_data->server == SIMIX_process_self()) {
-    XBT_VERB("I am the server");
-    return 1;
-  }
-  if (sock_data->client == SIMIX_process_self()) {
-    XBT_VERB("I am the client");
-    return 0;
-  }
-  XBT_VERB("I am neither the client nor the server, probably a listener");
-
-  /* neither the client nor the server. Check their respective listeners */
-  pd = ((gras_procdata_t*)SIMIX_process_get_data(sock_data->server));
-  l = pd->listener;
-  if (l) {
-    listener_thread = ((fake_gras_msg_listener_t)l)->listener;
-    server_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
-    if (server_listener_process == SIMIX_process_self()) {
-      XBT_VERB("I am the listener of the server");
-      return 1;
-    }
-  }
-
-  if (sock_data->client) {
-    pd = ((gras_procdata_t*)SIMIX_process_get_data(sock_data->client));
-    l = pd->listener;
-    if (l) {
-      listener_thread = ((fake_gras_msg_listener_t)l)->listener;
-      client_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
-      if (client_listener_process == SIMIX_process_self()) {
-  XBT_VERB("I am the listener of the client");
-        return 0;
-      }
-    }
-  }
-  /* THAT'S BAD! I should be either client or server of the sockets I get messages on!! */
-  /* This is where the bug is visible. Try to die as loudly as possible */
-  xbt_backtrace_display_current();
-  ((char*)sock)[sizeof(*sock)+1] = '0'; /* Try to make valgrind angry to see where that damn socket comes from */
-  if(system(bprintf("cat /proc/%d/maps 1>&2",getpid()))){}
-  XBT_INFO("I'm not the client in socket %p (comm:%p, rdvser=%p, rdvcli=%p) to %s, that's %s",
-      sock,sock_data->comm_recv,sock_data->rdv_server,sock_data->rdv_client,
-      SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)),
-      sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)");
-  XBT_INFO("server:%s (%p) server_listener=%p client:%s (%p) client_listener=%p, I'm %p",
-      SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)), sock_data->server,server_listener_process,
-      sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)", sock_data->client,client_listener_process,
-          SIMIX_process_self());
-  xbt_die("Bailing out after finding that damn bug");
-
-}
-
-gras_msg_t gras_msg_recv_any(void)
-{
-  gras_trp_procdata_t trp_proc =
-      (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
-  gras_msg_t msg;
-  /* Build a dynar of all communications I could get something from */
-  xbt_dynar_t comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
-  unsigned int cursor = 0;
-  int got = 0;
-  xbt_socket_t sock = NULL;
-  gras_trp_sg_sock_data_t sock_data;
-  xbt_dynar_foreach(trp_proc->sockets, cursor, sock) {
-    sock_data = (gras_trp_sg_sock_data_t) sock->data;
-
-
-    XBT_DEBUG
-        ("Consider socket %p (data:%p; Here rdv: %p; Remote rdv: %p; Comm %p) to get a message",
-         sock, sock_data,
-         gras_socket_im_the_server(sock)?
-             sock_data->rdv_server : sock_data->rdv_client,
-         gras_socket_im_the_server(sock)?
-             sock_data->rdv_client : sock_data->rdv_server,
-         sock_data->comm_recv);
-
-
-    /* If the following assert fails in some valid conditions, we need to
-     * change the code downward looking for the socket again.
-     *
-     * For now it relies on the facts (A) that sockets and comms are aligned
-     *                                (B) every sockets has a posted irecv in comms
-     *
-     * This is not trivial because we need that alignment to hold after the waitany(), so
-     * after other processes get scheduled.
-     *
-     * I cannot think of conditions where they get desynchronized (A violated) as long as
-     *    1) only the listener calls that function
-     *    2) Nobody but the listener removes sockets from that set (in main listener loop)
-     *    3) New sockets are added at the end, and signified ASAP to the listener (by awaking him)
-     * The throw bellow ensures that B is never violated without failing out loudly.
-     *
-     * We cannot search by comparing the comm object pointer that object got
-     *    freed by the waiting process (down in smx_network, in
-     *    comm_wait_for_completion or comm_cleanup). So, actually, we could
-     *    use that pointer since that's a dangling pointer, but no one changes it.
-     * I still feel unconfortable with using dangling pointers, even if that would
-     *    let the code work even if A and/or B are violated, provided that
-     *    (C) the new irecv is never posted before we return from waitany to that function.
-     *
-     * Another approach, robust to B violation would be to retraverse the socks dynar with
-     *    an iterator, incremented only when the socket has a comm. And we've the right socket
-     *    when that iterator is equal to "got", the result of waitany. Not needed if B holds.
-     */
-    xbt_assert(sock_data->comm_recv,
-                "Comm_recv of socket %p is empty; please report that nasty bug",
-                sock);
-    /* End of paranoia */
-
-    XBT_VERB("Consider receiving messages from on comm_recv %p rdv:%p (other rdv:%p)",
-          sock_data->comm_recv,
-          gras_socket_im_the_server(sock)?
-              sock_data->rdv_server : sock_data->rdv_client,
-          gras_socket_im_the_server(sock)?
-              sock_data->rdv_client : sock_data->rdv_server);
-    xbt_dynar_push(comms, &(sock_data->comm_recv));
-  }
-  XBT_VERB("Wait on %lu 'sockets'", xbt_dynar_length(comms));
-  /* Wait for the end of any of these communications */
-  got = simcall_comm_waitany(comms);
-
-  /* retrieve the message sent in that communication */
-  sock = xbt_dynar_get_as(trp_proc->sockets, got, xbt_socket_t);
-  sock_data = (gras_trp_sg_sock_data_t) sock->data;
-  msg = sock_data->msg;
-  XBT_VERB("Got something. Communication over rdv_server=%p, rdv_client=%p",
-      sock_data->rdv_server,sock_data->rdv_client);
-
-  /* Reinstall a waiting communication on that rdv */
-/*  xbt_dynar_foreach(trp_proc->sockets,cursor,sock) {
-    sock_data = (gras_trp_sg_sock_data_t) sock->data;
-    if (sock_data->comm_recv && sock_data->comm_recv == comm)
-      break;
-  }
-  */
-  sock_data->comm_recv =
-      simcall_comm_irecv(gras_socket_im_the_server(sock) ?
-                          sock_data->rdv_server : sock_data->rdv_client,
-                          &sock_data->msg, NULL, NULL, NULL);
-
-  return msg;
-}
-
-
-void gras_msg_send_ext(xbt_socket_t sock,
-                       e_gras_msg_kind_t kind,
-                       unsigned long int ID,
-                       gras_msgtype_t msgtype, void *payload)
-{
-  int whole_payload_size = 0;   /* msg->payload_size is used to memcpy the payload.
-                                   This is used to report the load onto the simulator. It also counts the size of pointed stuff */
-  gras_msg_t msg;               /* message to send */
-  smx_action_t comm;
-  gras_trp_sg_sock_data_t sock_data = (gras_trp_sg_sock_data_t) sock->data;
-
-  smx_rdv_t target_rdv =
-      (sock_data->server == SIMIX_process_self())?
-          sock_data->rdv_client :
-          sock_data->rdv_server;
-
-  /*initialize gras message */
-  msg = xbt_new(s_gras_msg_t, 1);
-  sock->refcount++;
-  msg->expe = sock;
-  msg->kind = kind;
-  msg->type = msgtype;
-  msg->ID = ID;
-  XBT_PUBLIC(xbt_datadesc_type_t) xbt_datadesc_by_id(long int code);
-
-  /* to debug */
-  XBT_PUBLIC(void) xbt_datadesc_type_dump(const xbt_datadesc_type_t ddt);
-  XBT_PUBLIC(const char *) xbt_datadesc_arch_name(int code);
-
-  /* compare two data type description */
-  XBT_PUBLIC(int)
-  xbt_datadesc_type_cmp(const xbt_datadesc_type_t d1,
-                         const xbt_datadesc_type_t d2);
-
-  /* Access function */
-  XBT_PUBLIC(int) xbt_datadesc_size(xbt_datadesc_type_t type);
-  /* Described data exchanges: direct use */
-  XBT_PUBLIC(int) xbt_datadesc_memcpy(xbt_datadesc_type_t type, void *src,
-                                       void *dst);
-  XBT_PUBLIC(void) xbt_datadesc_send(xbt_socket_t sock,
-                                      xbt_datadesc_type_t type, void *src);
-  XBT_PUBLIC(void) xbt_datadesc_recv(xbt_socket_t sock,
-                                      xbt_datadesc_type_t type, int r_arch,
-                                      void *dst);
-
-  /* Described data exchanges: IDL compilation FIXME: not implemented*/
-  void xbt_datadesc_gen_cpy(xbt_datadesc_type_t type, void *src,
-                             void **dst);
-  void xbt_datadesc_gen_send(xbt_socket_t sock,
-                              xbt_datadesc_type_t type, void *src);
-  void xbt_datadesc_gen_recv(xbt_socket_t sock,
-                              xbt_datadesc_type_t type, int r_arch,
-                              void *dst);
-
-
-  XBT_VERB("Send msg %s (%s) to rdv %p sock %p",
-      msgtype->name,  e_gras_msg_kind_names[kind], target_rdv, sock);
-
-  if (kind == e_gras_msg_kind_rpcerror) {
-    /* error on remote host, careful, payload is an exception */
-    msg->payl_size = xbt_datadesc_size(xbt_datadesc_by_name("ex_t"));
-    msg->payl = xbt_malloc(msg->payl_size);
-    whole_payload_size =
-        xbt_datadesc_memcpy(xbt_datadesc_by_name("ex_t"), payload,
-                             msg->payl);
-  } else if (kind == e_gras_msg_kind_rpcanswer) {
-    msg->payl_size = xbt_datadesc_size(msgtype->answer_type);
-    if (msg->payl_size)
-      msg->payl = xbt_malloc(msg->payl_size);
-    else
-      msg->payl = NULL;
-
-    if (msgtype->answer_type)
-      whole_payload_size = xbt_datadesc_memcpy(msgtype->answer_type,
-                                                payload, msg->payl);
-  } else {
-    msg->payl_size = xbt_datadesc_size(msgtype->ctn_type);
-    msg->payl = msg->payl_size ? xbt_malloc(msg->payl_size) : NULL;
-    if (msgtype->ctn_type)
-      whole_payload_size = xbt_datadesc_memcpy(msgtype->ctn_type,
-                                                payload, msg->payl);
-  }
-
-  comm = simcall_comm_isend(target_rdv, whole_payload_size, -1, msg, sizeof(void *), NULL,NULL, msg, 0);
-  simcall_comm_wait(comm, -1);
-
-  XBT_VERB("Message sent (and received)");
-
-}
diff --git a/src/gras/Msg/timer.c b/src/gras/Msg/timer.c
deleted file mode 100644 (file)
index 1fff6ea..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/* timer - Delayed and repetitive actions                                   */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/timer.h"
-#include "gras/Virtu/virtu_interface.h"
-
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_timer, gras,
-                                "Delayed and repetitive actions");
-
-/** @brief Request \a action to be called once in \a delay seconds */
-void gras_timer_delay(double delay, void_f_void_t action)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-
-  gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
-
-  XBT_VERB("Register delayed action %p", action);
-  timer->period = delay;
-  timer->expiry = delay + gras_os_time();
-  timer->action = action;
-  timer->repeat = FALSE;
-}
-
-/** @brief Request \a action to be called every \a interval seconds */
-void gras_timer_repeat(double interval, void_f_void_t action)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-
-  gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
-
-  XBT_VERB("Register repetitive action %p", action);
-  timer->period = interval;
-  timer->expiry = interval + gras_os_time();
-  timer->action = action;
-  timer->repeat = TRUE;
-}
-
-/** @brief Cancel a delayed task */
-void gras_timer_cancel_delay(double interval, void_f_void_t action)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cursor;
-  int found;
-  s_gras_timer_t timer;
-
-  found = FALSE;
-  xbt_dynar_foreach(pd->timers, cursor, timer) {
-    if (timer.repeat == FALSE &&
-        timer.period == interval && timer.action == action) {
-
-      found = TRUE;
-      xbt_dynar_cursor_rm(pd->timers, &cursor);
-    }
-  }
-
-  if (!found)
-    THROWF(mismatch_error, 0,
-           "Cannot remove the action %p delayed of %f second: not found",
-           action, interval);
-
-}
-
-/** @brief Cancel a repetitive task */
-void gras_timer_cancel_repeat(double interval, void_f_void_t action)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cursor;
-  int found;
-  s_gras_timer_t timer;
-
-  found = FALSE;
-  xbt_dynar_foreach(pd->timers, cursor, timer) {
-    if (timer.repeat == TRUE &&
-        timer.period == interval && timer.action == action) {
-
-      found = TRUE;
-      xbt_dynar_cursor_rm(pd->timers, &cursor);
-    }
-  }
-
-  if (!found)
-    THROWF(mismatch_error, 0,
-           "Cannot remove the action %p delayed of %f second: not found",
-           action, interval);
-}
-
-/** @brief Cancel all delayed tasks */
-void gras_timer_cancel_delay_all(void)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cursor;
-  int found;
-  s_gras_timer_t timer;
-
-  found = FALSE;
-  xbt_dynar_foreach(pd->timers, cursor, timer) {
-    if (timer.repeat == FALSE) {
-
-      found = TRUE;
-      xbt_dynar_cursor_rm(pd->timers, &cursor);
-    }
-  }
-
-  if (!found)
-    THROWF(mismatch_error, 0, "No delayed action to remove");
-
-}
-
-/** @brief Cancel all repetitive tasks */
-void gras_timer_cancel_repeat_all(void)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cursor;
-  int found;
-  s_gras_timer_t timer;
-
-  found = FALSE;
-  xbt_dynar_foreach(pd->timers, cursor, timer) {
-    if (timer.repeat == FALSE) {
-
-      found = TRUE;
-      xbt_dynar_cursor_rm(pd->timers, &cursor);
-    }
-  }
-
-  if (!found)
-    THROWF(mismatch_error, 0, "No repetitive action to remove");
-}
-
-/** @brief Cancel all delayed and repetitive tasks */
-void gras_timer_cancel_all(void)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  xbt_dynar_reset(pd->timers);
-}
-
-
-/* returns 0 if it handled a timer, or the delay until next timer, or -1 if no armed timer */
-double gras_msg_timer_handle(void)
-{
-  gras_msg_procdata_t pd =
-      (gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
-  unsigned int cursor;
-  gras_timer_t timer;
-  double now = gras_os_time();
-  double untilnext = -1.0;
-
-  for (cursor = 0; cursor < xbt_dynar_length(pd->timers); cursor++) {
-    double untilthis;
-
-    timer = xbt_dynar_get_ptr(pd->timers, cursor);
-    untilthis = timer->expiry - now;
-
-    XBT_DEBUG("Action %p expires in %f", timer->action, untilthis);
-
-    if (untilthis <= 0.0) {
-      void_f_void_t action = timer->action;
-
-      XBT_DEBUG("[%.0f] Serve %s action %p (%f<%f)", gras_os_time(),
-             timer->repeat ? "repetitive" : "delayed", timer->action,
-             timer->expiry, now);
-
-      if (timer->repeat) {
-        timer->expiry = now + timer->period;
-        XBT_DEBUG("[%.0f] Re-arm repetitive action %p for %f (period=%f)",
-               gras_os_time(), timer->action, timer->expiry,
-               timer->period);
-      } else {
-        XBT_DEBUG("[%.0f] Remove %p now that it's done", gras_os_time(),
-               timer->action);
-        xbt_dynar_cursor_rm(pd->timers, &cursor);
-      }
-      action();
-      return 0.0;
-    } else if (untilthis < untilnext || untilnext == -1) {
-      untilnext = untilthis;
-    }
-  }
-  return untilnext;
-}
diff --git a/src/gras/Transport/README b/src/gras/Transport/README
deleted file mode 100644 (file)
index e883290..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-There is a plugin mechanism in here, and the selection is automatic
-
-If you open a socket in SG realm, you'll get a SG socket.
-If you open a socket in RL realm, you'll get a TCP socket.
-
-To get a file socket, you'll have to build it manually using
-gras_socket_client_from_file() to read from it, or
-gras_socket_server_from_file() to write to it.
-
-There is no way (yet?) to build a pipe socket, so threads have to
-discuss using network sockets, or xbt_queue_t structures.
-
-IMPLEMENTATION NOTES ABOUT THE SG SIDE
-
-This area is quite messy. The thing is that I strived too much to keep
-the existing interface, which is loosely inspired from BSD sockets.
-
-Vocabulary: 
-  Server is the one who created the master socket. 
-  Client is the one connecting to that from a remote host. 
-  Their roles keep the same for the whole connection duration. 
-  Sender and Receiver denote the roles during one message exchange.
-  If the server answers to the client, it becomes the sender while the
-  client becomes the receiver. 
-  All this seems trivial, but confusion is easy and dangerous.
-
-
-The connection story goes that way. When we create a master socket, we
-look whether the given port is free on that host or not. For that, we
-traverse the gras_hostdata_t->ports dynar, which contains
-gras_sg_portrec_t records. If it's free, we create a socket with a
-gras_trp_sg_sock_data_t structure. Here is that struct:
-
-typedef struct { 
-  smx_process_t server; 
-  smx_process_t client;
-    
-  smx_rdv_t rdv_server; /* The rendez-vous point to use */
-  smx_rdv_t rdv_client; /* The rendez-vous point to use */
-  smx_action_t comm_recv; /* The comm of irecv on receiver side */
-} s_gras_trp_sg_sock_data_t,*gras_trp_sg_sock_data_t;
-
-In GRAS, there is a listener process, in charge of pumping everything
-coming from the network and post that to the main user thread. That
-to overlap (incoming) communications and computations.
-In SG, this is done by ensuring that a receive is posted on every
-opened socket, and having the listener doing a smx_sem_waitany() to
-find the first ending one (in RL, a select+ddt_recv does the same).
-
-Another extra complexity is due to the fact that when the user
-receives a message, it gets a socket being a mean to contact the
-sender of that message. In RL, that's easy since sockets are
-full-duplex. In SG, I have to either create a new socket for each
-message (slow and leak-prone), or maintain a set of opened sockets on
-receiver side and check if the one I need is there or create it. The
-approach used currently is to give to the receiver a pointer to the
-structure created on the sender side directly.
-
-At the end of the day, everything is as if there were master socket
-and working sockets, just like in BSD. There is no explicit accept.
-Master sockets get created by gras_socket_server() and friends. You
-can recognize them by the fact that the rdv_client field is always
-NULL. Such sockets are not really used to exchange data, but more to
-establish connections. For actual exchanges, you need a working socket
-created by gras_socket_client() and friends. So, they are created on
-client side, but the master side will see it as message expeditor when
-getting a message.
-
-You can see which side of the socket you are with the
-gras_socket_im_the_server() function, which is designed for that.
diff --git a/src/gras/Transport/rl_transport.c b/src/gras/Transport/rl_transport.c
deleted file mode 100644 (file)
index f142dfc..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/* rl_transport - RL specific functions for transport                       */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/xbt_socket_private.h" /* FIXME */
-#include "portable.h"
-#include "gras/Transport/transport_private.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_trp);
-
-/* check transport_private.h for an explanation of this variable */
-xbt_socket_t _gras_lastly_selected_socket = NULL;
-
-/**
- * gras_trp_select:
- *
- * Returns the next socket to service because it receives a message.
- *
- * if timeout<0, we ought to implement the adaptative timeout (FIXME)
- *
- *
- * if timeout>0 and no message there, wait at most that amount of time before giving up.
- */
-xbt_socket_t gras_trp_select(double timeout)
-{
-  xbt_dynar_t sockets =
-      ((gras_trp_procdata_t)
-       gras_libdata_by_id(gras_trp_libdata_id))->sockets;
-  int done = -1;
-  double wakeup = gras_os_time() + timeout;
-  double now = 0;
-  /* nextToService used to make sure socket with high number do not starve */
-  /*  static int nextToService = 0; */
-  struct timeval tout, *p_tout;
-
-  int max_fds = 0;              /* first arg of select: number of existing sockets */
-  /* but accept() of winsock returns sockets bigger than the limit, so don't bother 
-     with this tiny optimisation on BillWare */
-  fd_set FDS;
-  int ready;                    /* return of select: number of socket ready to be serviced */
-  static int fd_setsize = -1;   /* FD_SETSIZE not always defined. Get this portably */
-
-  xbt_socket_t sock_iter;      /* iterating over all sockets */
-  unsigned int cursor;          /* iterating over all sockets */
-
-  /* Check whether there is more data to read from the socket we selected last time.
-     This can happen with tcp buffered sockets since we try to get as much data as we can for them */
-  if (_gras_lastly_selected_socket
-      && _gras_lastly_selected_socket->moredata) {
-    XBT_VERB
-        ("Returning _gras_lastly_selected_socket since there is more data on it");
-    return _gras_lastly_selected_socket;
-  }
-
-  /* Compute FD_SETSIZE on need */
-  if (fd_setsize < 0) {
-#ifdef HAVE_SYSCONF
-    fd_setsize = sysconf(_SC_OPEN_MAX);
-#else
-#  ifdef HAVE_GETDTABLESIZE
-    fd_setsize = getdtablesize();
-#  else
-    fd_setsize = FD_SETSIZE;
-#  endif                        /* !USE_SYSCONF */
-#endif
-  }
-
-  while (done == -1) {
-    if (timeout > 0) {          /* did we timeout already? */
-      now = gras_os_time();
-      XBT_DEBUG("wakeup=%f now=%f", wakeup, now);
-      if (now == -1 || now >= wakeup) {
-        /* didn't find anything; no need to update _gras_lastly_selected_socket since its moredata is 0 (or we would have returned it directly) */
-        THROWF(timeout_error, 0,
-               "Timeout (%f) elapsed with selecting for incoming connections",
-               timeout);
-      }
-    }
-
-    /* construct the set of socket to ear from */
-    FD_ZERO(&FDS);
-    max_fds = -1;
-    xbt_dynar_foreach(sockets, cursor, sock_iter) {
-      if (!sock_iter->valid)
-        continue;
-
-      if (sock_iter->incoming) {
-        //XBT_DEBUG("Considering socket %d for select", sock_iter->sd);
-#ifndef HAVE_WINSOCK_H
-        if (max_fds < sock_iter->sd)
-          max_fds = sock_iter->sd;
-#else
-        max_fds = 0;
-
-#endif
-        FD_SET(sock_iter->sd, &FDS);
-      } else {
-        XBT_DEBUG("Not considering socket %d for select", sock_iter->sd);
-      }
-    }
-
-
-    if (max_fds == -1) {
-      if (timeout > 0) {
-        XBT_DEBUG("No socket to select onto. Sleep %f sec instead.", timeout);
-        gras_os_sleep(timeout);
-        THROWF(timeout_error, 0,
-               "No socket to select onto. Sleep %f sec instead", timeout);
-      } else {
-        XBT_DEBUG("No socket to select onto. Return directly.");
-        THROWF(timeout_error, 0,
-               "No socket to select onto. Return directly.");
-      }
-    }
-#ifndef HAVE_WINSOCK_H
-    /* we cannot have more than FD_SETSIZE sockets 
-       ... but with WINSOCK which returns sockets higher than the limit (killing this optim) */
-    if (++max_fds > fd_setsize && fd_setsize > 0) {
-      XBT_WARN("too many open sockets (%d).", max_fds);
-      done = 0;
-      break;
-    }
-#else
-    max_fds = fd_setsize;
-#endif
-
-    tout.tv_sec = tout.tv_usec = 0;
-    if (timeout > 0) {
-      /* set the timeout */
-      tout.tv_sec = (unsigned long) (wakeup - now);
-      tout.tv_usec =
-          ((wakeup - now) - ((unsigned long) (wakeup - now))) * 1000000;
-      p_tout = &tout;
-    } else if (timeout == 0) {
-      /* polling only */
-      tout.tv_sec = 0;
-      tout.tv_usec = 0;
-      p_tout = &tout;
-      /* we just do one loop around */
-      done = 0;
-    } else {
-      /* no timeout: good luck! */
-      p_tout = NULL;
-    }
-
-    XBT_DEBUG("Selecting over %d socket(s); timeout=%f", max_fds - 1,
-           timeout);
-    ready = select(max_fds, &FDS, NULL, NULL, p_tout);
-    XBT_DEBUG("select returned %d", ready);
-    if (ready == -1) {
-      switch (errno) {
-      case EINTR:              /* a signal we don't care about occured. we don't care */
-        /* if we cared, we would have set an handler */
-        continue;
-      case EINVAL:             /* invalid value */
-        THROWF(system_error, EINVAL,
-               "invalid select: nb fds: %d, timeout: %d.%d", max_fds,
-               (int) tout.tv_sec, (int) tout.tv_usec);
-      case ENOMEM:
-        xbt_die("Malloc error during the select");
-      default:
-        THROWF(system_error, errno, "Error during select: %s (%d)",
-               strerror(errno), errno);
-      }
-      THROW_IMPOSSIBLE;
-    } else if (ready == 0) {
-      continue;                 /* this was a timeout */
-    }
-
-    xbt_dynar_foreach(sockets, cursor, sock_iter) {
-      if (!FD_ISSET(sock_iter->sd, &FDS)) {     /* this socket is not ready */
-        continue;
-      }
-
-      /* Got a socket to serve */
-      ready--;
-
-      if (sock_iter->accepting && sock_iter->plugin->socket_accept) {
-        /* not a socket but an ear. accept on it and serve next socket */
-        xbt_socket_t accepted = NULL;
-
-        /* release mutex before accept; it will change the sockets dynar, so we have to break the foreach asap */
-        xbt_dynar_cursor_unlock(sockets);
-        accepted = (sock_iter->plugin->socket_accept) (sock_iter);
-
-        XBT_DEBUG("accepted=%p,&accepted=%p", accepted, &accepted);
-        accepted->meas = sock_iter->meas;
-        break;
-
-      } else {
-        /* Make sure the socket is still alive by reading the first byte */
-        int recvd;
-
-        if (sock_iter->recvd) {
-          /* Socket wasn't used since last time! Don't bother checking whether it's still alive */
-          recvd = 1;
-        } else {
-          recvd = read(sock_iter->sd, &sock_iter->recvd_val, 1);
-        }
-
-        if (recvd < 0) {
-          XBT_WARN("socket %d failed: %s", sock_iter->sd, strerror(errno));
-          /* done with this socket; remove it and break the foreach since it will change the dynar */
-          xbt_dynar_cursor_unlock(sockets);
-          gras_socket_close(sock_iter);
-          break;
-        } else if (recvd == 0) {
-          /* Connection reset (=closed) by peer. */
-          XBT_DEBUG("Connection %d reset by peer", sock_iter->sd);
-          sock_iter->valid = 0; /* don't close it. User may keep references to it */
-        } else {
-          /* Got a suited socket ! */
-          XBT_OUT();
-          sock_iter->recvd = 1;
-          XBT_DEBUG("Filled little buffer (%c %x %d)", sock_iter->recvd_val,
-                 sock_iter->recvd_val, recvd);
-          _gras_lastly_selected_socket = sock_iter;
-          /* break sync dynar iteration */
-          xbt_dynar_cursor_unlock(sockets);
-          return sock_iter;
-        }
-      }
-
-      /* if we're here, the socket we found wasn't really ready to be served */
-      if (ready == 0) {         /* exausted all sockets given by select. Request new ones */
-
-        xbt_dynar_cursor_unlock(sockets);
-        break;
-      }
-    }
-
-  }
-
-  /* No socket found. Maybe we had timeout=0 and nothing to do */
-  XBT_DEBUG("TIMEOUT");
-  THROWF(timeout_error, 0, "Timeout");
-}
-
-/* to make the linker happy in SG mode */
-void gras_trp_sg_setup(xbt_trp_plugin_t plug)
-{
-  THROWF(mismatch_error, 0, "No SG transport on live platforms");
-}
diff --git a/src/gras/Transport/sg_transport.c b/src/gras/Transport/sg_transport.c
deleted file mode 100644 (file)
index d8bf5b0..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* sg_transport - SG specific functions for transport                       */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "gras/Transport/transport_private.h"
-#include "gras/Virtu/virtu_sg.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_trp);
-
-/* check transport_private.h for an explanation of this variable;
- * this just need to be defined to NULL in SG */
-xbt_socket_t _gras_lastly_selected_socket = NULL;
-
-#ifdef KILLME
-/**  
- * gras_trp_select:
- *
- * Returns the next socket to service having a message awaiting.
- *
- * if timeout<0, we ought to implement the adaptative timeout (FIXME)
- *
- * if timeout=0, do not wait for new message, only handle the ones already there.
- *
- * if timeout>0 and no message there, wait at most that amount of time before giving up.
- */
-gras_socket_t gras_trp_select(double timeout)
-{
-  gras_socket_t res;
-  gras_trp_procdata_t pd =
-      (gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id);
-  gras_trp_sg_sock_data_t *sockdata;
-  gras_trp_plugin_t trp;
-  gras_socket_t active_socket = NULL;
-  gras_trp_sg_sock_data_t *active_socket_data;
-  gras_socket_t sock_iter;      /* iterating over all sockets */
-  unsigned int cursor;
-
-  XBT_DEBUG("select on %s@%s with timeout=%f",
-         SIMIX_process_self_get_name(),
-         SIMIX_host_self_get_name(), timeout);
-  if (timeout >= 0) {
-    xbt_queue_shift_timed(pd->msg_selectable_sockets,
-                          &active_socket, timeout);
-  } else {
-    xbt_queue_shift(pd->msg_selectable_sockets, &active_socket);
-  }
-
-  if (active_socket == NULL) {
-    XBT_DEBUG("TIMEOUT");
-    THROWF(timeout_error, 0, "Timeout");
-  }
-  active_socket_data = (gras_trp_sg_sock_data_t *) active_socket->data;
-
-  /* Ok, got something. Open a socket back to the expeditor */
-
-  /* Try to reuse an already openned socket to that expeditor */
-  XBT_DEBUG("Open sockets size %lu", xbt_dynar_length(pd->sockets));
-  xbt_dynar_foreach(pd->sockets, cursor, sock_iter) {
-    gras_trp_sg_sock_data_t *sock_data;
-    XBT_DEBUG("Consider %p as outgoing socket to expeditor", sock_iter);
-
-    if (sock_iter->meas || !sock_iter->outgoing)
-      continue;
-    sock_data = ((gras_trp_sg_sock_data_t *) sock_iter->data);
-
-    if ((sock_data->to_socket == active_socket) &&
-        (sock_data->to_host ==
-         simcall_process_get_host(active_socket_data->from_process))) {
-      xbt_dynar_cursor_unlock(pd->sockets);
-      return sock_iter;
-    }
-  }
-
-  /* Socket to expeditor not created yet */
-  XBT_DEBUG("Create a socket to the expeditor");
-
-  trp = gras_trp_plugin_get_by_name("sg");
-
-  gras_trp_socket_new(1, &res);
-  res->plugin = trp;
-
-  res->incoming = 1;
-  res->outgoing = 1;
-  res->accepting = 0;
-  res->sd = -1;
-
-  res->port = -1;
-
-  /* initialize the ports */
-  //res->peer_port = active_socket->port;
-  res->port = active_socket->peer_port;
-
-  /* create sockdata */
-  sockdata = xbt_new(gras_trp_sg_sock_data_t, 1);
-  sockdata->from_process = SIMIX_process_self();
-  sockdata->to_process = active_socket_data->from_process;
-
-  res->peer_port = ((gras_trp_procdata_t)
-                    gras_libdata_by_name_from_remote("gras_trp",
-                                                     sockdata->to_process))->
-      myport;
-  sockdata->to_socket = active_socket;
-  /*update the peer to_socket  variable */
-  active_socket_data->to_socket = res;
-  sockdata->cond = simcall_cond_init();
-  sockdata->mutex = simcall_mutex_init();
-
-  sockdata->to_host =
-      simcall_process_get_host(active_socket_data->from_process);
-
-  res->data = sockdata;
-  res->peer_name = strdup(simcall_host_get_name(sockdata->to_host));
-
-  gras_trp_buf_init_sock(res);
-
-  XBT_DEBUG("Create socket to process:%s(Port %d) from process: %s(Port %d)",
-         simcall_process_get_name(sockdata->from_process),
-         res->peer_port,
-         simcall_process_get_name(sockdata->to_process), res->port);
-
-  return res;
-}
-#endif
diff --git a/src/gras/Transport/transport.c b/src/gras/Transport/transport.c
deleted file mode 100644 (file)
index 1c86966..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/* transport - low level communication                                      */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-/***
- *** Options
- ***/
-#ifndef NDEBUG
-static int gras_opt_trp_nomoredata_on_close = 0;
-#endif
-
-#include "xbt/ex.h"
-#include "xbt/peer.h"
-#include "xbt/socket.h"
-#include "xbt/xbt_socket_private.h" /* FIXME */
-#include "portable.h"
-#include "gras/Transport/transport_private.h"
-#include "gras/Msg/msg_interface.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_trp, gras,
-                                "Conveying bytes over the network");
-
-/**
- * @brief Opens a server socket and makes it ready to be listened to.
- * @param port: port on which you want to listen
- * @param buf_size: size of the buffer (in byte) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
- * @param measurement: whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)
- *
- * In real life, you'll get a TCP socket.
- */
-xbt_socket_t
-gras_socket_server_ext(unsigned short port,
-                       unsigned long int buf_size, int measurement)
-{
-  xbt_trp_plugin_t trp;
-  xbt_socket_t sock;
-
-  XBT_DEBUG("Create a server socket from plugin %s on port %d",
-         gras_if_RL() ? "tcp" : "sg", port);
-  trp = xbt_trp_plugin_get_by_name(gras_if_SG() ? "sg" : "tcp");
-
-  /* defaults settings */
-  xbt_socket_new_ext(1,
-                     &sock,
-                     trp,
-                     (buf_size > 0 ? buf_size : 32 * 1024),
-                     measurement);
-
-  /* Call plugin socket creation function */
-  XBT_DEBUG("Prepare socket with plugin (fct=%p)", trp->socket_server);
-  TRY {
-    trp->socket_server(trp, port, sock);
-  }
-  CATCH_ANONYMOUS {
-    free(sock);
-    RETHROW;
-  }
-
-  if (!measurement)
-    ((gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id))->myport
-        = port;
-  xbt_dynar_push(((gras_trp_procdata_t)
-                  gras_libdata_by_id(gras_trp_libdata_id))->sockets,
-                 &sock);
-
-  gras_msg_listener_awake();
-  return sock;
-}
-
-/**
- * @brief Opens a server socket on any port in the given range
- *
- * @param minport: first port we will try
- * @param maxport: last port we will try
- * @param buf_size: size of the buffer (in byte) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
- * @param measurement: whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)
- *
- * If none of the provided ports works, raises the exception got when trying the last possibility
- */
-xbt_socket_t
-gras_socket_server_range(unsigned short minport, unsigned short maxport,
-                         unsigned long int buf_size, int measurement)
-{
-  volatile int port;
-  xbt_socket_t res = NULL;
-  xbt_ex_t e;
-
-  for (port = minport; port < maxport; port++) {
-    TRY {
-      res = gras_socket_server_ext(port, buf_size, measurement);
-    }
-    CATCH(e) {
-      if (port == maxport)
-        RETHROW;
-      xbt_ex_free(e);
-    }
-    if (res)
-      return res;
-  }
-  THROW_IMPOSSIBLE;
-}
-
-/**
- * @brief Opens a client socket to a remote host.
- * @param host: who you want to connect to
- * @param port: where you want to connect to on this host
- * @param buf_size: size of the buffer (in bytes) on the socket (for TCP sockets only). If 0, a sain default is used (32k, but may change)
- * @param measurement: whether this socket is meant to convey measurement (if you don't know, use 0 to exchange regular messages)
- *
- * In real life, you'll get a TCP socket.
- */
-xbt_socket_t
-gras_socket_client_ext(const char *host,
-                       unsigned short port,
-                       unsigned long int buf_size, int measurement)
-{
-  xbt_trp_plugin_t trp;
-  xbt_socket_t sock;
-
-  trp = xbt_trp_plugin_get_by_name(gras_if_SG() ? "sg" : "tcp");
-
-  XBT_DEBUG("Create a client socket from plugin %s",
-         gras_if_RL()? "tcp" : "sg");
-  /* defaults settings */
-  xbt_socket_new_ext(0,
-                     &sock,
-                     trp,
-                     (buf_size > 0 ? buf_size : 32 * 1024),
-                     measurement);
-
-  /* plugin-specific */
-  TRY {
-    (*trp->socket_client) (trp, host, port, sock);
-  }
-  CATCH_ANONYMOUS {
-    free(sock);
-    RETHROW;
-  }
-  xbt_dynar_push(((gras_trp_procdata_t)
-                  gras_libdata_by_id(gras_trp_libdata_id))->sockets,
-                 &sock);
-  gras_msg_listener_awake();
-  return sock;
-}
-
-/**
- * @brief Opens a server socket and make it ready to be listened to.
- *
- * In real life, you'll get a TCP socket.
- */
-xbt_socket_t gras_socket_server(unsigned short port)
-{
-  return gras_socket_server_ext(port, 32 * 1024, 0);
-}
-
-/** @brief Opens a client socket to a remote host */
-xbt_socket_t gras_socket_client(const char *host, unsigned short port)
-{
-  return gras_socket_client_ext(host, port, 0, 0);
-}
-
-/** @brief Opens a client socket to a remote host specified as '\a host:\a port' */
-xbt_socket_t gras_socket_client_from_string(const char *host)
-{
-  xbt_peer_t p = xbt_peer_from_string(host);
-  xbt_socket_t res = gras_socket_client_ext(p->name, p->port, 0, 0);
-  xbt_peer_free(p);
-  return res;
-}
-
-void gras_socket_close_voidp(void *sock)
-{
-  gras_socket_close((xbt_socket_t) sock);
-}
-
-/** \brief Close socket */
-void gras_socket_close(xbt_socket_t sock)
-{
-  if (--sock->refcount)
-    return;
-
-  xbt_dynar_t sockets =
-      ((gras_trp_procdata_t)
-       gras_libdata_by_id(gras_trp_libdata_id))->sockets;
-  xbt_socket_t sock_iter = NULL;
-  unsigned int cursor;
-
-  XBT_IN();
-  XBT_VERB("Close %p", sock);
-  if (sock == _gras_lastly_selected_socket) {
-    xbt_assert(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
-                "Closing a socket having more data in buffer while the nomoredata_on_close option is activated");
-
-    if (sock->moredata)
-      XBT_CRITICAL
-          ("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
-    _gras_lastly_selected_socket = NULL;
-  }
-
-  /* FIXME: Issue an event when the socket is closed */
-  XBT_DEBUG("sockets pointer before %p", sockets);
-  if (sock) {
-    /* FIXME: Cannot get the dynar mutex, because it can be already locked */
-//              _xbt_dynar_foreach(sockets,cursor,sock_iter) {
-    for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
-      _xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
-      if (sock == sock_iter) {
-        XBT_DEBUG("remove sock cursor %u dize %lu\n", cursor,
-               xbt_dynar_length(sockets));
-        xbt_dynar_cursor_rm(sockets, &cursor);
-        if (sock->plugin->socket_close)
-          (*sock->plugin->socket_close) (sock);
-
-        /* free the memory */
-        free(sock);
-        XBT_OUT();
-        return;
-      }
-    }
-    XBT_WARN
-        ("Ignoring request to free an unknown socket (%p). Execution stack:",
-         sock);
-    xbt_backtrace_display_current();
-  }
-  XBT_OUT();
-}
-
-/*
- * Creating procdata for this module
- */
-static void *gras_trp_procdata_new(void)
-{
-  gras_trp_procdata_t res = xbt_new(s_gras_trp_procdata_t, 1);
-
-  res->name = xbt_strdup("gras_trp");
-  res->name_len = 0;
-  res->sockets = xbt_dynar_new_sync(sizeof(xbt_socket_t *), NULL);
-  res->myport = 0;
-
-  return (void *) res;
-}
-
-/*
- * Freeing procdata for this module
- */
-static void gras_trp_procdata_free(void *data)
-{
-  gras_trp_procdata_t res = (gras_trp_procdata_t) data;
-
-  xbt_dynar_free(&(res->sockets));
-  free(res->name);
-  free(res);
-}
-
-void gras_trp_socketset_dump(const char *name)
-{
-  gras_trp_procdata_t procdata =
-      (gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id);
-
-  unsigned int it;
-  xbt_socket_t s;
-
-  XBT_INFO("** Dump the socket set %s", name);
-  xbt_dynar_foreach(procdata->sockets, it, s) {
-    XBT_INFO("  %p -> %s:%d %s",
-          s, xbt_socket_peer_name(s), xbt_socket_peer_port(s),
-          s->valid ? "(valid)" : "(peer dead)");
-  }
-  XBT_INFO("** End of socket set %s", name);
-}
-
-/*
- * Module registration
- */
-int gras_trp_libdata_id;
-void gras_trp_register()
-{
-  gras_trp_libdata_id =
-      gras_procdata_add("gras_trp", gras_trp_procdata_new,
-                        gras_trp_procdata_free);
-}
-
-int gras_os_myport(void)
-{
-  return ((gras_trp_procdata_t)
-          gras_libdata_by_id(gras_trp_libdata_id))->myport;
-}
diff --git a/src/gras/Transport/transport_interface.h b/src/gras/Transport/transport_interface.h
deleted file mode 100644 (file)
index c0bb894..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* transport - low level communication (send/receive bunches of bytes)      */
-
-/* module's public interface exported within GRAS, but not to end user.     */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_TRP_INTERFACE_H
-#define GRAS_TRP_INTERFACE_H
-
-#include "portable.h"           /* sometimes needed for fd_set */
-#include "simgrid/simix.h"
-#include "xbt/queue.h"
-
-/* Data of this module specific to each process
- * (used by sg_process.c to cleanup the SG channel cruft)
- */
-typedef struct {
-  /* set headers */
-  unsigned int ID;
-  char *name;
-  unsigned int name_len;
-
-  int myport;                   /* Port on which I listen myself */
-
-  xbt_dynar_t sockets;          /* all sockets known to this process */
-
-  /* SG only elements. In RL, they are part of the OS ;) */
-
-  /* List of sockets ready to be select()ed */
-  xbt_queue_t msg_selectable_sockets;   /* regular sockets  */
-  xbt_queue_t meas_selectable_sockets;  /* measurement ones */
-
-} s_gras_trp_procdata_t, *gras_trp_procdata_t;
-
-/* Display the content of our socket set (debugging purpose) */
-XBT_PUBLIC(void) gras_trp_socketset_dump(const char *name);
-
-XBT_PUBLIC(xbt_socket_t) gras_trp_select(double timeout);
-
-#endif                          /* GRAS_TRP_INTERFACE_H */
diff --git a/src/gras/Transport/transport_plugin_file.c b/src/gras/Transport/transport_plugin_file.c
deleted file mode 100644 (file)
index 0951ef7..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/* File transport - send/receive a bunch of bytes from a file               */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "portable.h"
-#include "gras/Transport/transport_private.h"
-#include "xbt/ex.h"
-#include "xbt/xbt_socket_private.h"
-#include "gras/Msg/msg_interface.h"     /* gras_msg_listener_awake */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_trp_file, gras_trp,
-                                "Pseudo-transport to write to/read from a file");
-
-/***
- *** Prototypes
- ***/
-void gras_trp_file_close(xbt_socket_t sd);
-
-void gras_trp_file_chunk_send_raw(xbt_socket_t sd,
-                                  const char *data,
-                                  unsigned long int size);
-void gras_trp_file_chunk_send(xbt_socket_t sd, const char *data,
-                              unsigned long int size, int stable_ignored);
-
-int gras_trp_file_chunk_recv(xbt_socket_t sd,
-                             char *data, unsigned long int size);
-
-/***
- *** Specific plugin part
- ***/
-
-typedef struct {
-  fd_set incoming_socks;
-} gras_trp_file_plug_data_t;
-
-/***
- *** Specific socket part
- ***/
-
-/***
- *** Info about who's speaking
- ***/
-static int gras_trp_file_my_port(xbt_socket_t s) {
-  THROW_UNIMPLEMENTED;
-}
-static int gras_trp_file_peer_port(xbt_socket_t s) {
-  THROW_UNIMPLEMENTED;
-}
-static const char* gras_trp_file_peer_name(xbt_socket_t s) {
-  THROW_UNIMPLEMENTED;
-}
-static const char* gras_trp_file_peer_proc(xbt_socket_t s) {
-  THROW_UNIMPLEMENTED;
-}
-static void gras_trp_file_peer_proc_set(xbt_socket_t s,char *name) {
-  THROW_UNIMPLEMENTED;
-}
-
-/***
- *** Code
- ***/
-void gras_trp_file_setup(xbt_trp_plugin_t plug)
-{
-
-  gras_trp_file_plug_data_t *file = xbt_new(gras_trp_file_plug_data_t, 1);
-
-  FD_ZERO(&(file->incoming_socks));
-
-  plug->my_port = gras_trp_file_my_port;
-  plug->peer_port = gras_trp_file_peer_port;
-  plug->peer_name = gras_trp_file_peer_name;
-  plug->peer_proc = gras_trp_file_peer_proc;
-  plug->peer_proc_set = gras_trp_file_peer_proc_set;
-
-  plug->socket_close = gras_trp_file_close;
-
-  plug->raw_send = gras_trp_file_chunk_send_raw;
-  plug->send = gras_trp_file_chunk_send;
-
-  plug->raw_recv = plug->recv = gras_trp_file_chunk_recv;
-
-  plug->data = (void *) file;
-}
-
-/**
- * gras_socket_client_from_file:
- *
- * Create a client socket from a file path.
- *
- * This only possible in RL, and is mainly for debugging.
- */
-xbt_socket_t gras_socket_client_from_file(const char *path)
-{
-  xbt_socket_t res;
-
-  xbt_assert(gras_if_RL(), "Cannot use file as socket in the simulator");
-
-  xbt_socket_new_ext(0, &res, xbt_trp_plugin_get_by_name("file"), 0, 0);
-
-  if (strcmp("-", path)) {
-    res->sd =
-        open(path, O_TRUNC | O_WRONLY | O_CREAT | O_BINARY,
-             S_IRUSR | S_IWUSR | S_IRGRP);
-
-    if (res->sd < 0) {
-      THROWF(system_error, 0,
-             "Cannot create a client socket from file %s: %s",
-             path, strerror(errno));
-    }
-  } else {
-    res->sd = 1;                /* stdout */
-  }
-
-  XBT_DEBUG("sock_client_from_file(%s): sd=%d in=%c out=%c accept=%c",
-         path,
-         res->sd,
-         res->incoming ? 'y' : 'n',
-         res->outgoing ? 'y' : 'n', res->accepting ? 'y' : 'n');
-
-  xbt_dynar_push(((gras_trp_procdata_t)
-                  gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
-  return res;
-}
-
-/**
- * gras_socket_server_from_file:
- *
- * Create a server socket from a file path.
- *
- * This only possible in RL, and is mainly for debugging.
- */
-xbt_socket_t gras_socket_server_from_file(const char *path)
-{
-  xbt_socket_t res;
-
-  xbt_assert(gras_if_RL(), "Cannot use file as socket in the simulator");
-
-  xbt_socket_new_ext(1, &res, xbt_trp_plugin_get_by_name("file"), 0, 0);
-
-  if (strcmp("-", path)) {
-    res->sd = open(path, O_RDONLY | O_BINARY);
-
-    if (res->sd < 0) {
-      THROWF(system_error, 0,
-             "Cannot create a server socket from file %s: %s",
-             path, strerror(errno));
-    }
-  } else {
-    res->sd = 0;                /* stdin */
-  }
-
-  XBT_DEBUG("sd=%d in=%c out=%c accept=%c",
-         res->sd,
-         res->incoming ? 'y' : 'n',
-         res->outgoing ? 'y' : 'n', res->accepting ? 'y' : 'n');
-
-  xbt_dynar_push(((gras_trp_procdata_t)
-                  gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
-  gras_msg_listener_awake();
-  return res;
-}
-
-void gras_trp_file_close(xbt_socket_t sock)
-{
-  gras_trp_file_plug_data_t *data;
-
-  if (!sock)
-    return;                     /* close only once */
-  data = sock->plugin->data;
-
-  if (sock->sd == 0) {
-    XBT_DEBUG("Do not close stdin");
-  } else if (sock->sd == 1) {
-    XBT_DEBUG("Do not close stdout");
-  } else {
-    XBT_DEBUG("close file connection %d", sock->sd);
-
-    /* forget about the socket */
-    FD_CLR(sock->sd, &(data->incoming_socks));
-
-    /* close the socket */
-    if (close(sock->sd) < 0) {
-      XBT_WARN("error while closing file %d: %s", sock->sd, strerror(errno));
-    }
-  }
-}
-
-/**
- * gras_trp_file_chunk_send:
- *
- * Send data on a file pseudo-socket
- */
-void
-gras_trp_file_chunk_send(xbt_socket_t sock,
-                         const char *data,
-                         unsigned long int size, int stable_ignored)
-{
-  gras_trp_file_chunk_send_raw(sock, data, size);
-}
-
-void
-gras_trp_file_chunk_send_raw(xbt_socket_t sock,
-                             const char *data, unsigned long int size)
-{
-
-  xbt_assert(sock->outgoing, "Cannot write on client file socket");
-
-  while (size) {
-    int status = 0;
-
-    XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, (long int) size);
-    status = write(sock->sd, data, (long int) size);
-
-    if (status == -1) {
-      THROWF(system_error, 0, "write(%d,%p,%d) failed: %s",
-             sock->sd, data, (int) size, strerror(errno));
-    }
-
-    if (status) {
-      size -= status;
-      data += status;
-    } else {
-      THROWF(system_error, 0, "file descriptor closed");
-    }
-  }
-}
-
-/**
- * gras_trp_file_chunk_recv:
- *
- * Receive data on a file pseudo-socket.
- */
-int
-gras_trp_file_chunk_recv(xbt_socket_t sock,
-                         char *data, unsigned long int size)
-{
-
-  int got = 0;
-
-  xbt_assert(sock, "Cannot recv on an NULL socket");
-  xbt_assert(sock->incoming, "Cannot recv on client file socket");
-
-  if (sock->recvd) {
-    data[0] = sock->recvd_val;
-    sock->recvd = 0;
-    got++;
-    size--;
-  }
-
-  while (size) {
-    int status = 0;
-
-    status = read(sock->sd, data + got, (long int) size);
-    XBT_DEBUG("read(%d, %p, %lu);", sock->sd, data + got, size);
-
-    if (status < 0) {
-      THROWF(system_error, 0, "read(%d,%p,%d) failed: %s",
-             sock->sd, data + got, (int) size, strerror(errno));
-    }
-
-    if (status) {
-      size -= status;
-      got += status;
-    } else {
-      THROWF(system_error, errno, "file descriptor closed after %d bytes",
-             got);
-    }
-  }
-  return got;
-}
diff --git a/src/gras/Transport/transport_plugin_sg.c b/src/gras/Transport/transport_plugin_sg.c
deleted file mode 100644 (file)
index 6dbffd0..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-/* file trp (transport) - send/receive a bunch of bytes in SG realm         */
-
-/* Note that this is only used to debug other parts of GRAS since message   */
-/*  exchange in SG realm is implemented directly without mimicing real life */
-/*  This would be terribly unefficient.                                     */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-
-#include "simgrid/simix.h"
-#include "gras/Msg/msg_private.h"
-#include "gras/Transport/transport_private.h"
-#include "gras/Virtu/virtu_sg.h"
-#include "xbt/xbt_socket_private.h" /* FIXME */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_trp_sg, gras_trp,
-                                "SimGrid pseudo-transport");
-
-/***
- *** Prototypes 
- ***/
-
-/* retrieve the port record associated to a numerical port on an host */
-static gras_sg_portrec_t find_port(gras_hostdata_t * hd, int port);
-
-void gras_trp_sg_socket_client(xbt_trp_plugin_t self,
-                               const char*host,
-                               int port,
-                               /* OUT */ xbt_socket_t sock);
-void gras_trp_sg_socket_server(xbt_trp_plugin_t self,
-                               int port,
-                               /* OUT */ xbt_socket_t sock);
-void gras_trp_sg_socket_close(xbt_socket_t sd);
-
-void gras_trp_sg_chunk_send_raw(xbt_socket_t sd,
-                                const char *data, unsigned long int size);
-void gras_trp_sg_chunk_send(xbt_socket_t sd,
-                            const char *data,
-                            unsigned long int size, int stable_ignored);
-
-int gras_trp_sg_chunk_recv(xbt_socket_t sd,
-                           char *data, unsigned long int size);
-
-/***
- *** Specific plugin part
- ***/
-typedef struct {
-  int placeholder;              /* nothing plugin specific so far */
-} gras_trp_sg_plug_data_t;
-
-
-/***
- *** Code
- ***/
-static gras_sg_portrec_t find_port(gras_hostdata_t * hd, int port)
-{
-  unsigned int cpt;
-  gras_sg_portrec_t pr;
-
-  xbt_assert(hd, "Please run gras_process_init on each process");
-
-  xbt_dynar_foreach(hd->ports, cpt, pr) {
-    if (pr->port == port)
-      return pr;
-  }
-  return NULL;
-}
-
-/***
- *** Info about who's speaking
- ***/
-static int gras_trp_sg_my_port(xbt_socket_t s)
-{
-  gras_trp_sg_sock_data_t sockdata = xbt_socket_get_data(s);
-  if (gras_socket_im_the_server(s))
-    return sockdata->server_port;
-  else
-    return sockdata->client_port;
-}
-static int gras_trp_sg_peer_port(xbt_socket_t s)
-{
-  gras_trp_sg_sock_data_t sockdata = xbt_socket_get_data(s);
-  if (gras_socket_im_the_server(s))
-    return sockdata->client_port;
-  else
-    return sockdata->server_port;
-}
-
-static const char* gras_trp_sg_peer_name(xbt_socket_t s)
-{
-  gras_trp_sg_sock_data_t sockdata = xbt_socket_get_data(s);
-  if (gras_socket_im_the_server(s))
-    return SIMIX_host_get_name(simcall_process_get_host(sockdata->client));
-  else {
-    return SIMIX_host_get_name(simcall_process_get_host(sockdata->server));
-  }
-}
-static const char* gras_trp_sg_peer_proc(xbt_socket_t s) {
-  THROW_UNIMPLEMENTED;
-}
-static void gras_trp_sg_peer_proc_set(xbt_socket_t s,char *name) {
-  THROW_UNIMPLEMENTED;
-}
-
-void gras_trp_sg_setup(xbt_trp_plugin_t plug)
-{
-  plug->my_port = gras_trp_sg_my_port;
-  plug->peer_port = gras_trp_sg_peer_port;
-  plug->peer_name = gras_trp_sg_peer_name;
-  plug->peer_proc = gras_trp_sg_peer_proc;
-  plug->peer_proc_set = gras_trp_sg_peer_proc_set;
-
-  gras_trp_sg_plug_data_t *data = xbt_new(gras_trp_sg_plug_data_t, 1);
-
-  plug->data = data;
-
-  plug->socket_client = gras_trp_sg_socket_client;
-  plug->socket_server = gras_trp_sg_socket_server;
-  plug->socket_close = gras_trp_sg_socket_close;
-
-  plug->raw_send = gras_trp_sg_chunk_send_raw;
-  plug->send = gras_trp_sg_chunk_send;
-  plug->raw_recv = plug->recv = gras_trp_sg_chunk_recv;
-
-  plug->flush = NULL;           /* nothing cached */
-}
-
-void gras_trp_sg_socket_client(xbt_trp_plugin_t self,
-                               const char*host,
-                               int port,
-                               /* OUT */ xbt_socket_t sock)
-{
-
-  smx_host_t peer;
-  gras_hostdata_t *hd;
-  gras_trp_sg_sock_data_t data;
-  gras_sg_portrec_t pr;
-
-  /* make sure this socket will reach someone */
-  if (!(peer = simcall_host_get_by_name(host)))
-    THROWF(mismatch_error, 0,
-           "Can't connect to %s: no such host.\n", host);
-
-  if (!(hd = (gras_hostdata_t *) simcall_host_get_data(peer)))
-    THROWF(mismatch_error, 0,
-           "can't connect to %s: no process on this host",
-           host);
-
-  pr = find_port(hd, port);
-
-  if (pr == NULL) {
-    THROWF(mismatch_error, 0,
-           "can't connect to %s:%d, no process listen on this port",
-           host, port);
-  }
-
-  /* Ensure that the listener is expecting the kind of stuff we want to send */
-  if (pr->meas && !sock->meas) {
-    THROWF(mismatch_error, 0,
-           "can't connect to %s:%d in regular mode, the process listen "
-           "in measurement mode on this port", host,
-           port);
-  }
-  if (!pr->meas && sock->meas) {
-    THROWF(mismatch_error, 0,
-           "can't connect to %s:%d in measurement mode, the process listen "
-           "in regular mode on this port", host,
-           port);
-  }
-
-  /* create simulation data of the socket */
-  data = xbt_new0(s_gras_trp_sg_sock_data_t, 1);
-  data->client = SIMIX_process_self();
-  data->server = pr->server;
-  data->server_port = port;
-  data->client_port = gras_os_myport();
-
-  /* initialize synchronization stuff on the socket */
-  data->rdv_server = pr->rdv;
-  data->rdv_client = simcall_rdv_create(NULL);
-  data->comm_recv = simcall_comm_irecv(data->rdv_client, &data->msg, NULL, NULL, NULL);
-
-  /* connect that simulation data to the socket */
-  sock->data = data;
-  sock->incoming = 1;
-
-  XBT_DEBUG("%s (PID %d) connects in %s mode to %s:%d (rdv_ser:%p, rdv_cli:%p, comm:%p)",
-         simcall_process_get_name(SIMIX_process_self()), gras_os_getpid(),
-         sock->meas ? "meas" : "regular", host, port,
-         data->rdv_server,data->rdv_client,data->comm_recv);
-}
-
-void gras_trp_sg_socket_server(xbt_trp_plugin_t self, int port, xbt_socket_t sock)
-{
-
-  gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_self_get_data();
-  gras_sg_portrec_t pr;
-  gras_trp_sg_sock_data_t data;
-
-  xbt_assert(hd, "Please run gras_process_init on each process");
-
-  sock->accepting = 1;
-
-  /* Check whether a server is already listening on that port or not */
-  pr = find_port(hd, port);
-
-  if (pr)
-    THROWF(mismatch_error, 0,
-           "can't listen on address %s:%d: port already in use.",
-           SIMIX_host_self_get_name(), port);
-
-  /* This port is free, let's take it */
-  pr = xbt_new(s_gras_sg_portrec_t, 1);
-  pr->port = port;
-  pr->meas = sock->meas;
-  pr->server = SIMIX_process_self();
-  xbt_dynar_push(hd->ports, &pr);
-  pr->rdv = simcall_rdv_create(NULL);
-
-  /* Create the socket */
-  data = xbt_new0(s_gras_trp_sg_sock_data_t, 1);
-  data->server = SIMIX_process_self();
-  data->server_port = port;
-  data->client = NULL;
-  data->rdv_server = pr->rdv;
-  data->rdv_client = NULL;
-  data->comm_recv = simcall_comm_irecv(pr->rdv, &data->msg, NULL, NULL, NULL);
-
-  sock->data = data;
-
-  XBT_VERB
-      ("'%s' (%d) ears on %s:%d%s (%p; data:%p); Here rdv: %p; Remote rdv: %p; Comm %p",
-       simcall_process_get_name(SIMIX_process_self()), gras_os_getpid(),
-       SIMIX_host_self_get_name(), port,
-       sock->meas ? " (mode meas)" : "", sock, data,
-       (data->server ==
-        SIMIX_process_self())? data->rdv_server : data->rdv_client,
-       (data->server ==
-        SIMIX_process_self())? data->rdv_client : data->rdv_server,
-       data->comm_recv);
-
-}
-
-void gras_trp_sg_socket_close(xbt_socket_t sock)
-{
-  gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_self_get_data();
-  unsigned int cpt;
-  gras_sg_portrec_t pr;
-
-  XBT_IN(" (sock=%p)", sock);
-
-  if (!sock)
-    return;
-
-  xbt_assert(hd, "Please run gras_process_init on each process");
-
-  gras_trp_sg_sock_data_t sockdata = sock->data;
-
-  if (sock->incoming && !sock->outgoing && sockdata->server_port >= 0) {
-    /* server mode socket. Unregister it from 'OS' tables */
-    xbt_dynar_foreach(hd->ports, cpt, pr) {
-      XBT_DEBUG("Check pr %u of %lu", cpt, xbt_dynar_length(hd->ports));
-      if (pr->port == sockdata->server_port) {
-        xbt_dynar_cursor_rm(hd->ports, &cpt);
-        XBT_OUT();
-        return;
-      }
-    }
-    XBT_WARN
-        ("socket_close called on the unknown incoming socket %p (port=%d)",
-         sock, sockdata->server_port);
-  }
-  /* FIXME: kill the rdv point if receiver side */
-  free(sock->data);
-  XBT_OUT();
-}
-
-typedef struct {
-  int size;
-  void *data;
-} sg_task_data_t;
-
-void gras_trp_sg_chunk_send(xbt_socket_t sock,
-                            const char *data,
-                            unsigned long int size, int stable_ignored)
-{
-  gras_trp_sg_chunk_send_raw(sock, data, size);
-}
-
-void gras_trp_sg_chunk_send_raw(xbt_socket_t sock,
-                                const char *data, unsigned long int size)
-{
-#ifdef KILLME
-  char name[256];
-  static unsigned int count = 0;
-
-  smx_action_t act;             /* simix action */
-  gras_trp_procdata_t trp_remote_proc;
-  gras_msg_procdata_t msg_remote_proc;
-  gras_msg_t msg;               /* message to send */
-
-  //gras_trp_sg_sock_data_t sock_data = (gras_trp_sg_sock_data_t) sock->data;
-  xbt_assert(sock->meas,
-              "SG chunk exchange shouldn't be used on non-measurement sockets");
-
-
-  /* creates simix action and waits its ends, waits in the sender host
-     condition */
-  /*
-  if (XBT_LOG_ISENABLED(gras_trp_sg, xbt_log_priority_debug)) {
-    smx_process_t remote_dude =
-        (sock_data->server ==
-         SIMIX_process_self())? (sock_data->client) : (sock_data->server);
-    smx_host_t remote_host = simcall_process_get_host(remote_dude);
-  }
-  */
-  //SIMIX_network_send(sock_data->rdv,size,1,-1,NULL,0,NULL,NULL);
-#endif
-  THROW_UNIMPLEMENTED;
-}
-
-int gras_trp_sg_chunk_recv(xbt_socket_t sock,
-                           char *data, unsigned long int size)
-{
-  //gras_trp_sg_sock_data_t *sock_data =
-  //    (gras_trp_sg_sock_data_t *) sock->data;
-
-  //simcall_comm_recv(sock_data->rdv,-1,NULL,0,NULL);
-  THROW_UNIMPLEMENTED;
-#ifdef KILLME
-  gras_trp_sg_sock_data_t *remote_sock_data;
-  xbt_socket_t remote_socket = NULL;
-  gras_msg_t msg_got;
-  gras_msg_procdata_t msg_procdata =
-      (gras_msg_procdata_t) gras_libdata_by_name("gras_msg");
-  gras_trp_procdata_t trp_proc =
-      (gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id);
-
-  xbt_assert(sock->meas,
-              "SG chunk exchange shouldn't be used on non-measurement sockets");
-  xbt_queue_shift_timed(trp_proc->meas_selectable_sockets,
-                        &remote_socket, 60);
-
-  if (remote_socket == NULL) {
-    THROWF(timeout_error, 0, "Timeout");
-  }
-
-  remote_sock_data = (gras_trp_sg_sock_data_t *) remote_socket->data;
-  msg_got = xbt_fifo_shift(msg_procdata->msg_to_receive_queue_meas);
-
-  sock_data = (gras_trp_sg_sock_data_t *) sock->data;
-
-  /* ok, I'm here, you can continue the communication */
-  simcall_cond_signal(remote_sock_data->cond);
-
-  simcall_mutex_lock(remote_sock_data->mutex);
-  /* wait for communication end */
-  simcall_cond_wait(remote_sock_data->cond, remote_sock_data->mutex);
-
-  if (msg_got->payl_size != size)
-    THROWF(mismatch_error, 0,
-           "Got %d bytes when %ld where expected (in %s->%s:%d)",
-           msg_got->payl_size, size,
-           simcall_host_get_name(sock_data->to_host),
-           SIMIX_host_self_get_name(), sock->peer_port);
-
-  if (data)
-    memcpy(data, msg_got->payl, size);
-
-  xbt_free(msg_got->payl);
-
-  xbt_free(msg_got);
-  simcall_mutex_unlock(remote_sock_data->mutex);
-#endif
-  return 0;
-}
diff --git a/src/gras/Transport/transport_private.h b/src/gras/Transport/transport_private.h
deleted file mode 100644 (file)
index 9f67861..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* transport - low level communication (send/receive bunches of bytes)      */
-
-/* module's private interface masked even to other parts of GRAS.           */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_TRP_PRIVATE_H
-#define GRAS_TRP_PRIVATE_H
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/dynar.h"
-#include "xbt/dict.h"
-
-#include "gras/emul.h"          /* gras_if_RL() */
-
-#include "gras_modinter.h"      /* module init/exit */
-#include "gras/transport.h"     /* rest of module interface */
-
-#include "gras/Transport/transport_interface.h" /* semi-public API */
-#include "gras/Virtu/virtu_interface.h" /* libdata management */
-
-extern int gras_trp_libdata_id; /* our libdata identifier */
-
-/* The function that select returned the last time we asked. We need this
-   because the TCP read are greedy and try to get as much data in their 
-   buffer as possible (to avoid subsequent syscalls).
-   (measurement sockets are not buffered and thus not concerned).
-  
-   So, we can get more than one message in one shoot. And when this happens,
-   we have to handle the same socket again afterward without select()ing at
-   all. 
-   Then, this data is not a static of the TCP driver because we want to
-   zero it when it gets closed by the user. If not, we use an already freed 
-   pointer, which is bad.
-   It gets tricky since gras_socket_close is part of the common API, not 
-   only the RL one. */
-extern xbt_socket_t _gras_lastly_selected_socket;
-
-#endif                          /* GRAS_TRP_PRIVATE_H */
diff --git a/src/gras/Virtu/gras_module.c b/src/gras/Virtu/gras_module.c
deleted file mode 100644 (file)
index cd48084..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/* module - module handling, along with module dependencies and local state */
-
-/* Copyright (c) 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt.h"
-#include "gras/module.h"
-#include "virtu_private.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_modules, gras,
-                                "Module and moddata handling");
-
-/* IMPLEMENTATION NOTE
-
-The goal of this module is quite difficult. We want to have several modules,
-each of them having globals which have to be initialized in any unix
-process. Let's call them world-wide globals. An example may be the messages
-dictionnary, which is world-wide to detect definition discrepencies when
-running in SG.
-
-And then, the module may want to have some globals specific to a gras process,
-just like userdata stuff allows to have per-process globals. Let's call them
-process-wide globals. An example may be the list of attached callbacks.
-
-That is why we have 4 functions per module: the join function is called by any
-process, and is in charge of creating the process-wide globals. If it is the
-first time a process uses the module, it also calls the init function, in
-charge of initializing the world-wide globals. We have the symmetric functions
-leave, called by any process not using the module anymore, and exit, in charge
-of freeing the world-wide globals when no process use it anymore.
-
-One can see this as a factory of factories. the init function is a factory
-creating the module, which contains a factory (the join function) able to
-create process-wide globals. The fact that indeed the calling sequence goes
-from join to init and not the other side is just an implementation bias ;)
-
-Then again, we want these functionalities to be quick. We want to access
-the process-wide globals by providing their rank in a dynar, we don't want to
-search them in a dictionary. This is especially true in the module
-implementation, where each functions is likely to require them to work. The
-position could be a stored in a global variable only visible from the module
-implementation.
-
-The need for an array in which to store the globals does not hold for
-world-wide globals: only one instance of them can exist in the same unix naming
-space. Thus, there is no need to put them in an array, we can actually declare
-them as regular C globals.
-
-The next trick comes from the fact that the user may (and will) mess up and not
-get all modules initialized in the same order in every process. So, the rank of
-module data cannot be the order in which a process called the join
-function. This has to be a world-wide global instead.
-
-And finally, if we want to get the ability to destroy modules (one day, they
-will load their code in as plugin), we want to give the module handling library
-(ie, this file) to modify the variable containing the rank of module in the
-tables. This is why we have the ID field in the module structure: it points
-exactly to the implementation side global.
-
-Yeah, I know. All this is not that clear. But at least, writing this helped me
-to design that crap ;)
-
-*/
-
-typedef struct s_gras_module {
-  XBT_SET_HEADERS;
-
-  unsigned int datasize;
-  int refcount;                 /* Number of processes using this module */
-  /* FIXME: we should keep a count of references within a given process to
-     allow modules initializing other modules while tracking dependencies
-     properly and leave() only when needed. This would allow dynamic module
-     loading/unloading */
-
-  int *p_id;                    /* where the module stores the libdata ID (a global somewhere), to tweak it on need */
-  void_f_void_t init_f;         /* First time the module is referenced. */
-  void_f_void_t exit_f;         /* When last process referencing it stops doing so. */
-  void_f_pvoid_t join_f;        /* Called by each process in initialization phase (init_f called once for all processes) */
-  void_f_pvoid_t leave_f;       /* Called by each process in finalization phase. Should free moddata passed */
-} s_gras_module_t, *gras_module_t;
-
-static xbt_set_t _gras_modules = NULL;  /* content: s_gras_module_t */
-
-static void gras_module_freep(void *p)
-{
-  free(((gras_module_t) p)->name);
-  free(p);
-}
-
-
-/**
- * @brief Declaring a new GRAS module
- * @param name: name of the module, of course (beware of dupplicates!)
- * @param datasize: the size of your data, ie of the state this module has on each process
- * @param ID: address of a global you use as parameter to gras_module_data_by_id
- * @param init_f: function called the first time a module gets by a process of the naming space.
- *                A classical use is to declare some messages the module uses, as well as the initialization
- *                of module constants (accross processes boundaries in SG).
- * @param exit_f: function called when the last process of this naming space unref this module.
- * @param join_f: function called each time a process references the module.
- *                It is passed the moddata already malloced, and should initialize the fields as it wants.
- *                It can also attach some callbacks to the module messages.
- * @param leave_f: function called each time a process unrefs the module.
- *                 It is passed the moddata, and should free any memory allocated by init_f.
- *                 It should alse disconnect any attached callbacks.
- */
-
-void gras_module_add(const char *name, unsigned int datasize, int *ID,
-                     void_f_void_t init_f, void_f_void_t exit_f,
-                     void_f_pvoid_t join_f, void_f_pvoid_t leave_f)
-{
-  gras_module_t mod = NULL;
-  xbt_ex_t e;
-  volatile int found = 0;
-
-  if (!_gras_modules)
-    _gras_modules = xbt_set_new();
-
-  TRY {
-    mod = (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
-    found = 1;
-  }
-  CATCH(e) {
-    if (e.category != not_found_error)
-      RETHROW;
-    xbt_ex_free(e);
-  }
-
-  if (found) {
-    xbt_assert(mod->init_f == init_f,
-                "Module %s reregistered with a different init_f!", name);
-    xbt_assert(mod->exit_f == exit_f,
-                "Module %s reregistered with a different exit_f!", name);
-    xbt_assert(mod->join_f == join_f,
-                "Module %s reregistered with a different join_f!", name);
-    xbt_assert(mod->leave_f == leave_f,
-                "Module %s reregistered with a different leave_f!", name);
-    xbt_assert(mod->datasize == datasize,
-                "Module %s reregistered with a different datasize!", name);
-    xbt_assert(mod->p_id == ID,
-                "Module %s reregistered with a different p_id field!",
-                name);
-
-    XBT_DEBUG("Module %s already registered. Ignoring re-registration", name);
-    return;
-  }
-
-  XBT_VERB("Register module %s", name);
-  mod = xbt_new(s_gras_module_t, 1);
-  mod->name = xbt_strdup(name);
-  mod->name_len = strlen(name);
-
-  mod->datasize = datasize;
-  mod->p_id = ID;
-  mod->init_f = init_f;
-  mod->exit_f = exit_f;
-  mod->join_f = join_f;
-  mod->leave_f = leave_f;
-  mod->refcount = 0;
-
-  *mod->p_id = xbt_set_length(_gras_modules);
-
-  xbt_set_add(_gras_modules, (void *) mod, gras_module_freep);
-}
-
-/* shutdown the module mechanism (world-wide cleanups) */
-void gras_moddata_exit(void)
-{
-  xbt_set_free(&_gras_modules);
-}
-
-/* frees the moddata on this host (process-wide cleanups) */
-void gras_moddata_leave(void)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-
-  xbt_dynar_free(&pd->moddata);
-}
-
-/* Removes & frees a given moddata from the current host */
-static void moddata_freep(void *p)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  int id = xbt_dynar_search(pd->moddata, p);
-  gras_module_t mod = (gras_module_t) xbt_set_get_by_id(_gras_modules, id);
-
-  mod->leave_f(gras_moddata_by_id(id));
-}
-
-void gras_module_join(const char *name)
-{
-  gras_procdata_t *pd;
-  void *moddata;
-  gras_module_t mod =
-      (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
-
-  XBT_VERB("Join to module %s (%p)", name, mod);
-
-  /* NEW */
-  if (mod->refcount == 0) {
-    XBT_VERB("Init module %s", name);
-    mod->name = xbt_strdup(name);
-
-    mod->init_f();
-  } else {
-    XBT_DEBUG("Module %s already inited. Refcount=%d ID=%d",
-           mod->name, mod->refcount, *(mod->p_id));
-  }
-  mod->refcount++;
-
-  /* JOIN */
-  pd = gras_procdata_get();
-
-  if (!pd->moddata)             /* Damn. I must be the first module on this process. Scary ;) */
-    pd->moddata = xbt_dynar_new(sizeof(gras_module_t), &moddata_freep);
-
-  moddata = xbt_malloc(mod->datasize);
-
-  xbt_dynar_set(pd->moddata, *(mod->p_id), &moddata);
-
-  mod->join_f(moddata);
-
-  XBT_DEBUG("Module %s joined successfully (ID=%d)", name, *(mod->p_id));
-}
-
-void gras_module_leave(const char *name)
-{
-  void *moddata;
-  gras_module_t mod =
-      (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
-
-  XBT_VERB("Leave module %s", name);
-
-  /* LEAVE */
-  moddata = gras_moddata_by_id(*(mod->p_id));
-  mod->leave_f(moddata);
-
-  /* EXIT */
-  mod->refcount--;
-  if (!mod->refcount) {
-    XBT_VERB("Exit module %s", name);
-
-    mod->exit_f();
-
-    /* Don't remove the module for real, sets don't allow to
-
-       free(mod->name);
-       free(mod);
-     */
-  }
-}
-
-
-void *gras_moddata_by_id(unsigned int ID)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  void *p;
-
-  xbt_dynar_get_cpy(pd->moddata, ID, &p);
-  return p;
-}
diff --git a/src/gras/Virtu/process.c b/src/gras/Virtu/process.c
deleted file mode 100644 (file)
index b2d442c..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/* process - GRAS process handling (common code for RL and SG)              */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "gras/transport.h"
-#include "xbt/datadesc.h"
-#include "gras/messages.h"
-#include "gras_modinter.h"
-
-#include "gras/Virtu/virtu_private.h"
-
-XBT_LOG_NEW_SUBCATEGORY(gras_virtu, gras, "Virtualization code");
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_virtu_process, gras_virtu,
-                                "Process manipulation code");
-
-/* Functions to handle gras_procdata_t->libdata cells*/
-typedef struct {
-  char *name;
-  pvoid_f_void_t constructor;
-  void_f_pvoid_t destructor;
-} s_gras_procdata_fabric_t, *gras_procdata_fabric_t;
-
-static xbt_dynar_t _gras_procdata_fabrics = NULL;       /* content: s_gras_procdata_fabric_t */
-
-static void gras_procdata_fabric_free(void *fab)
-{
-  free(((gras_procdata_fabric_t) fab)->name);
-}
-
-/** @brief declare the functions in charge of creating/destructing the procdata of a module
- *  
- *  This is intended to be called from the gras_<module>_register function.
- *  This returns the module ID you can use for gras_libdata_by_id()
- */
-int gras_procdata_add(const char *name, pvoid_f_void_t constructor,
-                      void_f_pvoid_t destructor)
-{
-
-  gras_procdata_fabric_t fab;
-
-  if (!_gras_procdata_fabrics) {
-    /* create the dynar if needed */
-    _gras_procdata_fabrics =
-        xbt_dynar_new(sizeof(s_gras_procdata_fabric_t),
-                      gras_procdata_fabric_free);
-  }
-
-  fab = xbt_dynar_push_ptr(_gras_procdata_fabrics);
-
-  fab->name = xbt_strdup(name);
-  fab->constructor = constructor;
-  fab->destructor = destructor;
-
-  return xbt_dynar_length(_gras_procdata_fabrics) - 1;
-}
-
-/* **************************************************************************
- * Process data
- * **************************************************************************/
-void *gras_userdata_get(void)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  return pd->userdata;
-}
-
-void *gras_userdata_set(void *ud)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-
-  pd->userdata = ud;
-  return ud;
-}
-
-void *gras_libdata_by_name(const char *name)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  return gras_libdata_by_name_from_procdata(name, pd);
-}
-
-/* this function is splitted from previous to allow SG to get libdata from remote hosts */
-void *gras_libdata_by_name_from_procdata(const char *name,
-                                         gras_procdata_t * pd)
-{
-  void *res = NULL;
-  if (xbt_set_length(pd->libdata) <
-      xbt_dynar_length(_gras_procdata_fabrics)) {
-    /* Damn, some new modules were added since procdata_init(). Amok? */
-    /* Get 'em all */
-    gras_procdata_init();
-  }
-  TRY {
-    res = xbt_set_get_by_name(pd->libdata, name);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Cannot retrieve the libdata associated to %s: %s", name);
-  }
-  return res;
-}
-
-void *gras_libdata_by_id(int id)
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  if (xbt_set_length(pd->libdata) <
-      xbt_dynar_length(_gras_procdata_fabrics)) {
-    /* Damn, some new modules were added since procdata_init(). Amok? */
-    /* Get 'em all */
-    gras_procdata_init();
-  }
-  return xbt_set_get_by_id(pd->libdata, id);
-}
-
-
-void gras_procdata_init()
-{
-  gras_procdata_t *pd = gras_procdata_get();
-  s_gras_procdata_fabric_t fab;
-
-  unsigned int cursor;
-
-  xbt_set_elm_t elem;
-
-  if (!pd->libdata) {
-    pd->userdata = NULL;
-    pd->libdata = xbt_set_new();
-  }
-
-  xbt_dynar_foreach(_gras_procdata_fabrics, cursor, fab) {
-
-    if (cursor + 1 <= xbt_set_length(pd->libdata)) {
-      XBT_DEBUG("Skip fabric %u: there is already %lu libdata",
-             cursor, xbt_set_length(pd->libdata));
-      continue;                 /* allow to recall this function to get recently added fabrics */
-    }
-    XBT_DEBUG("Go ahead for cursor %u, there is %lu libdata",
-           cursor, xbt_set_length(pd->libdata));
-
-    xbt_assert(fab.name, "Name of fabric #%u is NULL!", cursor);
-    XBT_DEBUG("Create the procdata for %s", fab.name);
-    /* Check for our own errors */
-
-    if (xbt_set_get_by_name_or_null(pd->libdata, fab.name) != NULL)
-      THROWF(unknown_error, 0,
-             "MayDay: two modules use '%s' as libdata name", fab.name);
-
-    /* Add the data in place, after some more sanity checking */
-    elem = fab.constructor();
-    if (elem->name_len && elem->name_len != strlen(elem->name)) {
-      elem->name_len = strlen(elem->name);
-      XBT_WARN
-          ("Module '%s' constructor is borken: it does not set elem->name_len",
-           fab.name);
-    }
-    xbt_set_add(pd->libdata, elem, fab.destructor);
-  }
-}
-
-void gras_procdata_exit()
-{
-  int len;
-  gras_procdata_t *pd = gras_procdata_get();
-
-  xbt_set_free(&(pd->libdata));
-
-  /* Remove procdata in reverse order wrt creation */
-  while ((len = xbt_dynar_length(_gras_procdata_fabrics))) {
-    xbt_dynar_remove_at(_gras_procdata_fabrics, len - 1, NULL);
-  }
-  xbt_dynar_free(&_gras_procdata_fabrics);
-}
-
-
-const char *gras_os_hostport()
-{
-  static char *res = NULL;
-  free(res);                  /* my port may have changed */
-  res = bprintf("%s:%d", gras_os_myname(), gras_os_myport());
-  return (const char *) res;
-}
diff --git a/src/gras/Virtu/rl_dns.c b/src/gras/Virtu/rl_dns.c
deleted file mode 100644 (file)
index 8e7f9e9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* rl_dns - name resolution (real life)                                     */
-
-/* Copyright (c) 2005, 2009, 2010. 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. */
-
-#include "gras/Virtu/virtu_rl.h"
-#include "portable.h"
-
-/* A portable DNS resolver is a nightmare to do in a portable manner.
-   keep it simple/stupid for now. */
-
-const char *gras_os_myname(void)
-{
-  static char myname[255];
-  static int initialized = 0;
-
-  if (initialized)
-    return myname;
-
-  if (gethostname(myname, 255) == -1) {
-#ifdef HAVE_SYS_SOCKET_H
-    /* gethostname() failed! Trying with localhost instead. 
-       We first need to query the DNS to make sure localhost is resolved 
-       See the note in nws/Portability/dnsutil.c about {end,set}hostent() */
-    struct hostent *tmp;
-    sethostent(0);
-    tmp = gethostbyname("localhost");
-    endhostent();
-
-    if (tmp) {
-      strncpy(myname, tmp->h_name, 255);
-    } else {
-      /* Erm. localhost cannot be resolved. There's something wrong in the user DNS setting */
-      sprintf(myname, "(misconfigured host)");
-    }
-#else
-    sprintf(myname, "(misconfigured windows host)");
-#endif
-  }
-
-  myname[254] = '\0';
-
-  initialized = 1;
-  return myname;
-}
diff --git a/src/gras/Virtu/rl_emul.c b/src/gras/Virtu/rl_emul.c
deleted file mode 100644 (file)
index 5ed5a65..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* rl_emul - Emulation support (real life)                                  */
-
-/* Copyright (c) 2005, 2006, 2009, 2010. 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. */
-
-#include "gras/emul.h"
-#include "gras/Virtu/virtu_rl.h"
-#include "gras_modinter.h"
-
-XBT_LOG_NEW_SUBCATEGORY(gras_virtu_emul, gras_virtu, "Emulation support");
-
-/*** CPU burning */
-void gras_cpu_burn(double flops)
-{
-  while (flops > 0) {
-    flops -= 2;
-  }
-}
-
-
-/*** Timing macros: nothing to do in RL. Actually do the job and shutup ***/
-
-void gras_emul_init(void)
-{
-}
-
-void gras_emul_exit(void)
-{
-}
-
-int gras_bench_always_begin(const char *location, int line)
-{
-  return 0;
-}
-
-int gras_bench_always_end(void)
-{
-  return 0;
-}
-
-int gras_bench_once_begin(const char *location, int line)
-{
-  return 1;
-}
-
-int gras_bench_once_end(void)
-{
-  return 0;
-}
-
-/*** Conditional execution support ***/
-
-int gras_if_RL(void)
-{
-  return 1;
-}
-
-int gras_if_SG(void)
-{
-  return 0;
-}
diff --git a/src/gras/Virtu/rl_process.c b/src/gras/Virtu/rl_process.c
deleted file mode 100644 (file)
index cc364ce..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/* process_rl - GRAS process handling on real life                          */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "gras_modinter.h"      /* module initialization interface */
-#include "gras/Virtu/virtu_rl.h"
-#include "portable.h"
-#include "xbt/xbt_os_thread.h"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_virtu_process);
-
-/* globals */
-static gras_procdata_t *_gras_procdata = NULL;
-XBT_EXPORT_NO_IMPORT(char const *) _gras_procname = NULL;
-static xbt_dict_t _process_properties = NULL;
-static xbt_dict_t _host_properties = NULL;
-
-# ifdef __APPLE__
-        /* under darwin, the environment gets added to the process at startup time. So, it's not defined at library link time, forcing us to extra tricks */
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-# else
-#ifdef _XBT_WIN32
-                 /* the environment, as specified by the opengroup, used to initialize the process properties */
-extern char **wenviron;
-#else
-extern char **environ;
-#endif
-# endif
-
-void gras_process_init()
-{
-  char **env_iter;
-  _gras_procdata = xbt_new0(gras_procdata_t, 1);
-  gras_procdata_init();
-
-  /* initialize the host & process properties */
-  _host_properties = xbt_dict_new_homogeneous(xbt_free_f);
-  _process_properties = xbt_dict_new_homogeneous(xbt_free_f);
-  env_iter = environ;
-  while (*env_iter) {
-    char *equal, *buf = xbt_strdup(*env_iter);
-    equal = strchr(buf, '=');
-    if (!equal) {
-      XBT_WARN
-          ("The environment contains an entry without '=' char: %s (ignore it)",
-           *env_iter);
-      continue;
-    }
-    *equal = '\0';
-    xbt_dict_set(_process_properties, buf, xbt_strdup(equal + 1), NULL);
-    free(buf);
-    env_iter++;
-  }
-}
-
-void gras_process_exit()
-{
-  gras_procdata_exit();
-  free(_gras_procdata);
-  xbt_dict_free(&_process_properties);
-  xbt_dict_free(&_host_properties);
-}
-
-const char *xbt_procname(void)
-{
-  if (_gras_procname)
-    return _gras_procname;
-  else
-    return "";
-}
-
-int gras_os_getpid(void)
-{
-#ifdef _XBT_WIN32
-  return (long int) GetCurrentProcessId();
-#else
-  return (long int) getpid();
-#endif
-}
-
-/* **************************************************************************
- * Process data
- * **************************************************************************/
-
-gras_procdata_t *gras_procdata_get(void)
-{
-  xbt_assert(_gras_procdata, "Run gras_process_init (ie, gras_init)!");
-
-  return _gras_procdata;
-}
-
-typedef struct {
-  xbt_main_func_t code;
-  int argc;
-  char **argv;
-} spawner_wrapper_args;
-
-static void *spawner_wrapper(void *data) {
-  spawner_wrapper_args *a = data;
-  a->code(a->argc, a->argv);
-  free(a);
-  return NULL;
-}
-
-void gras_agent_spawn(const char *name,
-                      xbt_main_func_t code, int argc, char *argv[],
-                      xbt_dict_t properties)
-{
-  spawner_wrapper_args *args =malloc(sizeof(spawner_wrapper_args));
-  args->argc=argc;
-  args->argv=argv;
-  args->code=code;
-  xbt_os_thread_create(name,spawner_wrapper,args, NULL);
-}
-
-/* **************************************************************************
- * Properties
- * **************************************************************************/
-
-const char *gras_process_property_value(const char *name)
-{
-  return xbt_dict_get_or_null(_process_properties, name);
-}
-
-xbt_dict_t gras_process_properties(void)
-{
-  return _process_properties;
-}
-
-const char *gras_os_host_property_value(const char *name)
-{
-  return xbt_dict_get_or_null(_host_properties, name);
-}
-
-xbt_dict_t gras_os_host_properties(void)
-{
-  return _host_properties;
-}
diff --git a/src/gras/Virtu/sg_dns.c b/src/gras/Virtu/sg_dns.c
deleted file mode 100644 (file)
index cf15311..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* sg_dns - name resolution (simulator)                                     */
-
-/* Copyright (c) 2005, 2007, 2009, 2010. 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. */
-
-
-#include "gras/Virtu/virtu_sg.h"
-
-const char *gras_os_myname(void)
-{
-  return SIMIX_host_self_get_name();
-}
diff --git a/src/gras/Virtu/sg_emul.c b/src/gras/Virtu/sg_emul.c
deleted file mode 100644 (file)
index 1fce177..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/* sg_emul - Emulation support (simulation)                                 */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include <stdio.h>              /* sprintf */
-#include "gras/emul.h"
-#include "gras/Virtu/virtu_sg.h"
-#include "gras_modinter.h"
-
-#include "xbt/xbt_os_time.h"    /* timers */
-#include "xbt/dict.h"
-#include "xbt/ex.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_virtu_emul, gras_virtu,
-                                "Emulation support");
-/*** CPU burning */
-void gras_cpu_burn(double flops)
-{
-  smx_action_t execution;
-
-  if (flops > 0){
-    execution = simcall_host_execute("task", SIMIX_host_self(), flops, 1);
-    simcall_host_execution_wait(execution);
-  }
-}
-
-/*** Timing macros ***/
-static xbt_os_timer_t timer;
-static int benchmarking = 0;
-static xbt_dict_t benchmark_set = NULL;
-static double reference = .00000000523066250047108838;  /* FIXME: we should benchmark host machine to set this; unit=s/flop */
-static double duration = 0.0;
-
-static char *locbuf = NULL;
-static unsigned int locbufsize;
-
-void gras_emul_init(void)
-{
-  if (!benchmark_set) {
-    benchmark_set = xbt_dict_new_homogeneous(xbt_free_f);
-    timer = xbt_os_timer_new();
-  }
-}
-
-void gras_emul_exit(void)
-{
-  free(locbuf);
-  xbt_dict_free(&benchmark_set);
-  xbt_os_timer_free(timer);
-}
-
-
-static void store_in_dict(xbt_dict_t dict, const char *key, double value)
-{
-  double *ir;
-
-  ir = xbt_dict_get_or_null(dict, key);
-  if (!ir) {
-    ir = xbt_new0(double, 1);
-    xbt_dict_set(dict, key, ir, NULL);
-  }
-  *ir = value;
-}
-
-static double get_from_dict(xbt_dict_t dict, const char *key)
-{
-  double *ir = xbt_dict_get(dict, key);
-
-  return *ir;
-}
-
-int gras_bench_always_begin(const char *location, int line)
-{
-  xbt_assert(!benchmarking, "Already benchmarking");
-  benchmarking = 1;
-
-  if (!timer)
-    xbt_os_timer_start(timer);
-  return 0;
-}
-
-int gras_bench_always_end(void)
-{
-  xbt_assert(benchmarking, "Not benchmarking yet");
-  benchmarking = 0;
-  xbt_os_timer_stop(timer);
-  duration = xbt_os_timer_elapsed(timer);
-
-  gras_cpu_burn(duration / reference);
-
-  return 0;
-}
-
-int gras_bench_once_begin(const char *location, int line)
-{
-  double *ir = NULL;
-  xbt_assert(!benchmarking, "Already benchmarking");
-  benchmarking = 1;
-
-  if (!locbuf || locbufsize < strlen(location) + 64) {
-    locbufsize = strlen(location) + 64;
-    locbuf = xbt_realloc(locbuf, locbufsize);
-  }
-  sprintf(locbuf, "%s:%d", location, line);
-
-  ir = xbt_dict_get_or_null(benchmark_set, locbuf);
-  if (!ir) {
-    XBT_DEBUG("%s", locbuf);
-    duration = 1;
-    xbt_os_timer_start(timer);
-    return 1;
-  } else {
-    duration = -1.0;
-    return 0;
-  }
-}
-
-int gras_bench_once_end(void)
-{
-  xbt_assert(benchmarking, "Not benchmarking yet");
-  benchmarking = 0;
-  if (duration > 0) {
-    xbt_os_timer_stop(timer);
-    duration = xbt_os_timer_elapsed(timer);
-    store_in_dict(benchmark_set, locbuf, duration);
-  } else {
-    duration = get_from_dict(benchmark_set, locbuf);
-  }
-  XBT_DEBUG("Simulate the run of a task of %f sec for %s", duration, locbuf);
-  gras_cpu_burn(duration / reference);
-  return 0;
-}
-
-
-/*** Conditional execution support ***/
-
-int gras_if_RL(void)
-{
-  return 0;
-}
-
-int gras_if_SG(void)
-{
-  return 1;
-}
diff --git a/src/gras/Virtu/sg_process.c b/src/gras/Virtu/sg_process.c
deleted file mode 100644 (file)
index 96773db..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-/* process_sg - GRAS process handling on simulator                          */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/dict.h"
-#include "gras_modinter.h"      /* module initialization interface */
-#include "gras/Virtu/virtu_sg.h"
-#include "gras/Msg/msg_interface.h"     /* For some checks at simulation end */
-#include "gras/Transport/transport_interface.h" /* For some checks at simulation end */
-#if HAVE_LUA
-#include <lua.h>
-#include <lauxlib.h>
-#include <lualib.h>
-#endif
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_virtu_process);
-
-static long int PID = 1;
-
-
-void gras_agent_spawn(const char *name,
-                      xbt_main_func_t code, int argc, char *argv[],
-                      xbt_dict_t properties)
-{
-
-  smx_process_t process;
-  simcall_process_create(&process, name, code, NULL,
-                           gras_os_myname(), -1.0, argc, argv, properties, 0);
-}
-
-/* **************************************************************************
- * Process constructor/destructor (semi-public interface)
- * **************************************************************************/
-
-void gras_process_init()
-{
-  smx_process_t self = SIMIX_process_self();
-  gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_self_get_data();
-  gras_procdata_t *pd = xbt_new0(gras_procdata_t, 1);
-  gras_trp_procdata_t trp_pd;
-  long int pid = PID++; /* make sure the first process gets the first id */
-
-  if (!hd) {
-    /* First process on this host (FIXME: does not work if the SIMIX user contexts are truly parallel) */
-    hd = xbt_new(gras_hostdata_t, 1);
-    hd->refcount = 1;
-    hd->ports = xbt_dynar_new(sizeof(gras_sg_portrec_t), NULL);
-    SIMIX_host_self_set_data((void *) hd);
-  } else {
-    hd->refcount++;
-  }
-
-  SIMIX_process_self_set_data(self, (void *) pd);
-  gras_procdata_init();
-
-  trp_pd = (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
-  pd->pid = pid;
-
-  if (self != NULL) {
-    pd->ppid = gras_os_getpid();
-  } else
-    pd->ppid = -1;
-
-  trp_pd->msg_selectable_sockets = xbt_queue_new(0, sizeof(xbt_socket_t));
-
-  trp_pd->meas_selectable_sockets =
-      xbt_queue_new(0, sizeof(xbt_socket_t));
-
-  XBT_VERB("Creating process '%s' (%d)", SIMIX_process_self_get_name(),
-      gras_os_getpid());
-}
-
-void gras_process_exit()
-{
-  xbt_dynar_t sockets =
-      ((gras_trp_procdata_t) gras_libdata_by_name("gras_trp"))->sockets;
-  xbt_socket_t sock_iter;
-  unsigned int cursor;
-  gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_self_get_data();
-  gras_procdata_t *pd =
-      (gras_procdata_t *) simcall_process_get_data(SIMIX_process_self());
-
-  gras_msg_procdata_t msg_pd =
-      (gras_msg_procdata_t) gras_libdata_by_name("gras_msg");
-  gras_trp_procdata_t trp_pd =
-      (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
-
-  xbt_queue_free(&trp_pd->msg_selectable_sockets);
-
-  xbt_queue_free(&trp_pd->meas_selectable_sockets);
-
-
-  xbt_assert(hd, "Run gras_process_init (ie, gras_init)!!");
-
-  XBT_VERB("GRAS: Finalizing process '%s' (%d)",
-        simcall_process_get_name(SIMIX_process_self()), gras_os_getpid());
-
-  if (!xbt_dynar_is_empty(msg_pd->msg_queue)) {
-    unsigned int cpt;
-    s_gras_msg_t msg;
-    XBT_WARN
-        ("process %d terminated, but %lu messages are still queued. Message list:",
-         gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
-    xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
-      XBT_WARN("   Message %s (%s) from %s@%s:%d", msg.type->name,
-            e_gras_msg_kind_names[msg.kind],
-            xbt_socket_peer_proc(msg.expe),
-            xbt_socket_peer_name(msg.expe),
-            xbt_socket_peer_port(msg.expe));
-    }
-  }
-
-  /* if each process has its sockets list, we need to close them when the
-     process finish */
-  xbt_dynar_foreach(sockets, cursor, sock_iter) {
-    XBT_VERB("Closing the socket %p left open on exit. Maybe a socket leak?",
-          sock_iter);
-    gras_socket_close(sock_iter);
-  }
-  if (!--(hd->refcount)) {
-    xbt_dynar_free(&hd->ports);
-    free(hd);
-  }
-  gras_procdata_exit();
-  free(pd);
-}
-
-/* **************************************************************************
- * Process data (public interface)
- * **************************************************************************/
-
-gras_procdata_t *gras_procdata_get(void)
-{
-  gras_procdata_t *pd =
-      (gras_procdata_t *) simcall_process_get_data(SIMIX_process_self());
-
-  xbt_assert(pd, "Run gras_process_init! (ie, gras_init)");
-
-  return pd;
-}
-
-void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p)
-{
-  gras_procdata_t *pd = (gras_procdata_t *) simcall_process_get_data(p);
-
-  xbt_assert(pd,
-              "process '%s' on '%s' didn't run gras_process_init! (ie, gras_init)",
-              simcall_process_get_name(p),
-              simcall_host_get_name(simcall_process_get_host(p)));
-
-  return gras_libdata_by_name_from_procdata(name, pd);
-}
-
-/** @brief retrieve the value of a given process property (or NULL if not defined) */
-const char *gras_process_property_value(const char *name)
-{
-  return xbt_dict_get_or_null(simcall_process_get_properties
-                             (SIMIX_process_self()), name);
-}
-
-/** @brief retrieve the process properties dictionnary
- *  @warning it's the original one, not a copy. Don't mess with it
- */
-xbt_dict_t gras_process_properties(void)
-{
-  return simcall_process_get_properties(SIMIX_process_self());
-}
-
-/* **************************************************************************
- * OS virtualization function
- * **************************************************************************/
-
-
-int gras_os_getpid(void)
-{
-  gras_procdata_t *data;
-  data = (gras_procdata_t *) SIMIX_process_self_get_data(SIMIX_process_self());
-  if (data != NULL)
-    return data->pid;
-
-  return 0;
-}
-
-/** @brief retrieve the value of a given host property (or NULL if not defined) */
-const char *gras_os_host_property_value(const char *name)
-{
-  return
-      xbt_dict_get_or_null(simcall_host_get_properties
-                           (simcall_process_get_host(SIMIX_process_self())),
-                           name);
-}
-
-/** @brief retrieve the host properties dictionary
- *  @warning it's the original one, not a copy. Don't mess with it
- */
-xbt_dict_t gras_os_host_properties(void)
-{
-  return
-      simcall_host_get_properties(simcall_process_get_host
-                                (SIMIX_process_self()));
-}
-
-/* **************************************************************************
- * Interface with SIMIX
- * (these functions are called by the stuff generated by gras_stub_generator)
- * **************************************************************************/
-
-void gras_global_init(int *argc, char **argv)
-{
-  SIMIX_global_init(argc, argv);
-}
-
-void gras_create_environment(const char *file)
-{
-  SIMIX_create_environment(file);
-}
-
-void gras_function_register(const char *name, xbt_main_func_t code)
-{
-  SIMIX_function_register(name, code);
-}
-
-void gras_function_register_default(xbt_main_func_t code)
-{
-  SIMIX_function_register_default(code);
-}
-
-void gras_main()
-{
-  /* Clean IO before the run */
-  fflush(stdout);
-  fflush(stderr);
-  SIMIX_run();
-
-  return;
-}
-
-void gras_launch_application(const char *file)
-{
-  SIMIX_launch_application(file);
-}
-
-void gras_load_environment_script(const char *script_file)
-{
-#ifdef HAVE_LUA
-  lua_State *L = lua_open();
-  luaL_openlibs(L);
-
-  if (luaL_loadfile(L, script_file) || lua_pcall(L, 0, 0, 0)) {
-    printf("error: %s\n", lua_tostring(L, -1));
-    return;
-  }
-#else
-  xbt_die
-      ("Lua is not available!! to call gras_load_environment_script, lua should be available...");
-#endif
-  return;
-}
-
-void gras_clean(){ /* this function is not needed anymore and could be removed, but I feel so lazy */
-}
diff --git a/src/gras/Virtu/virtu_interface.h b/src/gras/Virtu/virtu_interface.h
deleted file mode 100644 (file)
index 8df85bc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* virtu[alization] - speciafic parts for each OS and for SG                */
-
-/* module's public interface exported within GRAS, but not to end user.     */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef GRAS_VIRTU_INTERFACE_H
-#define GRAS_VIRTU_INTERFACE_H
-
-
-#include "xbt/function_types.h"
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/set.h"
-#include "gras/virtu.h"
-#include "gras/process.h"
-
-SG_BEGIN_DECL()
-
-/* shutdown the module mechanism (world-wide cleanups) */
-void gras_moddata_exit(void);
-/* shutdown this process wrt module mecanism (process-wide cleanups) */
-void gras_moddata_leave(void);
-
-
-/* Perform the various intialisations needed by gras. Each process must run it */
-XBT_PUBLIC(void) gras_process_init(void);
-
-/* Frees the memory allocated by gras. Processes should run it */
-XBT_PUBLIC(void) gras_process_exit(void);
-
-
-/* This is the old interface (deprecated) */
-
-/* declare a new process specific data 
-   (used by gras_<module>_register to make sure that gras_process_init will create it) */
-int gras_procdata_add(const char *name, pvoid_f_void_t creator,
-                      void_f_pvoid_t destructor);
-
-void *gras_libdata_by_name(const char *name);
-void *gras_libdata_by_id(int id);
-
-SG_END_DECL()
-#endif                          /* GRAS_VIRTU_INTERFACE_H */
diff --git a/src/gras/Virtu/virtu_private.h b/src/gras/Virtu/virtu_private.h
deleted file mode 100644 (file)
index 462f500..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* virtu[alization] - speciafic parts for each OS and for SG                */
-
-/* module's private interface.                                              */
-
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-
-#ifndef GRAS_VIRTU_PRIVATE_H
-#define GRAS_VIRTU_PRIVATE_H
-
-#include "xbt/dynar.h"
-#include "gras/Virtu/virtu_interface.h"
-#include "simgrid/simix.h"
-#include "gras/Msg/msg_private.h"
-
-/** @brief Data for each process */
-typedef struct {
-  /* globals of the process */
-  void *userdata;
-
-  /* data specific to each process for each module. 
-   * Registered with gras_procdata_add(), retrieved with gras_libdata_get() 
-   * This is the old interface, and will disapear before 3.2
-   */
-  xbt_set_t libdata;
-
-  /* data specific to each process for each module. 
-   * Registered with gras_module_add(), retrieved with gras_moddata_get() 
-   * This is the new interface
-   */
-  xbt_dynar_t moddata;
-
-  int pid;                      /* pid of process, only for SG */
-  int ppid;                     /* ppid of process, only for SG */
-
-  gras_msg_listener_t listener; /* the thread in charge of the incoming communication for this process */
-} gras_procdata_t;
-
-gras_procdata_t *gras_procdata_get(void);
-void *gras_libdata_by_name_from_procdata(const char *name,
-                                         gras_procdata_t * pd);
-
-#endif                          /* GRAS_VIRTU_PRIVATE_H */
diff --git a/src/gras/Virtu/virtu_rl.h b/src/gras/Virtu/virtu_rl.h
deleted file mode 100644 (file)
index e402bc7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* virtu_rl - specific GRAS implementation for real life                    */
-
-/* Copyright (c) 2004, 2005, 2010. 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. */
-
-#ifndef VIRTU_RL_H
-#define VIRTU_RL_H
-
-#include "gras/Virtu/virtu_private.h"
-
-#endif                          /* VIRTU_RL_H */
diff --git a/src/gras/Virtu/virtu_sg.h b/src/gras/Virtu/virtu_sg.h
deleted file mode 100644 (file)
index 7554d19..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* virtu_sg - specific GRAS implementation for simulator                    */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef VIRTU_SG_H
-#define VIRTU_SG_H
-
-#include "gras/Virtu/virtu_private.h"
-#include "xbt/dynar.h"
-#include "simgrid/simix.h"        /* SimGrid header */
-#include "gras/Transport/transport_private.h"
-
-typedef struct {
-  int port;                     /* list of ports used by a server socket */
-  unsigned meas:1;              /* (boolean) the channel is for measurements or for messages */
-  smx_process_t server;
-  smx_rdv_t rdv;
-} s_gras_sg_portrec_t, *gras_sg_portrec_t;
-
-/* Data for each host */
-typedef struct {
-  int refcount;
-
-  xbt_dynar_t ports;
-
-} gras_hostdata_t;
-
-/* data for each socket (FIXME: find a better location for that) */
-typedef struct {
-  smx_process_t server;
-  smx_process_t client;
-
-  smx_rdv_t rdv_server;         /* The rendez-vous point to use */
-  smx_rdv_t rdv_client;         /* The rendez-vous point to use */
-  smx_action_t comm_recv;       /* The comm of irecv on receiver side */
-  gras_msg_t msg;               /* The destination buffer of the comm data */
-
-  int server_port;
-  int client_port;
-} s_gras_trp_sg_sock_data_t, *gras_trp_sg_sock_data_t;
-
-
-/** \brief Returns if I am on the server side of this socket (either server or listener of server) */
-/* FIXME make an im_the_server function in each socket plugin */
-int gras_socket_im_the_server(xbt_socket_t sock);
-
-
-void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p);
-/* The same function by id would be really dangerous.
- * 
- * Indeed, it would rely on the fact that all process register libdatas in
- * the same order, which is wrong if they init amok modules in different
- * order.
- */
-
-#endif                          /* VIRTU_SG_H */
diff --git a/src/gras/gras.c b/src/gras/gras.c
deleted file mode 100644 (file)
index 9267a50..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/* gras.c -- generic functions not fitting anywhere else                    */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/log.h"
-#include "xbt/virtu.h"          /* set the XBT virtualization to use GRAS */
-#include "xbt/module.h"         /* xbt_init/exit */
-#include "xbt/xbt_os_time.h"    /* xbt_os_time */
-#include "xbt/synchro.h"
-#include "xbt/socket.h"
-
-#include "Virtu/virtu_interface.h"      /* Module mechanism FIXME: deplace&rename */
-#include "Virtu/virtu_private.h"
-#include "gras_modinter.h"      /* module init/exit */
-#include "amok/amok_modinter.h" /* module init/exit */
-#include "xbt_modinter.h"       /* module init/exit */
-
-#include "gras.h"
-#include "gras/process.h"       /* FIXME: killme and put process_init in modinter */
-#include "gras/transport.h"
-#include "gras/Msg/msg_private.h"
-#include "portable.h"           /* hexa_*(); signalling stuff */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(gras,
-                             "All GRAS categories (cf. section \\ref GRAS_API)");
-static int gras_running_process = 0;
-#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
-static void gras_sigusr_handler(int sig)
-{
-  XBT_INFO("SIGUSR1 received. Display the backtrace");
-  xbt_backtrace_display_current();
-}
-
-static void gras_sigint_handler(int sig)
-{
-  static double lastone = 0;
-  if (lastone == 0 || xbt_os_time() - lastone > 5) {
-    if (gras_if_RL())
-      xbt_backtrace_display_current();
-    else
-      SIMIX_display_process_status();
-    fprintf(stderr,
-            "\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n");
-    lastone = xbt_os_time();
-  } else {
-    exit(1);
-  }
-}
-#endif
-
-/**
- * @ingroup GRAS_API
- * \brief Initialize the gras mechanisms.
- */
-void gras_init(int *argc, char **argv)
-{
-  int first = 0;
-  gras_procdata_t *pd;
-  gras_msg_procdata_t msg_pd;
-
-  xbt_getpid = gras_os_getpid;
-  /* First initialize the XBT */
-  xbt_init(argc, argv);
-
-  XBT_VERB("Initialize GRAS");
-
-  /* module registrations:
-   *    - declare process specific data we need (without creating them)
-   */
-  if (gras_running_process == 0) {
-    first = 1;
-
-    if (!getenv("GRAS_NO_WARN_EXPERIMENTAL"))
-      XBT_WARN("GRAS is not well maintained anymore. We consider it to be experimental (and not stable anymore) since SimGrid 3.6. Sorry about it, please consider contributing to improve this situation");
-
-    gras_trp_register();
-    gras_msg_register();
-
-    xbt_trp_plugin_new("file", gras_trp_file_setup);
-    if (gras_if_SG()) {
-      xbt_trp_plugin_new("sg", gras_trp_sg_setup);
-    }
-    /* the TCP plugin (used in RL mode) is automatically loaded by XBT */
-  }
-  gras_running_process++;
-
-  /*
-   * Initialize the process specific stuff
-   */
-  gras_process_init();          /* calls procdata_init, which creates process specific data for each module */
-
-  /*
-   * Initialize the global stuff if it's not the first process created
-   */
-  if (first) {
-    gras_emul_init();
-    gras_msg_init();
-#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
-# ifdef SIGUSR1
-    signal(SIGUSR1, gras_sigusr_handler);
-# endif
-    signal(SIGINT, gras_sigint_handler);
-#endif
-  }
-
-  /* and then init amok */
-  amok_init();
-
-  /* And finally, launch the listener thread */
-  pd = gras_procdata_get();
-  msg_pd = gras_libdata_by_name("gras_msg");
-  pd->listener = gras_msg_listener_launch(msg_pd->msg_received);
-}
-
-/**
- * @ingroup GRAS_API
- * @brief Finalize the gras mechanisms.
- * */
-void gras_exit(void)
-{
-  XBT_INFO("Exiting GRAS");
-  amok_exit();
-  gras_moddata_leave();
-  gras_msg_listener_shutdown();
-  gras_process_exit();
-  if (--gras_running_process == 0) {
-    gras_msg_exit();
-    gras_emul_exit();
-    gras_moddata_exit();
-  }
-}
-
-const char *hexa_str(unsigned char *data, int size, int downside)
-{
-  static char *buff = NULL;
-  static int buffsize = 0;
-  int i, pos = 0;
-  int begin, increment;
-
-  if (buffsize < 5 * (size + 1)) {
-    free(buff);
-    buffsize = 5 * (size + 1);
-    buff = xbt_malloc(buffsize);
-  }
-
-
-  if (downside) {
-    begin = size - 1;
-    increment = -1;
-  } else {
-    begin = 0;
-    increment = 1;
-  }
-
-  for (i = begin; 0 <= i && i < size; i += increment) {
-    if (data[i] < 32 || data[i] > 126)
-      sprintf(buff + pos, ".");
-    else
-      sprintf(buff + pos, "%c", data[i]);
-    while (buff[++pos]);
-  }
-  sprintf(buff + pos, "(");
-  while (buff[++pos]);
-  for (i = begin; 0 <= i && i < size; i += increment) {
-    sprintf(buff + pos, "%02x", data[i]);
-    while (buff[++pos]);
-  }
-  sprintf(buff + pos, ")");
-  while (buff[++pos]);
-  buff[pos] = '\0';
-  return buff;
-}
-
-void hexa_print(const char *name, unsigned char *data, int size)
-{
-  printf("%s: %s\n", name, hexa_str(data, size, 0));
-}
diff --git a/src/gras/rl_stubs.c b/src/gras/rl_stubs.c
deleted file mode 100644 (file)
index a9d5ddf..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* rl_stubs.c -- empty body of functions used in SG, but harmful in RL       */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt_modinter.h"
-#include "xbt/sysdep.h"
-#include "simgrid/simix.h"
-
-void SIMIX_display_process_status(void)
-{
-}
index 4d58f24..a534910 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.h"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.h"
-#include "xbt/time.h"
+#include "xbt/virtu.h"
 #include "mc/mc.h"
 #include "xbt/replay.h"
 #include <errno.h>
 #include "mc/mc.h"
 #include "xbt/replay.h"
 #include <errno.h>
index fc1e385..df3087e 100644 (file)
@@ -413,8 +413,13 @@ void sg_version(int *ver_major,int *ver_minor,int *ver_patch) {
 
 xbt_dynar_t sg_cmdline = NULL;
 
 
 xbt_dynar_t sg_cmdline = NULL;
 
+extern char *xbt_os_procname_data;
+
+
 void surf_init(int *argc, char **argv)
 {
 void surf_init(int *argc, char **argv)
 {
+  xbt_os_procname_data = argv[0];
+
   XBT_DEBUG("Create all Libs");
   host_lib = xbt_lib_new();
   link_lib = xbt_lib_new();
   XBT_DEBUG("Create all Libs");
   host_lib = xbt_lib_new();
   link_lib = xbt_lib_new();
diff --git a/src/xbt/datadesc/cbps.c b/src/xbt/datadesc/cbps.c
deleted file mode 100644 (file)
index b258d3a..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/* cbps - persistent states for callbacks                                   */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/datadesc/datadesc_private.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_cbps, xbt_ddt,
-                                "callback persistent state");
-
-typedef struct {
-  xbt_datadesc_type_t type;
-  void *data;
-} s_xbt_cbps_elm_t, *xbt_cbps_elm_t;
-
-typedef struct s_xbt_cbps {
-  xbt_dynar_t lints;            /* simple stack of long integers (easy interface) */
-
-  xbt_dict_t space;             /* varname x dynar of xbt_cbps_elm_t */
-  xbt_dynar_t frames;           /* of dynar of names defined within this frame
-                                   (and to pop when we leave it) */
-  xbt_dynar_t globals;
-} s_xbt_cbps_t;
-
-xbt_cbps_t xbt_cbps_new(void)
-{
-  xbt_cbps_t res;
-
-  res = xbt_new(s_xbt_cbps_t, 1);
-
-  res->lints = xbt_dynar_new(sizeof(int), NULL);
-  res->space = xbt_dict_new_homogeneous(NULL);
-  /* no leak, the content is freed manually on block_end */
-  res->frames = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
-  res->globals = xbt_dynar_new(sizeof(char *), NULL);
-
-  xbt_cbps_block_begin(res);
-
-  return res;
-}
-
-void xbt_cbps_free(xbt_cbps_t * state)
-{
-
-  xbt_dynar_free(&((*state)->lints));
-
-  xbt_cbps_block_end(*state);
-  xbt_dict_free(&((*state)->space));
-  xbt_dynar_free(&((*state)->frames));
-  xbt_dynar_free(&((*state)->globals));
-
-  free(*state);
-  *state = NULL;
-}
-
-void xbt_cbps_reset(xbt_cbps_t state)
-{
-
-  xbt_dynar_reset(state->lints);
-
-  xbt_dict_reset(state->space);
-
-  xbt_dynar_reset(state->frames);
-  xbt_dynar_reset(state->globals);
-}
-
-/** \brief Declare a new element in the PS, and give it a value.
- *
- * If an element of that
- * name already exists, it is masked by the one given here, and will be
- * seeable again only after a pop to remove the value this push adds.
- */
-void
-xbt_cbps_v_push(xbt_cbps_t ps,
-                 const char *name, void *data, xbt_datadesc_type_t ddt)
-{
-
-  xbt_dynar_t varstack = NULL, frame;
-  xbt_cbps_elm_t var;
-  char *varname = (char *) xbt_strdup(name);
-  xbt_ex_t e;
-
-  XBT_DEBUG("push(%s,%p)", name, (void *) data);
-
-  TRY {
-    varstack = xbt_dict_get(ps->space, name);
-  }
-  CATCH(e) {
-    if (e.category != mismatch_error)
-      RETHROW;
-
-    XBT_DEBUG("Create a new variable stack for '%s' into the space", name);
-    varstack = xbt_dynar_new(sizeof(xbt_cbps_elm_t *), NULL);
-    xbt_dict_set(ps->space, name, (void **) varstack, NULL);
-    xbt_ex_free(e);
-    /* leaking, you think? only if you do not close all the openned blocks ;) */
-  }
-
-  var = xbt_new0(s_xbt_cbps_elm_t, 1);
-  var->type = ddt;
-  var->data = data;
-
-  xbt_dynar_push(varstack, &var);
-
-  xbt_dynar_pop(ps->frames, &frame);
-  XBT_DEBUG("Push %s (%p @%p) into frame %p", varname, (void *) varname,
-         (void *) &varname, (void *) frame);
-  xbt_dynar_push(frame, &varname);
-  xbt_dynar_push(ps->frames, &frame);
-}
-
-/** \brief Retrieve an element from the PS, and remove it from the PS.
- *
- * If it's not present in the current block, it will fail (throwing not_found)
- * and not search in upper blocks since this denotes a programmation error.
- */
-void
-xbt_cbps_v_pop(xbt_cbps_t ps,
-                const char *name, xbt_datadesc_type_t * ddt, void **res)
-{
-  xbt_dynar_t varstack = NULL, frame = NULL;
-  xbt_cbps_elm_t var = NULL;
-  void *data = NULL;
-  xbt_ex_t e;
-
-  XBT_DEBUG("pop(%s)", name);
-  TRY {
-    varstack = xbt_dict_get(ps->space, name);
-  }
-  CATCH(e) {
-    if (e.category != mismatch_error)
-      RETHROW;
-
-    xbt_ex_free(e);
-    THROWF(not_found_error, 1, "Asked to pop the non-existant %s", name);
-  }
-  xbt_dynar_pop(varstack, &var);
-
-  if (xbt_dynar_is_empty(varstack)) {
-    XBT_DEBUG("Last incarnation of %s poped. Kill it", name);
-    xbt_dict_remove(ps->space, name);
-    xbt_dynar_free(&varstack);
-  }
-
-  if (ddt)
-    *ddt = var->type;
-  data = var->data;
-
-  free(var);
-
-  xbt_dynar_pop(ps->frames, &frame);
-  {
-    int l = xbt_dynar_length(frame);
-
-    while (l--) {
-      char *_name = NULL;
-
-      _name = xbt_dynar_get_as(frame, l, char *);
-      if (!strcmp(name, _name)) {
-        xbt_dynar_remove_at(frame, l, &_name);
-        free(_name);
-        break;
-      }
-    }
-  }
-  xbt_dynar_push(ps->frames, &frame);
-
-  *res = data;
-}
-
-/** \brief Change the value of an element in the PS.
- *
- * If it's not present in the current block, look in the upper ones.
- * If it's not present in any of them, modify in the globals
- * If not present there neither, the code may segfault (Oli?).
- *
- * Once a reference to an element of that name is found somewhere in the PS,
- *   its value is changed.
- */
-void
-xbt_cbps_v_set(xbt_cbps_t ps,
-                const char *name, void *data, xbt_datadesc_type_t ddt)
-{
-
-  xbt_dynar_t dynar = NULL;
-  xbt_cbps_elm_t elm = NULL;
-
-  XBT_DEBUG("set(%s)", name);
-  dynar = xbt_dict_get_or_null(ps->space, name);
-
-  if (dynar == NULL) {
-    dynar = xbt_dynar_new(sizeof(xbt_cbps_elm_t), NULL);
-    xbt_dict_set(ps->space, name, (void **) dynar, NULL);
-
-    elm = xbt_new0(s_xbt_cbps_elm_t, 1);
-    xbt_dynar_push(ps->globals, &name);
-  } else {
-    xbt_dynar_pop(dynar, &elm);
-  }
-
-  elm->type = ddt;
-  elm->data = data;
-
-  xbt_dynar_push(dynar, &elm);
-
-}
-
-/** \brief Get the value of an element in the PS without modifying it.
- *
- * (note that you get the content of the data struct and not a copy to it)
- * If it's not present in the current block, look in the upper ones.
- * If it's not present in any of them, look in the globals
- * If not present there neither, the code may segfault (Oli?).
- */
-void *xbt_cbps_v_get(xbt_cbps_t ps, const char *name,
-                      /* OUT */ xbt_datadesc_type_t * ddt)
-{
-
-  xbt_dynar_t dynar = NULL;
-  xbt_cbps_elm_t elm = NULL;
-
-  XBT_DEBUG("get(%s)", name);
-  dynar = xbt_dict_get(ps->space, name);
-  xbt_dynar_pop(dynar, &elm);
-  xbt_dynar_push(dynar, &elm);
-
-  if (ddt) {
-    *ddt = elm->type;
-  }
-
-  return elm->data;
-
-}
-
-/** \brief Begins a new block.
- *
- * Blocks are usefull to remove a whole set of declarations you don't even know
- *
- * E.g., they constitute an elegent solution to recursive data structures.
- *
- * push/pop may be used in some cases for that, but if your recursive data
- * struct contains other structs needing themselves callbacks, you have to
- * use block_{begin,end} to do the trick.
- */
-
-void xbt_cbps_block_begin(xbt_cbps_t ps)
-{
-
-  xbt_dynar_t dynar = NULL;
-
-  XBT_DEBUG(">>> Block begin");
-  dynar = xbt_dynar_new(sizeof(char *), NULL);
-  xbt_dynar_push(ps->frames, &dynar);
-}
-
-/** \brief End the current block, and go back to the upper one. */
-void xbt_cbps_block_end(xbt_cbps_t ps)
-{
-
-  xbt_dynar_t frame = NULL;
-  unsigned int cursor = 0;
-  char *name = NULL;
-
-  xbt_assert(xbt_dynar_length(ps->frames),
-              "More block_end than block_begin");
-  xbt_dynar_pop(ps->frames, &frame);
-
-  xbt_dynar_foreach(frame, cursor, name) {
-
-    xbt_dynar_t varstack = NULL;
-    xbt_cbps_elm_t var = NULL;
-
-    XBT_DEBUG("Get ride of %s (%p)", name, (void *) name);
-    varstack = xbt_dict_get(ps->space, name);
-    xbt_dynar_pop(varstack, &var);
-
-    if (xbt_dynar_is_empty(varstack)) {
-      xbt_dict_remove(ps->space, name);
-      xbt_dynar_free_container(&varstack);      /*already empty, save a test ;) */
-    }
-
-    free(var->data);
-    free(var);
-    free(name);
-  }
-  xbt_dynar_free_container(&frame);     /* we just emptied it */
-  XBT_DEBUG("<<< Block end");
-}
-
-
-/** \brief Push a new integer value into the cbps. */
-void xbt_cbps_i_push(xbt_cbps_t ps, int val)
-{
-  XBT_DEBUG("push %d as a size", val);
-  xbt_dynar_push_as(ps->lints, int, val);
-}
-
-/** \brief Pop the lastly pushed integer value from the cbps. */
-int xbt_cbps_i_pop(xbt_cbps_t ps)
-{
-  int ret;
-
-  xbt_assert(!xbt_dynar_is_empty(ps->lints),
-              "xbt_cbps_i_pop: no value to pop");
-  ret = xbt_dynar_pop_as(ps->lints, int);
-  XBT_DEBUG("pop %d as a size", ret);
-  return ret;
-}
-
-/** \brief Generic cb returning the lastly pushed value
- *
- * Used by \ref xbt_datadesc_ref_pop_arr
- */
-int xbt_datadesc_cb_pop(xbt_datadesc_type_t ignored, xbt_cbps_t vars,
-                         void *data)
-{
-  return xbt_cbps_i_pop(vars);
-}
-
-/* ************************* */
-/* **** PUSHy callbacks **** */
-/* ************************* */
-
-/** \brief Cb to push an integer. Must be attached to the field you want to push */
-void xbt_datadesc_cb_push_int(xbt_datadesc_type_t ignored,
-                               xbt_cbps_t vars, void *data)
-{
-  int *i = (int *) data;
-  xbt_cbps_i_push(vars, (int) *i);
-}
-
-/** \brief Cb to push an unsigned integer. Must be attached to the field you want to push */
-void xbt_datadesc_cb_push_uint(xbt_datadesc_type_t ignored,
-                                xbt_cbps_t vars, void *data)
-{
-  unsigned int *i = (unsigned int *) data;
-  xbt_cbps_i_push(vars, (int) *i);
-}
-
-/** \brief Cb to push an long integer. Must be attached to the field you want to push
- */
-void xbt_datadesc_cb_push_lint(xbt_datadesc_type_t ignored,
-                                xbt_cbps_t vars, void *data)
-{
-  long int *i = (long int *) data;
-  xbt_cbps_i_push(vars, (int) *i);
-}
-
-/** \brief Cb to push an unsigned long integer. Must be attached to the field you want to push
- */
-void xbt_datadesc_cb_push_ulint(xbt_datadesc_type_t ignored,
-                                 xbt_cbps_t vars, void *data)
-{
-  unsigned long int *i = (unsigned long int *) data;
-  xbt_cbps_i_push(vars, (int) *i);
-}
-
-/* ************************************ */
-/* **** PUSHy multiplier callbacks **** */
-/* ************************************ */
-/** \brief Cb to push an integer as multiplier. Must be attached to the field you want to push */
-void xbt_datadesc_cb_push_int_mult(xbt_datadesc_type_t ignored,
-                                    xbt_cbps_t vars, void *data)
-{
-  int old = *(int *) data;
-  int new = xbt_cbps_i_pop(vars);
-  XBT_DEBUG("push %d x %d as a size", old, new);
-  xbt_cbps_i_push(vars, old * new);
-}
-
-/** \brief Cb to push an unsigned integer as multiplier. Must be attached to the field you want to push */
-void xbt_datadesc_cb_push_uint_mult(xbt_datadesc_type_t ignored,
-                                     xbt_cbps_t vars, void *data)
-{
-  unsigned int old = *(unsigned int *) data;
-  unsigned int new = xbt_cbps_i_pop(vars);
-
-  XBT_DEBUG("push %u x %u as a size", old, new);
-  xbt_cbps_i_push(vars, (int) (old * new));
-}
-
-/** \brief Cb to push an long integer as multiplier. Must be attached to the field you want to push
- */
-void xbt_datadesc_cb_push_lint_mult(xbt_datadesc_type_t ignored,
-                                     xbt_cbps_t vars, void *data)
-{
-  long int i = *(long int *) data;
-  i *= xbt_cbps_i_pop(vars);
-  xbt_cbps_i_push(vars, (int) i);
-}
-
-/** \brief Cb to push an unsigned long integer as multiplier. Must be attached to the field you want to push
- */
-void xbt_datadesc_cb_push_ulint_mult(xbt_datadesc_type_t ignored,
-                                      xbt_cbps_t vars, void *data)
-{
-  unsigned long int old = *(unsigned long int *) data;
-  unsigned long int new = xbt_cbps_i_pop(vars);
-
-  XBT_DEBUG("push %lu x %lu as a size", old, new);
-  xbt_cbps_i_push(vars, (int) (old * new));
-}
diff --git a/src/xbt/datadesc/datadesc.c b/src/xbt/datadesc/datadesc.c
deleted file mode 100644 (file)
index 40856a5..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/* datadesc - data description in order to send/recv it in XBT             */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "datadesc_private.h"
-#include "portable.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt, xbt, "Data description");
-/* FIXME: make this host-dependent using a trick such as UserData*/
-/*@null@*/ xbt_set_t xbt_datadesc_set_local = NULL;
-
-
-/* callback for array size when sending strings */
-static int _strlen_cb( /*@unused@ */ xbt_datadesc_type_t type, /*@unused@ */
-                      xbt_cbps_t vars, void *data)
-{
-
-  return 1 + (int) strlen(data);
-}
-
-
-/**
- * xbt_datadesc_init:
- *
- * Initialize the datadesc module.
- * FIXME: We assume that when neither signed nor unsigned is given,
- *    that means signed. To be checked by configure.
- **/
-void xbt_datadesc_preinit(void)
-{
-  xbt_datadesc_type_t ddt;     /* What to add */
-
-  /* only initialize once */
-  if (xbt_datadesc_set_local != NULL)
-    return;
-
-  XBT_VERB("Initializing DataDesc");
-
-  xbt_datadesc_set_local = xbt_set_new();
-
-
-  /* all known datatypes */
-
-  ddt = xbt_datadesc_scalar("signed char",
-                             xbt_ddt_scalar_char,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("char",
-                             xbt_ddt_scalar_char,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("unsigned char",
-                             xbt_ddt_scalar_char,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("signed short int",
-                             xbt_ddt_scalar_short,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("short int",
-                             xbt_ddt_scalar_short,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("short",
-                             xbt_ddt_scalar_short,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("unsigned short int",
-                             xbt_ddt_scalar_short,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("signed int",
-                             xbt_ddt_scalar_int,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("int",
-                             xbt_ddt_scalar_int,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("unsigned int",
-                             xbt_ddt_scalar_int,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("signed long int",
-                             xbt_ddt_scalar_long,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("long int",
-                             xbt_ddt_scalar_long,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("long",
-                             xbt_ddt_scalar_long,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("unsigned long int",
-                             xbt_ddt_scalar_long,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("signed long long int",
-                             xbt_ddt_scalar_long_long,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("long long int",
-                             xbt_ddt_scalar_long_long,
-                             e_xbt_dd_scalar_encoding_sint);
-  ddt = xbt_datadesc_scalar("unsigned long long int",
-                             xbt_ddt_scalar_long_long,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("data pointer",
-                             xbt_ddt_scalar_pdata,
-                             e_xbt_dd_scalar_encoding_uint);
-  ddt = xbt_datadesc_scalar("function pointer",
-                             xbt_ddt_scalar_pfunc,
-                             e_xbt_dd_scalar_encoding_uint);
-
-  ddt = xbt_datadesc_scalar("float",
-                             xbt_ddt_scalar_float,
-                             e_xbt_dd_scalar_encoding_float);
-  ddt = xbt_datadesc_scalar("double",
-                             xbt_ddt_scalar_double,
-                             e_xbt_dd_scalar_encoding_float);
-
-  ddt = xbt_datadesc_array_dyn("char[]",
-                                xbt_datadesc_by_name("char"), _strlen_cb);
-  xbt_datadesc_ref("string", ddt);
-  xbt_datadesc_ref("xbt_string_t", ddt);
-
-  /* specific datatype: the exception type (for RPC) */
-  ddt = xbt_datadesc_struct("ex_t");
-  xbt_datadesc_struct_append(ddt, "msg", xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "category",
-                              xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(ddt, "value", xbt_datadesc_by_name("int"));
-
-  xbt_datadesc_struct_append(ddt, "remote",
-                              xbt_datadesc_by_name("short int"));
-
-  xbt_datadesc_struct_append(ddt, "host",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "procname",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "pid",
-                              xbt_datadesc_by_name("long int"));
-  xbt_datadesc_struct_append(ddt, "file",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "line", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(ddt, "func",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "used", xbt_datadesc_by_name("int"));
-  xbt_datadesc_cb_field_push(ddt, "used");
-  xbt_datadesc_struct_append(ddt, "bt_strings",
-                              xbt_datadesc_ref_pop_arr
-                              (xbt_datadesc_by_name("string")));
-
-  xbt_datadesc_struct_close(ddt);
-
-  /* specific datatype: xbt_peer_t */
-  ddt = xbt_datadesc_struct("s_xbt_peer_t");
-  xbt_datadesc_struct_append(ddt, "name",
-                              xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(ddt, "port", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_close(ddt);
-
-  ddt = xbt_datadesc_ref("xbt_peer_t", ddt);
-
-  /* Dict containing the constant value (for the parsing macro) */
-  xbt_dd_constants = xbt_dict_new_homogeneous(xbt_free_f);
-
-}
-
-/**
- * xbt_datadesc_exit:
- *
- * Finalize the datadesc module
- **/
-void xbt_datadesc_postexit(void)
-{
-  xbt_set_free(&xbt_datadesc_set_local);
-  xbt_dict_free(&xbt_dd_constants);
-}
-
-/** This is mainly to debug */
-const char *xbt_datadesc_get_name(xbt_datadesc_type_t ddt)
-{
-  return ddt ? (const char *) ddt->name : "(null)";
-}
-
-/** This is mainly to debug */
-int xbt_datadesc_get_id(xbt_datadesc_type_t ddt)
-{
-  return ddt->code;
-}
-
-/**
- * xbt_datadesc_size:
- *
- * Returns the size occuped by data of this type (on the current arch).
- *
- */
-int xbt_datadesc_size(xbt_datadesc_type_t type)
-{
-  return type ? type->size[GRAS_THISARCH] : 0;
-}
-
-/**
- * xbt_datadesc_type_dump:
- *
- * For debugging purpose
- */
-void xbt_datadesc_type_dump(const xbt_datadesc_type_t ddt)
-{
-  unsigned int cpt;
-
-  printf("DataDesc dump:");
-  if (!ddt) {
-    printf("(null)\n");
-    return;
-  }
-  printf("%s (ID:%d)\n", ddt->name, ddt->code);
-  printf("  category: %s\n", xbt_datadesc_cat_names[ddt->category_code]);
-
-  printf("  size[");
-  for (cpt = 0; cpt < xbt_arch_count; cpt++) {
-    printf("%s%s%ld%s",
-           cpt > 0 ? ", " : "",
-           cpt == GRAS_THISARCH ? ">" : "",
-           ddt->size[cpt], cpt == GRAS_THISARCH ? "<" : "");
-  }
-  printf("]\n");
-
-  printf("  alignment[");
-  for (cpt = 0; cpt < xbt_arch_count; cpt++) {
-    printf("%s%s%lu%s",
-           cpt > 0 ? ", " : "",
-           cpt == GRAS_THISARCH ? ">" : "",
-           ddt->alignment[cpt], cpt == GRAS_THISARCH ? "<" : "");
-  }
-  printf("]\n");
-
-  printf("  aligned_size[");
-  for (cpt = 0; cpt < xbt_arch_count; cpt++) {
-    printf("%s%s%lu%s",
-           cpt > 0 ? ", " : "",
-           cpt == GRAS_THISARCH ? ">" : "",
-           ddt->aligned_size[cpt], cpt == GRAS_THISARCH ? "<" : "");
-  }
-  printf("]\n");
-  if (ddt->category_code == e_xbt_datadesc_type_cat_struct) {
-    xbt_dd_cat_struct_t struct_data;
-    xbt_dd_cat_field_t field;
-
-    struct_data = ddt->category.struct_data;
-    xbt_dynar_foreach(struct_data.fields, cpt, field) {
-      printf(">>> Dump field #%u (%s) (offset=%ld)\n",
-             cpt, field->name, field->offset[GRAS_THISARCH]);
-      xbt_datadesc_type_dump(field->type);
-      printf("<<< end dump field #%u (%s)\n", cpt, field->name);
-    }
-  }
-  fflush(stdout);
-}
diff --git a/src/xbt/datadesc/datadesc_interface.h b/src/xbt/datadesc/datadesc_interface.h
deleted file mode 100644 (file)
index 7568c45..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* datadesc - describing the data to exchange                               */
-
-/* module's public interface exported within XBT, but not to end user.     */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef XBT_DATADESC_INTERFACE_H
-#define XBT_DATADESC_INTERFACE_H
-
-#include "xbt/datadesc.h"
-#include "xbt/misc.h"
-#include "xbt/socket.h"
-
-XBT_PUBLIC(xbt_datadesc_type_t) xbt_datadesc_by_id(long int code);
-
-/* to debug */
-XBT_PUBLIC(void) xbt_datadesc_type_dump(const xbt_datadesc_type_t ddt);
-XBT_PUBLIC(const char *) xbt_datadesc_arch_name(int code);
-
-/* compare two data type description */
-XBT_PUBLIC(int)
-xbt_datadesc_type_cmp(const xbt_datadesc_type_t d1,
-                       const xbt_datadesc_type_t d2);
-
-/* Access function */
-XBT_PUBLIC(int) xbt_datadesc_size(xbt_datadesc_type_t type);
-/* Described data exchanges: direct use */
-XBT_PUBLIC(int) xbt_datadesc_memcpy(xbt_datadesc_type_t type, void *src,
-                                     void *dst);
-XBT_PUBLIC(void) xbt_datadesc_send(xbt_socket_t sock,
-                                    xbt_datadesc_type_t type, void *src);
-XBT_PUBLIC(void) xbt_datadesc_recv(xbt_socket_t sock,
-                                    xbt_datadesc_type_t type, int r_arch,
-                                    void *dst);
-
-/* Described data exchanges: IDL compilation FIXME: not implemented*/
-void xbt_datadesc_gen_cpy(xbt_datadesc_type_t type, void *src,
-                           void **dst);
-void xbt_datadesc_gen_send(xbt_socket_t sock,
-                            xbt_datadesc_type_t type, void *src);
-void xbt_datadesc_gen_recv(xbt_socket_t sock,
-                            xbt_datadesc_type_t type, int r_arch,
-                            void *dst);
-
-#endif                          /* XBT_DATADESC_INTERFACE_H */
diff --git a/src/xbt/datadesc/datadesc_private.h b/src/xbt/datadesc/datadesc_private.h
deleted file mode 100644 (file)
index 1faf92e..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/* datadesc - describing the data to exchange                               */
-
-/* module's private interface masked even to other parts of XBT.           */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef XBT_DATADESC_PRIVATE_H
-#define XBT_DATADESC_PRIVATE_H
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/dynar.h"
-#include "xbt/dict.h"
-#include "xbt/set.h"
-
-#include "gras_config.h"        /* XBT_THISARCH */
-#include "xbt_modinter.h"       /* module init/exit */
-#include "datadesc_interface.h" /* semi-public API */
-
-/**
- * ddt_aligned:
- *
- * Align the data v on the boundary a.
- */
-#define ddt_aligned(v, a) (((v) + (a - 1)) & ~(a - 1))
-
-/*@null@*/ extern xbt_set_t xbt_datadesc_set_local;
-void xbt_ddt_freev(void *ddt);
-/*******************************************
- * Descriptions of all known architectures *
- *******************************************/
-
-#define xbt_arch_count 12
-typedef enum {
-  xbt_ddt_scalar_char = 0,
-  xbt_ddt_scalar_short = 1,
-  xbt_ddt_scalar_int = 2,
-  xbt_ddt_scalar_long = 3,
-  xbt_ddt_scalar_long_long = 4,
-
-  xbt_ddt_scalar_pdata = 5,
-  xbt_ddt_scalar_pfunc = 6,
-
-  xbt_ddt_scalar_float = 7,
-  xbt_ddt_scalar_double = 8
-} xbt_ddt_scalar_type_t;
-
-typedef struct {
-  const char *name;
-
-  int endian;
-
-  int sizeofs[9];               /* char,short,int,long,long_long,pdata,pfunc,float,double */
-  int boundaries[9];            /* idem */
-} xbt_arch_desc_t;
-
-extern const xbt_arch_desc_t xbt_arches[xbt_arch_count];
-extern const char *xbt_datadesc_cat_names[9];
-
-/**********************************************************/
-/* Actual definitions of the stuff in the type descriptor */
-/**********************************************************/
-
-/**
- * e_xbt_datadesc_type_category:
- *
- * Defines all possible type categories.
- */
-typedef enum e_xbt_datadesc_type_category {
-
-  /* if you edit this, also fix xbt_datadesc_cat_names in ddt_exchange.c */
-
-  e_xbt_datadesc_type_cat_undefined = 0,
-
-  e_xbt_datadesc_type_cat_scalar = 1,
-  e_xbt_datadesc_type_cat_struct = 2,
-  e_xbt_datadesc_type_cat_union = 3,
-  e_xbt_datadesc_type_cat_ref = 4,     /* ref to an uniq element */
-  e_xbt_datadesc_type_cat_array = 5,
-
-  e_xbt_datadesc_type_cat_invalid = 6
-} xbt_datadesc_type_category_t;
-
-/*------------------------------------------------*/
-/* definitions of specific data for each category */
-/*------------------------------------------------*/
-/**
- * s_xbt_dd_cat_field:
- *
- * Fields of struct and union
- */
-typedef struct s_xbt_dd_cat_field {
-
-  char *name;
-  long int offset[xbt_arch_count];
-  xbt_datadesc_type_t type;
-
-  xbt_datadesc_type_cb_void_t send;
-  xbt_datadesc_type_cb_void_t recv;
-
-} s_xbt_dd_cat_field_t, *xbt_dd_cat_field_t;
-
-void xbt_dd_cat_field_free(void *f);
-
-/**
- * xbt_dd_cat_scalar_t:
- *
- * Specific fields of a scalar
- */
-enum e_xbt_dd_scalar_encoding {
-  e_xbt_dd_scalar_encoding_undefined = 0,
-
-  e_xbt_dd_scalar_encoding_uint,
-  e_xbt_dd_scalar_encoding_sint,
-  e_xbt_dd_scalar_encoding_float,
-
-  e_xbt_dd_scalar_encoding_invalid
-};
-typedef struct s_xbt_dd_cat_scalar {
-  enum e_xbt_dd_scalar_encoding encoding;
-  xbt_ddt_scalar_type_t type;  /* to check easily that redefinition matches */
-} xbt_dd_cat_scalar_t;
-
-/**
- * xbt_dd_cat_struct_t:
- *
- * Specific fields of a struct
- */
-typedef struct s_xbt_dd_cat_struct {
-  xbt_dynar_t fields;           /* elm type = xbt_dd_cat_field_t */
-  int closed;                   /* xbt_datadesc_declare_struct_close() was called */
-} xbt_dd_cat_struct_t;
-
-/**
- * xbt_dd_cat_union_t:
- *
- * Specific fields of a union
- */
-typedef struct s_xbt_dd_cat_union {
-  xbt_datadesc_type_cb_int_t selector;
-  xbt_dynar_t fields;           /* elm type = xbt_dd_cat_field_t */
-  int closed;                   /* xbt_datadesc_declare_union_close() was called */
-} xbt_dd_cat_union_t;
-
-/**
- * xbt_dd_cat_ref_t:
- *
- * Specific fields of a reference
- */
-typedef struct s_xbt_dd_cat_ref {
-  xbt_datadesc_type_t type;
-
-  /* callback used to return the referenced type number  */
-  xbt_datadesc_selector_t selector;
-} xbt_dd_cat_ref_t;
-
-
-/**
- * xbt_dd_cat_array_t:
- *
- * Specific fields of an array
- */
-typedef struct s_xbt_dd_cat_array {
-  xbt_datadesc_type_t type;
-
-  /* element_count == -1 means dynamically defined */
-  long int fixed_size;
-
-  /* callback used to return the dynamic length */
-  xbt_datadesc_type_cb_int_t dynamic_size;
-
-} xbt_dd_cat_array_t;
-
-/**
- * u_xbt_datadesc_category:
- *
- * Specific data to each possible category
- */
-union u_xbt_datadesc_category {
-  void *undefined_data;
-  xbt_dd_cat_scalar_t scalar_data;
-  xbt_dd_cat_struct_t struct_data;
-  xbt_dd_cat_union_t union_data;
-  xbt_dd_cat_ref_t ref_data;
-  xbt_dd_cat_array_t array_data;
-};
-
-/****************************************/
-/* The holy grail: type descriptor type */
-/****************************************/
-/**
- * s_xbt_datadesc_type:
- *
- * Type descriptor.
- */
-typedef struct s_xbt_datadesc_type {
-  /* headers for the data set */
-  int code;
-  char *name;
-  unsigned int name_len;
-
-  /* payload */
-  long int size[xbt_arch_count];       /* Cannot be unsigned: -1 means dynamic */
-
-  unsigned long int alignment[xbt_arch_count];
-  unsigned long int aligned_size[xbt_arch_count];
-
-  enum e_xbt_datadesc_type_category category_code;
-  union u_xbt_datadesc_category category;
-
-  xbt_datadesc_type_cb_void_t send;
-  xbt_datadesc_type_cb_void_t recv;
-
-  /* flags */
-  unsigned cycle:1;
-
-  /* random value for users (like default value or whatever) */
-  char extra[SIZEOF_MAX];
-
-} s_xbt_datadesc_type_t;
-
-/***************************
- * constructor/desctructor *
- ***************************/
-void xbt_datadesc_free(xbt_datadesc_type_t * type);
-
-xbt_datadesc_type_t
-xbt_datadesc_scalar(const char *name,
-                     xbt_ddt_scalar_type_t type,
-                     enum e_xbt_dd_scalar_encoding encoding);
-
-/****************************************************
- * Callback persistent state constructor/destructor *
- ****************************************************/
-xbt_cbps_t xbt_cbps_new(void);
-void xbt_cbps_free(xbt_cbps_t * state);
-void xbt_cbps_reset(xbt_cbps_t state);
-
-/***************
- * Convertions *
- ***************/
-void
-xbt_dd_convert_elm(xbt_datadesc_type_t type, int count,
-                    int r_arch, void *src, void *dst);
-
-/********************************************************************
- * Dictionnary containing the constant values for the parsing macro *
- ********************************************************************/
-extern xbt_dict_t xbt_dd_constants;    /* lives in ddt_parse.c of course */
-
-#endif                          /* XBT_DATADESC_PRIVATE_H */
diff --git a/src/xbt/datadesc/ddt_convert.c b/src/xbt/datadesc/ddt_convert.c
deleted file mode 100644 (file)
index 2c6758c..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-/* ddt_remote - Stuff needed to get datadescs about remote hosts            */
-
-/* Copyright (c) 2004, 2005, 2006, 2009, 2010. 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. */
-
-/************************************************************************/
-/* C combines the power of assembler with the portability of assembler. */
-/************************************************************************/
-
-#include "datadesc_private.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_convert, xbt_ddt,
-                                "Inter-architecture convertions");
-
-/***
- *** Table of all known architectures:
- ***
-l_C:1/1:_I:2/1:4/1:4/1:8/1:_P:4/1:4/1:_D:4/1:8/1: #xbt_arch=0;  xbt_size=32; xbt_arch_name=little32_1;
-l_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2: #xbt_arch=1;  xbt_size=32; xbt_arch_name=little32_2;
-l_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4: #xbt_arch=2;  xbt_size=32; xbt_arch_name=little32_4;
-l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8: #xbt_arch=3;  xbt_size=32; xbt_arch_name=little32_8;
-l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8: #xbt_arch=4;  xbt_size=64; xbt_arch_name=little64;
-l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:8/8:8/8:_D:4/4:8/8: #xbt_arch=5;  xbt_size=64; xbt_arch_name=little64_2;
-
-B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8: #xbt_arch=6;  xbt_size=32; xbt_arch_name=big32_8;
-B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4: #xbt_arch=7;  xbt_size=32; xbt_arch_name=big32_8_4;
-B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4: #xbt_arch=8;  xbt_size=32; xbt_arch_name=big32_4;
-B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2: #xbt_arch=9;  xbt_size=32; xbt_arch_name=big32_2;
-B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8: #xbt_arch=10; xbt_size=64; xbt_arch_name=big64;
-B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4: #xbt_arch=11; xbt_size=64; xbt_arch_name=big64_8_4;
-
-  PLEASE DO NOT MESS WITH THESE HARDCODED VALUES
-  
-  
-  Grep GRAS_THISARCH in buildtools/Cmake/CompleteInFiles.cmake for details
-  
- ***/
-
-const xbt_arch_desc_t xbt_arches[xbt_arch_count] = {
-
-  {"little32_1", 0, {1, 2, 4, 4, 8, 4, 4, 4, 8},        /* little endian, 1 byte alignement (win32) */
-   {1, 1, 1, 1, 1, 1, 1, 1, 1}},
-
-  {"little32_2", 0, {1, 2, 4, 4, 8, 4, 4, 4, 8},        /* little endian, 2 bytes alignements (win32) */
-   {1, 2, 2, 2, 2, 2, 2, 2, 2}},
-
-  {"little32_4", 0, {1, 2, 4, 4, 8, 4, 4, 4, 8},        /* little endian, 4 bytes alignements (win32 and linux x86) */
-   {1, 2, 4, 4, 4, 4, 4, 4, 4}},
-
-  {"little32_8", 0, {1, 2, 4, 4, 8, 4, 4, 4, 8},        /* little endian, 8 bytes alignement (win32) */
-   {1, 2, 4, 4, 8, 4, 4, 4, 8}},
-
-  {"little64", 0, {1, 2, 4, 8, 8, 8, 8, 4, 8},  /* alpha, ia64 */
-   {1, 2, 4, 8, 8, 8, 8, 4, 8}},
-
-  {"little64_2", 0, {1, 2, 4, 4, 8, 8, 8, 4, 8},  /* win64 */
-   {1, 2, 4, 4, 8, 8, 8, 4, 8}},
-
-  {"big32_8", 1, {1, 2, 4, 4, 8, 4, 4, 4, 8},
-   {1, 2, 4, 4, 8, 4, 4, 4, 8}},
-
-  {"big32_8_4", 1, {1, 2, 4, 4, 8, 4, 4, 4, 8}, /* AIX */
-   {1, 2, 4, 4, 8, 4, 4, 4, 4}},
-
-  {"big32_4", 1, {1, 2, 4, 4, 8, 4, 4, 4, 8},   /* G5 */
-   {1, 2, 4, 4, 4, 4, 4, 4, 4}},
-
-  {"big32_2", 1, {1, 2, 4, 4, 8, 4, 4, 4, 8},   /* ARM */
-   {1, 2, 2, 2, 2, 2, 2, 2, 2}},
-
-  {"big64", 1, {1, 2, 4, 8, 8, 8, 8, 4, 8},     /* sparc */
-   {1, 2, 4, 8, 8, 8, 8, 4, 8}},
-
-  {"big64_8_4", 1, {1, 2, 4, 8, 8, 8, 8, 4, 8}, /* aix with -maix64 */
-   {1, 2, 4, 8, 8, 8, 8, 4, 4}}
-};
-
-const char *xbt_datadesc_arch_name(int code)
-{
-  if (code < 0 || code >= xbt_arch_count)
-    return "[unknown arch]";
-  return xbt_arches[code].name;
-}
-
-
-/**
- * Local function doing the grunt work
- */
-static void xbt_dd_reverse_bytes(void *to, const void *from,
-                                  size_t length);
-
-/**
- * xbt_dd_convert_elm:
- *
- * Convert the element described by @type comming from architecture @r_arch.
- * The data to be converted is stored in @src, and is to be stored in @dst.
- * Both pointers may be the same location if no resizing is needed.
- */
-void
-xbt_dd_convert_elm(xbt_datadesc_type_t type, int count,
-                    int r_arch, void *src, void *dst)
-{
-  xbt_dd_cat_scalar_t scal = type->category.scalar_data;
-  int cpt;
-  const void *r_data;
-  void *l_data;
-  unsigned long r_size, l_size;
-  /* Hexadecimal displayer
-     union {
-     char c[sizeof(int)];
-     int i;
-     } tester;
-   */
-
-  xbt_assert(type->category_code == e_xbt_datadesc_type_cat_scalar);
-  xbt_assert(r_arch != GRAS_THISARCH);
-
-  r_size = type->size[r_arch];
-  l_size = type->size[GRAS_THISARCH];
-  XBT_DEBUG("r_size=%lu l_size=%lu,    src=%p dst=%p", r_size, l_size, src,
-         dst);
-
-  XBT_DEBUG("remote=%c local=%c", xbt_arches[r_arch].endian ? 'B' : 'l',
-         xbt_arches[GRAS_THISARCH].endian ? 'B' : 'l');
-
-  if (r_size != l_size) {
-    for (cpt = 0, r_data = src, l_data = dst;
-         cpt < count;
-         cpt++,
-         r_data = (char *) r_data + r_size,
-         l_data = (char *) l_data + l_size) {
-
-      /*
-         fprintf(stderr,"r_data=");
-         for (cpt=0; cpt<r_size; cpt++) {
-         tester.i=0;
-         tester.c[0]= ((char*)r_data)[cpt];
-         fprintf(stderr,"\\%02x", tester.i);
-         }
-         fprintf(stderr,"\n");
-       */
-
-      /* Resize that damn integer, pal */
-
-      unsigned char *l_sign, *r_sign;
-      int padding;
-      int sizeChange = l_size - r_size;
-      int lowOrderFirst = !xbt_arches[r_arch].endian ||
-          xbt_arches[r_arch].endian == xbt_arches[GRAS_THISARCH].endian;
-
-      XBT_DEBUG("Resize integer %d from %lu @%p to %lu @%p",
-             cpt, r_size, r_data, l_size, l_data);
-      xbt_assert(r_data != l_data, "Impossible to resize in place");
-
-      if (sizeChange < 0) {
-        XBT_DEBUG("Truncate %d bytes (%s,%s)", -sizeChange,
-               lowOrderFirst ? "lowOrderFirst" : "bigOrderFirst",
-               scal.encoding ==
-               e_xbt_dd_scalar_encoding_sint ? "signed" : "unsigned");
-        /* Truncate high-order bytes. */
-        memcpy(l_data,
-               xbt_arches[r_arch].endian ? ((char *) r_data - sizeChange)
-               : r_data, l_size);
-
-        if (scal.encoding == e_xbt_dd_scalar_encoding_sint) {
-          XBT_DEBUG("This is signed");
-          /* Make sure the high order bit of r_data and l_data are the same */
-          l_sign = xbt_arches[GRAS_THISARCH].endian
-              ? ((unsigned char *) l_data + l_size - 1)
-              : (unsigned char *) l_data;
-          r_sign = xbt_arches[r_arch].endian
-              ? ((unsigned char *) r_data + r_size - 1)
-              : (unsigned char *) r_data;
-          XBT_DEBUG("This is signed (r_sign=%c l_sign=%c", *r_sign, *l_sign);
-
-          if ((*r_sign > 127) != (*l_sign > 127)) {
-            if (*r_sign > 127)
-              *l_sign += 128;
-            else
-              *l_sign -= 128;
-          }
-        }
-      } else {
-        XBT_DEBUG("Extend %d bytes", sizeChange);
-        if (scal.encoding != e_xbt_dd_scalar_encoding_sint) {
-          XBT_DEBUG("This is signed");
-          padding = 0;          /* pad unsigned with 0 */
-        } else {
-          /* extend sign */
-          r_sign =
-              xbt_arches[r_arch].endian ? ((unsigned char *) r_data +
-                                            r_size - 1)
-              : (unsigned char *) r_data;
-          padding = (*r_sign > 127) ? 0xff : 0;
-        }
-
-        if (l_size != 0) {
-          memset(l_data, padding, l_size);
-        }
-        memcpy(!xbt_arches[r_arch].endian ? l_data
-               : ((char *) l_data + sizeChange), r_data, r_size);
-
-        /*
-           fprintf(stderr,"r_data=");
-           for (cpt=0; cpt<r_size; cpt++) {
-           tester.i=0;
-           tester.c[0] = ((char*)r_data)[cpt];
-           fprintf(stderr,"\\%02x", tester.i);
-           }
-           fprintf(stderr,"\n");
-
-           fprintf(stderr,"l_data=");
-           for (cpt=0; cpt<l_size; cpt++) {
-           tester.i=0;
-           tester.c[0]= ((char*)l_data)[cpt];
-           fprintf(stderr,"\\%02x", tester.i);
-           } fprintf(stderr,"\n");
-         */
-      }
-    }
-  }
-
-  /* flip bytes if needed */
-  if (xbt_arches[r_arch].endian != xbt_arches[GRAS_THISARCH].endian &&
-      (l_size * count) > 1) {
-
-    for (cpt = 0, r_data = dst, l_data = dst; cpt < count; cpt++, r_data = (char *) r_data + l_size,    /* resizing already done */
-         l_data = (char *) l_data + l_size) {
-
-      XBT_DEBUG("Flip elm %d", cpt);
-      xbt_dd_reverse_bytes(l_data, r_data, l_size);
-    }
-  }
-
-}
-
-static void xbt_dd_reverse_bytes(void *to, const void *from,
-                                  size_t length)
-{
-
-  char charBegin;
-  const char *fromBegin;
-  const char *fromEnd;
-  char *toBegin;
-  char *toEnd;
-
-  for (fromBegin = (const char *) from,
-       fromEnd = fromBegin + length - 1,
-       toBegin = (char *) to,
-       toEnd = toBegin + length - 1;
-       fromBegin <= fromEnd; fromBegin++, fromEnd--, toBegin++, toEnd--) {
-
-    charBegin = *fromBegin;
-    *toBegin = *fromEnd;
-    *toEnd = charBegin;
-  }
-}
-
-
-/**
- * xbt_arch_selfid:
- *
- * returns the ID of the architecture the process is running on
- */
-int xbt_arch_selfid(void)
-{
-  return GRAS_THISARCH;
-}
diff --git a/src/xbt/datadesc/ddt_create.c b/src/xbt/datadesc/ddt_create.c
deleted file mode 100644 (file)
index e1cf03b..0000000
+++ /dev/null
@@ -1,1140 +0,0 @@
-/* ddt_new - creation/deletion of datatypes structs (private to this module)*/
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/misc.h"           /* min()/max() */
-#include "xbt/ex.h"
-#include "datadesc_private.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_create, xbt_ddt,
-                                "Creating new data descriptions");
-
-/*** prototypes ***/
-static xbt_dd_cat_field_t
-xbt_dd_find_field(xbt_datadesc_type_t type, const char *field_name);
-/**
- * xbt_ddt_freev:
- *
- * gime that memory back, dude. I mean it.
- */
-void xbt_ddt_freev(void *ddt)
-{
-  xbt_datadesc_type_t type = (xbt_datadesc_type_t) ddt;
-
-  if (type) {
-    xbt_datadesc_free(&type);
-  }
-}
-
-static xbt_datadesc_type_t xbt_ddt_new(const char *name)
-{
-  xbt_datadesc_type_t res;
-
-  XBT_IN("(%s)", name);
-  res = xbt_new0(s_xbt_datadesc_type_t, 1);
-
-  res->name = (char *) strdup(name);
-  res->name_len = strlen(name);
-  res->cycle = 0;
-
-  xbt_set_add(xbt_datadesc_set_local, (xbt_set_elm_t) res,
-              xbt_ddt_freev);
-  XBT_OUT();
-  return res;
-}
-
-/** @brief retrieve an existing message type from its name (or NULL if it does not exist). */
-xbt_datadesc_type_t xbt_datadesc_by_name_or_null(const char *name)
-{
-  xbt_ex_t e;
-  xbt_datadesc_type_t res = NULL;
-
-  TRY {
-    res = xbt_datadesc_by_name(name);
-  }
-  CATCH(e) {
-    res = NULL;
-    xbt_ex_free(e);
-  }
-  return res;
-}
-
-/**
- * Search the given datadesc (or raises an exception if it can't be found)
- */
-xbt_datadesc_type_t xbt_datadesc_by_name(const char *name)
-{
-  xbt_ex_t e;
-  xbt_datadesc_type_t res = NULL;
-  volatile int found = 0;
-  TRY {
-    res =
-        (xbt_datadesc_type_t) xbt_set_get_by_name(xbt_datadesc_set_local,
-                                                   name);
-    found = 1;
-  }
-  CATCH(e) {
-    if (e.category != not_found_error)
-      RETHROW;
-    xbt_ex_free(e);
-  }
-  if (!found)
-    THROWF(not_found_error, 0, "No registred datatype of that name: %s",
-           name);
-
-  return res;
-}
-
-/**
- * Retrieve a type from its code (or NULL if not found)
- */
-xbt_datadesc_type_t xbt_datadesc_by_id(long int code)
-{
-  xbt_ex_t e;
-  xbt_datadesc_type_t res = NULL;
-  TRY {
-    res =
-        (xbt_datadesc_type_t) xbt_set_get_by_id(xbt_datadesc_set_local,
-                                                 code);
-  }
-  CATCH(e) {
-    if (e.category != not_found_error)
-      RETHROW;
-    xbt_ex_free(e);
-    res = NULL;
-  }
-  return res;
-}
-
-/**
- * Create a new scalar and give a pointer to it
- */
-xbt_datadesc_type_t
-xbt_datadesc_scalar(const char *name,
-                     xbt_ddt_scalar_type_t type,
-                     enum e_xbt_dd_scalar_encoding encoding)
-{
-
-  xbt_datadesc_type_t res;
-  long int arch;
-
-  XBT_IN();
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_scalar,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.scalar_data.encoding == encoding,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.scalar_data.type == type,
-                "Redefinition of type %s does not match", name);
-    XBT_VERB("Discarding redefinition of %s", name);
-    return res;
-  }
-  res = xbt_ddt_new(name);
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = xbt_arches[arch].sizeofs[type];
-    res->alignment[arch] = xbt_arches[arch].boundaries[type];
-    res->aligned_size[arch] =
-        ddt_aligned(res->size[arch], res->alignment[arch]);
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_scalar;
-  res->category.scalar_data.encoding = encoding;
-  res->category.scalar_data.type = type;
-  XBT_OUT();
-
-  return res;
-}
-
-
-/** Frees one struct or union field */
-void xbt_dd_cat_field_free(void *f)
-{
-  xbt_dd_cat_field_t field = *(xbt_dd_cat_field_t *) f;
-  XBT_IN();
-  if (field) {
-    free(field->name);
-    free(field);
-  }
-  XBT_OUT();
-}
-
-/** \brief Declare a new structure description */
-xbt_datadesc_type_t xbt_datadesc_struct(const char *name)
-{
-
-  xbt_datadesc_type_t res;
-  long int arch;
-
-  XBT_IN("(%s)", name);
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    /* FIXME: Check that field redefinition matches */
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_struct,
-                "Redefinition of type %s does not match", name);
-    XBT_DEBUG("Discarding redefinition of %s", name);
-    return res;
-  }
-  res = xbt_ddt_new(name);
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = 0;
-    res->alignment[arch] = 0;
-    res->aligned_size[arch] = 0;
-  }
-  res->category_code = e_xbt_datadesc_type_cat_struct;
-  res->category.struct_data.fields =
-      xbt_dynar_new(sizeof(xbt_dd_cat_field_t), xbt_dd_cat_field_free);
-
-  XBT_OUT();
-  return res;
-}
-
-/** \brief Append a new field to a structure description */
-void
-xbt_datadesc_struct_append(xbt_datadesc_type_t struct_type,
-                            const char *name,
-                            xbt_datadesc_type_t field_type)
-{
-
-  xbt_dd_cat_field_t field;
-  int arch;
-
-  xbt_assert(field_type,
-              "Cannot add the field '%s' into struct '%s': its type is NULL",
-              name, struct_type->name);
-  XBT_IN("(%s %s.%s;)", field_type->name, struct_type->name, name);
-  if (struct_type->category.struct_data.closed) {
-    XBT_DEBUG
-        ("Ignoring request to add field to struct %s (closed. Redefinition?)",
-         struct_type->name);
-    return;
-  }
-
-  xbt_assert(field_type->size[GRAS_THISARCH] >= 0,
-              "Cannot add a dynamically sized field in structure %s",
-              struct_type->name);
-
-  field = xbt_new(s_xbt_dd_cat_field_t, 1);
-  field->name = (char *) strdup(name);
-
-  XBT_DEBUG("----------------");
-  XBT_DEBUG("PRE s={size=%ld,align=%lu,asize=%lu}",
-         struct_type->size[GRAS_THISARCH],
-         struct_type->alignment[GRAS_THISARCH],
-         struct_type->aligned_size[GRAS_THISARCH]);
-
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    field->offset[arch] = ddt_aligned(struct_type->size[arch],
-                                      field_type->alignment[arch]);
-
-    struct_type->size[arch] = field->offset[arch] + field_type->size[arch];
-    struct_type->alignment[arch] = max(struct_type->alignment[arch],
-                                       field_type->alignment[arch]);
-    struct_type->aligned_size[arch] = ddt_aligned(struct_type->size[arch],
-                                                  struct_type->alignment
-                                                  [arch]);
-  }
-  field->type = field_type;
-  field->send = NULL;
-  field->recv = NULL;
-
-  xbt_dynar_push(struct_type->category.struct_data.fields, &field);
-
-  XBT_DEBUG("Push a %s into %s at offset %ld.",
-         field_type->name, struct_type->name,
-         field->offset[GRAS_THISARCH]);
-  XBT_DEBUG("  f={size=%ld,align=%lu,asize=%lu}",
-         field_type->size[GRAS_THISARCH],
-         field_type->alignment[GRAS_THISARCH],
-         field_type->aligned_size[GRAS_THISARCH]);
-  XBT_DEBUG("  s={size=%ld,align=%lu,asize=%lu}",
-         struct_type->size[GRAS_THISARCH],
-         struct_type->alignment[GRAS_THISARCH],
-         struct_type->aligned_size[GRAS_THISARCH]);
-  XBT_OUT();
-}
-
-/** \brief Close a structure description
- *
- * No new field can be added afterward, and it is mandatory to close the structure before using it.
- */
-void xbt_datadesc_struct_close(xbt_datadesc_type_t struct_type)
-{
-  int arch;
-  XBT_IN();
-  struct_type->category.struct_data.closed = 1;
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    struct_type->size[arch] = struct_type->aligned_size[arch];
-  }
-  XBT_DEBUG("structure %s closed. size=%ld,align=%lu,asize=%lu",
-         struct_type->name,
-         struct_type->size[GRAS_THISARCH],
-         struct_type->alignment[GRAS_THISARCH],
-         struct_type->aligned_size[GRAS_THISARCH]);
-}
-
-/**
- * xbt_datadesc_cycle_set:
- *
- * Tell XBT that the pointers of the type described by ddt may present
- * some loop, and that the cycle detection mechanism is needed.
- *
- * Note that setting this option when not needed have a rather bad effect
- * on the performance (several times slower on big data).
- */
-void xbt_datadesc_cycle_set(xbt_datadesc_type_t ddt)
-{
-  ddt->cycle = 1;
-}
-
-/**
- * xbt_datadesc_cycle_unset:
- *
- * Tell XBT that the pointers of the type described by ddt do not present
- * any loop and that cycle detection mechanism are not needed.
- * (default)
- */
-void xbt_datadesc_cycle_unset(xbt_datadesc_type_t ddt)
-{
-  ddt->cycle = 0;
-}
-
-/** \brief Declare a new union description */
-xbt_datadesc_type_t
-xbt_datadesc_union(const char *name, xbt_datadesc_type_cb_int_t selector)
-{
-
-  xbt_datadesc_type_t res;
-  int arch;
-
-  XBT_IN("(%s)", name);
-  xbt_assert(selector,
-              "Attempt to creat an union without field_count function");
-
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    /* FIXME: Check that field redefinition matches */
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_union,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.union_data.selector == selector,
-                "Redefinition of type %s does not match", name);
-    XBT_VERB("Discarding redefinition of %s", name);
-    return res;
-  }
-
-  res = xbt_ddt_new(name);
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = 0;
-    res->alignment[arch] = 0;
-    res->aligned_size[arch] = 0;
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_union;
-  res->category.union_data.fields =
-      xbt_dynar_new(sizeof(xbt_dd_cat_field_t *), xbt_dd_cat_field_free);
-  res->category.union_data.selector = selector;
-
-  return res;
-}
-
-/** \brief Append a new field to an union description */
-void xbt_datadesc_union_append(xbt_datadesc_type_t union_type,
-                                const char *name,
-                                xbt_datadesc_type_t field_type)
-{
-
-  xbt_dd_cat_field_t field;
-  int arch;
-
-  XBT_IN("(%s %s.%s;)", field_type->name, union_type->name, name);
-  xbt_assert(field_type->size[GRAS_THISARCH] >= 0,
-              "Cannot add a dynamically sized field in union %s",
-              union_type->name);
-
-  if (union_type->category.union_data.closed) {
-    XBT_VERB("Ignoring request to add field to union %s (closed)",
-          union_type->name);
-    return;
-  }
-
-  field = xbt_new0(s_xbt_dd_cat_field_t, 1);
-
-  field->name = (char *) strdup(name);
-  field->type = field_type;
-  /* All offset are left to 0 in an union */
-
-  xbt_dynar_push(union_type->category.union_data.fields, &field);
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    union_type->size[arch] = max(union_type->size[arch],
-                                 field_type->size[arch]);
-    union_type->alignment[arch] = max(union_type->alignment[arch],
-                                      field_type->alignment[arch]);
-    union_type->aligned_size[arch] = ddt_aligned(union_type->size[arch],
-                                                 union_type->alignment
-                                                 [arch]);
-  }
-}
-
-
-/** \brief Close an union description
- *
- * No new field can be added afterward, and it is mandatory to close the union before using it.
- */
-void xbt_datadesc_union_close(xbt_datadesc_type_t union_type)
-{
-  union_type->category.union_data.closed = 1;
-}
-
-/** \brief Copy a type under another name
- *
- * This may reveal useful to circumvent parsing macro limitations
- */
-xbt_datadesc_type_t
-xbt_datadesc_copy(const char *name, xbt_datadesc_type_t copied)
-{
-
-  xbt_datadesc_type_t res = xbt_ddt_new(name);
-  char *name_cpy = res->name;
-
-  memcpy(res, copied, sizeof(s_xbt_datadesc_type_t));
-  res->name = name_cpy;
-  return res;
-}
-
-/** \brief Declare a new type being a reference to the one passed in arg */
-xbt_datadesc_type_t
-xbt_datadesc_ref(const char *name, xbt_datadesc_type_t referenced_type)
-{
-
-  xbt_datadesc_type_t res;
-  xbt_datadesc_type_t pointer_type =
-      xbt_datadesc_by_name("data pointer");
-  int arch;
-
-  XBT_IN("(%s)", name);
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_ref,
-                "Redefinition of %s does not match", name);
-    xbt_assert(res->category.ref_data.type == referenced_type,
-                "Redefinition of %s does not match", name);
-    xbt_assert(res->category.ref_data.selector == NULL,
-                "Redefinition of %s does not match", name);
-    XBT_DEBUG("Discarding redefinition of %s", name);
-    return res;
-  }
-
-  res = xbt_ddt_new(name);
-
-  xbt_assert(pointer_type, "Cannot get the description of data pointer");
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = pointer_type->size[arch];
-    res->alignment[arch] = pointer_type->alignment[arch];
-    res->aligned_size[arch] = pointer_type->aligned_size[arch];
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_ref;
-  res->category.ref_data.type = referenced_type;
-  res->category.ref_data.selector = NULL;
-
-  return res;
-}
-
-/** \brief Declare a new type being a generic reference.
- *
- * The callback passed in argument is to be used to select which type is currently used.
- * So, when XBT wants to send a generic reference, it passes the current data to the selector
- * callback and expects it to return the type description to use.
- */
-xbt_datadesc_type_t
-xbt_datadesc_ref_generic(const char *name,
-                          xbt_datadesc_selector_t selector)
-{
-
-  xbt_datadesc_type_t res;
-  xbt_datadesc_type_t pointer_type =
-      xbt_datadesc_by_name("data pointer");
-  int arch;
-
-  XBT_IN("(%s)", name);
-  res = xbt_datadesc_by_name_or_null(name);
-
-  if (res) {
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_ref,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.ref_data.type == NULL,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.ref_data.selector == selector,
-                "Redefinition of type %s does not match", name);
-    XBT_VERB("Discarding redefinition of %s", name);
-    return res;
-  }
-  res = xbt_ddt_new(name);
-
-  xbt_assert(pointer_type, "Cannot get the description of data pointer");
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = pointer_type->size[arch];
-    res->alignment[arch] = pointer_type->alignment[arch];
-    res->aligned_size[arch] = pointer_type->aligned_size[arch];
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_ref;
-
-  res->category.ref_data.type = NULL;
-  res->category.ref_data.selector = selector;
-
-  return res;
-}
-
-/** \brief Declare a new type being an array of fixed size and content */
-xbt_datadesc_type_t
-xbt_datadesc_array_fixed(const char *name,
-                          xbt_datadesc_type_t element_type,
-                          long int fixed_size)
-{
-
-  xbt_datadesc_type_t res;
-  int arch;
-
-  XBT_IN("(%s)", name);
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_array,
-                "Redefinition of type %s does not match", name);
-
-    if (res->category.array_data.type != element_type) {
-      XBT_ERROR
-          ("Redefinition of type %s does not match: array elements differ",
-           name);
-      xbt_datadesc_type_dump(res->category.array_data.type);
-      xbt_datadesc_type_dump(element_type);
-    }
-
-    xbt_assert(res->category.array_data.fixed_size == fixed_size,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.array_data.dynamic_size == NULL,
-                "Redefinition of type %s does not match", name);
-    XBT_VERB("Discarding redefinition of %s", name);
-
-    return res;
-  }
-  res = xbt_ddt_new(name);
-
-  xbt_assert(fixed_size >= 0, "'%s' is a array of negative fixed size",
-              name);
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = fixed_size * element_type->aligned_size[arch];
-    res->alignment[arch] = element_type->alignment[arch];
-    res->aligned_size[arch] = res->size[arch];
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_array;
-
-  res->category.array_data.type = element_type;
-  res->category.array_data.fixed_size = fixed_size;
-  res->category.array_data.dynamic_size = NULL;
-
-  return res;
-}
-
-/** \brief Declare a new type being an array of fixed size, but accepting several content types. */
-xbt_datadesc_type_t xbt_datadesc_array_dyn(const char *name,
-                                             xbt_datadesc_type_t
-                                             element_type,
-                                             xbt_datadesc_type_cb_int_t
-                                             dynamic_size)
-{
-
-  xbt_datadesc_type_t res;
-  int arch;
-
-  XBT_IN("(%s)", name);
-  xbt_assert(dynamic_size,
-              "'%s' is a dynamic array without size discriminant", name);
-
-  res = xbt_datadesc_by_name_or_null(name);
-  if (res) {
-    xbt_assert(res->category_code == e_xbt_datadesc_type_cat_array,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.array_data.type == element_type,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.array_data.fixed_size == -1,
-                "Redefinition of type %s does not match", name);
-    xbt_assert(res->category.array_data.dynamic_size == dynamic_size,
-                "Redefinition of type %s does not match", name);
-    XBT_VERB("Discarding redefinition of %s", name);
-
-    return res;
-  }
-
-  res = xbt_ddt_new(name);
-
-  for (arch = 0; arch < xbt_arch_count; arch++) {
-    res->size[arch] = 0;        /* make sure it indicates "dynamic" */
-    res->alignment[arch] = element_type->alignment[arch];
-    res->aligned_size[arch] = 0;        /*FIXME: That was so in GS, but looks stupid */
-  }
-
-  res->category_code = e_xbt_datadesc_type_cat_array;
-
-  res->category.array_data.type = element_type;
-  res->category.array_data.fixed_size = -1;
-  res->category.array_data.dynamic_size = dynamic_size;
-
-  return res;
-}
-
-/** \brief Declare a new type being an array which size can be found with \ref xbt_cbps_i_pop
- *
- * Most of the time, you want to include a reference in your structure which
- * is a pointer to a dynamic array whose size is fixed by another field of
- * your structure.
- *
- * This case pops up so often that this function was created to take care of
- * this case. It creates a dynamic array type whose size is poped from the
- * current cbps, and then create a reference to it.
- *
- * The name of the created datatype will be the name of the element type, with
- * '[]*' appended to it.
- *
- * Then to use it, you just have to make sure that your structure pre-callback
- * does push the size of the array in the cbps (using #xbt_cbps_i_push), and
- * you are set.
- *
- * But be remember that this is a stack. If you have two different pop_arr, you
- * should push the second one first, so that the first one is on the top of the
- * list when the first field gets transfered.
- *
- */
-xbt_datadesc_type_t
-xbt_datadesc_ref_pop_arr(xbt_datadesc_type_t element_type)
-{
-  int cpt = 0;
-  xbt_datadesc_type_t res, ddt2;
-  char *name = (char *) xbt_malloc(strlen(element_type->name) + 4);
-
-  sprintf(name, "%s[]", element_type->name);
-  /* Make sure we are not trying to redefine a ddt with the same name */
-  ddt2 = xbt_datadesc_by_name_or_null(name);
-
-  while (ddt2) {
-    free(name);
-    name = bprintf("%s[]_%d", element_type->name, cpt++);
-    ddt2 = xbt_datadesc_by_name_or_null(name);
-  }
-
-  res = xbt_datadesc_array_dyn(name, element_type, xbt_datadesc_cb_pop);
-
-  sprintf(name, "%s[]*", element_type->name);
-  cpt = 0;
-  ddt2 = xbt_datadesc_by_name_or_null(name);
-  while (ddt2) {
-    free(name);
-    name = bprintf("%s[]*_%d", element_type->name, cpt++);
-    ddt2 = xbt_datadesc_by_name_or_null(name);
-  }
-
-  res = xbt_datadesc_ref(name, res);
-
-  free(name);
-
-  return res;
-}
-
-/*
- *##
- *## Constructor of container datatypes
- *##
- */
-
-static void xbt_datadesc_dynar_cb(xbt_datadesc_type_t typedesc,
-                                   xbt_cbps_t vars, void *data)
-{
-  xbt_datadesc_type_t subtype;
-  xbt_dynar_t dynar = (xbt_dynar_t) data;
-
-  memcpy(&dynar->free_f, &typedesc->extra, sizeof(dynar->free_f));
-
-  /* search for the elemsize in what we have. If elements are "int", typedesc got is "int[]*" */
-  subtype = xbt_dd_find_field(typedesc, "data")->type;
-
-  /* this is now a ref to array of what we're looking for */
-  subtype = subtype->category.ref_data.type;
-  subtype = subtype->category.array_data.type;
-
-  XBT_DEBUG("subtype is %s", subtype->name);
-
-  dynar->elmsize = subtype->size[GRAS_THISARCH];
-  dynar->size = dynar->used;
-  dynar->mutex = NULL;
-}
-
-/** \brief Declare a new type being a dynar in which each elements are of the given type
- *
- *  The type gets registered under the name "dynar(%s)_s", where %s is the name of the subtype.
- *  For example, a dynar of doubles will be called "dynar(double)_s" and a dynar of dynar of
- *  strings will be called "dynar(dynar(string)_s)_s".
- *
- *  \param elm_t: the datadesc of the elements
- *  \param free_func: the function to use to free the elements when the dynar gets freed
- */
-xbt_datadesc_type_t
-xbt_datadesc_dynar(xbt_datadesc_type_t elm_t, void_f_pvoid_t free_func)
-{
-
-  char *buffname;
-  xbt_datadesc_type_t res;
-
-  buffname = bprintf("s_xbt_dynar_of_%s", elm_t->name);
-
-  res = xbt_datadesc_struct(buffname);
-
-  xbt_datadesc_struct_append(res, "size",
-                              xbt_datadesc_by_name("unsigned long int"));
-
-  xbt_datadesc_struct_append(res, "used",
-                              xbt_datadesc_by_name("unsigned long int"));
-
-  xbt_datadesc_struct_append(res, "elmsize",
-                              xbt_datadesc_by_name("unsigned long int"));
-
-  xbt_datadesc_struct_append(res, "data",
-                              xbt_datadesc_ref_pop_arr(elm_t));
-
-  xbt_datadesc_struct_append(res, "free_f",
-                              xbt_datadesc_by_name("function pointer"));
-  memcpy(res->extra, &free_func, sizeof(free_func));
-
-  xbt_datadesc_struct_append(res, "mutex",
-                              xbt_datadesc_by_name("data pointer"));
-
-  xbt_datadesc_struct_close(res);
-
-  xbt_datadesc_cb_field_push(res, "used");
-  xbt_datadesc_cb_recv(res, &xbt_datadesc_dynar_cb);
-
-  /* build a ref to it */
-  free(buffname);
-  buffname = bprintf("xbt_dynar_of_%s", elm_t->name);
-  res = xbt_datadesc_ref(buffname, res);
-  free(buffname);
-  return res;
-}
-
-#include "xbt/matrix.h"
-static void xbt_datadesc_matrix_cb(xbt_datadesc_type_t typedesc,
-                                    xbt_cbps_t vars, void *data)
-{
-  xbt_datadesc_type_t subtype;
-  xbt_matrix_t matrix = (xbt_matrix_t) data;
-
-  memcpy(&matrix->free_f, &typedesc->extra, sizeof(matrix->free_f));
-
-  /* search for the elemsize in what we have. If elements are "int", typedesc got is "int[]*" */
-  subtype = xbt_dd_find_field(typedesc, "data")->type;
-
-  /* this is now a ref to array of what we're looking for */
-  subtype = subtype->category.ref_data.type;
-  subtype = subtype->category.array_data.type;
-
-  XBT_DEBUG("subtype is %s", subtype->name);
-
-  matrix->elmsize = subtype->size[GRAS_THISARCH];
-}
-
-xbt_datadesc_type_t
-xbt_datadesc_matrix(xbt_datadesc_type_t elm_t,
-                     void_f_pvoid_t const free_f)
-{
-  char *buffname;
-  xbt_datadesc_type_t res;
-
-  buffname = bprintf("s_xbt_matrix_t(%s)", elm_t->name);
-  res = xbt_datadesc_struct(buffname);
-
-  xbt_datadesc_struct_append(res, "lines",
-                              xbt_datadesc_by_name("unsigned int"));
-  xbt_datadesc_struct_append(res, "rows",
-                              xbt_datadesc_by_name("unsigned int"));
-
-  xbt_datadesc_struct_append(res, "elmsize",
-                              xbt_datadesc_by_name("unsigned long int"));
-
-  xbt_datadesc_struct_append(res, "data",
-                              xbt_datadesc_ref_pop_arr(elm_t));
-  xbt_datadesc_struct_append(res, "free_f",
-                              xbt_datadesc_by_name("function pointer"));
-  xbt_datadesc_struct_close(res);
-
-  xbt_datadesc_cb_field_push(res, "lines");
-  xbt_datadesc_cb_field_push_multiplier(res, "rows");
-
-  xbt_datadesc_cb_recv(res, &xbt_datadesc_matrix_cb);
-  memcpy(res->extra, &free_f, sizeof(free_f));
-
-  /* build a ref to it */
-  free(buffname);
-  buffname = bprintf("xbt_matrix_t(%s)", elm_t->name);
-  res = xbt_datadesc_ref(buffname, res);
-  free(buffname);
-  return res;
-}
-
-xbt_datadesc_type_t
-xbt_datadesc_import_nws(const char *name,
-                         const DataDescriptor * desc,
-                         unsigned long howmany)
-{
-  THROW_UNIMPLEMENTED;
-}
-
-/**
- * (useful to push the sizes of the upcoming arrays, for example)
- */
-void xbt_datadesc_cb_send(xbt_datadesc_type_t type,
-                           xbt_datadesc_type_cb_void_t send)
-{
-  type->send = send;
-}
-
-/**
- * (useful to put the function pointers to the rigth value, for example)
- */
-void xbt_datadesc_cb_recv(xbt_datadesc_type_t type,
-                           xbt_datadesc_type_cb_void_t recv)
-{
-  type->recv = recv;
-}
-
-/*
- * xbt_dd_find_field:
- *
- * Returns the type descriptor of the given field. Abort on error.
- */
-static xbt_dd_cat_field_t
-xbt_dd_find_field(xbt_datadesc_type_t type, const char *field_name)
-{
-  xbt_dynar_t field_array;
-
-  xbt_dd_cat_field_t field = NULL;
-  unsigned int field_num;
-
-  if (type->category_code == e_xbt_datadesc_type_cat_union) {
-    field_array = type->category.union_data.fields;
-  } else if (type->category_code == e_xbt_datadesc_type_cat_struct) {
-    field_array = type->category.struct_data.fields;
-  } else {
-    XBT_ERROR("%s (%p) is not a struct nor an union. There is no field.",
-           type->name, (void *) type);
-    xbt_abort();
-  }
-  xbt_dynar_foreach(field_array, field_num, field) {
-    if (!strcmp(field_name, field->name)) {
-      return field;
-    }
-  }
-  XBT_ERROR("No field named '%s' in '%s'", field_name, type->name);
-  xbt_abort();
-
-}
-
-/**
- * The given datadesc must be a struct or union (abort if not).
- * (useful to push the sizes of the upcoming arrays, for example)
- */
-void xbt_datadesc_cb_field_send(xbt_datadesc_type_t type,
-                                 const char *field_name,
-                                 xbt_datadesc_type_cb_void_t send)
-{
-
-  xbt_dd_cat_field_t field = xbt_dd_find_field(type, field_name);
-  field->send = send;
-}
-
-
-/**
- * The value, which must be an int, unsigned int, long int or unsigned long int
- * is pushed to the stacks of sizes and can then be retrieved with
- * \ref xbt_datadesc_ref_pop_arr or directly with \ref xbt_cbps_i_pop.
- */
-void xbt_datadesc_cb_field_push(xbt_datadesc_type_t type,
-                                 const char *field_name)
-{
-
-  xbt_dd_cat_field_t field = xbt_dd_find_field(type, field_name);
-  xbt_datadesc_type_t sub_type = field->type;
-
-  XBT_DEBUG("add a PUSHy cb to '%s' field (type '%s') of '%s'",
-         field_name, sub_type->name, type->name);
-  if (!strcmp("int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_int;
-  } else if (!strcmp("unsigned int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_uint;
-  } else if (!strcmp("long int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_lint;
-  } else if (!strcmp("unsigned long int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_ulint;
-  } else {
-    XBT_ERROR
-        ("Field %s is not an int, unsigned int, long int neither unsigned long int",
-         sub_type->name);
-    xbt_abort();
-  }
-}
-
-/**
- * Any previously pushed value is poped and the field value is multiplied to
- * it. The result is then pushed back into the stack of sizes. It can then be
- * retrieved with \ref xbt_datadesc_ref_pop_arr or directly with \ref
- * xbt_cbps_i_pop.
- *
- * The field must be an int, unsigned int, long int or unsigned long int.
- */
-void xbt_datadesc_cb_field_push_multiplier(xbt_datadesc_type_t type,
-                                            const char *field_name)
-{
-
-  xbt_dd_cat_field_t field = xbt_dd_find_field(type, field_name);
-  xbt_datadesc_type_t sub_type = field->type;
-
-  XBT_DEBUG("add a MPUSHy cb to '%s' field (type '%s') of '%s'",
-         field_name, sub_type->name, type->name);
-  if (!strcmp("int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_int_mult;
-  } else if (!strcmp("unsigned int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_uint_mult;
-  } else if (!strcmp("long int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_lint_mult;
-  } else if (!strcmp("unsigned long int", sub_type->name)) {
-    field->send = xbt_datadesc_cb_push_ulint_mult;
-  } else {
-    XBT_ERROR
-        ("Field %s is not an int, unsigned int, long int neither unsigned long int",
-         sub_type->name);
-    xbt_abort();
-  }
-}
-
-/**
- * The given datadesc must be a struct or union (abort if not).
- * (useful to put the function pointers to the right value, for example)
- */
-void xbt_datadesc_cb_field_recv(xbt_datadesc_type_t type,
-                                 const char *field_name,
-                                 xbt_datadesc_type_cb_void_t recv)
-{
-
-  xbt_dd_cat_field_t field = xbt_dd_find_field(type, field_name);
-  field->recv = recv;
-}
-
-/*
- * Free a datadesc. Should only be called at xbt_exit.
- */
-void xbt_datadesc_free(xbt_datadesc_type_t * type)
-{
-
-  XBT_DEBUG("Let's free ddt %s", (*type)->name);
-
-  switch ((*type)->category_code) {
-  case e_xbt_datadesc_type_cat_scalar:
-  case e_xbt_datadesc_type_cat_ref:
-  case e_xbt_datadesc_type_cat_array:
-    /* nothing to free in there */
-    break;
-
-  case e_xbt_datadesc_type_cat_struct:
-    xbt_dynar_free(&((*type)->category.struct_data.fields));
-    break;
-
-  case e_xbt_datadesc_type_cat_union:
-    xbt_dynar_free(&((*type)->category.union_data.fields));
-    break;
-
-  default:
-    /* datadesc was invalid. Killing it is like euthanasy, I guess */
-    break;
-  }
-  free((*type)->name);
-  free(*type);
-  type = NULL;
-}
-
-/**
- * xbt_datadesc_type_cmp:
- *
- * Compares two datadesc types with the same semantic than strcmp.
- *
- * This comparison does not take the set headers into account (name and ID),
- * but only the payload (actual type description).
- */
-int xbt_datadesc_type_cmp(const xbt_datadesc_type_t d1,
-                           const xbt_datadesc_type_t d2)
-{
-  int ret;
-  unsigned int cpt;
-  xbt_dd_cat_field_t field1, field2;
-  xbt_datadesc_type_t field_desc_1, field_desc_2;
-
-  if (d1 == d2)
-    return 0;                   /* easy optimization */
-
-  if (!d1 && d2) {
-    XBT_DEBUG("ddt_cmp: !d1 && d2 => 1");
-    return 1;
-  }
-  if (!d1 && !d2) {
-    XBT_DEBUG("ddt_cmp: !d1 && !d2 => 0");
-    return 0;
-  }
-  if (d1 && !d2) {
-    XBT_DEBUG("ddt_cmp: d1 && !d2 => -1");
-    return -1;
-  }
-
-  for (cpt = 0; cpt < xbt_arch_count; cpt++) {
-    if (d1->size[cpt] != d2->size[cpt]) {
-      XBT_DEBUG("ddt_cmp: %s->size=%ld  !=  %s->size=%ld (on %s)",
-             d1->name, d1->size[cpt], d2->name, d2->size[cpt],
-             xbt_arches[cpt].name);
-      return d1->size[cpt] > d2->size[cpt] ? 1 : -1;
-    }
-
-    if (d1->alignment[cpt] != d2->alignment[cpt]) {
-      XBT_DEBUG("ddt_cmp: %s->alignment=%lu  !=  %s->alignment=%lu (on %s)",
-             d1->name, d1->alignment[cpt], d2->name, d2->alignment[cpt],
-             xbt_arches[cpt].name);
-      return d1->alignment[cpt] > d2->alignment[cpt] ? 1 : -1;
-    }
-
-    if (d1->aligned_size[cpt] != d2->aligned_size[cpt]) {
-      XBT_DEBUG
-          ("ddt_cmp: %s->aligned_size=%lu  !=  %s->aligned_size=%lu (on %s)",
-           d1->name, d1->aligned_size[cpt], d2->name,
-           d2->aligned_size[cpt], xbt_arches[cpt].name);
-      return d1->aligned_size[cpt] > d2->aligned_size[cpt] ? 1 : -1;
-    }
-  }
-
-  if (d1->category_code != d2->category_code) {
-    XBT_DEBUG("ddt_cmp: %s->cat=%s  !=  %s->cat=%s",
-           d1->name, xbt_datadesc_cat_names[d1->category_code],
-           d2->name, xbt_datadesc_cat_names[d2->category_code]);
-    return d1->category_code > d2->category_code ? 1 : -1;
-  }
-
-  if (d1->send != d2->send) {
-    XBT_DEBUG("ddt_cmp: %s->send=%p  !=  %s->send=%p",
-           d1->name, (void *) d1->send, d2->name, (void *) d2->send);
-    return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
-  }
-
-  if (d1->recv != d2->recv) {
-    XBT_DEBUG("ddt_cmp: %s->recv=%p  !=  %s->recv=%p",
-           d1->name, (void *) d1->recv, d2->name, (void *) d2->recv);
-    return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
-  }
-
-  switch (d1->category_code) {
-  case e_xbt_datadesc_type_cat_scalar:
-    if (d1->category.scalar_data.encoding !=
-        d2->category.scalar_data.encoding)
-      return d1->category.scalar_data.encoding >
-          d2->category.scalar_data.encoding ? 1 : -1;
-    break;
-
-  case e_xbt_datadesc_type_cat_struct:
-    if (xbt_dynar_length(d1->category.struct_data.fields) !=
-        xbt_dynar_length(d2->category.struct_data.fields)) {
-      XBT_DEBUG("ddt_cmp: %s (having %lu fields) !=  %s (having %lu fields)",
-             d1->name, xbt_dynar_length(d1->category.struct_data.fields),
-             d2->name, xbt_dynar_length(d2->category.struct_data.fields));
-
-      return xbt_dynar_length(d1->category.struct_data.fields) >
-          xbt_dynar_length(d2->category.struct_data.fields) ? 1 : -1;
-    }
-    xbt_dynar_foreach(d1->category.struct_data.fields, cpt, field1) {
-
-      field2 =
-          xbt_dynar_get_as(d2->category.struct_data.fields, cpt,
-                           xbt_dd_cat_field_t);
-      field_desc_1 = field1->type;
-      field_desc_2 = field2->type;
-      ret = xbt_datadesc_type_cmp(field_desc_1, field_desc_2);
-      if (ret) {
-        XBT_DEBUG("%s->field[%u]=%s != %s->field[%u]=%s",
-               d1->name, cpt, field1->name, d2->name, cpt, field2->name);
-        return ret;
-      }
-
-    }
-    break;
-
-  case e_xbt_datadesc_type_cat_union:
-    if (d1->category.union_data.selector !=
-        d2->category.union_data.selector)
-      return 1;                 /* ISO C forbids ordered comparisons of pointers to functions */
-
-    if (xbt_dynar_length(d1->category.union_data.fields) !=
-        xbt_dynar_length(d2->category.union_data.fields))
-      return xbt_dynar_length(d1->category.union_data.fields) >
-          xbt_dynar_length(d2->category.union_data.fields) ? 1 : -1;
-
-    xbt_dynar_foreach(d1->category.union_data.fields, cpt, field1) {
-
-      field2 =
-          xbt_dynar_get_as(d2->category.union_data.fields, cpt,
-                           xbt_dd_cat_field_t);
-      field_desc_1 = field1->type;
-      field_desc_2 = field2->type;
-      ret = xbt_datadesc_type_cmp(field_desc_1, field_desc_2);
-      if (ret)
-        return ret;
-
-    }
-    break;
-
-
-  case e_xbt_datadesc_type_cat_ref:
-    if (d1->category.ref_data.selector != d2->category.ref_data.selector)
-      return 1;                 /* ISO C forbids ordered comparisons of pointers to functions */
-
-    if (d1->category.ref_data.type != d2->category.ref_data.type)
-      return d1->category.ref_data.type >
-          d2->category.ref_data.type ? 1 : -1;
-    break;
-
-  case e_xbt_datadesc_type_cat_array:
-    if (d1->category.array_data.type != d2->category.array_data.type)
-      return d1->category.array_data.type >
-          d2->category.array_data.type ? 1 : -1;
-
-    if (d1->category.array_data.fixed_size !=
-        d2->category.array_data.fixed_size)
-      return d1->category.array_data.fixed_size >
-          d2->category.array_data.fixed_size ? 1 : -1;
-
-    if (d1->category.array_data.dynamic_size !=
-        d2->category.array_data.dynamic_size)
-      return 1;                 /* ISO C forbids ordered comparisons of pointers to functions */
-
-    break;
-
-  default:
-    /* two stupidly created ddt are equally stupid ;) */
-    break;
-  }
-  return 0;
-
-}
diff --git a/src/xbt/datadesc/ddt_exchange.c b/src/xbt/datadesc/ddt_exchange.c
deleted file mode 100644 (file)
index b9fdb29..0000000
+++ /dev/null
@@ -1,990 +0,0 @@
-/* ddt_exchange - send/recv data described                                  */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "datadesc_private.h"
-#include "xbt/socket.h" /* xbt_trp_send/recv */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_exchange, xbt_ddt,
-                                "Sending data over the network");
-const char *xbt_datadesc_cat_names[9] = {
-  "undefined",
-  "scalar", "struct", "union", "ref", "array", "ignored",
-  "invalid"
-};
-
-static xbt_datadesc_type_t int_type = NULL;
-static xbt_datadesc_type_t pointer_type = NULL;
-
-static XBT_INLINE void
-xbt_dd_send_int(xbt_socket_t sock, int *i, int stable)
-{
-
-  if (!int_type) {
-    int_type = xbt_datadesc_by_name("int");
-    xbt_assert(int_type);
-  }
-
-  XBT_DEBUG("send_int(%d)", *i);
-  xbt_trp_send(sock, (char *) i, int_type->size[GRAS_THISARCH], stable);
-}
-
-static XBT_INLINE void
-xbt_dd_recv_int(xbt_socket_t sock, int r_arch, int *i)
-{
-
-  if (!int_type) {
-    int_type = xbt_datadesc_by_name("int");
-    xbt_assert(int_type);
-  }
-
-  if (int_type->size[GRAS_THISARCH] >= int_type->size[r_arch]) {
-    xbt_trp_recv(sock, (char *) i, int_type->size[r_arch]);
-    if (r_arch != GRAS_THISARCH)
-      xbt_dd_convert_elm(int_type, 1, r_arch, i, i);
-  } else {
-    void *ptr = xbt_malloc(int_type->size[r_arch]);
-
-    xbt_trp_recv(sock, (char *) ptr, int_type->size[r_arch]);
-    if (r_arch != GRAS_THISARCH)
-      xbt_dd_convert_elm(int_type, 1, r_arch, ptr, i);
-    free(ptr);
-  }
-  XBT_DEBUG("recv_int(%d)", *i);
-}
-
-/*
- * Note: here we suppose that the remote NULL is a sequence
- *       of 'length' bytes set to 0.
- * FIXME: Check in configure?
- */
-static XBT_INLINE int xbt_dd_is_r_null(char **r_ptr, long int length)
-{
-  int i;
-
-  for (i = 0; i < length; i++) {
-    if (((unsigned char *) r_ptr)[i]) {
-      return 0;
-    }
-  }
-
-  return 1;
-}
-
-static XBT_INLINE void xbt_dd_alloc_ref(xbt_dict_t refs, long int size, char **r_ref, long int r_len,  /* pointer_type->size[r_arch] */
-                                         char **l_ref, int detect_cycle)
-{
-  char *l_data = NULL;
-
-  xbt_assert(size > 0, "Cannot allocate %ld bytes!", size);
-  l_data = xbt_malloc((size_t) size);
-
-  *l_ref = l_data;
-  XBT_DEBUG
-      ("alloc_ref: l_data=%p, &l_data=%p; r_ref=%p; *r_ref=%p, r_len=%ld",
-       (void *) l_data, (void *) &l_data, (void *) r_ref,
-       (void *) (r_ref ? *r_ref : NULL), r_len);
-  if (detect_cycle && r_ref && !xbt_dd_is_r_null(r_ref, r_len)) {
-    void *ptr = xbt_malloc(sizeof(void *));
-
-    memcpy(ptr, l_ref, sizeof(void *));
-
-    XBT_DEBUG("Insert l_ref=%p under r_ref=%p", *(void **) ptr,
-           *(void **) r_ref);
-
-    if (detect_cycle)
-      xbt_dict_set_ext(refs, (const char *) r_ref, r_len, ptr, NULL);
-  }
-}
-
-static int
-xbt_datadesc_memcpy_rec(xbt_cbps_t state,
-                         xbt_dict_t refs,
-                         xbt_datadesc_type_t type,
-                         char *src, char *dst, int subsize,
-                         int detect_cycle)
-{
-
-
-  unsigned int cpt;
-  xbt_datadesc_type_t sub_type;        /* type on which we recurse */
-  int count = 0;
-
-  XBT_VERB("Copy a %s (%s) from %p to %p (local sizeof=%ld)",
-        type->name, xbt_datadesc_cat_names[type->category_code],
-        src, dst, type->size[GRAS_THISARCH]);
-
-  if (type->send) {
-    type->send(type, state, src);
-  }
-
-  switch (type->category_code) {
-  case e_xbt_datadesc_type_cat_scalar:
-    memcpy(dst, src, type->size[GRAS_THISARCH]);
-    count += type->size[GRAS_THISARCH];
-    break;
-
-  case e_xbt_datadesc_type_cat_struct:{
-      xbt_dd_cat_struct_t struct_data;
-      xbt_dd_cat_field_t field;
-      char *field_src;
-      char *field_dst;
-
-      struct_data = type->category.struct_data;
-      xbt_assert(struct_data.closed,
-                  "Please call xbt_datadesc_declare_struct_close on %s before copying it",
-                  type->name);
-      XBT_VERB(">> Copy all fields of the structure %s", type->name);
-      xbt_dynar_foreach(struct_data.fields, cpt, field) {
-        field_src = src + field->offset[GRAS_THISARCH];
-        field_dst = dst + field->offset[GRAS_THISARCH];
-
-        sub_type = field->type;
-
-        if (field->send)
-          field->send(type, state, field_src);
-
-        XBT_DEBUG("Copy field %s", field->name);
-        count +=
-            xbt_datadesc_memcpy_rec(state, refs, sub_type, field_src,
-                                     field_dst, 0, detect_cycle
-                                     || sub_type->cycle);
-
-        if (XBT_LOG_ISENABLED(xbt_ddt_exchange, xbt_log_priority_verbose)) {
-          if (sub_type == xbt_datadesc_by_name("unsigned int")) {
-            XBT_VERB("Copied value for field '%s': %u (type: unsigned int)",
-                  field->name, *(unsigned int *) field_dst);
-          } else if (sub_type == xbt_datadesc_by_name("int")) {
-            XBT_VERB("Copied value for field '%s': %d (type: int)",
-                  field->name, *(int *) field_dst);
-
-          } else if (sub_type ==
-                     xbt_datadesc_by_name("unsigned long int")) {
-            XBT_VERB
-                ("Copied value for field '%s': %lu (type: unsigned long int)",
-                 field->name, *(unsigned long int *) field_dst);
-          } else if (sub_type == xbt_datadesc_by_name("long int")) {
-            XBT_VERB("Copied value for field '%s': %ld (type: long int)",
-                  field->name, *(long int *) field_dst);
-
-          } else if (sub_type == xbt_datadesc_by_name("string")) {
-            XBT_VERB("Copied value for field '%s': '%s' (type: string)",
-                  field->name, *(char **) field_dst);
-          } else {
-            XBT_VERB("Copied a value for field '%s' (type not scalar?)",
-                  field->name);
-          }
-        }
-
-      }
-      XBT_VERB("<< Copied all fields of the structure %s", type->name);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_union:{
-      xbt_dd_cat_union_t union_data;
-      xbt_dd_cat_field_t field = NULL;
-      unsigned int field_num;
-
-      union_data = type->category.union_data;
-
-      xbt_assert(union_data.closed,
-                  "Please call xbt_datadesc_declare_union_close on %s before copying it",
-                  type->name);
-      /* retrieve the field number */
-      field_num = union_data.selector(type, state, src);
-
-      xbt_assert(field_num > 0,
-                  "union field selector of %s gave a negative value",
-                  type->name);
-
-      xbt_assert(field_num < xbt_dynar_length(union_data.fields),
-                  "union field selector of %s returned %u but there is only %lu fields",
-                  type->name, field_num,
-                  xbt_dynar_length(union_data.fields));
-
-      /* Copy the content */
-      field =
-          xbt_dynar_get_as(union_data.fields, field_num,
-                           xbt_dd_cat_field_t);
-      sub_type = field->type;
-
-      if (field->send)
-        field->send(type, state, src);
-
-      count += xbt_datadesc_memcpy_rec(state, refs, sub_type, src, dst, 0,
-                                        detect_cycle || sub_type->cycle);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_ref:{
-      xbt_dd_cat_ref_t ref_data;
-      char **o_ref = NULL;
-      char **n_ref = NULL;
-      int reference_is_to_cpy;
-
-      ref_data = type->category.ref_data;
-
-      /* Detect the referenced type */
-      sub_type = ref_data.type;
-      if (sub_type == NULL) {
-        sub_type = ref_data.selector(type, state, src);
-      }
-
-      /* Send the pointed data only if not already sent */
-      if (*(void **) src == NULL) {
-        XBT_VERB("Not copying NULL referenced data");
-        *(void **) dst = NULL;
-        break;
-      }
-      o_ref = (char **) src;
-
-      reference_is_to_cpy = 1;
-      if (detect_cycle &&
-          (n_ref =
-           xbt_dict_get_or_null_ext(refs, (char *) o_ref,
-                                    sizeof(char *)))) {
-        /* already known, no need to copy it */
-        //XBT_INFO("Cycle detected");
-        reference_is_to_cpy = 0;
-      }
-
-      if (reference_is_to_cpy) {
-        int subsubcount = -1;
-        void *l_referenced = NULL;
-        XBT_VERB("Copy a ref to '%s' referenced at %p", sub_type->name,
-              (void *) *o_ref);
-
-        if (!pointer_type) {
-          pointer_type = xbt_datadesc_by_name("data pointer");
-          xbt_assert(pointer_type);
-        }
-
-        if (sub_type->category_code == e_xbt_datadesc_type_cat_array) {
-          /* Damn. Reference to a dynamic array. Allocating the space for it is more complicated */
-          xbt_dd_cat_array_t array_data = sub_type->category.array_data;
-          xbt_datadesc_type_t subsub_type;
-
-          subsub_type = array_data.type;
-          subsubcount = array_data.fixed_size;
-          if (subsubcount == -1)
-            subsubcount =
-                array_data.dynamic_size(subsub_type, state, *o_ref);
-
-          if (subsubcount != 0)
-            xbt_dd_alloc_ref(refs,
-                              subsub_type->size[GRAS_THISARCH] *
-                              subsubcount, o_ref,
-                              pointer_type->size[GRAS_THISARCH],
-                              (char **) &l_referenced, detect_cycle);
-        } else {
-          xbt_dd_alloc_ref(refs, sub_type->size[GRAS_THISARCH],
-                            o_ref, pointer_type->size[GRAS_THISARCH],
-                            (char **) &l_referenced, detect_cycle);
-        }
-
-        count += xbt_datadesc_memcpy_rec(state, refs, sub_type,
-                                          *o_ref, (char *) l_referenced,
-                                          subsubcount, detect_cycle
-                                          || sub_type->cycle);
-
-        *(void **) dst = l_referenced;
-        XBT_VERB("'%s' previously referenced at %p now at %p",
-              sub_type->name, *(void **) o_ref, l_referenced);
-
-      } else {
-        XBT_VERB
-            ("NOT copying data previously referenced @%p (already done, @%p now)",
-             *(void **) o_ref, *(void **) n_ref);
-
-        *(void **) dst = *n_ref;
-
-      }
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_array:{
-      xbt_dd_cat_array_t array_data;
-      unsigned long int array_count;
-      char *src_ptr = src;
-      char *dst_ptr = dst;
-      long int elm_size;
-
-      array_data = type->category.array_data;
-
-      /* determine and send the element count */
-      array_count = array_data.fixed_size;
-      if (array_count == -1)
-        array_count = subsize;
-      if (array_count == -1)
-        array_count = array_data.dynamic_size(type, state, src);
-
-      /* send the content */
-      sub_type = array_data.type;
-      elm_size = sub_type->aligned_size[GRAS_THISARCH];
-      if (sub_type->category_code == e_xbt_datadesc_type_cat_scalar) {
-        XBT_VERB("Array of %lu scalars, copy it in one shot", array_count);
-        memcpy(dst, src,
-               sub_type->aligned_size[GRAS_THISARCH] * array_count);
-        count += sub_type->aligned_size[GRAS_THISARCH] * array_count;
-      } else if (sub_type->category_code == e_xbt_datadesc_type_cat_array
-                 && sub_type->category.array_data.fixed_size > 0
-                 && sub_type->category.array_data.type->category_code ==
-                 e_xbt_datadesc_type_cat_scalar) {
-
-        XBT_VERB("Array of %lu fixed array of scalars, copy it in one shot",
-              array_count);
-        memcpy(dst, src,
-               sub_type->category.array_data.
-               type->aligned_size[GRAS_THISARCH]
-               * array_count * sub_type->category.array_data.fixed_size);
-        count +=
-            sub_type->category.array_data.type->aligned_size[GRAS_THISARCH]
-            * array_count * sub_type->category.array_data.fixed_size;
-
-      } else {
-        XBT_VERB("Array of %lu stuff, copy it in one after the other",
-              array_count);
-        for (cpt = 0; cpt < array_count; cpt++) {
-          XBT_VERB("Copy the %uth stuff out of %lu", cpt, array_count);
-          count +=
-              xbt_datadesc_memcpy_rec(state, refs, sub_type, src_ptr,
-                                       dst_ptr, 0, detect_cycle
-                                       || sub_type->cycle);
-          src_ptr += elm_size;
-          dst_ptr += elm_size;
-        }
-      }
-      break;
-    }
-
-  default:
-    xbt_die("Invalid type");
-  }
-
-  return count;
-}
-
-/**
- * xbt_datadesc_memcpy:
- *
- * Copy the data pointed by src and described by type
- * to a new location, and store a pointer to it in dst.
- *
- */
-int xbt_datadesc_memcpy(xbt_datadesc_type_t type, void *src, void *dst)
-{
-  static xbt_cbps_t state = NULL;
-  static xbt_dict_t refs = NULL;        /* all references already sent */
-  int size = 0;
-
-  xbt_assert(type, "called with NULL type descriptor");
-
-  XBT_DEBUG("Memcopy a %s from %p to %p", xbt_datadesc_get_name(type), src,
-         dst);
-  if (!state) {
-    state = xbt_cbps_new();
-    refs = xbt_dict_new_homogeneous(xbt_free_f);
-  }
-
-  TRY {
-    size =
-        xbt_datadesc_memcpy_rec(state, refs, type, (char *) src,
-                                 (char *) dst, 0, type->cycle);
-  }
-  TRY_CLEANUP {
-    xbt_dict_reset(refs);
-    xbt_cbps_reset(state);
-  }
-  CATCH_ANONYMOUS {
-    RETHROW;
-  }
-  return size;
-}
-
-/***
- *** Direct use functions
- ***/
-
-static void
-xbt_datadesc_send_rec(xbt_socket_t sock,
-                       xbt_cbps_t state,
-                       xbt_dict_t refs,
-                       xbt_datadesc_type_t type,
-                       char *data, int detect_cycle)
-{
-
-  unsigned int cpt;
-  xbt_datadesc_type_t sub_type;        /* type on which we recurse */
-
-  XBT_VERB("Send a %s (%s)",
-        type->name, xbt_datadesc_cat_names[type->category_code]);
-
-  if (!strcmp(type->name, "string"))
-    XBT_VERB("value: '%s'", *(char **) data);
-
-  if (type->send) {
-    type->send(type, state, data);
-    XBT_DEBUG("Run the emission callback");
-  }
-
-  switch (type->category_code) {
-  case e_xbt_datadesc_type_cat_scalar:
-    xbt_trp_send(sock, data, type->size[GRAS_THISARCH], 1);
-    break;
-
-  case e_xbt_datadesc_type_cat_struct:{
-      xbt_dd_cat_struct_t struct_data;
-      xbt_dd_cat_field_t field;
-      char *field_data;
-
-      struct_data = type->category.struct_data;
-      xbt_assert(struct_data.closed,
-                  "Please call xbt_datadesc_declare_struct_close on %s before sending it",
-                  type->name);
-      XBT_VERB(">> Send all fields of the structure %s", type->name);
-      xbt_dynar_foreach(struct_data.fields, cpt, field) {
-        field_data = data;
-        field_data += field->offset[GRAS_THISARCH];
-
-        sub_type = field->type;
-
-        if (field->send) {
-          XBT_DEBUG("Run the emission callback of field %s", field->name);
-          field->send(type, state, field_data);
-        }
-
-        XBT_VERB("Send field %s", field->name);
-        xbt_datadesc_send_rec(sock, state, refs, sub_type, field_data,
-                               detect_cycle || sub_type->cycle);
-
-      }
-      XBT_VERB("<< Sent all fields of the structure %s", type->name);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_union:{
-      xbt_dd_cat_union_t union_data;
-      xbt_dd_cat_field_t field = NULL;
-      int field_num;
-
-      union_data = type->category.union_data;
-
-      xbt_assert(union_data.closed,
-                  "Please call xbt_datadesc_declare_union_close on %s before sending it",
-                  type->name);
-      /* retrieve the field number */
-      field_num = union_data.selector(type, state, data);
-
-      xbt_assert(field_num > 0,
-                  "union field selector of %s gave a negative value",
-                  type->name);
-
-      xbt_assert(field_num < xbt_dynar_length(union_data.fields),
-                  "union field selector of %s returned %d but there is only %lu fields",
-                  type->name, field_num,
-                  xbt_dynar_length(union_data.fields));
-
-      /* Send the field number */
-      xbt_dd_send_int(sock, &field_num, 0 /* not stable */ );
-
-      /* Send the content */
-      field =
-          xbt_dynar_get_as(union_data.fields, field_num,
-                           xbt_dd_cat_field_t);
-      sub_type = field->type;
-
-      if (field->send)
-        field->send(type, state, data);
-
-      xbt_datadesc_send_rec(sock, state, refs, sub_type, data,
-                             detect_cycle || sub_type->cycle);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_ref:{
-      xbt_dd_cat_ref_t ref_data;
-      void **ref = (void **) data;
-      int reference_is_to_send;
-
-      ref_data = type->category.ref_data;
-
-      /* Detect the referenced type and send it to peer if needed */
-      sub_type = ref_data.type;
-      if (sub_type == NULL) {
-        sub_type = ref_data.selector(type, state, data);
-        xbt_dd_send_int(sock, &(sub_type->code), 1 /*stable */ );
-      }
-
-      /* Send the actual value of the pointer for cycle handling */
-      if (!pointer_type) {
-        pointer_type = xbt_datadesc_by_name("data pointer");
-        xbt_assert(pointer_type);
-      }
-
-      xbt_trp_send(sock, (char *) data,
-                    pointer_type->size[GRAS_THISARCH], 1 /*stable */ );
-
-      /* Send the pointed data only if not already sent */
-      if (*(void **) data == NULL) {
-        XBT_VERB("Not sending NULL referenced data");
-        break;
-      }
-
-      reference_is_to_send = 1;
-      /* return ignored. Just checking whether it's known or not */
-      if (detect_cycle
-          && xbt_dict_get_or_null_ext(refs, (char *) ref,
-                                      sizeof(char *))) {
-        //XBT_INFO("Cycle detected");
-        reference_is_to_send = 0;
-      }
-
-      if (reference_is_to_send) {
-        XBT_VERB("Sending data referenced at %p", (void *) *ref);
-        if (detect_cycle)
-          xbt_dict_set_ext(refs, (char *) ref, sizeof(void *), ref, NULL);
-        xbt_datadesc_send_rec(sock, state, refs, sub_type, *ref,
-                               detect_cycle || sub_type->cycle);
-
-      } else {
-        XBT_VERB("Not sending data referenced at %p (already done)",
-              (void *) *ref);
-      }
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_array:{
-      xbt_dd_cat_array_t array_data;
-      int count;
-      char *ptr = data;
-      long int elm_size;
-
-      array_data = type->category.array_data;
-
-      /* determine and send the element count */
-      count = array_data.fixed_size;
-      if (count == -1) {
-        count = array_data.dynamic_size(type, state, data);
-        xbt_assert(count >= 0,
-                    "Invalid (negative) array size for type %s",
-                    type->name);
-        xbt_dd_send_int(sock, &count, 0 /*non-stable */ );
-      }
-
-      /* send the content */
-      sub_type = array_data.type;
-      elm_size = sub_type->aligned_size[GRAS_THISARCH];
-      if (sub_type->category_code == e_xbt_datadesc_type_cat_scalar) {
-        XBT_VERB("Array of %d scalars, send it in one shot", count);
-        xbt_trp_send(sock, data,
-                      sub_type->aligned_size[GRAS_THISARCH] * count,
-                      0 /* not stable */ );
-      } else if (sub_type->category_code == e_xbt_datadesc_type_cat_array
-                 && sub_type->category.array_data.fixed_size > 0
-                 && sub_type->category.array_data.type->category_code ==
-                 e_xbt_datadesc_type_cat_scalar) {
-
-        XBT_VERB("Array of %d fixed array of scalars, send it in one shot",
-              count);
-        xbt_trp_send(sock, data,
-                      sub_type->category.array_data.
-                      type->aligned_size[GRAS_THISARCH]
-                      * count * sub_type->category.array_data.fixed_size,
-                      0 /* not stable */ );
-
-      } else {
-        for (cpt = 0; cpt < count; cpt++) {
-          xbt_datadesc_send_rec(sock, state, refs, sub_type, ptr,
-                                 detect_cycle || sub_type->cycle);
-          ptr += elm_size;
-        }
-      }
-      break;
-    }
-
-  default:
-    xbt_die("Invalid type");
-  }
-}
-
-/**
- * xbt_datadesc_send:
- *
- * Copy the data pointed by src and described by type to the socket
- *
- */
-void xbt_datadesc_send(xbt_socket_t sock,
-                        xbt_datadesc_type_t type, void *src)
-{
-  static xbt_cbps_t state = NULL;
-  static xbt_dict_t refs = NULL;        /* all references already sent */
-
-  xbt_assert(type, "called with NULL type descriptor");
-
-  if (!state) {
-    state = xbt_cbps_new();
-    refs = xbt_dict_new_homogeneous(NULL);
-  }
-
-  TRY {
-    xbt_datadesc_send_rec(sock, state, refs, type, (char *) src,
-                           type->cycle);
-  }
-  TRY_CLEANUP {
-    xbt_dict_reset(refs);
-    xbt_cbps_reset(state);
-  }
-  CATCH_ANONYMOUS {
-    RETHROW;
-  }
-}
-
-/**
- * xbt_datadesc_recv_rec:
- *
- * Do the data reception job recursively.
- *
- * subsize used only to deal with vicious case of reference to dynamic array.
- *  This size is needed at the reference reception level (to allocate enough
- * space) and at the array reception level (to fill enough room).
- *
- * Having this size passed as an argument of the recursive function is a crude
- * hack, but I was told that working code is sometimes better than neat one ;)
- */
-static void
-xbt_datadesc_recv_rec(xbt_socket_t sock,
-                       xbt_cbps_t state,
-                       xbt_dict_t refs,
-                       xbt_datadesc_type_t type,
-                       int r_arch,
-                       char **r_data,
-                       long int r_lgr,
-                       char *l_data, int subsize, int detect_cycle)
-{
-
-  unsigned int cpt;
-  xbt_datadesc_type_t sub_type;
-
-  XBT_VERB("Recv a %s @%p", type->name, (void *) l_data);
-  xbt_assert(l_data);
-
-  switch (type->category_code) {
-  case e_xbt_datadesc_type_cat_scalar:
-    if (type->size[GRAS_THISARCH] == type->size[r_arch]) {
-      xbt_trp_recv(sock, (char *) l_data, type->size[r_arch]);
-      if (r_arch != GRAS_THISARCH)
-        xbt_dd_convert_elm(type, 1, r_arch, l_data, l_data);
-    } else {
-      void *ptr = xbt_malloc(type->size[r_arch]);
-
-      xbt_trp_recv(sock, (char *) ptr, type->size[r_arch]);
-      if (r_arch != GRAS_THISARCH)
-        xbt_dd_convert_elm(type, 1, r_arch, ptr, l_data);
-      free(ptr);
-    }
-    break;
-
-  case e_xbt_datadesc_type_cat_struct:{
-      xbt_dd_cat_struct_t struct_data;
-      xbt_dd_cat_field_t field;
-
-      struct_data = type->category.struct_data;
-
-      xbt_assert(struct_data.closed,
-                  "Please call xbt_datadesc_declare_struct_close on %s before receiving it",
-                  type->name);
-      XBT_VERB(">> Receive all fields of the structure %s", type->name);
-      xbt_dynar_foreach(struct_data.fields, cpt, field) {
-        char *field_data = l_data + field->offset[GRAS_THISARCH];
-
-        sub_type = field->type;
-
-        xbt_datadesc_recv_rec(sock, state, refs, sub_type,
-                               r_arch, NULL, 0,
-                               field_data, -1,
-                               detect_cycle || sub_type->cycle);
-
-        if (field->recv) {
-          XBT_DEBUG("Run the reception callback of field %s", field->name);
-          field->recv(type, state, (void *) l_data);
-        }
-
-      }
-      XBT_VERB("<< Received all fields of the structure %s", type->name);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_union:{
-      xbt_dd_cat_union_t union_data;
-      xbt_dd_cat_field_t field = NULL;
-      int field_num;
-
-      union_data = type->category.union_data;
-
-      xbt_assert(union_data.closed,
-                  "Please call xbt_datadesc_declare_union_close on %s before receiving it",
-                  type->name);
-      /* retrieve the field number */
-      xbt_dd_recv_int(sock, r_arch, &field_num);
-      if (field_num < 0)
-        THROWF(mismatch_error, 0,
-               "Received union field for %s is negative", type->name);
-      if (field_num > xbt_dynar_length(union_data.fields))
-        THROWF(mismatch_error, 0,
-               "Received union field for %s is said to be #%d but there is only %lu fields",
-               type->name, field_num, xbt_dynar_length(union_data.fields));
-
-      /* Recv the content */
-      field =
-          xbt_dynar_get_as(union_data.fields, field_num,
-                           xbt_dd_cat_field_t);
-      sub_type = field->type;
-
-      xbt_datadesc_recv_rec(sock, state, refs, sub_type,
-                             r_arch, NULL, 0,
-                             l_data, -1, detect_cycle || sub_type->cycle);
-      if (field->recv)
-        field->recv(type, state, l_data);
-
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_ref:{
-      char **r_ref = NULL;
-      char **l_ref = NULL;
-      xbt_dd_cat_ref_t ref_data;
-      int reference_is_to_recv = 0;
-
-      ref_data = type->category.ref_data;
-
-      /* Get the referenced type locally or from peer */
-      sub_type = ref_data.type;
-      if (sub_type == NULL) {
-        int ref_code;
-        xbt_dd_recv_int(sock, r_arch, &ref_code);
-        sub_type = xbt_datadesc_by_id(ref_code);
-      }
-
-      /* Get the actual value of the pointer for cycle handling */
-      if (!pointer_type) {
-        pointer_type = xbt_datadesc_by_name("data pointer");
-        xbt_assert(pointer_type);
-      }
-
-      r_ref = xbt_malloc(pointer_type->size[r_arch]);
-
-      xbt_trp_recv(sock, (char *) r_ref, pointer_type->size[r_arch]);
-
-      /* Receive the pointed data only if not already sent */
-      if (xbt_dd_is_r_null(r_ref, pointer_type->size[r_arch])) {
-        XBT_VERB("Not receiving data remotely referenced @%p since it's NULL",
-              *(void **) r_ref);
-        *(void **) l_data = NULL;
-        free(r_ref);
-        break;
-      }
-
-      reference_is_to_recv = 1;
-      if (detect_cycle && (l_ref =
-                           xbt_dict_get_or_null_ext(refs, (char *) r_ref,
-                                                    pointer_type->size
-                                                    [r_arch]))) {
-        reference_is_to_recv = 0;
-        //XBT_INFO("Cycle detected");
-      }
-
-      if (reference_is_to_recv) {
-        int subsubcount = -1;
-        void *l_referenced = NULL;
-
-        XBT_VERB("Receiving a ref to '%s', remotely @%p",
-              sub_type->name, *(void **) r_ref);
-        if (sub_type->category_code == e_xbt_datadesc_type_cat_array) {
-          /* Damn. Reference to a dynamic array. Allocating the space for it is more complicated */
-          xbt_dd_cat_array_t array_data = sub_type->category.array_data;
-          xbt_datadesc_type_t subsub_type;
-
-          subsubcount = array_data.fixed_size;
-          if (subsubcount == -1)
-            xbt_dd_recv_int(sock, r_arch, &subsubcount);
-
-          subsub_type = array_data.type;
-
-          if (subsubcount != 0)
-            xbt_dd_alloc_ref(refs,
-                              subsub_type->size[GRAS_THISARCH] *
-                              subsubcount, r_ref,
-                              pointer_type->size[r_arch],
-                              (char **) &l_referenced, detect_cycle);
-          else
-            l_referenced = NULL;
-        } else {
-          xbt_dd_alloc_ref(refs, sub_type->size[GRAS_THISARCH],
-                            r_ref, pointer_type->size[r_arch],
-                            (char **) &l_referenced, detect_cycle);
-        }
-
-        if (l_referenced != NULL)
-          xbt_datadesc_recv_rec(sock, state, refs, sub_type,
-                                 r_arch, r_ref, pointer_type->size[r_arch],
-                                 (char *) l_referenced, subsubcount,
-                                 detect_cycle || sub_type->cycle);
-
-        *(void **) l_data = l_referenced;
-        XBT_VERB("'%s' remotely referenced at %p locally at %p",
-              sub_type->name, *(void **) r_ref, l_referenced);
-
-      } else {
-        XBT_VERB
-            ("NOT receiving data remotely referenced @%p (already done, @%p here)",
-             *(void **) r_ref, *(void **) l_ref);
-
-        *(void **) l_data = *l_ref;
-
-      }
-      free(r_ref);
-      break;
-    }
-
-  case e_xbt_datadesc_type_cat_array:{
-      xbt_dd_cat_array_t array_data;
-      int count;
-      char *ptr;
-      long int elm_size;
-
-      array_data = type->category.array_data;
-      /* determine element count locally, or from caller, or from peer */
-      count = array_data.fixed_size;
-      if (count == -1)
-        count = subsize;
-      if (count == -1)
-        xbt_dd_recv_int(sock, r_arch, &count);
-      if (count == -1)
-        THROWF(mismatch_error, 0,
-               "Invalid (=-1) array size for type %s", type->name);
-
-      /* receive the content */
-      sub_type = array_data.type;
-      if (sub_type->category_code == e_xbt_datadesc_type_cat_scalar) {
-        XBT_VERB("Array of %d scalars, get it in one shoot", count);
-        if (sub_type->aligned_size[GRAS_THISARCH] >=
-            sub_type->aligned_size[r_arch]) {
-          xbt_trp_recv(sock, (char *) l_data,
-                        sub_type->aligned_size[r_arch] * count);
-          if (r_arch != GRAS_THISARCH)
-            xbt_dd_convert_elm(sub_type, count, r_arch, l_data, l_data);
-        } else {
-          ptr = xbt_malloc(sub_type->aligned_size[r_arch] * count);
-
-          xbt_trp_recv(sock, (char *) ptr,
-                        sub_type->size[r_arch] * count);
-          if (r_arch != GRAS_THISARCH)
-            xbt_dd_convert_elm(sub_type, count, r_arch, ptr, l_data);
-          free(ptr);
-        }
-      } else if (sub_type->category_code == e_xbt_datadesc_type_cat_array
-                 && sub_type->category.array_data.fixed_size >= 0
-                 && sub_type->category.array_data.type->category_code ==
-                 e_xbt_datadesc_type_cat_scalar) {
-        xbt_datadesc_type_t subsub_type;
-        array_data = sub_type->category.array_data;
-        subsub_type = array_data.type;
-
-        XBT_VERB("Array of %d fixed array of scalars, get it in one shot",
-              count);
-        if (subsub_type->aligned_size[GRAS_THISARCH] >=
-            subsub_type->aligned_size[r_arch]) {
-          xbt_trp_recv(sock, (char *) l_data,
-                        subsub_type->aligned_size[r_arch] * count *
-                        array_data.fixed_size);
-          if (r_arch != GRAS_THISARCH)
-            xbt_dd_convert_elm(subsub_type, count * array_data.fixed_size,
-                                r_arch, l_data, l_data);
-        } else {
-          ptr =
-              xbt_malloc(subsub_type->aligned_size[r_arch] * count *
-                         array_data.fixed_size);
-
-          xbt_trp_recv(sock, (char *) ptr,
-                        subsub_type->size[r_arch] * count *
-                        array_data.fixed_size);
-          if (r_arch != GRAS_THISARCH)
-            xbt_dd_convert_elm(subsub_type, count * array_data.fixed_size,
-                                r_arch, ptr, l_data);
-          free(ptr);
-        }
-
-
-      } else {
-        /* not scalar content, get it recursively (may contain pointers) */
-        elm_size = sub_type->aligned_size[GRAS_THISARCH];
-        XBT_VERB("Receive a %d-long array of %s", count, sub_type->name);
-
-        ptr = l_data;
-        for (cpt = 0; cpt < count; cpt++) {
-          xbt_datadesc_recv_rec(sock, state, refs, sub_type,
-                                 r_arch, NULL, 0, ptr, -1,
-                                 detect_cycle || sub_type->cycle);
-
-          ptr += elm_size;
-        }
-      }
-      break;
-    }
-
-  default:
-    xbt_die("Invalid type");
-  }
-
-  if (type->recv)
-    type->recv(type, state, l_data);
-
-  if (!strcmp(type->name, "string"))
-    XBT_VERB("value: '%s'", *(char **) l_data);
-
-}
-
-/**
- * xbt_datadesc_recv:
- *
- * Get an instance of the datatype described by @type from the @socket,
- * and store a pointer to it in @dst
- *
- */
-void
-xbt_datadesc_recv(xbt_socket_t sock,
-                   xbt_datadesc_type_t type, int r_arch, void *dst)
-{
-  static xbt_cbps_t state = NULL;      /* callback persistent state */
-  static xbt_dict_t refs = NULL;        /* all references already sent */
-
-  if (!state) {
-    state = xbt_cbps_new();
-    refs = xbt_dict_new_homogeneous(xbt_free_f);
-  }
-
-  xbt_assert(type, "called with NULL type descriptor");
-  TRY {
-    xbt_datadesc_recv_rec(sock, state, refs, type,
-                           r_arch, NULL, 0, (char *) dst, -1, type->cycle);
-  }
-  TRY_CLEANUP {
-    xbt_dict_reset(refs);
-    xbt_cbps_reset(state);
-  }
-  CATCH_ANONYMOUS {
-    RETHROW;
-  }
-}
diff --git a/src/xbt/datadesc/ddt_parse.c b/src/xbt/datadesc/ddt_parse.c
deleted file mode 100644 (file)
index 166b5b7..0000000
+++ /dev/null
@@ -1,815 +0,0 @@
-/* DataDesc/ddt_parse.c -- automatic parsing of data structures             */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include <ctype.h>              /* isdigit */
-
-#include "xbt/ex.h"
-#include "datadesc_private.h"
-#include "ddt_parse.yy.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_parse, xbt_ddt,
-                                "Parsing C data structures to build XBT data description");
-
-typedef struct s_type_modifier {
-  short is_long;
-  unsigned is_unsigned:1;
-  unsigned is_short:1;
-
-  unsigned is_struct:1;
-  unsigned is_union:1;
-  unsigned is_enum:1;
-
-  unsigned is_ref:1;
-
-  int is_dynar:2;
-  int is_matrix:2;
-} s_type_modifier_t, *type_modifier_t;
-
-typedef struct s_field {
-  xbt_datadesc_type_t type;
-  char *type_name;
-  char *name;
-  s_type_modifier_t tm;
-} s_identifier_t;
-
-extern char *xbt_ddt_parse_text;       /* text being considered in the parser */
-
-/* local functions */
-static void parse_type_modifier(type_modifier_t type_modifier)
-{
-  XBT_IN();
-  do {
-    if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_STAR) {
-      /* This only used when parsing 'short *' since this function returns when int, float, double,... is encountered */
-      XBT_DEBUG("This is a reference");
-      type_modifier->is_ref++;
-
-    } else if (!strcmp(xbt_ddt_parse_text, "unsigned")) {
-      XBT_DEBUG("This is an unsigned");
-      type_modifier->is_unsigned = 1;
-
-    } else if (!strcmp(xbt_ddt_parse_text, "short")) {
-      XBT_DEBUG("This is short");
-      type_modifier->is_short = 1;
-
-    } else if (!strcmp(xbt_ddt_parse_text, "long")) {
-      XBT_DEBUG("This is long");
-      type_modifier->is_long++; /* handle "long long" */
-
-    } else if (!strcmp(xbt_ddt_parse_text, "struct")) {
-      XBT_DEBUG("This is a struct");
-      type_modifier->is_struct = 1;
-
-    } else if (!strcmp(xbt_ddt_parse_text, "union")) {
-      XBT_DEBUG("This is an union");
-      type_modifier->is_union = 1;
-
-    } else if (!strcmp(xbt_ddt_parse_text, "enum")) {
-      XBT_DEBUG("This is an enum");
-      type_modifier->is_enum = 1;
-
-    } else if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_EMPTY) {
-      XBT_DEBUG("Pass space");
-
-    } else {
-      XBT_DEBUG("Done with modifiers (got %s)", xbt_ddt_parse_text);
-      break;
-    }
-
-    xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-    if ((xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD) &&
-        (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_STAR)) {
-      XBT_DEBUG("Done with modifiers (got %s,%d)", xbt_ddt_parse_text,
-             xbt_ddt_parse_tok_num);
-      break;
-    }
-  } while (1);
-  XBT_OUT();
-}
-
-static void print_type_modifier(s_type_modifier_t tm)
-{
-  int i;
-
-  XBT_IN();
-  if (tm.is_unsigned)
-    printf("(unsigned) ");
-  if (tm.is_short)
-    printf("(short) ");
-  for (i = 0; i < tm.is_long; i++)
-    printf("(long) ");
-
-  if (tm.is_struct)
-    printf("(struct) ");
-  if (tm.is_enum)
-    printf("(enum) ");
-  if (tm.is_union)
-    printf("(union) ");
-
-  for (i = 0; i < tm.is_ref; i++)
-    printf("(ref) ");
-  XBT_OUT();
-}
-
-static void change_to_fixed_array(xbt_dynar_t dynar, long int size)
-{
-  s_identifier_t former, array;
-  memset(&array, 0, sizeof(array));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  array.type_name = (char *) xbt_malloc(strlen(former.type->name) + 48);
-  XBT_DEBUG("Array specification (size=%ld, elm='%s'), change pushed type",
-         size, former.type_name);
-  sprintf(array.type_name, "%s%s%s%s[%ld]",
-          (former.tm.is_unsigned ? "u " : ""),
-          (former.tm.is_short ? "s " : ""),
-          (former.tm.is_long ? "l " : ""), former.type_name, size);
-  free(former.type_name);
-
-  array.type = xbt_datadesc_array_fixed(array.type_name, former.type, size);   /* redeclaration are ignored */
-  array.name = former.name;
-
-  xbt_dynar_push(dynar, &array);
-  XBT_OUT();
-}
-
-static void change_to_ref(xbt_dynar_t dynar)
-{
-  s_identifier_t former, ref;
-  memset(&ref, 0, sizeof(ref));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  ref.type_name = (char *) xbt_malloc(strlen(former.type->name) + 2);
-  XBT_DEBUG("Ref specification (elm='%s'), change pushed type",
-         former.type_name);
-  sprintf(ref.type_name, "%s*", former.type_name);
-  free(former.type_name);
-
-  ref.type = xbt_datadesc_ref(ref.type_name, former.type);     /* redeclaration are ignored */
-  ref.name = former.name;
-
-  xbt_dynar_push(dynar, &ref);
-  XBT_OUT();
-}
-
-static void change_to_ref_pop_array(xbt_dynar_t dynar)
-{
-  s_identifier_t former, ref;
-  memset(&ref, 0, sizeof(ref));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  ref.type = xbt_datadesc_ref_pop_arr(former.type);    /* redeclaration are ignored */
-  ref.type_name = (char *) strdup(ref.type->name);
-  ref.name = former.name;
-
-  free(former.type_name);
-
-  xbt_dynar_push(dynar, &ref);
-  XBT_OUT();
-}
-
-static void change_to_dynar_of(xbt_dynar_t dynar,
-                               xbt_datadesc_type_t subtype)
-{
-  s_identifier_t former, ref;
-  memset(&ref, 0, sizeof(ref));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  ref.type = xbt_datadesc_dynar(subtype, NULL);        /* redeclaration are ignored */
-  ref.type_name = (char *) strdup(ref.type->name);
-  ref.name = former.name;
-
-  free(former.type_name);
-
-  xbt_dynar_push(dynar, &ref);
-  XBT_OUT();
-}
-
-static void change_to_matrix_of(xbt_dynar_t dynar,
-                                xbt_datadesc_type_t subtype)
-{
-  s_identifier_t former, ref;
-  memset(&ref, 0, sizeof(ref));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  ref.type = xbt_datadesc_matrix(subtype, NULL);       /* redeclaration are ignored */
-  ref.type_name = (char *) strdup(ref.type->name);
-  ref.name = former.name;
-
-  free(former.type_name);
-
-  xbt_dynar_push(dynar, &ref);
-  XBT_OUT();
-}
-
-static void add_free_f(xbt_dynar_t dynar, void_f_pvoid_t free_f)
-{
-  s_identifier_t former, ref;
-  memset(&ref, 0, sizeof(ref));
-
-  XBT_IN();
-  xbt_dynar_pop(dynar, &former);
-  memcpy(former.type->extra, &free_f, sizeof(free_f));
-  xbt_dynar_push(dynar, &former);
-  XBT_OUT();
-}
-
-static void parse_statement(char *definition,
-                            xbt_dynar_t identifiers,
-                            xbt_dynar_t fields_to_push)
-{
-  char buffname[512];
-
-  s_identifier_t identifier;
-
-  int expect_id_separator = 0;
-
-  XBT_IN();
-  memset(&identifier, 0, sizeof(identifier));
-
-  xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-  if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_RA) {
-    XBT_OUT();
-    THROWF(mismatch_error, 0, "End of the englobing structure or union");
-  }
-
-  if (XBT_LOG_ISENABLED(xbt_ddt_parse, xbt_log_priority_debug)) {
-    int colon_pos;
-    for (colon_pos = xbt_ddt_parse_col_pos;
-         definition[colon_pos] != ';'; colon_pos++);
-    definition[colon_pos] = '\0';
-    XBT_DEBUG("Parse the statement \"%s%s;\" (col_pos=%d)",
-           xbt_ddt_parse_text,
-           definition + xbt_ddt_parse_col_pos, xbt_ddt_parse_col_pos);
-    definition[colon_pos] = ';';
-  }
-
-  if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD)
-    PARSE_ERROR
-        ("Unparsable symbol: found a typeless statement (got '%s' instead)",
-         xbt_ddt_parse_text);
-
-        /**** get the type modifier of this statement ****/
-  parse_type_modifier(&identifier.tm);
-
-  /*  FIXME: This does not detect recursive definitions at all? */
-  if (identifier.tm.is_union || identifier.tm.is_enum
-      || identifier.tm.is_struct)
-    PARSE_ERROR
-        ("Unimplemented feature: XBT_DEFINE_TYPE cannot handle recursive type definition yet");
-
-        /**** get the base type, giving "short a" the needed love ****/
-  if (!identifier.tm.is_union &&
-      !identifier.tm.is_enum &&
-      !identifier.tm.is_struct &&
-      (identifier.tm.is_short || identifier.tm.is_long
-       || identifier.tm.is_unsigned) && strcmp(xbt_ddt_parse_text, "char")
-      && strcmp(xbt_ddt_parse_text, "float")
-      && strcmp(xbt_ddt_parse_text, "double")
-      && strcmp(xbt_ddt_parse_text, "int")) {
-
-    /* bastard user, they omited "int" ! */
-    identifier.type_name = (char *) strdup("int");
-    XBT_DEBUG("the base type is 'int', which were omited (you vicious user)");
-  } else {
-    identifier.type_name = (char *) strdup(xbt_ddt_parse_text);
-    XBT_DEBUG("the base type is '%s'", identifier.type_name);
-    xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-  }
-
-        /**** build the base type for latter use ****/
-  if (identifier.tm.is_union) {
-    PARSE_ERROR
-        ("Unimplemented feature: XBT_DEFINE_TYPE cannot handle union yet (get callback from annotation?)");
-
-  } else if (identifier.tm.is_enum) {
-    PARSE_ERROR
-        ("Unimplemented feature: XBT_DEFINE_TYPE cannot handle enum yet");
-
-  } else if (identifier.tm.is_struct) {
-    sprintf(buffname, "struct %s", identifier.type_name);
-    identifier.type = xbt_datadesc_struct(buffname);   /* Get created when does not exist */
-
-  } else if (identifier.tm.is_unsigned) {
-    if (!strcmp(identifier.type_name, "int")) {
-      if (identifier.tm.is_long == 2) {
-        identifier.type = xbt_datadesc_by_name("unsigned long long int");
-      } else if (identifier.tm.is_long) {
-        identifier.type = xbt_datadesc_by_name("unsigned long int");
-      } else if (identifier.tm.is_short) {
-        identifier.type = xbt_datadesc_by_name("unsigned short int");
-      } else {
-        identifier.type = xbt_datadesc_by_name("unsigned int");
-      }
-
-    } else if (!strcmp(identifier.type_name, "char")) {
-      identifier.type = xbt_datadesc_by_name("unsigned char");
-
-    } else {                    /* impossible, gcc parses this shit before us */
-      THROW_IMPOSSIBLE;
-    }
-
-  } else if (!strcmp(identifier.type_name, "float")) {
-    /* no modificator allowed by gcc */
-    identifier.type = xbt_datadesc_by_name("float");
-
-  } else if (!strcmp(identifier.type_name, "double")) {
-    if (identifier.tm.is_long)
-      PARSE_ERROR("long double not portable and thus not handled");
-
-    identifier.type = xbt_datadesc_by_name("double");
-
-  } else {                      /* signed integer elemental */
-    if (!strcmp(identifier.type_name, "int")) {
-      if (identifier.tm.is_long == 2) {
-        identifier.type = xbt_datadesc_by_name("signed long long int");
-      } else if (identifier.tm.is_long) {
-        identifier.type = xbt_datadesc_by_name("signed long int");
-      } else if (identifier.tm.is_short) {
-        identifier.type = xbt_datadesc_by_name("signed short int");
-      } else {
-        identifier.type = xbt_datadesc_by_name("int");
-      }
-
-    } else if (!strcmp(identifier.type_name, "char")) {
-      identifier.type = xbt_datadesc_by_name("char");
-
-    } else {
-      XBT_DEBUG("Base type is a constructed one (%s)", identifier.type_name);
-      if (!strcmp(identifier.type_name, "xbt_matrix_t")) {
-        identifier.tm.is_matrix = 1;
-      } else if (!strcmp(identifier.type_name, "xbt_dynar_t")) {
-        identifier.tm.is_dynar = 1;
-      } else {
-        identifier.type = xbt_datadesc_by_name(identifier.type_name);
-        if (!identifier.type)
-          PARSE_ERROR("Unknown base type '%s'", identifier.type_name);
-      }
-    }
-  }
-  /* Now identifier.type and identifier.name speak about the base type.
-     Stars are not eaten unless 'int' was omitted.
-     We will have to enhance it if we are in fact asked for array or reference.
-
-     Dynars and matrices also need some extra love (prodiged as annotations)
-   */
-
-        /**** look for the symbols of this type ****/
-  for (expect_id_separator = 0; (       /*(xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_EMPTY) && FIXME */
-                                  (xbt_ddt_parse_tok_num !=
-                                   XBT_DDT_PARSE_TOKEN_SEMI_COLON));
-       xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump()) {
-
-    if (expect_id_separator) {
-      if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_COLON) {
-        expect_id_separator = 0;
-        continue;
-
-      } else if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_LB) {
-        /* Handle fixed size arrays */
-        xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-        if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_RB) {
-          PARSE_ERROR
-              ("Unimplemented feature: XBT_DEFINE_TYPE cannot deal with [] constructs (yet)");
-
-        } else if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD) {
-          char *end;
-          long int size = strtol(xbt_ddt_parse_text, &end, 10);
-
-          if (end == xbt_ddt_parse_text || *end != '\0') {
-            /* Not a number. Get the constant value, if any */
-            int *storage = xbt_dict_get_or_null(xbt_dd_constants,
-                                                xbt_ddt_parse_text);
-            if (storage) {
-              size = *storage;
-            } else {
-              PARSE_ERROR
-                  ("Unparsable size of array. Found '%s', expected number or known constant. Need to use xbt_datadesc_set_const(), huh?",
-                   xbt_ddt_parse_text);
-            }
-          }
-
-          /* replace the previously pushed type to an array of it */
-          change_to_fixed_array(identifiers, size);
-
-          /* eat the closing bracket */
-          xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-          if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_RB)
-            PARSE_ERROR("Unparsable size of array");
-          XBT_DEBUG("Fixed size array, size=%ld", size);
-          continue;
-        } else {
-          PARSE_ERROR("Unparsable size of array");
-        }
-        /* End of fixed size arrays handling */
-
-      } else if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD) {
-        /* Handle annotation */
-        s_identifier_t array;
-        char *keyname = NULL;
-        char *keyval = NULL;
-        memset(&array, 0, sizeof(array));
-        if (strcmp(xbt_ddt_parse_text, "XBT_ANNOTE"))
-          PARSE_ERROR
-              ("Unparsable symbol: Expected 'XBT_ANNOTE', got '%s'",
-               xbt_ddt_parse_text);
-
-        xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-        if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_LP)
-          PARSE_ERROR
-              ("Unparsable annotation: Expected parenthesis, got '%s'",
-               xbt_ddt_parse_text);
-
-        while ((xbt_ddt_parse_tok_num =
-                xbt_ddt_parse_lex_n_dump()) ==
-               XBT_DDT_PARSE_TOKEN_EMPTY);
-
-        if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD)
-          PARSE_ERROR
-              ("Unparsable annotation: Expected key name, got '%s'",
-               xbt_ddt_parse_text);
-        keyname = (char *) strdup(xbt_ddt_parse_text);
-
-        while ((xbt_ddt_parse_tok_num =
-                xbt_ddt_parse_lex_n_dump()) ==
-               XBT_DDT_PARSE_TOKEN_EMPTY);
-
-        if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_COLON)
-          PARSE_ERROR
-              ("Unparsable annotation: expected ',' after the key name, got '%s'",
-               xbt_ddt_parse_text);
-
-        while ((xbt_ddt_parse_tok_num =
-                xbt_ddt_parse_lex_n_dump()) ==
-               XBT_DDT_PARSE_TOKEN_EMPTY);
-
-        /* get the value */
-
-        if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD)
-          PARSE_ERROR
-              ("Unparsable annotation: Expected key value, got '%s'",
-               xbt_ddt_parse_text);
-        keyval = (char *) strdup(xbt_ddt_parse_text);
-
-        while ((xbt_ddt_parse_tok_num =
-                xbt_ddt_parse_lex_n_dump()) ==
-               XBT_DDT_PARSE_TOKEN_EMPTY);
-
-        /* Done with parsing the annotation. Now deal with it by replacing previously pushed type with the right one */
-
-        XBT_DEBUG("Anotation: %s=%s", keyname, keyval);
-        if (!strcmp(keyname, "size")) {
-          if (!identifier.tm.is_ref)
-            PARSE_ERROR
-                ("Size annotation for a field not being a reference");
-          identifier.tm.is_ref--;
-
-          if (!strcmp(keyval, "1")) {
-            change_to_ref(identifiers);
-            free(keyval);
-          } else {
-            char *p;
-            int fixed = 1;
-            for (p = keyval; *p != '\0'; p++)
-              if (!isdigit(*p))
-                fixed = 0;
-            if (fixed) {
-              change_to_fixed_array(identifiers, atoi(keyval));
-              change_to_ref(identifiers);
-              free(keyval);
-
-            } else {
-              change_to_ref_pop_array(identifiers);
-              xbt_dynar_push(fields_to_push, &keyval);
-            }
-          }
-        } else if (!strcmp(keyname, "subtype")) {
-          xbt_datadesc_type_t subtype = xbt_datadesc_by_name(keyval);
-          if (identifier.tm.is_matrix) {
-            change_to_matrix_of(identifiers, subtype);
-            identifier.tm.is_matrix = -1;
-          } else if (identifier.tm.is_dynar) {
-            change_to_dynar_of(identifiers, subtype);
-            identifier.tm.is_dynar = -1;
-          } else {
-            PARSE_ERROR
-                ("subtype annotation only accepted for dynars and matrices, but passed to '%s'",
-                 identifier.type_name);
-          }
-          free(keyval);
-        } else if (!strcmp(keyname, "free_f")) {
-          int *storage = xbt_dict_get_or_null(xbt_dd_constants, keyval);
-          if (!storage)
-            PARSE_ERROR
-                ("value for free_f annotation of field %s is not a known constant",
-                 identifier.name);
-          if (identifier.tm.is_matrix == -1) {
-            add_free_f(identifiers, *(void_f_pvoid_t *) storage);
-            identifier.tm.is_matrix = 0;
-          } else if (identifier.tm.is_dynar == -1) {
-            add_free_f(identifiers, *(void_f_pvoid_t *) storage);
-            identifier.tm.is_dynar = 0;
-          } else {
-            PARSE_ERROR
-                ("free_f annotation only accepted for dynars and matrices which subtype is already declared (field %s)",
-                 identifier.name);
-          }
-          free(keyval);
-        } else {
-          free(keyval);
-          PARSE_ERROR("Unknown annotation type: '%s'", keyname);
-        }
-        free(keyname);
-
-        /* Get all the multipliers */
-        while (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_STAR) {
-
-          xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-
-          if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD)
-            PARSE_ERROR
-                ("Unparsable annotation: Expected field name after '*', got '%s'",
-                 xbt_ddt_parse_text);
-
-          keyval = xbt_malloc(strlen(xbt_ddt_parse_text) + 2);
-          sprintf(keyval, "*%s", xbt_ddt_parse_text);
-
-          /* ask caller to push field as a multiplier */
-          xbt_dynar_push(fields_to_push, &keyval);
-
-          /* skip blanks after this block */
-          while ((xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump())
-                 == XBT_DDT_PARSE_TOKEN_EMPTY);
-        }
-
-        if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_RP)
-          PARSE_ERROR
-              ("Unparsable annotation: Expected parenthesis, got '%s'",
-               xbt_ddt_parse_text);
-
-        continue;
-
-        /* End of annotation handling */
-      } else {
-        PARSE_ERROR
-            ("Unparsable symbol: Got '%s' instead of expected comma (',')",
-             xbt_ddt_parse_text);
-      }
-    } else if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_COLON) {
-      PARSE_ERROR("Unparsable symbol: Unexpected comma (',')");
-    }
-
-    if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_STAR) {
-      identifier.tm.is_ref++;   /* We indeed deal with multiple references with multiple annotations */
-      continue;
-    }
-
-    /* found a symbol name. Build the type and push it to dynar */
-    if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD) {
-
-      identifier.name = (char *) strdup(xbt_ddt_parse_text);
-      XBT_DEBUG("Found the identifier \"%s\"", identifier.name);
-
-      xbt_dynar_push(identifiers, &identifier);
-      XBT_DEBUG("Dynar_len=%lu", xbt_dynar_length(identifiers));
-      expect_id_separator = 1;
-      continue;
-    }
-
-    PARSE_ERROR
-        ("Unparasable symbol (maybe a def struct in a def struct or a parser bug ;)");
-  }
-
-  if (identifier.tm.is_matrix > 0)
-    PARSE_ERROR("xbt_matrix_t field without 'subtype' annotation");
-  if (identifier.tm.is_dynar > 0)
-    PARSE_ERROR("xbt_dynar_t field without 'subtype' annotation");
-
-  XBT_OUT();
-}
-
-static xbt_datadesc_type_t parse_struct(char *definition)
-{
-
-  xbt_ex_t e;
-
-  char buffname[32];
-  static int anonymous_struct = 0;
-
-  xbt_dynar_t identifiers;
-  s_identifier_t field;
-  unsigned int iter;
-  int done;
-
-  xbt_dynar_t fields_to_push;
-  char *name;
-
-  volatile xbt_datadesc_type_t struct_type;
-
-  XBT_IN();
-  identifiers = xbt_dynar_new(sizeof(s_identifier_t), NULL);
-  fields_to_push = xbt_dynar_new(sizeof(char *), NULL);
-
-  /* Create the struct descriptor */
-  if (xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD) {
-    struct_type = xbt_datadesc_struct(xbt_ddt_parse_text);
-    XBT_VERB("Parse the struct '%s'", xbt_ddt_parse_text);
-    xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-  } else {
-    sprintf(buffname, "anonymous struct %d", anonymous_struct++);
-    XBT_VERB("Parse the anonymous struct nb %d", anonymous_struct);
-    struct_type = xbt_datadesc_struct(buffname);
-  }
-
-  if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_LA)
-    PARSE_ERROR
-        ("Unparasable symbol: Expecting struct definition, but got %s instead of '{'",
-         xbt_ddt_parse_text);
-
-  /* Parse the identifiers */
-  done = 0;
-  do {
-    TRY {
-      parse_statement(definition, identifiers, fields_to_push);
-    }
-    CATCH(e) {
-      if (e.category != mismatch_error)
-        RETHROW;
-      xbt_ex_free(e);
-      done = 1;
-    }
-
-    XBT_DEBUG("This statement contained %lu identifiers",
-           xbt_dynar_length(identifiers));
-    /* append the identifiers we've found */
-    xbt_dynar_foreach(identifiers, iter, field) {
-      if (field.tm.is_ref)
-        PARSE_ERROR
-            ("Not enough XBT_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
-             field.name, (int)field.tm.is_ref);
-
-      XBT_VERB("Append field '%s' to %p", field.name, (void *) struct_type);
-      xbt_datadesc_struct_append(struct_type, field.name, field.type);
-      free(field.name);
-      free(field.type_name);
-
-    }
-    xbt_dynar_reset(identifiers);
-    XBT_DEBUG("struct_type=%p", (void *) struct_type);
-
-    /* Make sure that all fields declaring a size push it into the cbps */
-    xbt_dynar_foreach(fields_to_push, iter, name) {
-      XBT_DEBUG("struct_type=%p", (void *) struct_type);
-      if (name[0] == '*') {
-        XBT_VERB("Push field '%s' as a multiplier into size stack of %p",
-              name + 1, (void *) struct_type);
-        xbt_datadesc_cb_field_push_multiplier(struct_type, name + 1);
-      } else {
-        XBT_VERB("Push field '%s' into size stack of %p",
-              name, (void *) struct_type);
-        xbt_datadesc_cb_field_push(struct_type, name);
-      }
-      free(name);
-    }
-    xbt_dynar_reset(fields_to_push);
-  } while (!done);
-  xbt_datadesc_struct_close(struct_type);
-
-  /* terminates */
-  if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_RA)
-    PARSE_ERROR
-        ("Unparasable symbol: Expected '}' at the end of struct definition, got '%s'",
-         xbt_ddt_parse_text);
-
-  xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-
-  xbt_dynar_free(&identifiers);
-  xbt_dynar_free(&fields_to_push);
-  XBT_OUT();
-  return struct_type;
-}
-
-static xbt_datadesc_type_t parse_typedef(char *definition)
-{
-
-  s_type_modifier_t tm;
-
-  xbt_datadesc_type_t typedef_desc = NULL;
-
-  XBT_IN();
-  memset(&tm, 0, sizeof(tm));
-
-  /* get the aliased type */
-  parse_type_modifier(&tm);
-
-  if (tm.is_struct) {
-     parse_struct(definition);
-  }
-
-  parse_type_modifier(&tm);
-
-  if (tm.is_ref)
-    PARSE_ERROR
-        ("XBT_DEFINE_TYPE cannot handle reference without annotation");
-
-  /* get the aliasing name */
-  if (xbt_ddt_parse_tok_num != XBT_DDT_PARSE_TOKEN_WORD)
-    PARSE_ERROR
-        ("Unparsable typedef: Expected the alias name, and got '%s'",
-         xbt_ddt_parse_text);
-
-  /* (FIXME: should) build the alias */
-  PARSE_ERROR
-      ("Unimplemented feature: XBT_DEFINE_TYPE cannot handle typedef yet");
-
-  XBT_OUT();
-  return typedef_desc;
-}
-
-
-/**
- * xbt_datadesc_parse:
- *
- * Create a datadescription from the result of parsing the C type description
- */
-xbt_datadesc_type_t
-xbt_datadesc_parse(const char *name, const char *C_statement)
-{
-
-  xbt_datadesc_type_t res = NULL;
-  char *definition;
-  int semicolon_count = 0;
-  int def_count, C_count;
-
-  XBT_IN();
-  /* reput the \n in place for debug */
-  for (C_count = 0; C_statement[C_count] != '\0'; C_count++)
-    if (C_statement[C_count] == ';' || C_statement[C_count] == '{')
-      semicolon_count++;
-  definition = (char *) xbt_malloc(C_count + semicolon_count + 1);
-  for (C_count = 0, def_count = 0; C_statement[C_count] != '\0'; C_count++) {
-    definition[def_count++] = C_statement[C_count];
-    if (C_statement[C_count] == ';' || C_statement[C_count] == '{') {
-      definition[def_count++] = '\n';
-    }
-  }
-  definition[def_count] = '\0';
-
-  /* init */
-  XBT_VERB("_xbt_ddt_type_parse(%s) -> %d chars", definition, def_count);
-  xbt_ddt_parse_pointer_string_init(definition);
-
-  /* Do I have a typedef, or a raw struct ? */
-  xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-
-  if ((xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD)
-      && (!strcmp(xbt_ddt_parse_text, "struct"))) {
-    xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-    res = parse_struct(definition);
-
-  } else if ((xbt_ddt_parse_tok_num == XBT_DDT_PARSE_TOKEN_WORD)
-             && (!strcmp(xbt_ddt_parse_text, "typedef"))) {
-    xbt_ddt_parse_tok_num = xbt_ddt_parse_lex_n_dump();
-    res = parse_typedef(definition);
-
-  } else {
-    XBT_ERROR
-        ("Failed to parse the following symbol (not a struct neither a typedef) :\n%s",
-         definition);
-    xbt_abort();
-  }
-
-  xbt_ddt_parse_pointer_string_close();
-  XBT_VERB("end of _xbt_ddt_type_parse()");
-  free(definition);
-  /* register it under the name provided as symbol */
-  if (strcmp(res->name, name)) {
-    XBT_ERROR
-        ("In XBT_DEFINE_TYPE, the provided symbol (here %s) must be the C type name (here %s)",
-         name, res->name);
-    xbt_abort();
-  }
-  xbt_ddt_parse_lex_destroy();
-  XBT_OUT();
-  return res;
-}
-
-xbt_dict_t xbt_dd_constants;
-/** \brief Declare a constant to the parsing mecanism. See the "\#define and fixed size array" section */
-void xbt_datadesc_set_const(const char *name, int value)
-{
-  int *stored = xbt_new(int, 1);
-  *stored = value;
-
-  xbt_dict_set(xbt_dd_constants, name, stored, NULL);
-}
diff --git a/src/xbt/datadesc/ddt_parse.yy.c b/src/xbt/datadesc/ddt_parse.yy.c
deleted file mode 100644 (file)
index a3a4c66..0000000
+++ /dev/null
@@ -1,2085 +0,0 @@
-
-#line 3 "src/xbt/datadesc/ddt_parse.yy.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define yy_create_buffer xbt_ddt_parse__create_buffer
-#define yy_delete_buffer xbt_ddt_parse__delete_buffer
-#define yy_flex_debug xbt_ddt_parse__flex_debug
-#define yy_init_buffer xbt_ddt_parse__init_buffer
-#define yy_flush_buffer xbt_ddt_parse__flush_buffer
-#define yy_load_buffer_state xbt_ddt_parse__load_buffer_state
-#define yy_switch_to_buffer xbt_ddt_parse__switch_to_buffer
-#define yyin xbt_ddt_parse_in
-#define yyleng xbt_ddt_parse_leng
-#define yylex xbt_ddt_parse_lex
-#define yylineno xbt_ddt_parse_lineno
-#define yyout xbt_ddt_parse_out
-#define yyrestart xbt_ddt_parse_restart
-#define yytext xbt_ddt_parse_text
-#define yywrap xbt_ddt_parse_wrap
-#define yyalloc xbt_ddt_parse_alloc
-#define yyrealloc xbt_ddt_parse_realloc
-#define yyfree xbt_ddt_parse_free
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! C99 */
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else  /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE xbt_ddt_parse_restart(xbt_ddt_parse_in  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
-#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-extern int xbt_ddt_parse_leng;
-
-extern FILE *xbt_ddt_parse_in, *xbt_ddt_parse_out;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up xbt_ddt_parse_text. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               *yy_cp = (yy_hold_char); \
-               YY_RESTORE_YY_MORE_OFFSET \
-               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-               YY_DO_BEFORE_ACTION; /* set up xbt_ddt_parse_text again */ \
-               } \
-       while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-       {
-       FILE *yy_input_file;
-
-       char *yy_ch_buf;                /* input buffer */
-       char *yy_buf_pos;               /* current position in input buffer */
-
-       /* Size of input buffer in bytes, not including room for EOB
-        * characters.
-        */
-       yy_size_t yy_buf_size;
-
-       /* Number of characters read into yy_ch_buf, not including EOB
-        * characters.
-        */
-       int yy_n_chars;
-
-       /* Whether we "own" the buffer - i.e., we know we created it,
-        * and can realloc() it to grow it, and should free() it to
-        * delete it.
-        */
-       int yy_is_our_buffer;
-
-       /* Whether this is an "interactive" input source; if so, and
-        * if we're using stdio for input, then we want to use getc()
-        * instead of fread(), to make sure we stop fetching input after
-        * each newline.
-        */
-       int yy_is_interactive;
-
-       /* Whether we're considered to be at the beginning of a line.
-        * If so, '^' rules will be active on the next match, otherwise
-        * not.
-        */
-       int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-       /* Whether to try to fill the input buffer when we reach the
-        * end of it.
-        */
-       int yy_fill_buffer;
-
-       int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-       /* When an EOF's been seen but there's still some text to process
-        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-        * shouldn't try reading from the input source any more.  We might
-        * still have a bunch of tokens to match, though, because of
-        * possible backing-up.
-        *
-        * When we actually see the EOF, we change the status to "new"
-        * (via xbt_ddt_parse_restart()), so that the user can continue scanning by
-        * just pointing xbt_ddt_parse_in at a new input file.
-        */
-#define YY_BUFFER_EOF_PENDING 2
-
-       };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when xbt_ddt_parse_text is formed. */
-static char yy_hold_char;
-static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-int xbt_ddt_parse_leng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;                /* whether we need to initialize */
-static int yy_start = 0;       /* start state number */
-
-/* Flag which is used to allow xbt_ddt_parse_wrap()'s to do buffer switches
- * instead of setting up a fresh xbt_ddt_parse_in.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void xbt_ddt_parse_restart (FILE *input_file  );
-void xbt_ddt_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE xbt_ddt_parse__create_buffer (FILE *file,int size  );
-void xbt_ddt_parse__delete_buffer (YY_BUFFER_STATE b  );
-void xbt_ddt_parse__flush_buffer (YY_BUFFER_STATE b  );
-void xbt_ddt_parse_push_buffer_state (YY_BUFFER_STATE new_buffer  );
-void xbt_ddt_parse_pop_buffer_state (void );
-
-static void xbt_ddt_parse_ensure_buffer_stack (void );
-static void xbt_ddt_parse__load_buffer_state (void );
-static void xbt_ddt_parse__init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER xbt_ddt_parse__flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE xbt_ddt_parse__scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE xbt_ddt_parse__scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE xbt_ddt_parse__scan_bytes (yyconst char *bytes,int len  );
-
-void *xbt_ddt_parse_alloc (yy_size_t  );
-void *xbt_ddt_parse_realloc (void *,yy_size_t  );
-void xbt_ddt_parse_free (void *  );
-
-#define yy_new_buffer xbt_ddt_parse__create_buffer
-
-#define yy_set_interactive(is_interactive) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){ \
-        xbt_ddt_parse_ensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-       }
-
-#define yy_set_bol(at_bol) \
-       { \
-       if ( ! YY_CURRENT_BUFFER ){\
-        xbt_ddt_parse_ensure_buffer_stack (); \
-               YY_CURRENT_BUFFER_LVALUE =    \
-            xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE ); \
-       } \
-       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-       }
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define xbt_ddt_parse_wrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-FILE *xbt_ddt_parse_in = (FILE *) 0, *xbt_ddt_parse_out = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int xbt_ddt_parse_lineno;
-
-int xbt_ddt_parse_lineno = 1;
-
-extern char *xbt_ddt_parse_text;
-#define yytext_ptr xbt_ddt_parse_text
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up xbt_ddt_parse_text.
- */
-#define YY_DO_BEFORE_ACTION \
-       (yytext_ptr) = yy_bp; \
-       xbt_ddt_parse_leng = (size_t) (yy_cp - yy_bp); \
-       (yy_hold_char) = *yy_cp; \
-       *yy_cp = '\0'; \
-       (yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 26
-#define YY_END_OF_BUFFER 27
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-       {
-       flex_int32_t yy_verify;
-       flex_int32_t yy_nxt;
-       };
-static yyconst flex_int16_t yy_accept[61] =
-    {   0,
-       14,   14,    7,    7,   10,   10,    0,    0,   27,   25,
-       24,   19,   20,   21,   23,   14,   25,   22,   17,   18,
-       15,   16,    7,    7,    6,    7,    7,   10,   12,   11,
-       26,   26,   14,    0,    1,    7,    7,    7,    5,    7,
-       10,   11,   11,   13,    0,    0,    2,    1,    4,    0,
-        3,    0,    2,    0,    3,    0,    0,    8,    9,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    1,    1,    1,    1,    1,    1,    4,
-        5,    6,    1,    7,    8,    8,    9,   10,   10,   10,
-       10,   10,   10,   10,   10,   10,   10,    1,   11,    1,
-        1,    1,    1,    1,    8,    8,    8,    8,    8,    8,
-        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
-        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
-       12,    1,   13,   14,    8,    1,    8,    8,    8,    8,
-
-        8,    8,   15,    8,    8,    8,    8,    8,    8,    8,
-        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
-        8,    8,   16,    1,   17,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[18] =
-    {   0,
-        1,    1,    2,    1,    1,    3,    1,    4,    1,    4,
-        1,    1,    1,    1,    4,    1,    1
-    } ;
-
-static yyconst flex_int16_t yy_base[69] =
-    {   0,
-        0,    0,   16,   30,   17,   18,   78,   77,   85,   88,
-       88,   88,   88,   88,   88,    0,   19,   88,   88,   88,
-       88,   88,    0,   24,   88,   75,   77,    0,   88,   21,
-       88,   76,    0,   22,    0,    0,   27,   75,    0,   71,
-        0,   29,   34,   88,   29,   65,   76,    0,    0,   63,
-       74,   60,   72,   56,   65,   51,   50,   88,   88,   88,
-       45,   49,   53,   55,   57,   61,   65,   69
-    } ;
-
-static yyconst flex_int16_t yy_def[69] =
-    {   0,
-       60,    1,   61,   61,   62,   62,   63,   63,   60,   60,
-       60,   60,   60,   60,   60,   64,   60,   60,   60,   60,
-       60,   60,   65,   65,   60,   65,   65,   66,   60,   67,
-       60,   60,   64,   60,   68,   65,   65,   65,   65,   65,
-       66,   67,   67,   60,   60,   60,   60,   68,   65,   60,
-       60,   60,   60,   60,   60,   60,   60,   60,   60,    0,
-       60,   60,   60,   60,   60,   60,   60,   60
-    } ;
-
-static yyconst flex_int16_t yy_nxt[106] =
-    {   0,
-       10,   10,   11,   12,   13,   14,   15,   16,   17,   16,
-       18,   19,   20,   10,   16,   21,   22,   24,   25,   29,
-       29,   26,   30,   30,   34,   37,   43,   35,   37,   44,
-       27,   24,   25,   46,   60,   26,   47,   60,   38,   43,
-       50,   38,   44,   51,   27,   23,   23,   23,   23,   28,
-       28,   28,   28,   31,   31,   31,   31,   36,   33,   36,
-       36,   41,   59,   58,   41,   42,   55,   42,   42,   48,
-       57,   48,   48,   53,   56,   55,   54,   53,   52,   49,
-       40,   45,   40,   39,   60,   32,   32,    9,   60,   60,
-       60,   60,   60,   60,   60,   60,   60,   60,   60,   60,
-
-       60,   60,   60,   60,   60
-    } ;
-
-static yyconst flex_int16_t yy_chk[106] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    3,    3,    5,
-        6,    3,    5,    6,   17,   24,   30,   17,   37,   30,
-        3,    4,    4,   34,   42,    4,   34,   42,   24,   43,
-       45,   37,   43,   45,    4,   61,   61,   61,   61,   62,
-       62,   62,   62,   63,   63,   63,   63,   65,   64,   65,
-       65,   66,   57,   56,   66,   67,   55,   67,   67,   68,
-       54,   68,   68,   53,   52,   51,   50,   47,   46,   40,
-       38,   32,   27,   26,    9,    8,    7,   60,   60,   60,
-       60,   60,   60,   60,   60,   60,   60,   60,   60,   60,
-
-       60,   60,   60,   60,   60
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int xbt_ddt_parse__flex_debug;
-int xbt_ddt_parse__flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *xbt_ddt_parse_text;
-/* datadesc/ddt_parse -- automatic parsing of data structures */
-/* Copyright (c) 2004 Arnaud Legrand, 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/datadesc/datadesc_private.h"
-#include "xbt/datadesc/ddt_parse.yy.h"
-#include <string.h>
-  YY_BUFFER_STATE xbt_ddt_input_buffer;
-  FILE *xbt_ddt_file_to_parse;
-
-  int xbt_ddt_parse_line_pos = 1;
-  int xbt_ddt_parse_col_pos = 0;
-  int xbt_ddt_parse_char_pos = 0;
-  int xbt_ddt_parse_tok_num = 0;
-  const char *definition;
-  XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_lexer,xbt_ddt_parse,"The crude internals of the lexer used for type parsing");
-#define SHOW_WHERE XBT_DEBUG("%d:%d (char #%d): seen '%s'", xbt_ddt_parse_line_pos,xbt_ddt_parse_col_pos,xbt_ddt_parse_char_pos,xbt_ddt_parse_text)
-
-#define INITIAL 0
-#define annotate 1
-#define comment 2
-#define foo 3
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int xbt_ddt_parse_lex_destroy (void );
-
-int xbt_ddt_parse_get_debug (void );
-
-void xbt_ddt_parse_set_debug (int debug_flag  );
-
-YY_EXTRA_TYPE xbt_ddt_parse_get_extra (void );
-
-void xbt_ddt_parse_set_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *xbt_ddt_parse_get_in (void );
-
-void xbt_ddt_parse_set_in  (FILE * in_str  );
-
-FILE *xbt_ddt_parse_get_out (void );
-
-void xbt_ddt_parse_set_out  (FILE * out_str  );
-
-int xbt_ddt_parse_get_leng (void );
-
-char *xbt_ddt_parse_get_text (void );
-
-int xbt_ddt_parse_get_lineno (void );
-
-void xbt_ddt_parse_set_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int xbt_ddt_parse_wrap (void );
-#else
-extern int xbt_ddt_parse_wrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
-#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO do { if (fwrite( xbt_ddt_parse_text, xbt_ddt_parse_leng, 1, xbt_ddt_parse_out )) {} } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-               { \
-               int c = '*'; \
-               size_t n; \
-               for ( n = 0; n < max_size && \
-                            (c = getc( xbt_ddt_parse_in )) != EOF && c != '\n'; ++n ) \
-                       buf[n] = (char) c; \
-               if ( c == '\n' ) \
-                       buf[n++] = (char) c; \
-               if ( c == EOF && ferror( xbt_ddt_parse_in ) ) \
-                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
-               result = n; \
-               } \
-       else \
-               { \
-               errno=0; \
-               while ( (result = fread(buf, 1, max_size, xbt_ddt_parse_in))==0 && ferror(xbt_ddt_parse_in)) \
-                       { \
-                       if( errno != EINTR) \
-                               { \
-                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                               break; \
-                               } \
-                       errno=0; \
-                       clearerr(xbt_ddt_parse_in); \
-                       } \
-               }\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int xbt_ddt_parse_lex (void);
-
-#define YY_DECL int xbt_ddt_parse_lex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after xbt_ddt_parse_text and xbt_ddt_parse_leng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-       YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp, *yy_bp;
-       register int yy_act;
-    
-   int comment_caller=0;
-   int annotate_caller=0;
-
-       if ( !(yy_init) )
-               {
-               (yy_init) = 1;
-
-#ifdef YY_USER_INIT
-               YY_USER_INIT;
-#endif
-
-               if ( ! (yy_start) )
-                       (yy_start) = 1; /* first start state */
-
-               if ( ! xbt_ddt_parse_in )
-                       xbt_ddt_parse_in = stdin;
-
-               if ( ! xbt_ddt_parse_out )
-                       xbt_ddt_parse_out = stdout;
-
-               if ( ! YY_CURRENT_BUFFER ) {
-                       xbt_ddt_parse_ensure_buffer_stack ();
-                       YY_CURRENT_BUFFER_LVALUE =
-                               xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE );
-               }
-
-               xbt_ddt_parse__load_buffer_state( );
-               }
-
-       while ( 1 )             /* loops until end-of-file is reached */
-               {
-               yy_cp = (yy_c_buf_p);
-
-               /* Support of xbt_ddt_parse_text. */
-               *yy_cp = (yy_hold_char);
-
-               /* yy_bp points to the position in yy_ch_buf of the start of
-                * the current run.
-                */
-               yy_bp = yy_cp;
-
-               yy_current_state = (yy_start);
-yy_match:
-               do
-                       {
-                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                       if ( yy_accept[yy_current_state] )
-                               {
-                               (yy_last_accepting_state) = yy_current_state;
-                               (yy_last_accepting_cpos) = yy_cp;
-                               }
-                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                               {
-                               yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 61 )
-                                       yy_c = yy_meta[(unsigned int) yy_c];
-                               }
-                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                       ++yy_cp;
-                       }
-               while ( yy_base[yy_current_state] != 88 );
-
-yy_find_action:
-               yy_act = yy_accept[yy_current_state];
-               if ( yy_act == 0 )
-                       { /* have to back up */
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       yy_act = yy_accept[yy_current_state];
-                       }
-
-               YY_DO_BEFORE_ACTION;
-
-do_action:     /* This label is used only to access EOF actions. */
-
-               switch ( yy_act )
-       { /* beginning of action switch */
-                       case 0: /* must back up */
-                       /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = (yy_hold_char);
-                       yy_cp = (yy_last_accepting_cpos);
-                       yy_current_state = (yy_last_accepting_state);
-                       goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-
-       YY_BREAK
-case 2:
-YY_RULE_SETUP
-{ /****************** ANNOTATION ************************/
-  XBT_DEBUG("Begin annotation");
-  annotate_caller = INITIAL;
-  xbt_ddt_parse_char_pos+= strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
-  BEGIN(annotate);
-}
-       YY_BREAK
-case 3:
-YY_RULE_SETUP
-{ /* trim annotation */
-  XBT_DEBUG("Begin annotation");
-  annotate_caller = foo;
-  xbt_ddt_parse_char_pos+= strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
-  BEGIN(annotate);
-}
-       YY_BREAK
-case 4:
-YY_RULE_SETUP
-{
-  XBT_DEBUG("End annotation");
-  xbt_ddt_parse_char_pos+= strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
-  BEGIN(annotate_caller);
-}
-       YY_BREAK
-case 5:
-YY_RULE_SETUP
-{
-  PARSE_ERROR("``/*g'' construct closed by a regular ``*/''");
-}
-       YY_BREAK
-case 6:
-/* rule 6 can match eol */
-YY_RULE_SETUP
-{
-  PARSE_ERROR("Type annotation cannot spread over several lines");
-}
-       YY_BREAK
-case 7:
-YY_RULE_SETUP
-{ /* eat the rest */
-  xbt_ddt_parse_char_pos+= strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
-  return XBT_DDT_PARSE_TOKEN_ANNOTATE;
-}
-       YY_BREAK
-case 8:
-YY_RULE_SETUP
-{ /****************** COMMENTS ************************/
-  /* constructs like : */
-    /*g [string] g*/ 
-  /* are not comments but size annotations */
-  comment_caller = INITIAL;
-  BEGIN(comment);
-}
-       YY_BREAK
-case 9:
-YY_RULE_SETUP
-{
-  comment_caller = foo;
-  BEGIN(comment);
-}
-       YY_BREAK
-case 10:
-YY_RULE_SETUP
-{ /* eat anything that's not a '*' */
-}
-       YY_BREAK
-case 11:
-YY_RULE_SETUP
-{ /* eat up '*'s not followed by '/'s */
-}
-       YY_BREAK
-case 12:
-/* rule 12 can match eol */
-YY_RULE_SETUP
-{
-  ++xbt_ddt_parse_line_pos;
-  xbt_ddt_parse_col_pos=0;
-  xbt_ddt_parse_char_pos++;
-}
-       YY_BREAK
-case 13:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos+= strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
-  BEGIN(comment_caller);
-}
-       YY_BREAK
-case 14:
-YY_RULE_SETUP
-{  /****************** STATEMENTS ************************/
-  xbt_ddt_parse_char_pos += strlen(xbt_ddt_parse_text);
-  xbt_ddt_parse_col_pos += strlen(xbt_ddt_parse_text);
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_WORD);
-}
-       YY_BREAK
-case 15:
-YY_RULE_SETUP
-{ 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LA);
-}
-       YY_BREAK
-case 16:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RA);
-}
-       YY_BREAK
-case 17:
-YY_RULE_SETUP
-{ 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LB);
-}
-       YY_BREAK
-case 18:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RB);
-}
-       YY_BREAK
-case 19:
-YY_RULE_SETUP
-{ 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LP);
-}
-       YY_BREAK
-case 20:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RP);
-}
-       YY_BREAK
-case 21:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_STAR);
-}
-       YY_BREAK
-case 22:
-YY_RULE_SETUP
-{
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_SEMI_COLON);
-}
-       YY_BREAK
-case 23:
-YY_RULE_SETUP
-{ 
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_COLON);
-}
-       YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-{
- xbt_ddt_parse_line_pos++; 
- xbt_ddt_parse_char_pos++;
- xbt_ddt_parse_col_pos=0;
-  SHOW_WHERE;
-}
-       YY_BREAK
-case 25:
-YY_RULE_SETUP
-{ 
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-}
-       YY_BREAK
-case 26:
-YY_RULE_SETUP
-ECHO;
-       YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(annotate):
-case YY_STATE_EOF(comment):
-case YY_STATE_EOF(foo):
-       yyterminate();
-
-       case YY_END_OF_BUFFER:
-               {
-               /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-               /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = (yy_hold_char);
-               YY_RESTORE_YY_MORE_OFFSET
-
-               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-                       {
-                       /* We're scanning a new file or input source.  It's
-                        * possible that this happened because the user
-                        * just pointed xbt_ddt_parse_in at a new source and called
-                        * xbt_ddt_parse_lex().  If so, then we have to assure
-                        * consistency between YY_CURRENT_BUFFER and our
-                        * globals.  Here is the right place to do so, because
-                        * this is the first action (other than possibly a
-                        * back-up) that will match for the new input source.
-                        */
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_ddt_parse_in;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                       }
-
-               /* Note that here we test for yy_c_buf_p "<=" to the position
-                * of the first EOB in the buffer, since yy_c_buf_p will
-                * already have been incremented past the NUL character
-                * (since all states make transitions on EOB to the
-                * end-of-buffer state).  Contrast this with the test
-                * in input().
-                */
-               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       { /* This was really a NUL. */
-                       yy_state_type yy_next_state;
-
-                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-                       yy_current_state = yy_get_previous_state(  );
-
-                       /* Okay, we're now positioned to make the NUL
-                        * transition.  We couldn't have
-                        * yy_get_previous_state() go ahead and do it
-                        * for us because it doesn't know how to deal
-                        * with the possibility of jamming (and we don't
-                        * want to build jamming into it because then it
-                        * will run more slowly).
-                        */
-
-                       yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-                       if ( yy_next_state )
-                               {
-                               /* Consume the NUL. */
-                               yy_cp = ++(yy_c_buf_p);
-                               yy_current_state = yy_next_state;
-                               goto yy_match;
-                               }
-
-                       else
-                               {
-                               yy_cp = (yy_c_buf_p);
-                               goto yy_find_action;
-                               }
-                       }
-
-               else switch ( yy_get_next_buffer(  ) )
-                       {
-                       case EOB_ACT_END_OF_FILE:
-                               {
-                               (yy_did_buffer_switch_on_eof) = 0;
-
-                               if ( xbt_ddt_parse_wrap( ) )
-                                       {
-                                       /* Note: because we've taken care in
-                                        * yy_get_next_buffer() to have set up
-                                        * xbt_ddt_parse_text, we can now set up
-                                        * yy_c_buf_p so that if some total
-                                        * hoser (like flex itself) wants to
-                                        * call the scanner after we return the
-                                        * YY_NULL, it'll still work - another
-                                        * YY_NULL will get returned.
-                                        */
-                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-                                       yy_act = YY_STATE_EOF(YY_START);
-                                       goto do_action;
-                                       }
-
-                               else
-                                       {
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-                                       }
-                               break;
-                               }
-
-                       case EOB_ACT_CONTINUE_SCAN:
-                               (yy_c_buf_p) =
-                                       (yytext_ptr) + yy_amount_of_matched_text;
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_match;
-
-                       case EOB_ACT_LAST_MATCH:
-                               (yy_c_buf_p) =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-                               yy_current_state = yy_get_previous_state(  );
-
-                               yy_cp = (yy_c_buf_p);
-                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                               goto yy_find_action;
-                       }
-               break;
-               }
-
-       default:
-               YY_FATAL_ERROR(
-                       "fatal flex scanner internal error--no action found" );
-       } /* end of action switch */
-               } /* end of scanning one token */
-} /* end of xbt_ddt_parse_lex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *     EOB_ACT_LAST_MATCH -
- *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *     EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-       register char *source = (yytext_ptr);
-       register int number_to_move, i;
-       int ret_val;
-
-       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-               YY_FATAL_ERROR(
-               "fatal flex scanner internal error--end of buffer missed" );
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-               { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-                       {
-                       /* We matched a single character, the EOB, so
-                        * treat this as a final EOF.
-                        */
-                       return EOB_ACT_END_OF_FILE;
-                       }
-
-               else
-                       {
-                       /* We matched some text prior to the EOB, first
-                        * process it.
-                        */
-                       return EOB_ACT_LAST_MATCH;
-                       }
-               }
-
-       /* Try to read more data. */
-
-       /* First move last chars to start of buffer. */
-       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-       for ( i = 0; i < number_to_move; ++i )
-               *(dest++) = *(source++);
-
-       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-               /* don't do the read, it's not guaranteed to return an EOF,
-                * just force an EOF
-                */
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-       else
-               {
-                       int num_to_read =
-                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-               while ( num_to_read <= 0 )
-                       { /* Not enough room in the buffer - grow it. */
-
-                       /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-                       int yy_c_buf_p_offset =
-                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-                       if ( b->yy_is_our_buffer )
-                               {
-                               int new_size = b->yy_buf_size * 2;
-
-                               if ( new_size <= 0 )
-                                       b->yy_buf_size += b->yy_buf_size / 8;
-                               else
-                                       b->yy_buf_size *= 2;
-
-                               b->yy_ch_buf = (char *)
-                                       /* Include room in for 2 EOB chars. */
-                                       xbt_ddt_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-                               }
-                       else
-                               /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
-
-                       if ( ! b->yy_ch_buf )
-                               YY_FATAL_ERROR(
-                               "fatal error - scanner input buffer overflow" );
-
-                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-                                               number_to_move - 1;
-
-                       }
-
-               if ( num_to_read > YY_READ_BUF_SIZE )
-                       num_to_read = YY_READ_BUF_SIZE;
-
-               /* Read in more data. */
-               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), (size_t) num_to_read );
-
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       if ( (yy_n_chars) == 0 )
-               {
-               if ( number_to_move == YY_MORE_ADJ )
-                       {
-                       ret_val = EOB_ACT_END_OF_FILE;
-                       xbt_ddt_parse_restart(xbt_ddt_parse_in  );
-                       }
-
-               else
-                       {
-                       ret_val = EOB_ACT_LAST_MATCH;
-                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-                               YY_BUFFER_EOF_PENDING;
-                       }
-               }
-
-       else
-               ret_val = EOB_ACT_CONTINUE_SCAN;
-
-       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-               /* Extend the array by 50%, plus the number we really need. */
-               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_ddt_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-       }
-
-       (yy_n_chars) += number_to_move;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-       return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-       register yy_state_type yy_current_state;
-       register char *yy_cp;
-    
-       yy_current_state = (yy_start);
-
-       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-               {
-               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-               if ( yy_accept[yy_current_state] )
-                       {
-                       (yy_last_accepting_state) = yy_current_state;
-                       (yy_last_accepting_cpos) = yy_cp;
-                       }
-               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                       {
-                       yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 61 )
-                               yy_c = yy_meta[(unsigned int) yy_c];
-                       }
-               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-               }
-
-       return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *     next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-       register int yy_is_jam;
-       register char *yy_cp = (yy_c_buf_p);
-
-       register YY_CHAR yy_c = 1;
-       if ( yy_accept[yy_current_state] )
-               {
-               (yy_last_accepting_state) = yy_current_state;
-               (yy_last_accepting_cpos) = yy_cp;
-               }
-       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-               {
-               yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 61 )
-                       yy_c = yy_meta[(unsigned int) yy_c];
-               }
-       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 60);
-
-       return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-       register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-       /* undo effects of setting up xbt_ddt_parse_text */
-       *yy_cp = (yy_hold_char);
-
-       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-               { /* need to shift things up to make room */
-               /* +2 for EOB chars. */
-               register int number_to_move = (yy_n_chars) + 2;
-               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-               register char *source =
-                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-                       *--dest = *--source;
-
-               yy_cp += (int) (dest - source);
-               yy_bp += (int) (dest - source);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
-               }
-
-       *--yy_cp = (char) c;
-
-       (yytext_ptr) = yy_bp;
-       (yy_hold_char) = *yy_cp;
-       (yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-       int c;
-    
-       *(yy_c_buf_p) = (yy_hold_char);
-
-       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-               {
-               /* yy_c_buf_p now points to the character we want to return.
-                * If this occurs *before* the EOB characters, then it's a
-                * valid NUL; if not, then we've hit the end of the buffer.
-                */
-               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                       /* This was really a NUL. */
-                       *(yy_c_buf_p) = '\0';
-
-               else
-                       { /* need more input */
-                       int offset = (yy_c_buf_p) - (yytext_ptr);
-                       ++(yy_c_buf_p);
-
-                       switch ( yy_get_next_buffer(  ) )
-                               {
-                               case EOB_ACT_LAST_MATCH:
-                                       /* This happens because yy_g_n_b()
-                                        * sees that we've accumulated a
-                                        * token and flags that we need to
-                                        * try matching the token before
-                                        * proceeding.  But for input(),
-                                        * there's no matching to consider.
-                                        * So convert the EOB_ACT_LAST_MATCH
-                                        * to EOB_ACT_END_OF_FILE.
-                                        */
-
-                                       /* Reset buffer status. */
-                                       xbt_ddt_parse_restart(xbt_ddt_parse_in );
-
-                                       /*FALLTHROUGH*/
-
-                               case EOB_ACT_END_OF_FILE:
-                                       {
-                                       if ( xbt_ddt_parse_wrap( ) )
-                                               return EOF;
-
-                                       if ( ! (yy_did_buffer_switch_on_eof) )
-                                               YY_NEW_FILE;
-#ifdef __cplusplus
-                                       return yyinput();
-#else
-                                       return input();
-#endif
-                                       }
-
-                               case EOB_ACT_CONTINUE_SCAN:
-                                       (yy_c_buf_p) = (yytext_ptr) + offset;
-                                       break;
-                               }
-                       }
-               }
-
-       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
-       *(yy_c_buf_p) = '\0';   /* preserve xbt_ddt_parse_text */
-       (yy_hold_char) = *++(yy_c_buf_p);
-
-       return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void xbt_ddt_parse_restart  (FILE * input_file )
-{
-    
-       if ( ! YY_CURRENT_BUFFER ){
-        xbt_ddt_parse_ensure_buffer_stack ();
-               YY_CURRENT_BUFFER_LVALUE =
-            xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE );
-       }
-
-       xbt_ddt_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
-       xbt_ddt_parse__load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void xbt_ddt_parse__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-       /* TODO. We should be able to replace this entire function body
-        * with
-        *              xbt_ddt_parse_pop_buffer_state();
-        *              xbt_ddt_parse_push_buffer_state(new_buffer);
-     */
-       xbt_ddt_parse_ensure_buffer_stack ();
-       if ( YY_CURRENT_BUFFER == new_buffer )
-               return;
-
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       xbt_ddt_parse__load_buffer_state( );
-
-       /* We don't actually know whether we did this switch during
-        * EOF (xbt_ddt_parse_wrap()) processing, but the only time this flag
-        * is looked at is after xbt_ddt_parse_wrap() is called, so it's safe
-        * to go ahead and always set it.
-        */
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void xbt_ddt_parse__load_buffer_state  (void)
-{
-       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-       xbt_ddt_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-       (yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE xbt_ddt_parse__create_buffer  (FILE * file, int  size )
-{
-       YY_BUFFER_STATE b;
-    
-       b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
-
-       b->yy_buf_size = size;
-
-       /* yy_ch_buf has to be 2 characters longer than the size given because
-        * we need to put in 2 end-of-buffer characters.
-        */
-       b->yy_ch_buf = (char *) xbt_ddt_parse_alloc(b->yy_buf_size + 2  );
-       if ( ! b->yy_ch_buf )
-               YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
-
-       b->yy_is_our_buffer = 1;
-
-       xbt_ddt_parse__init_buffer(b,file );
-
-       return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with xbt_ddt_parse__create_buffer()
- * 
- */
-    void xbt_ddt_parse__delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-       if ( ! b )
-               return;
-
-       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-       if ( b->yy_is_our_buffer )
-               xbt_ddt_parse_free((void *) b->yy_ch_buf  );
-
-       xbt_ddt_parse_free((void *) b  );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a xbt_ddt_parse_restart() or at EOF.
- */
-    static void xbt_ddt_parse__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-       int oerrno = errno;
-    
-       xbt_ddt_parse__flush_buffer(b );
-
-       b->yy_input_file = file;
-       b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then xbt_ddt_parse__init_buffer was _probably_
-     * called from xbt_ddt_parse_restart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
-       errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void xbt_ddt_parse__flush_buffer (YY_BUFFER_STATE  b )
-{
-       if ( ! b )
-               return;
-
-       b->yy_n_chars = 0;
-
-       /* We always need two end-of-buffer characters.  The first causes
-        * a transition to the end-of-buffer state.  The second causes
-        * a jam in that state.
-        */
-       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-       b->yy_buf_pos = &b->yy_ch_buf[0];
-
-       b->yy_at_bol = 1;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       if ( b == YY_CURRENT_BUFFER )
-               xbt_ddt_parse__load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void xbt_ddt_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-       if (new_buffer == NULL)
-               return;
-
-       xbt_ddt_parse_ensure_buffer_stack();
-
-       /* This block is copied from xbt_ddt_parse__switch_to_buffer. */
-       if ( YY_CURRENT_BUFFER )
-               {
-               /* Flush out information for old buffer. */
-               *(yy_c_buf_p) = (yy_hold_char);
-               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-               }
-
-       /* Only push if top exists. Otherwise, replace top. */
-       if (YY_CURRENT_BUFFER)
-               (yy_buffer_stack_top)++;
-       YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-       /* copied from xbt_ddt_parse__switch_to_buffer. */
-       xbt_ddt_parse__load_buffer_state( );
-       (yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void xbt_ddt_parse_pop_buffer_state (void)
-{
-       if (!YY_CURRENT_BUFFER)
-               return;
-
-       xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER );
-       YY_CURRENT_BUFFER_LVALUE = NULL;
-       if ((yy_buffer_stack_top) > 0)
-               --(yy_buffer_stack_top);
-
-       if (YY_CURRENT_BUFFER) {
-               xbt_ddt_parse__load_buffer_state( );
-               (yy_did_buffer_switch_on_eof) = 1;
-       }
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void xbt_ddt_parse_ensure_buffer_stack (void)
-{
-       int num_to_alloc;
-    
-       if (!(yy_buffer_stack)) {
-
-               /* First allocation is just for 2 elements, since we don't know if this
-                * scanner will even need a stack. We use 2 instead of 1 to avoid an
-                * immediate realloc on the next call.
-         */
-               num_to_alloc = 1;
-               (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_alloc
-                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
-                                                                 
-               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                               
-               (yy_buffer_stack_max) = num_to_alloc;
-               (yy_buffer_stack_top) = 0;
-               return;
-       }
-
-       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-               /* Increase the buffer to prepare for a possible push. */
-               int grow_size = 8 /* arbitrary grow size */;
-
-               num_to_alloc = (yy_buffer_stack_max) + grow_size;
-               (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_realloc
-                                                               ((yy_buffer_stack),
-                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
-                                                               );
-               if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
-
-               /* zero only the new slots.*/
-               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-               (yy_buffer_stack_max) = num_to_alloc;
-       }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE xbt_ddt_parse__scan_buffer  (char * base, yy_size_t  size )
-{
-       YY_BUFFER_STATE b;
-    
-       if ( size < 2 ||
-            base[size-2] != YY_END_OF_BUFFER_CHAR ||
-            base[size-1] != YY_END_OF_BUFFER_CHAR )
-               /* They forgot to leave room for the EOB's. */
-               return 0;
-
-       b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state )  );
-       if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_buffer()" );
-
-       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
-       b->yy_buf_pos = b->yy_ch_buf = base;
-       b->yy_is_our_buffer = 0;
-       b->yy_input_file = 0;
-       b->yy_n_chars = b->yy_buf_size;
-       b->yy_is_interactive = 0;
-       b->yy_at_bol = 1;
-       b->yy_fill_buffer = 0;
-       b->yy_buffer_status = YY_BUFFER_NEW;
-
-       xbt_ddt_parse__switch_to_buffer(b  );
-
-       return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to xbt_ddt_parse_lex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       xbt_ddt_parse__scan_bytes() instead.
- */
-YY_BUFFER_STATE xbt_ddt_parse__scan_string (yyconst char * yystr )
-{
-    
-       return xbt_ddt_parse__scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to xbt_ddt_parse_lex() will
- * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE xbt_ddt_parse__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
-{
-       YY_BUFFER_STATE b;
-       char *buf;
-       yy_size_t n;
-       int i;
-    
-       /* Get memory for full buffer, including space for trailing EOB's. */
-       n = _yybytes_len + 2;
-       buf = (char *) xbt_ddt_parse_alloc(n  );
-       if ( ! buf )
-               YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_bytes()" );
-
-       for ( i = 0; i < _yybytes_len; ++i )
-               buf[i] = yybytes[i];
-
-       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-       b = xbt_ddt_parse__scan_buffer(buf,n );
-       if ( ! b )
-               YY_FATAL_ERROR( "bad buffer in xbt_ddt_parse__scan_bytes()" );
-
-       /* It's okay to grow etc. this buffer, and we should throw it
-        * away when we're done.
-        */
-       b->yy_is_our_buffer = 1;
-
-       return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up xbt_ddt_parse_text. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-               xbt_ddt_parse_text[xbt_ddt_parse_leng] = (yy_hold_char); \
-               (yy_c_buf_p) = xbt_ddt_parse_text + yyless_macro_arg; \
-               (yy_hold_char) = *(yy_c_buf_p); \
-               *(yy_c_buf_p) = '\0'; \
-               xbt_ddt_parse_leng = yyless_macro_arg; \
-               } \
-       while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int xbt_ddt_parse_get_lineno  (void)
-{
-        
-    return xbt_ddt_parse_lineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *xbt_ddt_parse_get_in  (void)
-{
-        return xbt_ddt_parse_in;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *xbt_ddt_parse_get_out  (void)
-{
-        return xbt_ddt_parse_out;
-}
-
-/** Get the length of the current token.
- * 
- */
-int xbt_ddt_parse_get_leng  (void)
-{
-        return xbt_ddt_parse_leng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *xbt_ddt_parse_get_text  (void)
-{
-        return xbt_ddt_parse_text;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void xbt_ddt_parse_set_lineno (int  line_number )
-{
-    
-    xbt_ddt_parse_lineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see xbt_ddt_parse__switch_to_buffer
- */
-void xbt_ddt_parse_set_in (FILE *  in_str )
-{
-        xbt_ddt_parse_in = in_str ;
-}
-
-void xbt_ddt_parse_set_out (FILE *  out_str )
-{
-        xbt_ddt_parse_out = out_str ;
-}
-
-int xbt_ddt_parse_get_debug  (void)
-{
-        return xbt_ddt_parse__flex_debug;
-}
-
-void xbt_ddt_parse_set_debug (int  bdebug )
-{
-        xbt_ddt_parse__flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from xbt_ddt_parse_lex_destroy(), so don't allocate here.
-     */
-
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    xbt_ddt_parse_in = stdin;
-    xbt_ddt_parse_out = stdout;
-#else
-    xbt_ddt_parse_in = (FILE *) 0;
-    xbt_ddt_parse_out = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * xbt_ddt_parse_lex_init()
-     */
-    return 0;
-}
-
-/* xbt_ddt_parse_lex_destroy is for both reentrant and non-reentrant scanners. */
-int xbt_ddt_parse_lex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-       while(YY_CURRENT_BUFFER){
-               xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER  );
-               YY_CURRENT_BUFFER_LVALUE = NULL;
-               xbt_ddt_parse_pop_buffer_state();
-       }
-
-       /* Destroy the stack itself. */
-       xbt_ddt_parse_free((yy_buffer_stack) );
-       (yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * xbt_ddt_parse_lex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-       register int i;
-       for ( i = 0; i < n; ++i )
-               s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-       register int n;
-       for ( n = 0; s[n]; ++n )
-               ;
-
-       return n;
-}
-#endif
-
-void *xbt_ddt_parse_alloc (yy_size_t  size )
-{
-       return (void *) malloc( size );
-}
-
-void *xbt_ddt_parse_realloc  (void * ptr, yy_size_t  size )
-{
-       /* The cast to (char *) in the following accommodates both
-        * implementations that use char* generic pointers, and those
-        * that use void* generic pointers.  It works with the latter
-        * because both ANSI C and C++ allow castless assignment from
-        * any pointer type to void*, and deal with argument conversions
-        * as though doing an assignment.
-        */
-       return (void *) realloc( (char *) ptr, size );
-}
-
-void xbt_ddt_parse_free (void * ptr )
-{
-       free( (char *) ptr );   /* see xbt_ddt_parse_realloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-/* {space}+                { return(TOKEN_SPACE);} */
-
-void xbt_ddt_parse_dump(void) {
-  switch(xbt_ddt_parse_tok_num) {
-  case XBT_DDT_PARSE_TOKEN_LA      : {printf("TOKEN_LA ");break;}
-  case XBT_DDT_PARSE_TOKEN_RA      : {printf("TOKEN_RA ");break;}
-  case XBT_DDT_PARSE_TOKEN_WORD    : {printf("TOKEN_WORD ");break;}
-    /*  case XBT_DDT_PARSE_TOKEN_SPACE   : {printf("TOKEN_SPACE ");break;}*/
-    /*  case XBT_DDT_PARSE_TOKEN_COMMENT : {printf("TOKEN_COMMENT ");break;}*/
-  case XBT_DDT_PARSE_TOKEN_NEWLINE : {printf("TOKEN_NEWLINE\n");return;}
-  case XBT_DDT_PARSE_TOKEN_EMPTY : {printf("TOKEN_EMPTY\n");return;}
-  default             : {printf("Unknown token %d\n", xbt_ddt_parse_tok_num);return;}
-  }
-  printf("-->%s<-- [line %d, pos %d]\n",xbt_ddt_parse_text,xbt_ddt_parse_line_pos,xbt_ddt_parse_char_pos);
-  return;
-}
-
-int xbt_ddt_parse_lex_n_dump(void) {
-  xbt_ddt_parse_tok_num = xbt_ddt_parse_lex();
-  /*  xbt_ddt_parse_char_pos += strlen(xbt_ddt_parse_text);*/
-  return(xbt_ddt_parse_tok_num);
-}
-
-void  xbt_ddt_parse_pointer_init(const char *file) {
-  xbt_ddt_file_to_parse = fopen(file,"r");
-  xbt_ddt_input_buffer = xbt_ddt_parse__create_buffer(xbt_ddt_file_to_parse,10 );
-  xbt_ddt_parse__switch_to_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_col_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-void  xbt_ddt_parse_pointer_close(void) {
-  xbt_ddt_parse__delete_buffer(xbt_ddt_input_buffer);
-  fclose(xbt_ddt_file_to_parse);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-void  xbt_ddt_parse_pointer_string_init(const char *string_to_parse) {
-  xbt_ddt_input_buffer = xbt_ddt_parse__scan_string (string_to_parse);
-  definition = string_to_parse;
-  xbt_ddt_parse__switch_to_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-void  xbt_ddt_parse_pointer_string_close(void) {
-  xbt_ddt_parse__delete_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-
-  if (0)
-    yyunput('\0',NULL); /* fake a use of this function to calm gcc down */
-}
-
-/* Local variables:*/
-/* mode: c */
-/* End: */
-
diff --git a/src/xbt/datadesc/ddt_parse.yy.h b/src/xbt/datadesc/ddt_parse.yy.h
deleted file mode 100644 (file)
index ff15725..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ddt_parse.h -- automatic parsing of data structures                      */
-
-/* Copyright (c) 2004, 2006, 2007, 2009, 2010. 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. */
-
-typedef enum {
-  XBT_DDT_PARSE_TOKEN_EMPTY = 0,
-  XBT_DDT_PARSE_TOKEN_LA = 512,        /* { 'A' for the french "accolade" since there is a name conflict in english (braket/brace) */
-  XBT_DDT_PARSE_TOKEN_RA,      /* } */
-  XBT_DDT_PARSE_TOKEN_LB,      /* [ */
-  XBT_DDT_PARSE_TOKEN_RB,      /* ] */
-  XBT_DDT_PARSE_TOKEN_LP,      /* ( */
-  XBT_DDT_PARSE_TOKEN_RP,      /* ) */
-  XBT_DDT_PARSE_TOKEN_WORD,
-  XBT_DDT_PARSE_TOKEN_SPACE,
-  XBT_DDT_PARSE_TOKEN_COMMENT,
-  XBT_DDT_PARSE_TOKEN_ANNOTATE,
-  XBT_DDT_PARSE_TOKEN_NEWLINE,
-  XBT_DDT_PARSE_TOKEN_STAR,
-  XBT_DDT_PARSE_TOKEN_SEMI_COLON,
-  XBT_DDT_PARSE_TOKEN_COLON,   /* impossible since the macro think that it's a arg separator. 
-                                   But handle anyway for the *vicious* calling xbt_ddt_parse manually */
-  XBT_DDT_PARSE_TOKEN_ERROR
-} xbt_ddt_parse_token_t;
-
-#define XBT_DDT_PARSE_MAX_STR_CONST 4048
-
-extern int xbt_ddt_parse_line_pos;
-extern int xbt_ddt_parse_col_pos;
-extern int xbt_ddt_parse_char_pos;
-extern int xbt_ddt_parse_tok_num;
-
-void xbt_ddt_parse_dump(void);
-int xbt_ddt_parse_lex_n_dump(void);
-void xbt_ddt_parse_pointer_init(const char *file);
-void xbt_ddt_parse_pointer_close(void);
-void xbt_ddt_parse_pointer_string_init(const char *string_to_parse);
-void xbt_ddt_parse_pointer_string_close(void);
-
-/* prototypes of the functions offered by flex */
-int xbt_ddt_parse_lex(void);
-int xbt_ddt_parse_get_lineno(void);
-FILE *xbt_ddt_parse_get_in(void);
-FILE *xbt_ddt_parse_get_out(void);
-int xbt_ddt_parse_get_leng(void);
-char *xbt_ddt_parse_get_text(void);
-void xbt_ddt_parse_set_lineno(int line_number);
-void xbt_ddt_parse_set_in(FILE * in_str);
-void xbt_ddt_parse_set_out(FILE * out_str);
-int xbt_ddt_parse_get_debug(void);
-void xbt_ddt_parse_set_debug(int bdebug);
-int xbt_ddt_parse_lex_destroy(void);
-
-#define PARSE_ERROR(...)                                                \
-  PARSE_ERROR_(__VA_ARGS__,                                             \
-               xbt_ddt_parse_line_pos, xbt_ddt_parse_col_pos, definition)
-#define PARSE_ERROR_(fmt, ...)                           \
-  do {                                                   \
-    XBT_ERROR(fmt " at %d:%d of :\n%s", __VA_ARGS__);   \
-    xbt_abort();                                         \
-  } while (0)
diff --git a/src/xbt/datadesc/ddt_parse.yy.l b/src/xbt/datadesc/ddt_parse.yy.l
deleted file mode 100644 (file)
index a3a7493..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/* datadesc/ddt_parse -- automatic parsing of data structures */
-
-/* Copyright (c) 2004 Arnaud Legrand, 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. */
-
-%option noyywrap
-%{
-#include "xbt/datadesc/datadesc_private.h"
-#include "xbt/datadesc/ddt_parse.yy.h"
-#include <string.h>
-  YY_BUFFER_STATE xbt_ddt_input_buffer;
-  FILE *xbt_ddt_file_to_parse;
-
-  int xbt_ddt_parse_line_pos = 1;
-  int xbt_ddt_parse_col_pos = 0;
-  int xbt_ddt_parse_char_pos = 0;
-  int xbt_ddt_parse_tok_num = 0;
-  const char *definition;
-  XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_lexer,xbt_ddt_parse,"The crude internals of the lexer used for type parsing");
-#define SHOW_WHERE XBT_DEBUG("%d:%d (char #%d): seen '%s'", xbt_ddt_parse_line_pos,xbt_ddt_parse_col_pos,xbt_ddt_parse_char_pos,yytext)
-%}
-
-%x annotate comment foo
-space           [ \t]
-letter          [A-Za-z._-]
-digit           [0-9]
-
-%%
-   int comment_caller=0;
-   int annotate_caller=0;
-
-"//"[^\n]*
-
-"/*g"{space}* { /****************** ANNOTATION ************************/
-  XBT_DEBUG("Begin annotation");
-  annotate_caller = INITIAL;
-  xbt_ddt_parse_char_pos+= strlen(yytext);
-  xbt_ddt_parse_col_pos+= strlen(yytext);
-  BEGIN(annotate);
-}
-<foo>"/*g"{space}* { /* trim annotation */
-  XBT_DEBUG("Begin annotation");
-  annotate_caller = foo;
-  xbt_ddt_parse_char_pos+= strlen(yytext);
-  xbt_ddt_parse_col_pos+= strlen(yytext);
-  BEGIN(annotate);
-}
-
-<annotate>{space}*"g*/" {
-  XBT_DEBUG("End annotation");
-  xbt_ddt_parse_char_pos+= strlen(yytext);
-  xbt_ddt_parse_col_pos+= strlen(yytext);
-  BEGIN(annotate_caller);
-}
-
-<annotate>"*/" {
-  PARSE_ERROR("``/*g'' construct closed by a regular ``*/''");
-}
-<annotate>\n  {
-  PARSE_ERROR("Type annotation cannot spread over several lines");
-}
-
-<annotate>.* { /* eat the rest */
-  xbt_ddt_parse_char_pos+= strlen(yytext);
-  xbt_ddt_parse_col_pos+= strlen(yytext);
-  return XBT_DDT_PARSE_TOKEN_ANNOTATE;
-}
-
-"/*[^g]"   { /****************** COMMENTS ************************/
-  /* constructs like : */
-    /*g [string] g*/ 
-  /* are not comments but size annotations */
-  comment_caller = INITIAL;
-  BEGIN(comment);
-}
-
-<foo>"/*[^g]"    {
-  comment_caller = foo;
-  BEGIN(comment);
-}
-
-<comment>[^*\n]*      { /* eat anything that's not a '*' */
-}
-<comment>"*"+[^*/\n]* { /* eat up '*'s not followed by '/'s */
-}
-<comment>\n             {
-  ++xbt_ddt_parse_line_pos;
-  xbt_ddt_parse_col_pos=0;
-  xbt_ddt_parse_char_pos++;
-}
-<comment>"*"+"/" {
-  xbt_ddt_parse_char_pos+= strlen(yytext);
-  xbt_ddt_parse_col_pos+= strlen(yytext);
-  BEGIN(comment_caller);
-}
-
-({letter}|{digit})* {  /****************** STATEMENTS ************************/
-  xbt_ddt_parse_char_pos += strlen(yytext);
-  xbt_ddt_parse_col_pos += strlen(yytext);
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_WORD);
-}
-"{"  { 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LA);
-}
-"}" {
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RA);
-}
-"["  { 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LB);
-}
-"]" {
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RB);
-}
-"("  { 
-  xbt_ddt_parse_char_pos++; 
-  xbt_ddt_parse_col_pos++; 
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_LP);
-}
-")" {
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_RP);
-}
-"*" {
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_STAR);
-}
-";" {
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_SEMI_COLON);
-}
-"," { 
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-  return(XBT_DDT_PARSE_TOKEN_COLON);
-}
-"\n" {
- xbt_ddt_parse_line_pos++; 
- xbt_ddt_parse_char_pos++;
- xbt_ddt_parse_col_pos=0;
-  SHOW_WHERE;
-}
-. { 
-  xbt_ddt_parse_char_pos++;
-  xbt_ddt_parse_col_pos++;
-  SHOW_WHERE;
-}
-%%
-/* {space}+                { return(TOKEN_SPACE);} */
-
-void xbt_ddt_parse_dump(void) {
-  switch(xbt_ddt_parse_tok_num) {
-  case XBT_DDT_PARSE_TOKEN_LA      : {printf("TOKEN_LA ");break;}
-  case XBT_DDT_PARSE_TOKEN_RA      : {printf("TOKEN_RA ");break;}
-  case XBT_DDT_PARSE_TOKEN_WORD    : {printf("TOKEN_WORD ");break;}
-    /*  case XBT_DDT_PARSE_TOKEN_SPACE   : {printf("TOKEN_SPACE ");break;}*/
-    /*  case XBT_DDT_PARSE_TOKEN_COMMENT : {printf("TOKEN_COMMENT ");break;}*/
-  case XBT_DDT_PARSE_TOKEN_NEWLINE : {printf("TOKEN_NEWLINE\n");return;}
-  case XBT_DDT_PARSE_TOKEN_EMPTY : {printf("TOKEN_EMPTY\n");return;}
-  default             : {printf("Unknown token %d\n", xbt_ddt_parse_tok_num);return;}
-  }
-  printf("-->%s<-- [line %d, pos %d]\n",yytext,xbt_ddt_parse_line_pos,xbt_ddt_parse_char_pos);
-  return;
-}
-
-int xbt_ddt_parse_lex_n_dump(void) {
-  xbt_ddt_parse_tok_num = xbt_ddt_parse_lex();
-  /*  xbt_ddt_parse_char_pos += strlen(yytext);*/
-  return(xbt_ddt_parse_tok_num);
-}
-
-void  xbt_ddt_parse_pointer_init(const char *file) {
-  xbt_ddt_file_to_parse = fopen(file,"r");
-  xbt_ddt_input_buffer = yy_create_buffer( xbt_ddt_file_to_parse, 10 );
-  yy_switch_to_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_col_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-void  xbt_ddt_parse_pointer_close(void) {
-  yy_delete_buffer(xbt_ddt_input_buffer);
-  fclose(xbt_ddt_file_to_parse);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-
-void  xbt_ddt_parse_pointer_string_init(const char *string_to_parse) {
-  xbt_ddt_input_buffer = yy_scan_string (string_to_parse);
-  definition = string_to_parse;
-  yy_switch_to_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-}
-
-void  xbt_ddt_parse_pointer_string_close(void) {
-  yy_delete_buffer(xbt_ddt_input_buffer);
-
-  xbt_ddt_parse_line_pos = 1;
-  xbt_ddt_parse_char_pos = 0;
-  xbt_ddt_parse_tok_num = 0;
-
-  if (0)
-    yyunput('\0',NULL); /* fake a use of this function to calm gcc down */
-}
-
-/* Local variables:*/
-/* mode: c */
-/* End: */
index 1d15d7a..f4ab2b7 100644 (file)
@@ -50,7 +50,6 @@
 #include "xbt_modinter.h"       /* backtrace initialization headers */
 #include "xbt/synchro.h"        /* xbt_thread_self */
 
 #include "xbt_modinter.h"       /* backtrace initialization headers */
 #include "xbt/synchro.h"        /* xbt_thread_self */
 
-#include "gras/Virtu/virtu_interface.h" /* gras_os_myname */
 #include "xbt/ex_interface.h"
 
 #undef HAVE_BACKTRACE
 #include "xbt/ex_interface.h"
 
 #undef HAVE_BACKTRACE
@@ -142,7 +141,7 @@ void xbt_ex_display(xbt_ex_t * e)
           "** SimGrid: UNCAUGHT EXCEPTION received on %s(%d): category: %s; value: %d\n"
           "** %s\n"
           "** Thrown by %s()%s\n",
           "** SimGrid: UNCAUGHT EXCEPTION received on %s(%d): category: %s; value: %d\n"
           "** %s\n"
           "** Thrown by %s()%s\n",
-          gras_os_myname(), xbt_getpid(),
+          xbt_os_procname(), xbt_getpid(),
           xbt_ex_catname(e->category), e->value, e->msg,
           e->procname, thrower ? thrower : " in this process");
   XBT_CRITICAL("%s", e->msg);
           xbt_ex_catname(e->category), e->value, e->msg,
           e->procname, thrower ? thrower : " in this process");
   XBT_CRITICAL("%s", e->msg);
index 25d3f4e..26985c7 100644 (file)
@@ -526,25 +526,6 @@ static void xbt_log_connect_categories(void)
   /* Connect our log channels: that must be done manually under windows */
   /* Also permit that they are correctly listed by xbt_log_help_categories() */
 
   /* Connect our log channels: that must be done manually under windows */
   /* Also permit that they are correctly listed by xbt_log_help_categories() */
 
-  /* amok */
-  XBT_LOG_CONNECT(amok);
-  XBT_LOG_CONNECT(amok_bw);
-  XBT_LOG_CONNECT(amok_bw_sat);
-  XBT_LOG_CONNECT(amok_pm);
-
-  /* gras */
-  XBT_LOG_CONNECT(gras);
-  XBT_LOG_CONNECT(gras_modules);
-  XBT_LOG_CONNECT(gras_msg);
-  XBT_LOG_CONNECT(gras_msg_read);
-  XBT_LOG_CONNECT(gras_msg_rpc);
-  XBT_LOG_CONNECT(gras_timer);
-  XBT_LOG_CONNECT(gras_trp);
-  XBT_LOG_CONNECT(gras_trp_file);
-  XBT_LOG_CONNECT(gras_virtu);
-  XBT_LOG_CONNECT(gras_virtu_emul);
-  XBT_LOG_CONNECT(gras_virtu_process);
-
   /* xbt */
   XBT_LOG_CONNECT(xbt);
   XBT_LOG_CONNECT(graphxml_parse);
   /* xbt */
   XBT_LOG_CONNECT(xbt);
   XBT_LOG_CONNECT(graphxml_parse);
@@ -563,13 +544,6 @@ static void xbt_log_connect_categories(void)
 #ifdef XBT_USE_DEPRECATED
   XBT_LOG_CONNECT(xbt_dict_multi);
 #endif
 #ifdef XBT_USE_DEPRECATED
   XBT_LOG_CONNECT(xbt_dict_multi);
 #endif
-  XBT_LOG_CONNECT(xbt_ddt);
-  XBT_LOG_CONNECT(xbt_ddt_cbps);
-  XBT_LOG_CONNECT(xbt_ddt_convert);
-  XBT_LOG_CONNECT(xbt_ddt_create);
-  XBT_LOG_CONNECT(xbt_ddt_exchange);
-  XBT_LOG_CONNECT(xbt_ddt_parse);
-  XBT_LOG_CONNECT(xbt_ddt_lexer);
   XBT_LOG_CONNECT(xbt_dyn);
   XBT_LOG_CONNECT(xbt_ex);
   XBT_LOG_CONNECT(xbt_fifo);
   XBT_LOG_CONNECT(xbt_dyn);
   XBT_LOG_CONNECT(xbt_ex);
   XBT_LOG_CONNECT(xbt_fifo);
@@ -583,9 +557,6 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt_set);
   XBT_LOG_CONNECT(xbt_sync);
   XBT_LOG_CONNECT(xbt_sync_os);
   XBT_LOG_CONNECT(xbt_set);
   XBT_LOG_CONNECT(xbt_sync);
   XBT_LOG_CONNECT(xbt_sync_os);
-  XBT_LOG_CONNECT(xbt_trp);
-  XBT_LOG_CONNECT(xbt_trp_meas);
-  XBT_LOG_CONNECT(xbt_trp_tcp);
 
 #ifdef simgrid_EXPORTS
   /* The following categories are only defined in libsimgrid */
 
 #ifdef simgrid_EXPORTS
   /* The following categories are only defined in libsimgrid */
index e19302c..e4ebf8d 100644 (file)
@@ -11,8 +11,8 @@
 #include "xbt/sysdep.h"
 #include "xbt/strbuff.h"
 #include "xbt/log_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/strbuff.h"
 #include "xbt/log_private.h"
-#include "gras/virtu.h"         /* gras_os_myname (KILLME) */
 #include "xbt/synchro.h"        /* xbt_thread_self_name */
 #include "xbt/synchro.h"        /* xbt_thread_self_name */
+#include "surf/surf.h"
 #include <stdio.h>
 
 extern const char *xbt_log_priority_names[8];
 #include <stdio.h>
 
 extern const char *xbt_log_priority_names[8];
@@ -126,7 +126,7 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l,
         show_string(xbt_log_priority_names[ev->priority]);
         break;
       case 'h':                 /* host name; SimGrid extension */
         show_string(xbt_log_priority_names[ev->priority]);
         break;
       case 'h':                 /* host name; SimGrid extension */
-        show_string(gras_os_myname());
+        show_string(xbt_os_procname());
         break;
       case 't':                 /* thread name; LOG4J compliant */
         show_string(xbt_thread_self_name());
         break;
       case 't':                 /* thread name; LOG4J compliant */
         show_string(xbt_thread_self_name());
@@ -184,10 +184,10 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l,
 #endif
         break;
       case 'd':                 /* date; LOG4J compliant */
 #endif
         break;
       case 'd':                 /* date; LOG4J compliant */
-        show_double(gras_os_time());
+        show_double(surf_get_clock());
         break;
       case 'r':                 /* application age; LOG4J compliant */
         break;
       case 'r':                 /* application age; LOG4J compliant */
-        show_double(gras_os_time() - format_begin_of_time);
+        show_double(surf_get_clock() - format_begin_of_time);
         break;
       case 'm': {               /* user-provided message; LOG4J compliant */
         int len, sz;
         break;
       case 'm': {               /* user-provided message; LOG4J compliant */
         int len, sz;
@@ -223,7 +223,7 @@ xbt_log_layout_t xbt_log_layout_format_new(char *arg)
   res->data = xbt_strdup((char *) arg);
 
   if (format_begin_of_time < 0)
   res->data = xbt_strdup((char *) arg);
 
   if (format_begin_of_time < 0)
-    format_begin_of_time = gras_os_time();
+    format_begin_of_time = surf_get_clock();
 
   return res;
 }
 
   return res;
 }
index d42d7f5..c6acdc9 100644 (file)
@@ -11,7 +11,7 @@
 #include "xbt/log_private.h"
 #include "xbt/synchro.h"        /* xbt_thread_name */
 
 #include "xbt/log_private.h"
 #include "xbt/synchro.h"        /* xbt_thread_name */
 
-#include "gras/virtu.h"
+#include "surf/surf.h"
 #include <stdio.h>
 #include "portable.h"
 
 #include <stdio.h>
 #include "portable.h"
 
@@ -42,18 +42,18 @@ static int xbt_log_layout_simple_doit(xbt_log_layout_t l,
   procname = xbt_procname();
   if (procname && *procname) {
     len = snprintf(p, rem_size, "%s:%s:(%d) ",
   procname = xbt_procname();
   if (procname && *procname) {
     len = snprintf(p, rem_size, "%s:%s:(%d) ",
-                   gras_os_myname(), procname, xbt_getpid());
+                   xbt_os_procname(), procname, xbt_getpid());
     check_overflow(len);
   }
   else if (!procname)  {
   len = snprintf(p, rem_size, "%s::(%d) ",
     check_overflow(len);
   }
   else if (!procname)  {
   len = snprintf(p, rem_size, "%s::(%d) ",
-           gras_os_myname(), xbt_getpid());
+           xbt_os_procname(), xbt_getpid());
   check_overflow(len);
   }
 
   /* Display the date */
   len = snprintf(p, rem_size, "%f] ",
   check_overflow(len);
   }
 
   /* Display the date */
   len = snprintf(p, rem_size, "%f] ",
-                 gras_os_time() - simple_begin_of_time);
+                 surf_get_clock() - simple_begin_of_time);
   check_overflow(len);
 
   /* Display file position if not INFO */
   check_overflow(len);
 
   /* Display file position if not INFO */
@@ -86,7 +86,7 @@ xbt_log_layout_t xbt_log_layout_simple_new(char *arg)
   res->do_layout = xbt_log_layout_simple_doit;
 
   if (simple_begin_of_time < 0)
   res->do_layout = xbt_log_layout_simple_doit;
 
   if (simple_begin_of_time < 0)
-    simple_begin_of_time = gras_os_time();
+    simple_begin_of_time = surf_get_clock();
 
   return res;
 }
 
   return res;
 }
index 05bf14d..4585ae1 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "xbt/synchro.h"
 #include "xbt/queue.h"          /* this module */
 
 #include "xbt/synchro.h"
 #include "xbt/queue.h"          /* this module */
-#include "gras/virtu.h"
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_queue, xbt,
                                 "Message exchanging queue");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_queue, xbt,
                                 "Message exchanging queue");
 
diff --git a/src/xbt/xbt_rl_time.c b/src/xbt/xbt_rl_time.c
deleted file mode 100644 (file)
index 5d36fd2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* time - time related syscal wrappers                                      */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "portable.h"
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "gras/virtu.h"
-#include "xbt/xbt_os_time.h"    /* private */
-
-#include <math.h>               /* floor */
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_virtu);
-double xbt_time(void)
-{
-  return xbt_os_time();
-}
-
-void xbt_sleep(double sec)
-{
-  xbt_os_sleep(sec);
-}
-
diff --git a/src/xbt/xbt_sg_time.c b/src/xbt/xbt_sg_time.c
deleted file mode 100644 (file)
index 8a3722f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* time - time related syscal wrappers                                      */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. 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. */
-
-#include "gras/Virtu/virtu_sg.h"
-#include "simgrid/simix.h"
-
-/*
- * Time elapsed since the begining of the simulation.
- */
-double xbt_time()
-{
-  /* FIXME: check if we should use the request mechanism or not */
-  return SIMIX_get_clock();
-}
-
-/*
- * Freeze the process for the specified amount of time
- */
-void xbt_sleep(double sec)
-{
-  simcall_process_sleep(sec);
-}
-
-const char *xbt_procname(void)
-{
-  return SIMIX_process_self_get_name();
-}
-
diff --git a/src/xbt/xbt_socket.c b/src/xbt/xbt_socket.c
deleted file mode 100644 (file)
index 4be4581..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/* transport - low level communication                                      */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
-
-#include "xbt/ex.h"
-#include "xbt/peer.h"
-#include "xbt/dict.h"
-#include "xbt/socket.h"
-#include "xbt_modinter.h"
-#include "portable.h"
-#include "xbt_socket_private.h"
-#include "gras/Msg/msg_interface.h" /* FIXME */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_trp, xbt,
-                                "Conveying bytes over the network");
-XBT_LOG_NEW_SUBCATEGORY(xbt_trp_meas, xbt_trp,
-                        "Conveying bytes over the network without formating for perf measurements");
-
-static short int xbt_trp_started = 0;
-static xbt_dict_t xbt_trp_plugins;          /* all registered plugins */
-static void xbt_trp_plugin_free(void *p);   /* free one of the plugins */
-
-void xbt_trp_plugin_new(const char *name, xbt_trp_setup_t setup)
-{
-  xbt_trp_plugin_t plug = xbt_new0(s_xbt_trp_plugin_t, 1);
-
-  XBT_DEBUG("Create plugin %s", name);
-
-  plug->name = xbt_strdup(name);
-  setup(plug);
-  xbt_dict_set(xbt_trp_plugins, name, plug, NULL);
-}
-
-void xbt_trp_preinit(void)
-{
-  if (!xbt_trp_started) {
-    /* make room for all plugins */
-    xbt_trp_plugins = xbt_dict_new_homogeneous(xbt_trp_plugin_free);
-
-#ifdef HAVE_WINSOCK2_H
-    /* initialize the windows mechanism */
-    {
-      WORD wVersionRequested;
-      WSADATA wsaData;
-
-      wVersionRequested = MAKEWORD(2, 0);
-      int res;
-      res = WSAStartup(wVersionRequested, &wsaData);
-      xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
-
-      /* Confirm that the WinSock DLL supports 2.0. */
-      /* Note that if the DLL supports versions greater    */
-      /* than 2.0 in addition to 2.0, it will still return */
-      /* 2.0 in wVersion since that is the version we      */
-      /* requested.                                        */
-
-      xbt_assert(LOBYTE(wsaData.wVersion) == 2 &&
-                  HIBYTE(wsaData.wVersion) == 0,
-                  "Cannot find a usable WinSock DLL");
-      XBT_INFO("Found and initialized winsock2");
-    }                           /* The WinSock DLL is acceptable. Proceed. */
-#elif HAVE_WINSOCK_H
-    {
-      WSADATA wsaData;
-      int res;
-      res = WSAStartup(0x0101, &wsaData);
-      xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
-      XBT_INFO("Found and initialized winsock");
-    }
-#endif
-
-    /* create the TCP transport plugin */
-    xbt_trp_plugin_new("tcp", xbt_trp_tcp_setup);
-  }
-
-  xbt_trp_started++;
-}
-
-void xbt_trp_postexit(void)
-{
-  XBT_DEBUG("xbt_trp value %d", xbt_trp_started);
-  if (xbt_trp_started == 0) {
-    return;
-  }
-
-  if (--xbt_trp_started == 0) {
-#ifdef HAVE_WINSOCK_H
-    if (WSACleanup() == SOCKET_ERROR) {
-      if (WSAGetLastError() == WSAEINPROGRESS) {
-        WSACancelBlockingCall();
-        WSACleanup();
-      }
-    }
-#endif
-
-    /* Delete the plugins */
-    xbt_dict_free(&xbt_trp_plugins);
-  }
-}
-
-void xbt_trp_plugin_free(void *p)
-{
-  xbt_trp_plugin_t plug = p;
-
-  if (plug) {
-    if (plug->exit) {
-      plug->exit(plug);
-    } else if (plug->data) {
-      XBT_DEBUG("Plugin %s lacks exit(). Free data anyway.", plug->name);
-      free(plug->data);
-    }
-
-    free(plug->name);
-    free(plug);
-  }
-}
-
-
-/**
- * xbt_trp_socket:
- *
- * Malloc a new socket with the TCP transport plugin and default parameters.
- */
-void xbt_socket_new(int incoming, xbt_socket_t* dst)
-{
-  xbt_socket_new_ext(incoming, dst, xbt_trp_plugin_get_by_name("tcp"), 0, 0);
-}
-
-/**
- * xbt_trp_socket_new:
- *
- * Malloc a new socket.
- */
-void xbt_socket_new_ext(int incoming,
-                        xbt_socket_t * dst,
-                        xbt_trp_plugin_t plugin,
-                        unsigned long int buf_size,
-                        int measurement)
-{
-  xbt_socket_t sock = xbt_new0(s_xbt_socket_t, 1);
-
-  XBT_VERB("Create a new socket (%p)", (void *) sock);
-
-  sock->plugin = plugin;
-
-  sock->incoming = incoming ? 1 : 0;
-  sock->outgoing = incoming ? 0 : 1;
-  sock->accepting = incoming ? 1 : 0;
-  sock->meas = measurement;
-  sock->recvd = 0;
-  sock->valid = 1;
-  sock->moredata = 0;
-
-  sock->refcount = 1;
-  sock->buf_size = buf_size;
-  sock->sd = -1;
-
-  sock->data = NULL;
-  sock->bufdata = NULL;
-
-  *dst = sock;
-
-  XBT_OUT();
-}
-
-XBT_INLINE void* xbt_socket_get_data(xbt_socket_t sock) {
-  return sock->data;
-}
-
-XBT_INLINE void xbt_socket_set_data(xbt_socket_t sock, void* data) {
-  sock->data = data;
-}
-
-/**
- * xbt_trp_send:
- *
- * Send a bunch of bytes from on socket
- * (stable if we know the storage will keep as is until the next trp_flush)
- */
-void xbt_trp_send(xbt_socket_t sd, char *data, long int size, int stable)
-{
-  xbt_assert(sd->outgoing, "Socket not suited for data send");
-  sd->plugin->send(sd, data, size, stable);
-}
-
-/**
- * xbt_trp_recv:
- *
- * Receive a bunch of bytes from a socket
- */
-void xbt_trp_recv(xbt_socket_t sd, char *data, long int size)
-{
-  xbt_assert(sd->incoming, "Socket not suited for data receive");
-  (sd->plugin->recv) (sd, data, size);
-}
-
-/**
- * gras_trp_flush:
- *
- * Make sure all pending communications are done
- */
-void xbt_trp_flush(xbt_socket_t sd)
-{
-  if (sd->plugin->flush)
-    (sd->plugin->flush) (sd);
-}
-
-xbt_trp_plugin_t xbt_trp_plugin_get_by_name(const char *name)
-{
-  return xbt_dict_get(xbt_trp_plugins, name);
-}
-
-int xbt_socket_my_port(xbt_socket_t sock)
-{
-  if (!sock->plugin->my_port)
-    THROWF(unknown_error, 0, "Function my_port unimplemented in plugin %s",sock->plugin->name);
-  return sock->plugin->my_port(sock);
-}
-
-int xbt_socket_peer_port(xbt_socket_t sock)
-{
-  if (!sock->plugin->peer_port)
-    THROWF(unknown_error, 0, "Function peer_port unimplemented in plugin %s",sock->plugin->name);
-  return sock->plugin->peer_port(sock);
-}
-
-const char *xbt_socket_peer_name(xbt_socket_t sock)
-{
-  xbt_assert(sock->plugin);
-  return sock->plugin->peer_name(sock);
-}
-
-const char *xbt_socket_peer_proc(xbt_socket_t sock)
-{
-  return sock->plugin->peer_proc(sock);
-}
-
-void xbt_socket_peer_proc_set(xbt_socket_t sock, char *peer_proc)
-{
-  return sock->plugin->peer_proc_set(sock,peer_proc);
-}
-
-/** \brief Check if the provided socket is a measurement one (or a regular one) */
-int xbt_socket_is_meas(xbt_socket_t sock)
-{
-  return sock->meas;
-}
-
-/** \brief Send a chunk of (random) data over a measurement socket
- *
- * @param peer measurement socket to use for the experiment
- * @param timeout timeout (in seconds)
- * @param msg_size size of each chunk sent over the socket (in bytes).
- * @param msg_amount how many of these packets you want to send.
- *
- * Calls to xbt_socket_meas_send() and xbt_socket_meas_recv() on
- * each side of the socket should be paired.
- *
- * The exchanged data is zeroed to make sure it's initialized, but
- * there is no way to control what is sent (ie, you cannot use these
- * functions to exchange data out of band).
- *
- * @warning: in SimGrid version 3.1 and previous, the numerical arguments
- *           were the total amount of data to send and the msg_size. This
- *           was changed for the fool wanting to send more than MAXINT
- *           bytes in a fat pipe.
- */
-void xbt_socket_meas_send(xbt_socket_t peer,
-                          unsigned int timeout,
-                          unsigned long int msg_size,
-                          unsigned long int msg_amount)
-{
-  char *chunk = NULL;
-  unsigned long int sent_sofar;
-
-  XBT_IN();
-  THROWF(unknown_error, 0, "measurement sockets were broken in this release of SimGrid and should be ported back in the future."
-      "If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
-
-  if (peer->plugin == xbt_trp_plugin_get_by_name("tcp")) {
-    chunk = xbt_malloc0(msg_size);
-  }
-
-  xbt_assert(peer->meas,
-              "Asked to send measurement data on a regular socket");
-  xbt_assert(peer->outgoing,
-              "Socket not suited for data send (this is a server socket)");
-
-  for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
-    XBT_CDEBUG(xbt_trp_meas,
-            "Sent %lu msgs of %lu (size of each: %lu) to %s:%d",
-            sent_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
-            xbt_socket_peer_port(peer));
-    peer->plugin->raw_send(peer, chunk, msg_size);
-  }
-  XBT_CDEBUG(xbt_trp_meas,
-          "Sent %lu msgs of %lu (size of each: %lu) to %s:%d", sent_sofar,
-          msg_amount, msg_size, xbt_socket_peer_name(peer),
-          xbt_socket_peer_port(peer));
-
-  if (peer->plugin == xbt_trp_plugin_get_by_name("tcp")) {
-    free(chunk);
-  }
-
-  XBT_OUT();
-}
-
-/** \brief Receive a chunk of data over a measurement socket
- *
- * Calls to xbt_socket_meas_send() and xbt_socket_meas_recv() on
- * each side of the socket should be paired.
- *
- * @warning: in SimGrid version 3.1 and previous, the numerical arguments
- *           were the total amount of data to send and the msg_size. This
- *           was changed for the fool wanting to send more than MAXINT
- *           bytes in a fat pipe.
- */
-void xbt_socket_meas_recv(xbt_socket_t peer,
-                           unsigned int timeout,
-                           unsigned long int msg_size,
-                           unsigned long int msg_amount)
-{
-
-  char *chunk = NULL;
-  unsigned long int got_sofar;
-
-  XBT_IN();
-  THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
-      "If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
-
-  if (peer->plugin == xbt_trp_plugin_get_by_name("tcp")) {
-    chunk = xbt_malloc(msg_size);
-  }
-
-  xbt_assert(peer->meas,
-              "Asked to receive measurement data on a regular socket");
-  xbt_assert(peer->incoming, "Socket not suited for data receive");
-
-  for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
-    XBT_CDEBUG(xbt_trp_meas,
-            "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
-            got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
-            xbt_socket_peer_port(peer));
-    (peer->plugin->raw_recv) (peer, chunk, msg_size);
-  }
-  XBT_CDEBUG(xbt_trp_meas,
-          "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
-          got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
-          xbt_socket_peer_port(peer));
-
-  if (peer->plugin == xbt_trp_plugin_get_by_name("tcp")) {
-    free(chunk);
-  }
-
-  XBT_OUT();
-}
-
-/**
- * \brief Something similar to the good old accept system call.
- *
- * Make sure that there is someone speaking to the provided server socket.
- * In RL, it does an accept(2) and return the result as last argument.
- * In SG, as accepts are useless, it returns the provided argument as result.
- * You should thus test whether (peer != accepted) before closing both of them.
- *
- * You should only call this on measurement sockets. It is automatically
- * done for regular sockets, but you usually want more control about
- * what's going on with measurement sockets.
- */
-xbt_socket_t xbt_socket_meas_accept(xbt_socket_t peer)
-{
-  xbt_socket_t res;
-  THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
-      "If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
-
-  xbt_assert(peer->meas,
-              "No need to accept on non-measurement sockets (it's automatic)");
-
-  if (!peer->accepting) {
-    /* nothing to accept here (must be in SG) */
-    /* BUG: FIXME: this is BAD! it makes tricky to free the accepted socket */
-    return peer;
-  }
-
-  res = (peer->plugin->socket_accept) (peer);
-  res->meas = peer->meas;
-  XBT_CDEBUG(xbt_trp_meas, "meas_accepted onto %d", res->sd);
-
-  return res;
-}
diff --git a/src/xbt/xbt_socket_private.h b/src/xbt/xbt_socket_private.h
deleted file mode 100644 (file)
index 5816b17..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* transport - low level communication (send/receive bunches of bytes)      */
-
-/* module's private interface masked even to other parts of XBT.           */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#ifndef XBT_SOCKET_PRIVATE_H
-#define XBT_SOCKET_PRIVATE_H
-
-#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/dynar.h"
-#include "xbt/dict.h"
-#include "xbt/socket.h"
-
-/**
- * s_xbt_trp_bufdata:
- * 
- * Description of a socket.
- */
-typedef struct s_xbt_trp_bufdata xbt_trp_bufdata_t;
-
-typedef struct s_xbt_socket {
-
-  xbt_trp_plugin_t plugin;
-
-  unsigned incoming:1;          /* true if we can read from this sock */
-  unsigned outgoing:1;          /* true if we can write on this sock */
-  unsigned accepting:1;         /* true if master incoming sock in tcp */
-  unsigned meas:1;              /* true if this is an experiment socket instead of messaging */
-  unsigned valid:1;             /* false if a select returned that the peer has left, forcing us to "close" the socket */
-  unsigned moredata:1;          /* TCP socket use a buffer and read operation get as much 
-                                   data as possible. It is possible that several messages
-                                   are received in one shoot, and select won't catch them 
-                                   afterward again. 
-                                   This boolean indicates that this is the case, so that we
-                                   don't call select in that case.  Note that measurement
-                                   sockets are not concerned since they use the TCP
-                                   interface directly, with no buffer. */
-
-  unsigned recvd:1;             /* true if the recvd_val field contains one byte of the stream (that we peek'ed to check the socket validity) */
-  char recvd_val;               /* what we peeked from the socket, if any */
-
-  int refcount;                 /* refcounting on shared sockets */
-
-  unsigned long int buf_size;   /* what to say to the OS. 
-                                   Field here to remember it when accepting */
-
-  int sd;
-
-  void *data;                   /* userdata */
-  xbt_trp_bufdata_t *bufdata;   /* buffer userdata */
-} s_xbt_socket_t;
-
-void xbt_trp_tcp_setup(xbt_trp_plugin_t plug);
-
-#endif                          /* XBT_SOCKET_PRIVATE_H */
diff --git a/src/xbt/xbt_trp_plugin_tcp.c b/src/xbt/xbt_trp_plugin_tcp.c
deleted file mode 100644 (file)
index cf171bf..0000000
+++ /dev/null
@@ -1,887 +0,0 @@
-/* buffered transport using the TCP plugin or a custom one                  */
-
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. 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. */
-
-#include <stdlib.h>
-#include <string.h>             /* memset */
-
-#include "portable.h"
-#include "xbt/misc.h"
-#include "xbt/sysdep.h"
-#include "xbt/ex.h"
-#include "xbt/xbt_socket_private.h"
-
-#include "gras/Transport/transport_interface.h" /* FIXME */
-#include "gras/Virtu/virtu_interface.h" /* FIXME */
-#include "gras/Msg/msg_interface.h" /* FIXME */
-extern int gras_trp_libdata_id; /* FIXME */
-
-/* FIXME maybe READV is sometime a good thing? */
-#undef HAVE_READV
-
-#ifdef HAVE_READV
-#include <sys/uio.h>
-#endif
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_trp_tcp, xbt_trp,
-                                "TCP buffered transport");
-
-/***
- *** Specific socket part
- ***/
-
-typedef struct {
-  int port;                     /* port on this side */
-  int peer_port;                /* port on the other side */
-  char *peer_name;              /* hostname of the other side */
-  char *peer_proc;              /* process on the other side */
-} s_xbt_trp_tcp_sock_data_t, *xbt_trp_tcp_sock_data_t;
-
-typedef enum { buffering_buf, buffering_iov } buffering_kind;
-
-typedef struct {
-  int size;
-  char *data;
-  int pos;                      /* for receive; not exchanged over the net */
-} xbt_trp_buf_t;
-
-struct s_xbt_trp_bufdata {
-  int buffsize;
-  xbt_trp_buf_t in_buf;
-  xbt_trp_buf_t out_buf;
-
-#ifdef HAVE_READV
-  xbt_dynar_t in_buf_v;
-  xbt_dynar_t out_buf_v;
-#endif
-
-  buffering_kind in;
-  buffering_kind out;
-};
-
-/*****************************/
-/****[ SOCKET MANAGEMENT ]****/
-/*****************************/
-
-/* we exchange port number on client side on socket creation,
-   so we need to be able to talk right now. */
-static XBT_INLINE void xbt_trp_tcp_send(xbt_socket_t sock,
-                                        const char *data,
-                                        unsigned long int size);
-static int xbt_trp_tcp_recv(xbt_socket_t sock, char *data,
-                            unsigned long int size);
-
-static int xbt_trp_tcp_proto_number(void);
-static void xbt_trp_sock_socket_close(xbt_socket_t sock);
-
-static XBT_INLINE
-void xbt_trp_sock_socket_client(xbt_trp_plugin_t ignored,
-                                const char *host,
-                                int port,
-                                /* OUT */ xbt_socket_t sock)
-{
-  xbt_trp_tcp_sock_data_t sockdata = xbt_new(s_xbt_trp_tcp_sock_data_t,1);
-  sockdata->port = port;
-  sockdata->peer_proc = NULL;
-  sockdata->peer_port = port;
-  sockdata->peer_name = (char *) xbt_strdup(host ? host : "localhost");
-  sock->data = sockdata;
-
-  struct sockaddr_in addr;
-  struct hostent *he;
-  struct in_addr *haddr;
-  int size = sock->buf_size;
-  uint32_t myport = htonl(((gras_trp_procdata_t)
-                           gras_libdata_by_id
-                           (gras_trp_libdata_id))->myport);
-
-  sock->incoming = 1;           /* TCP sockets are duplex'ed */
-
-  sock->sd = socket(AF_INET, SOCK_STREAM, 0);
-
-  if (sock->sd < 0) {
-    THROWF(system_error, 0, "Failed to create socket: %s",
-           sock_errstr(sock_errno));
-  }
-
-  if (setsockopt
-      (sock->sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
-      || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
-                    sizeof(size))) {
-    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
-          sock_errstr(sock_errno));
-  }
-
-  he = gethostbyname(sockdata->peer_name);
-  if (he == NULL) {
-    THROWF(system_error, 0, "Failed to lookup hostname %s: %s",
-        sockdata->peer_name, sock_errstr(sock_errno));
-  }
-
-  haddr = ((struct in_addr *) (he->h_addr_list)[0]);
-
-  memset(&addr, 0, sizeof(struct sockaddr_in));
-  memcpy(&addr.sin_addr, haddr, sizeof(struct in_addr));
-  addr.sin_family = AF_INET;
-  addr.sin_port = htons(sockdata->peer_port);
-
-  if (connect(sock->sd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
-    tcp_close(sock->sd);
-    THROWF(system_error, 0,
-           "Failed to connect socket to %s:%d (%s)",
-           sockdata->peer_name, sockdata->peer_port, sock_errstr(sock_errno));
-  }
-
-  xbt_trp_tcp_send(sock, (char *) &myport, sizeof(uint32_t));
-  XBT_DEBUG("peerport sent to %d", sockdata->peer_port);
-
-  XBT_VERB("Connect to %s:%d (sd=%d, port %d here)",
-        sockdata->peer_name, sockdata->peer_port, sock->sd, sockdata->port);
-}
-
-/**
- * gras_trp_sock_socket_server:
- *
- * Open a socket used to receive messages.
- */
-static XBT_INLINE
-void xbt_trp_sock_socket_server(xbt_trp_plugin_t ignored,
-                                int port,
-                                xbt_socket_t sock)
-{
-  int size = sock->buf_size;
-  int on = 1;
-  struct sockaddr_in server;
-
-  xbt_trp_tcp_sock_data_t sockdata = xbt_new(s_xbt_trp_tcp_sock_data_t,1);
-  sockdata->port = port;
-  sockdata->peer_port = -1;
-  sockdata->peer_name = NULL;
-  sockdata->peer_proc = NULL;
-  sock->data = sockdata;
-
-  sock->outgoing = 1;           /* TCP => duplex mode */
-
-  server.sin_port = htons((u_short) sockdata->port);
-  server.sin_addr.s_addr = INADDR_ANY;
-  server.sin_family = AF_INET;
-  if ((sock->sd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
-    THROWF(system_error, 0, "Socket allocation failed: %s",
-           sock_errstr(sock_errno));
-
-  if (setsockopt
-      (sock->sd, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on)))
-    THROWF(system_error, 0,
-           "setsockopt failed, cannot condition the socket: %s",
-           sock_errstr(sock_errno));
-
-  if (setsockopt(sock->sd, SOL_SOCKET, SO_RCVBUF,
-                 (char *) &size, sizeof(size))
-      || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF,
-                    (char *) &size, sizeof(size))) {
-    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
-          sock_errstr(sock_errno));
-  }
-
-  if (bind(sock->sd, (struct sockaddr *) &server, sizeof(server)) == -1) {
-    tcp_close(sock->sd);
-    THROWF(system_error, 0,
-           "Cannot bind to port %d: %s", sockdata->port,
-           sock_errstr(sock_errno));
-  }
-
-  XBT_DEBUG("Listen on port %d (sd=%d)", sockdata->port, sock->sd);
-  if (listen(sock->sd, 5) < 0) {
-    tcp_close(sock->sd);
-    THROWF(system_error, 0,
-           "Cannot listen on port %d: %s",
-           sockdata->port, sock_errstr(sock_errno));
-  }
-
-  XBT_VERB("Openned a server socket on port %d (sd=%d)", sockdata->port,
-        sock->sd);
-}
-
-static xbt_socket_t xbt_trp_sock_socket_accept(xbt_socket_t sock)
-{
-  xbt_socket_t res;
-
-  struct sockaddr_in peer_in;
-  socklen_t peer_in_len = sizeof(peer_in);
-
-  int sd;
-  int tmp_errno;
-  int size;
-
-  int i = 1;
-  socklen_t s = sizeof(int);
-
-  uint32_t hisport;
-
-  int failed = 0;
-
-  XBT_IN();
-  xbt_socket_new_ext(1, &res, sock->plugin, sock->buf_size, 0);
-
-  sd = accept(sock->sd, (struct sockaddr *) &peer_in, &peer_in_len);
-  tmp_errno = sock_errno;
-
-  if (sd == -1) {
-    xbt_trp_sock_socket_close(sock);
-    THROWF(system_error, 0,
-           "Accept failed (%s). Droping server socket.",
-           sock_errstr(tmp_errno));
-  }
-
-  if (xbt_trp_tcp_proto_number() != -1)
-    if (setsockopt(sd, xbt_trp_tcp_proto_number(), TCP_NODELAY, (char *) &i,s))
-      failed = 1;
-
-  if (setsockopt(sd, SOL_SOCKET, SO_KEEPALIVE, (char *) &i, s))
-    failed = 1;
-
-  if (failed)
-    THROWF(system_error, 0,
-           "setsockopt failed, cannot condition the socket: %s",
-           sock_errstr(tmp_errno));
-
-  size = sock->buf_size;
-  if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
-      || setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
-                    sizeof(size)))
-    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
-          sock_errstr(tmp_errno));
-
-  res->plugin = sock->plugin;
-  res->incoming = sock->incoming;
-  res->outgoing = sock->outgoing;
-  res->accepting = 0;
-  res->sd = sd;
-  xbt_trp_tcp_sock_data_t sockdata = xbt_new(s_xbt_trp_tcp_sock_data_t, 1);
-  sockdata->port = -1;
-  res->data = sockdata;
-
-  xbt_trp_tcp_recv(res, (char *) &hisport, sizeof(hisport));
-  sockdata->peer_port = ntohl(hisport);
-  XBT_DEBUG("peerport %d received", sockdata->peer_port);
-
-  /* FIXME: Lock to protect inet_ntoa */
-  if (((struct sockaddr *) &peer_in)->sa_family != AF_INET) {
-    sockdata->peer_name = (char *) strdup("unknown");
-  } else {
-    struct in_addr addrAsInAddr;
-    char *tmp;
-
-    addrAsInAddr.s_addr = peer_in.sin_addr.s_addr;
-
-    tmp = inet_ntoa(addrAsInAddr);
-    if (tmp != NULL) {
-      sockdata->peer_name = (char *) strdup(tmp);
-    } else {
-      sockdata->peer_name = (char *) strdup("unknown");
-    }
-  }
-
-  XBT_VERB("Accepted from %s:%d (sd=%d)", sockdata->peer_name, sockdata->peer_port, sd);
-  xbt_dynar_push(((gras_trp_procdata_t)
-                  gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
-  /* FIXME we depend on GRAS here */
-
-  XBT_OUT();
-  return res;
-}
-
-static void xbt_trp_sock_socket_close(xbt_socket_t sock)
-{
-  if (!sock)
-    return;                     /* close only once */
-
-  free(((xbt_trp_tcp_sock_data_t)sock->data)->peer_name);
-  free(sock->data);
-
-  XBT_VERB("close tcp connection %d", sock->sd);
-
-  gras_msg_listener_close_socket(sock->sd); /* FIXME */
-}
-
-/************************************/
-/****[ end of SOCKET MANAGEMENT ]****/
-/************************************/
-
-
-/************************************/
-/****[ UNBUFFERED DATA EXCHANGE ]****/
-/************************************/
-/* Temptation to merge this with file data exchange is great, 
-   but doesn't work on BillWare (see tcp_write() in portable.h) */
-static XBT_INLINE void xbt_trp_tcp_send(xbt_socket_t sock,
-                                        const char *data,
-                                        unsigned long int size)
-{
-  while (size) {
-    int status = 0;
-
-    status = tcp_write(sock->sd, data, (size_t) size);
-    XBT_DEBUG("write(%d, %p, %lu);", sock->sd, data, size);
-
-    if (status < 0) {
-#ifdef EWOULDBLOCK
-      if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
-#else
-      if (errno == EINTR || errno == EAGAIN)
-#endif
-        continue;
-
-      THROWF(system_error, 0, "write(%d,%p,%lu) failed: %s",
-             sock->sd, data, size, sock_errstr(sock_errno));
-    }
-
-    if (status) {
-      size -= status;
-      data += status;
-    } else {
-      THROWF(system_error, 0, "file descriptor closed (%s)",
-             sock_errstr(sock_errno));
-    }
-  }
-}
-
-static XBT_INLINE int
-xbt_trp_tcp_recv_withbuffer(xbt_socket_t sock,
-                            char *data,
-                            unsigned long int size,
-                            unsigned long int bufsize)
-{
-  int got = 0;
-
-  if (sock->recvd) {
-    data[0] = sock->recvd_val;
-    sock->recvd = 0;
-    got++;
-    bufsize--;
-  }
-
-  while (size > got) {
-    int status = 0;
-
-    XBT_DEBUG("read(%d, %p, %lu) got %d so far (%s)",
-           sock->sd, data + got, bufsize, got,
-           hexa_str((unsigned char *) data, got, 0));
-    status = tcp_read(sock->sd, data + got, (size_t) bufsize);
-
-    if (status < 0) {
-      THROWF(system_error, 0,
-             "read(%d,%p,%lu) from %s:%d failed: %s; got %d so far",
-             sock->sd, data + got, size, xbt_socket_peer_name(sock),
-             xbt_socket_peer_port(sock), sock_errstr(sock_errno), got);
-    }
-    XBT_DEBUG("Got %d more bytes (%s)", status,
-           hexa_str((unsigned char *) data + got, status, 0));
-
-    if (status) {
-      bufsize -= status;
-      got += status;
-    } else {
-      THROWF(system_error, errno,
-             "Socket closed by remote side (got %d bytes before this)",
-             got);
-    }
-  }
-
-  return got;
-}
-
-static int xbt_trp_tcp_recv(xbt_socket_t sock,
-                            char *data,
-                            unsigned long int size)
-{
-  return xbt_trp_tcp_recv_withbuffer(sock, data, size, size);
-
-}
-
-/*******************************************/
-/****[ end of UNBUFFERED DATA EXCHANGE ]****/
-/*******************************************/
-
-/**********************************/
-/****[ BUFFERED DATA EXCHANGE ]****/
-/**********************************/
-
-/* Make sure the data is sent */
-static void xbt_trp_bufiov_flush(xbt_socket_t sock)
-{
-#ifdef HAVE_READV
-  xbt_dynar_t vect;
-  int size;
-#endif
-  xbt_trp_bufdata_t *data = sock->bufdata;
-  XBT_IN();
-
-  XBT_DEBUG("Flush");
-  if (data->out == buffering_buf) {
-    if (XBT_LOG_ISENABLED(xbt_trp_tcp, xbt_log_priority_debug))
-      hexa_print("chunk to send ",
-                 (unsigned char *) data->out_buf.data, data->out_buf.size);
-    if ((data->out_buf.size - data->out_buf.pos) != 0) {
-      XBT_DEBUG("Send the chunk (size=%d) to %s:%d", data->out_buf.size,
-             xbt_socket_peer_name(sock), xbt_socket_peer_port(sock));
-      xbt_trp_tcp_send(sock, data->out_buf.data, data->out_buf.size);
-      XBT_VERB("Chunk sent (size=%d)", data->out_buf.size);
-      data->out_buf.size = 0;
-    }
-  }
-#ifdef HAVE_READV
-  if (data->out == buffering_iov) {
-    XBT_DEBUG("Flush out iov");
-    vect = sock->bufdata->out_buf_v;
-    if ((size = xbt_dynar_length(vect))) {
-      XBT_DEBUG("Flush %d chunks out of this socket", size);
-      writev(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
-      xbt_dynar_reset(vect);
-    }
-    data->out_buf.size = 0;     /* reset the buffer containing non-stable data */
-  }
-
-  if (data->in == buffering_iov) {
-    XBT_DEBUG("Flush in iov");
-    vect = sock->bufdata->in_buf_v;
-    if ((size = xbt_dynar_length(vect))) {
-      XBT_DEBUG("Get %d chunks from of this socket", size);
-      readv(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
-      xbt_dynar_reset(vect);
-    }
-  }
-#endif
-}
-
-static void
-xbt_trp_buf_send(xbt_socket_t sock,
-                 const char *chunk,
-                 unsigned long int size,
-                 int stable_ignored)
-{
-
-  xbt_trp_bufdata_t *data = (xbt_trp_bufdata_t *) sock->bufdata;
-  int chunk_pos = 0;
-
-  XBT_IN();
-
-  while (chunk_pos < size) {
-    /* size of the chunk to receive in that shot */
-    long int thissize =
-        min(size - chunk_pos, data->buffsize - data->out_buf.size);
-    XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%lu, ctn=(%s)",
-           data->out_buf.size,
-           data->out_buf.size + thissize - 1, size,
-           hexa_str((unsigned char *) chunk, thissize, 0));
-
-    memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos,
-           thissize);
-
-    data->out_buf.size += thissize;
-    chunk_pos += thissize;
-    XBT_DEBUG("New pos = %d; Still to send = %lu of %lu; ctn sofar=(%s)",
-           data->out_buf.size, size - chunk_pos, size,
-           hexa_str((unsigned char *) chunk, chunk_pos, 0));
-
-    if (data->out_buf.size == data->buffsize)   /* out of space. Flush it */
-      xbt_trp_bufiov_flush(sock);
-  }
-
-  XBT_OUT();
-}
-
-static int
-xbt_trp_buf_recv(xbt_socket_t sock, char *chunk, unsigned long int size)
-{
-
-  xbt_trp_bufdata_t *data = sock->bufdata;
-  long int chunk_pos = 0;
-
-  XBT_IN();
-
-  while (chunk_pos < size) {
-    /* size of the chunk to receive in that shot */
-    long int thissize;
-
-    if (data->in_buf.size == data->in_buf.pos) {        /* out of data. Get more */
-
-      XBT_DEBUG("Get more data (size=%d,bufsize=%d)",
-             (int) MIN(size - chunk_pos, data->buffsize),
-             (int) data->buffsize);
-
-      data->in_buf.size =
-          xbt_trp_tcp_recv_withbuffer(sock, data->in_buf.data,
-                                      MIN(size - chunk_pos, data->buffsize),
-                                      data->buffsize);
-
-      data->in_buf.pos = 0;
-    }
-
-    thissize = min(size - chunk_pos, data->in_buf.size - data->in_buf.pos);
-    memcpy(chunk + chunk_pos, data->in_buf.data + data->in_buf.pos,
-           thissize);
-
-    data->in_buf.pos += thissize;
-    chunk_pos += thissize;
-    XBT_DEBUG("New pos = %d; Still to receive = %lu of %lu. Ctn so far=(%s)",
-           data->in_buf.pos, size - chunk_pos, size,
-           hexa_str((unsigned char *) chunk, chunk_pos, 0));
-  }
-  /* indicate on need to the gras_select function that there is more to read on this socket so that it does not actually select */
-  sock->moredata = (data->in_buf.size > data->in_buf.pos);
-  XBT_DEBUG("There is %smore data", (sock->moredata ? "" : "no "));
-
-  XBT_OUT();
-  return chunk_pos;
-}
-
-/*****************************************/
-/****[ end of BUFFERED DATA EXCHANGE ]****/
-/*****************************************/
-
-/********************************/
-/****[ VECTOR DATA EXCHANGE ]****/
-/********************************/
-#ifdef HAVE_READV
-static void
-xbt_trp_iov_send(xbt_socket_t sock,
-                 const char *chunk, unsigned long int size, int stable)
-{
-  struct iovec elm;
-  xbt_trp_bufdata_t *data = (xbt_trp_bufdata_t *) sock->bufdata;
-
-
-  XBT_DEBUG("Buffer one chunk to be sent later (%s)",
-      hexa_str((char *) chunk, size, 0));
-
-  elm.iov_len = (size_t) size;
-
-  if (!stable) {
-    /* data storage won't last until flush. Save it in a buffer if we can */
-
-    if (size > data->buffsize - data->out_buf.size) {
-      /* buffer too small: 
-         flush the socket, using data in its actual storage */
-      elm.iov_base = (void *) chunk;
-      xbt_dynar_push(data->out_buf_v, &elm);
-
-      xbt_trp_bufiov_flush(sock);
-      return;
-    } else {
-      /* buffer big enough: 
-         copy data into it, and chain it for upcoming writev */
-      memcpy(data->out_buf.data + data->out_buf.size, chunk, size);
-      elm.iov_base = (void *) (data->out_buf.data + data->out_buf.size);
-      data->out_buf.size += size;
-
-      xbt_dynar_push(data->out_buf_v, &elm);
-    }
-
-  } else {
-    /* data storage stable. Chain it */
-
-    elm.iov_base = (void *) chunk;
-    xbt_dynar_push(data->out_buf_v, &elm);
-  }
-}
-
-static int
-xbt_trp_iov_recv(gras_socket_t sock, char *chunk, unsigned long int size)
-{
-  struct iovec elm;
-
-  XBT_DEBUG("Buffer one chunk to be received later");
-  elm.iov_base = (void *) chunk;
-  elm.iov_len = (size_t) size;
-  xbt_dynar_push(sock->bufdata->in_buf_v, &elm);
-
-  return size;
-}
-
-#endif
-/***************************************/
-/****[ end of VECTOR DATA EXCHANGE ]****/
-/***************************************/
-
-
-/***
- *** Prototypes of BUFFERED
- ***/
-static xbt_socket_t xbt_trp_buf_init_sock(xbt_socket_t sock);
-static void xbt_trp_buf_socket_client(xbt_trp_plugin_t self,
-                               const char *host,
-                               int port,
-                               xbt_socket_t sock);
-static void xbt_trp_buf_socket_server(xbt_trp_plugin_t self,
-                                int port,
-                                xbt_socket_t sock);
-static xbt_socket_t xbt_trp_buf_socket_accept(xbt_socket_t sock);
-
-static void xbt_trp_buf_socket_close(xbt_socket_t sd);
-
-
-static xbt_socket_t xbt_trp_buf_init_sock(xbt_socket_t sock)
-{
-  xbt_trp_bufdata_t *data = xbt_new(xbt_trp_bufdata_t, 1);
-
-  data->buffsize = 100 * 1024;  /* 100k */
-
-  data->in_buf.size = 0;
-  data->in_buf.data = xbt_malloc(data->buffsize);
-  data->in_buf.pos = 0;         /* useless, indeed, since size==pos */
-
-  data->out_buf.size = 0;
-  data->out_buf.data = xbt_malloc(data->buffsize);
-  data->out_buf.pos = data->out_buf.size;
-
-#ifdef HAVE_READV
-  data->in_buf_v = data->out_buf_v = NULL;
-  data->in_buf_v = xbt_dynar_new(sizeof(struct iovec), NULL);
-  data->out_buf_v = xbt_dynar_new(sizeof(struct iovec), NULL);
-  data->out = buffering_iov;
-#else
-  data->out = buffering_buf;
-#endif
-
-  data->in = buffering_buf;
-
-  sock->bufdata = data;
-  return sock;
-}
-
-/***
- *** Info about who's speaking
- ***/
-static int xbt_trp_tcp_my_port(xbt_socket_t s) {
-  xbt_trp_tcp_sock_data_t sockdata = s->data;
-  return sockdata->port;
-}
-
-static int xbt_trp_tcp_peer_port(xbt_socket_t s) {
-  xbt_trp_tcp_sock_data_t sockdata = s->data;
-  return sockdata->peer_port;
-}
-
-static const char* xbt_trp_tcp_peer_name(xbt_socket_t s) {
-  xbt_trp_tcp_sock_data_t sockdata = s->data;
-  return sockdata->peer_name;
-}
-
-static const char* xbt_trp_tcp_peer_proc(xbt_socket_t s) {
-  xbt_trp_tcp_sock_data_t sockdata = s->data;
-  return sockdata->peer_proc;
-}
-
-static void xbt_trp_tcp_peer_proc_set(xbt_socket_t s,char *name) {
-  xbt_trp_tcp_sock_data_t sockdata = s->data;
-  sockdata->peer_proc = xbt_strdup(name);
-}
-
-/***
- *** Code
- ***/
-void xbt_trp_tcp_setup(xbt_trp_plugin_t plug)
-{
-  plug->my_port = xbt_trp_tcp_my_port;
-  plug->peer_port = xbt_trp_tcp_peer_port;
-  plug->peer_name = xbt_trp_tcp_peer_name;
-  plug->peer_proc = xbt_trp_tcp_peer_proc;
-  plug->peer_proc_set = xbt_trp_tcp_peer_proc_set;
-
-
-  plug->socket_client = xbt_trp_buf_socket_client;
-  plug->socket_server = xbt_trp_buf_socket_server;
-  plug->socket_accept = xbt_trp_buf_socket_accept;
-  plug->socket_close = xbt_trp_buf_socket_close;
-
-#ifdef HAVE_READV
-  plug->send = xbt_trp_iov_send;
-#else
-  plug->send = xbt_trp_buf_send;
-#endif
-  plug->recv = xbt_trp_buf_recv;
-
-  plug->raw_send = xbt_trp_tcp_send;
-  plug->raw_recv = xbt_trp_tcp_recv;
-
-  plug->flush = xbt_trp_bufiov_flush;
-
-  plug->data = NULL;
-  plug->exit = NULL;
-}
-
-static void xbt_trp_buf_socket_client(xbt_trp_plugin_t self,
-                               const char *host,
-                               int port,
-                               /* OUT */ xbt_socket_t sock)
-{
-  xbt_trp_sock_socket_client(NULL, host, port, sock);
-  xbt_trp_buf_init_sock(sock);
-}
-
-/**
- * xbt_trp_buf_socket_server:
- *
- * Open a socket used to receive messages.
- */
-static void xbt_trp_buf_socket_server(xbt_trp_plugin_t self,
-                               int port,
-                               /* OUT */ xbt_socket_t sock)
-{
-  xbt_trp_sock_socket_server(NULL, port, sock);
-  xbt_trp_buf_init_sock(sock);
-}
-
-static xbt_socket_t xbt_trp_buf_socket_accept(xbt_socket_t sock)
-{
-  return xbt_trp_buf_init_sock(xbt_trp_sock_socket_accept(sock));
-}
-
-static void xbt_trp_buf_socket_close(xbt_socket_t sock)
-{
-  xbt_trp_bufdata_t *data = sock->bufdata;
-
-  if (data->in_buf.size != data->in_buf.pos) {
-    XBT_WARN("Socket closed, but %d bytes were unread (size=%d,pos=%d)",
-        data->in_buf.size - data->in_buf.pos,
-        data->in_buf.size, data->in_buf.pos);
-  }
-  free(data->in_buf.data);
-
-  if (data->out_buf.size != data->out_buf.pos) {
-    XBT_DEBUG("Flush the socket before closing (in=%d,out=%d)",
-           data->in_buf.size, data->out_buf.size);
-    xbt_trp_bufiov_flush(sock);
-  }
-  free(data->out_buf.data);
-
-#ifdef HAVE_READV
-  if (data->in_buf_v) {
-    if (!xbt_dynar_is_empty(data->in_buf_v))
-      XBT_WARN("Socket closed, but some bytes were unread");
-    xbt_dynar_free(&data->in_buf_v);
-  }
-  if (data->out_buf_v) {
-    if (!xbt_dynar_is_empty(data->out_buf_v)) {
-      XBT_DEBUG("Flush the socket before closing");
-      xbt_trp_bufiov_flush(sock);
-    }
-    xbt_dynar_free(&data->out_buf_v);
-  }
-#endif
-
-  free(data);
-  xbt_trp_sock_socket_close(sock);
-}
-
-/****************************/
-/****[ HELPER FUNCTIONS ]****/
-/****************************/
-
-/*
- * Returns the tcp protocol number from the network protocol data base, or -1 if not found
- *
- * getprotobyname() is not thread safe. We need to lock it.
- */
-static int xbt_trp_tcp_proto_number(void)
-{
-  struct protoent *fetchedEntry;
-  static int returnValue = 0;
-
-  if (returnValue == 0) {
-    fetchedEntry = getprotobyname("tcp");
-    if (fetchedEntry == NULL) {
-      XBT_VERB("getprotobyname(tcp) gave NULL");
-      returnValue = -1;
-    } else {
-      returnValue = fetchedEntry->p_proto;
-    }
-  }
-
-  return returnValue;
-}
-
-#ifdef HAVE_WINSOCK_H
-#define RETSTR( x ) case x: return #x
-
-const char *xbt_wsa_err2string(int err)
-{
-  switch (err) {
-    RETSTR(WSAEINTR);
-    RETSTR(WSAEBADF);
-    RETSTR(WSAEACCES);
-    RETSTR(WSAEFAULT);
-    RETSTR(WSAEINVAL);
-    RETSTR(WSAEMFILE);
-    RETSTR(WSAEWOULDBLOCK);
-    RETSTR(WSAEINPROGRESS);
-    RETSTR(WSAEALREADY);
-    RETSTR(WSAENOTSOCK);
-    RETSTR(WSAEDESTADDRREQ);
-    RETSTR(WSAEMSGSIZE);
-    RETSTR(WSAEPROTOTYPE);
-    RETSTR(WSAENOPROTOOPT);
-    RETSTR(WSAEPROTONOSUPPORT);
-    RETSTR(WSAESOCKTNOSUPPORT);
-    RETSTR(WSAEOPNOTSUPP);
-    RETSTR(WSAEPFNOSUPPORT);
-    RETSTR(WSAEAFNOSUPPORT);
-    RETSTR(WSAEADDRINUSE);
-    RETSTR(WSAEADDRNOTAVAIL);
-    RETSTR(WSAENETDOWN);
-    RETSTR(WSAENETUNREACH);
-    RETSTR(WSAENETRESET);
-    RETSTR(WSAECONNABORTED);
-    RETSTR(WSAECONNRESET);
-    RETSTR(WSAENOBUFS);
-    RETSTR(WSAEISCONN);
-    RETSTR(WSAENOTCONN);
-    RETSTR(WSAESHUTDOWN);
-    RETSTR(WSAETOOMANYREFS);
-    RETSTR(WSAETIMEDOUT);
-    RETSTR(WSAECONNREFUSED);
-    RETSTR(WSAELOOP);
-    RETSTR(WSAENAMETOOLONG);
-    RETSTR(WSAEHOSTDOWN);
-    RETSTR(WSAEHOSTUNREACH);
-    RETSTR(WSAENOTEMPTY);
-    RETSTR(WSAEPROCLIM);
-    RETSTR(WSAEUSERS);
-    RETSTR(WSAEDQUOT);
-    RETSTR(WSAESTALE);
-    RETSTR(WSAEREMOTE);
-    RETSTR(WSASYSNOTREADY);
-    RETSTR(WSAVERNOTSUPPORTED);
-    RETSTR(WSANOTINITIALISED);
-    RETSTR(WSAEDISCON);
-
-#ifdef HAVE_WINSOCK2_H
-    RETSTR(WSAENOMORE);
-    RETSTR(WSAECANCELLED);
-    RETSTR(WSAEINVALIDPROCTABLE);
-    RETSTR(WSAEINVALIDPROVIDER);
-    RETSTR(WSASYSCALLFAILURE);
-    RETSTR(WSASERVICE_NOT_FOUND);
-    RETSTR(WSATYPE_NOT_FOUND);
-    RETSTR(WSA_E_NO_MORE);
-    RETSTR(WSA_E_CANCELLED);
-    RETSTR(WSAEREFUSED);
-#endif                          /* HAVE_WINSOCK2_H */
-
-    RETSTR(WSAHOST_NOT_FOUND);
-    RETSTR(WSATRY_AGAIN);
-    RETSTR(WSANO_RECOVERY);
-    RETSTR(WSANO_DATA);
-  }
-  return "unknown WSA error";
-}
-#endif                          /* HAVE_WINSOCK_H */
-
-/***********************************/
-/****[ end of HELPER FUNCTIONS ]****/
-/***********************************/
index 50ac952..e0b9ab6 100644 (file)
@@ -9,6 +9,7 @@
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 #include "xbt/function_types.h"
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 #include "xbt/function_types.h"
+#include "simgrid/simix.h"
 
 static int xbt_fake_pid(void)
 {
 
 static int xbt_fake_pid(void)
 {
@@ -16,3 +17,26 @@ static int xbt_fake_pid(void)
 }
 
 int_f_void_t xbt_getpid = xbt_fake_pid;
 }
 
 int_f_void_t xbt_getpid = xbt_fake_pid;
+
+/*
+ * Time elapsed since the beginning of the simulation.
+ */
+double xbt_time()
+{
+  /* FIXME: check if we should use the request mechanism or not */
+  return SIMIX_get_clock();
+}
+
+/*
+ * Freeze the process for the specified amount of time
+ */
+void xbt_sleep(double sec)
+{
+  simcall_process_sleep(sec);
+}
+
+const char *xbt_procname(void)
+{
+  return SIMIX_process_self_get_name();
+}
+
diff --git a/teshsuite/gras/CMakeLists.txt b/teshsuite/gras/CMakeLists.txt
deleted file mode 100644 (file)
index aa1ed39..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/gras.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/README
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/README b/teshsuite/gras/README
deleted file mode 100644 (file)
index 7cdf135..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-This directory contains several tests to the GRAS mecanism. The
-difference with the examples/gras directory is that what's in here
-tests some corner case that nobody would try in the first place. Here
-is a list of the directory content:
-
-empty_main/ Once upon a time, GRAS was broken when processes did
-           nothing. This test is here to ensure that this never
-           happen again.
-           
-msg_handle/ Ensures the wanted semantic for gras_msg_handle(i) when
-            i<0, i==0 and i>0.
-
-numerous_rpc/ Ensures that it is ok to have a very large amount of
-              very small RPC in real life (it used to be a race
-              condition in the socket mechanism stuff)
diff --git a/teshsuite/gras/datadesc/CMakeLists.txt b/teshsuite/gras/datadesc/CMakeLists.txt
deleted file mode 100644 (file)
index 1693115..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(NOT WIN32)
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-  add_executable(datadesc_usage datadesc_usage.c datadesc_structs.c)
-
-  ### Add definitions for compile
-  target_link_libraries(datadesc_usage gras m pthread)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_r_little32_4.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_r_big32_8_4.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_mem.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_r_little64.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_rw.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_usage.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc_structs.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mk_datadesc_structs.pl
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc.big32_8_4
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc.big64
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc.little32_4
-  ${CMAKE_CURRENT_SOURCE_DIR}/datadesc.little64
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/datadesc/datadesc.big32_8_4 b/teshsuite/gras/datadesc/datadesc.big32_8_4
deleted file mode 100644 (file)
index f230874..0000000
Binary files a/teshsuite/gras/datadesc/datadesc.big32_8_4 and /dev/null differ
diff --git a/teshsuite/gras/datadesc/datadesc.big64 b/teshsuite/gras/datadesc/datadesc.big64
deleted file mode 100644 (file)
index 167f95d..0000000
Binary files a/teshsuite/gras/datadesc/datadesc.big64 and /dev/null differ
diff --git a/teshsuite/gras/datadesc/datadesc.little32_4 b/teshsuite/gras/datadesc/datadesc.little32_4
deleted file mode 100644 (file)
index 84dcda7..0000000
Binary files a/teshsuite/gras/datadesc/datadesc.little32_4 and /dev/null differ
diff --git a/teshsuite/gras/datadesc/datadesc.little64 b/teshsuite/gras/datadesc/datadesc.little64
deleted file mode 100644 (file)
index b3e5e7d..0000000
Binary files a/teshsuite/gras/datadesc/datadesc.little64 and /dev/null differ
diff --git a/teshsuite/gras/datadesc/datadesc.tesh b/teshsuite/gras/datadesc/datadesc.tesh
deleted file mode 100644 (file)
index deae085..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! ./tesh
-
-# Description of this tesh file
-! D This tesh file contains all the tesh files relative with Gras
-
-# Gras datadesc suite
-
-! suite Checks the marshaling facilities of Gras
-! include datadesc_mem.tesh             Try to do a in-memory copy
-! include datadesc_rw.tesh              Try to read what we write
-! include datadesc_r_big32_2.tesh       Try to read the result of linux/mips?
-! include datadesc_r_big32_8.tesh       Try to read the result of ppc/sparc?
-! include datadesc_r_big32_8_4.tesh     Try to read the result of AIX
-! include datadesc_r_little32_4.tesh    Try to read the result of linux/x86
-! include datadesc_r_little64.tesh      Try to read the result of linux/amd64
diff --git a/teshsuite/gras/datadesc/datadesc_mem.tesh b/teshsuite/gras/datadesc/datadesc_mem.tesh
deleted file mode 100644 (file)
index b59d27f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-p Check the marshaling facilities (trying to to do a in-memory copy)
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ gras/datadesc/datadesc_usage --copy "--log=root.fmt:%m%n"
-> Memory copy
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
diff --git a/teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh b/teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh
deleted file mode 100644 (file)
index 9653525..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-p Check the marshaling facilities (trying to read the result of AIX)
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ gras/datadesc/datadesc_usage --read ${srcdir:=.}/gras/datadesc/datadesc.big32_8_4 --log=test.thres:verbose --log=structs.thres:info "--log=root.fmt:%m%n"
-> Read from file datadesc.big32_8_4
-> This file was generated on big32_8_4 (7)
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
diff --git a/teshsuite/gras/datadesc/datadesc_r_little32_4.tesh b/teshsuite/gras/datadesc/datadesc_r_little32_4.tesh
deleted file mode 100644 (file)
index 326cf7a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-p Check the marshaling facilities (trying to read the result of linux/x86)
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ gras/datadesc/datadesc_usage --read ${srcdir:=.}/gras/datadesc/datadesc.little32_4  --log=test.thres:verbose --log=structs.thres:info "--log=root.fmt:%m%n"
-> Read from file datadesc.little32_4
-> This file was generated on little32_4 (2)
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
diff --git a/teshsuite/gras/datadesc/datadesc_r_little64.tesh b/teshsuite/gras/datadesc/datadesc_r_little64.tesh
deleted file mode 100644 (file)
index e2fd6e6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-p Check the marshaling facilities (trying to read the result of linux/amd64)
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV gras/datadesc/datadesc_usage --read ${srcdir:=.}/gras/datadesc/datadesc.little64  --log=test.thres:verbose --log=structs.thres:info "--log=root.fmt:%m%n"
-> Read from file datadesc.little64
-> This file was generated on little64 (4)
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
diff --git a/teshsuite/gras/datadesc/datadesc_rw.tesh b/teshsuite/gras/datadesc/datadesc_rw.tesh
deleted file mode 100644 (file)
index 0922f56..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-
-p Check the marshaling facilities (trying to read what we write)
-$ rm -f datadesc_usage.out
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ gras/datadesc/datadesc_usage --write "--log=root.fmt:%m%n"
-> Write to file datadesc_usage.out
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ gras/datadesc/datadesc_usage --read "--log=root.fmt:%m%n"
-> Read from file datadesc_usage.out
-> ---- Test on integer ----
-> ---- Test on float ----
-> ---- Test on double ----
-> ---- Test on fixed array ----
-> ---- Test on a reference to an integer ----
-> ---- Test on string (ref to dynamic array) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on empty dynar of integers ----
-> ---- Test on all possible struct having 4 fields (49 structs) ----
-> ---- Test on homogeneous structure ----
-> ---- Test on heterogeneous structure ----
-> ---- Test on nested structures ----
-> ---- Test on heterogeneous structure arrays ----
-> ---- Test on chained list ----
-> ---- Test on graph (cyclique chained list of 3 items) ----
-> ---- Test on dynar containing integers ----
-> ---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----
-> ---- Test on struct containing dynamic array and its size (cbps test) ----
-> ---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----
-> Exiting GRAS
diff --git a/teshsuite/gras/datadesc/datadesc_structs.c b/teshsuite/gras/datadesc/datadesc_structs.c
deleted file mode 100644 (file)
index c9bb728..0000000
+++ /dev/null
@@ -1,609 +0,0 @@
-/* This file is perl-generated, of course */
-
-#include "gras.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(structs,test,"Logs about the gigantic struct test");
-
-#define READ  0
-#define WRITE 1
-#define RW    2
-
-void write_read(const char *type,void *src, void *dst, xbt_socket_t *sock, int direction);
-
-XBT_DEFINE_TYPE(cccc,struct cccc { char a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(ccsc,struct ccsc { char a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(ccic,struct ccic { char a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(cclc,struct cclc { char a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(ccLc,struct ccLc { char a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(ccfc,struct ccfc { char a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(ccdc,struct ccdc { char a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(sccc,struct sccc { short int a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(scsc,struct scsc { short int a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(scic,struct scic { short int a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(sclc,struct sclc { short int a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(scLc,struct scLc { short int a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(scfc,struct scfc { short int a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(scdc,struct scdc { short int a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(iccc,struct iccc { int a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(icsc,struct icsc { int a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(icic,struct icic { int a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(iclc,struct iclc { int a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(icLc,struct icLc { int a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(icfc,struct icfc { int a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(icdc,struct icdc { int a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(lccc,struct lccc { long int a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(lcsc,struct lcsc { long int a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(lcic,struct lcic { long int a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(lclc,struct lclc { long int a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(lcLc,struct lcLc { long int a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(lcfc,struct lcfc { long int a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(lcdc,struct lcdc { long int a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(Lccc,struct Lccc { long long int a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(Lcsc,struct Lcsc { long long int a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(Lcic,struct Lcic { long long int a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(Lclc,struct Lclc { long long int a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(LcLc,struct LcLc { long long int a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(Lcfc,struct Lcfc { long long int a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(Lcdc,struct Lcdc { long long int a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(fccc,struct fccc { float a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(fcsc,struct fcsc { float a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(fcic,struct fcic { float a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(fclc,struct fclc { float a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(fcLc,struct fcLc { float a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(fcfc,struct fcfc { float a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(fcdc,struct fcdc { float a; char b; double c;char d;};)
-XBT_DEFINE_TYPE(dccc,struct dccc { double a; char b; char c;char d;};)
-XBT_DEFINE_TYPE(dcsc,struct dcsc { double a; char b; short int c;char d;};)
-XBT_DEFINE_TYPE(dcic,struct dcic { double a; char b; int c;char d;};)
-XBT_DEFINE_TYPE(dclc,struct dclc { double a; char b; long int c;char d;};)
-XBT_DEFINE_TYPE(dcLc,struct dcLc { double a; char b; long long int c;char d;};)
-XBT_DEFINE_TYPE(dcfc,struct dcfc { double a; char b; float c;char d;};)
-XBT_DEFINE_TYPE(dcdc,struct dcdc { double a; char b; double c;char d;};)
-
-#define test(a) xbt_assert(a)
-void register_structures(void);
-void register_structures(void) {
-  gras_msgtype_declare("cccc", xbt_datadesc_by_symbol(cccc));
-  gras_msgtype_declare("ccsc", xbt_datadesc_by_symbol(ccsc));
-  gras_msgtype_declare("ccic", xbt_datadesc_by_symbol(ccic));
-  gras_msgtype_declare("cclc", xbt_datadesc_by_symbol(cclc));
-  gras_msgtype_declare("ccLc", xbt_datadesc_by_symbol(ccLc));
-  gras_msgtype_declare("ccfc", xbt_datadesc_by_symbol(ccfc));
-  gras_msgtype_declare("ccdc", xbt_datadesc_by_symbol(ccdc));
-  gras_msgtype_declare("sccc", xbt_datadesc_by_symbol(sccc));
-  gras_msgtype_declare("scsc", xbt_datadesc_by_symbol(scsc));
-  gras_msgtype_declare("scic", xbt_datadesc_by_symbol(scic));
-  gras_msgtype_declare("sclc", xbt_datadesc_by_symbol(sclc));
-  gras_msgtype_declare("scLc", xbt_datadesc_by_symbol(scLc));
-  gras_msgtype_declare("scfc", xbt_datadesc_by_symbol(scfc));
-  gras_msgtype_declare("scdc", xbt_datadesc_by_symbol(scdc));
-  gras_msgtype_declare("iccc", xbt_datadesc_by_symbol(iccc));
-  gras_msgtype_declare("icsc", xbt_datadesc_by_symbol(icsc));
-  gras_msgtype_declare("icic", xbt_datadesc_by_symbol(icic));
-  gras_msgtype_declare("iclc", xbt_datadesc_by_symbol(iclc));
-  gras_msgtype_declare("icLc", xbt_datadesc_by_symbol(icLc));
-  gras_msgtype_declare("icfc", xbt_datadesc_by_symbol(icfc));
-  gras_msgtype_declare("icdc", xbt_datadesc_by_symbol(icdc));
-  gras_msgtype_declare("lccc", xbt_datadesc_by_symbol(lccc));
-  gras_msgtype_declare("lcsc", xbt_datadesc_by_symbol(lcsc));
-  gras_msgtype_declare("lcic", xbt_datadesc_by_symbol(lcic));
-  gras_msgtype_declare("lclc", xbt_datadesc_by_symbol(lclc));
-  gras_msgtype_declare("lcLc", xbt_datadesc_by_symbol(lcLc));
-  gras_msgtype_declare("lcfc", xbt_datadesc_by_symbol(lcfc));
-  gras_msgtype_declare("lcdc", xbt_datadesc_by_symbol(lcdc));
-  gras_msgtype_declare("Lccc", xbt_datadesc_by_symbol(Lccc));
-  gras_msgtype_declare("Lcsc", xbt_datadesc_by_symbol(Lcsc));
-  gras_msgtype_declare("Lcic", xbt_datadesc_by_symbol(Lcic));
-  gras_msgtype_declare("Lclc", xbt_datadesc_by_symbol(Lclc));
-  gras_msgtype_declare("LcLc", xbt_datadesc_by_symbol(LcLc));
-  gras_msgtype_declare("Lcfc", xbt_datadesc_by_symbol(Lcfc));
-  gras_msgtype_declare("Lcdc", xbt_datadesc_by_symbol(Lcdc));
-  gras_msgtype_declare("fccc", xbt_datadesc_by_symbol(fccc));
-  gras_msgtype_declare("fcsc", xbt_datadesc_by_symbol(fcsc));
-  gras_msgtype_declare("fcic", xbt_datadesc_by_symbol(fcic));
-  gras_msgtype_declare("fclc", xbt_datadesc_by_symbol(fclc));
-  gras_msgtype_declare("fcLc", xbt_datadesc_by_symbol(fcLc));
-  gras_msgtype_declare("fcfc", xbt_datadesc_by_symbol(fcfc));
-  gras_msgtype_declare("fcdc", xbt_datadesc_by_symbol(fcdc));
-  gras_msgtype_declare("dccc", xbt_datadesc_by_symbol(dccc));
-  gras_msgtype_declare("dcsc", xbt_datadesc_by_symbol(dcsc));
-  gras_msgtype_declare("dcic", xbt_datadesc_by_symbol(dcic));
-  gras_msgtype_declare("dclc", xbt_datadesc_by_symbol(dclc));
-  gras_msgtype_declare("dcLc", xbt_datadesc_by_symbol(dcLc));
-  gras_msgtype_declare("dcfc", xbt_datadesc_by_symbol(dcfc));
-  gras_msgtype_declare("dcdc", xbt_datadesc_by_symbol(dcdc));
-}
-void test_structures(xbt_socket_t *sock, int direction);
-void test_structures(xbt_socket_t *sock, int direction) {
-  struct cccc my_cccc = {'w'+(char)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_cccc2;
-  struct ccsc my_ccsc = {'w'+(char)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_ccsc2;
-  struct ccic my_ccic = {'w'+(char)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_ccic2;
-  struct cclc my_cclc = {'w'+(char)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_cclc2;
-  struct ccLc my_ccLc = {'w'+(char)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_ccLc2;
-  struct ccfc my_ccfc = {'w'+(char)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_ccfc2;
-  struct ccdc my_ccdc = {'w'+(char)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_ccdc2;
-  struct sccc my_sccc = {134+(short int)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_sccc2;
-  struct scsc my_scsc = {134+(short int)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_scsc2;
-  struct scic my_scic = {134+(short int)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_scic2;
-  struct sclc my_sclc = {134+(short int)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_sclc2;
-  struct scLc my_scLc = {134+(short int)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_scLc2;
-  struct scfc my_scfc = {134+(short int)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_scfc2;
-  struct scdc my_scdc = {134+(short int)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_scdc2;
-  struct iccc my_iccc = {-11249+(int)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_iccc2;
-  struct icsc my_icsc = {-11249+(int)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_icsc2;
-  struct icic my_icic = {-11249+(int)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_icic2;
-  struct iclc my_iclc = {-11249+(int)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_iclc2;
-  struct icLc my_icLc = {-11249+(int)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_icLc2;
-  struct icfc my_icfc = {-11249+(int)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_icfc2;
-  struct icdc my_icdc = {-11249+(int)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_icdc2;
-  struct lccc my_lccc = {31319919+(long int)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_lccc2;
-  struct lcsc my_lcsc = {31319919+(long int)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_lcsc2;
-  struct lcic my_lcic = {31319919+(long int)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_lcic2;
-  struct lclc my_lclc = {31319919+(long int)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_lclc2;
-  struct lcLc my_lcLc = {31319919+(long int)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_lcLc2;
-  struct lcfc my_lcfc = {31319919+(long int)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_lcfc2;
-  struct lcdc my_lcdc = {31319919+(long int)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_lcdc2;
-  struct Lccc my_Lccc = {-232130010+(long long int)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_Lccc2;
-  struct Lcsc my_Lcsc = {-232130010+(long long int)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_Lcsc2;
-  struct Lcic my_Lcic = {-232130010+(long long int)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_Lcic2;
-  struct Lclc my_Lclc = {-232130010+(long long int)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_Lclc2;
-  struct LcLc my_LcLc = {-232130010+(long long int)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_LcLc2;
-  struct Lcfc my_Lcfc = {-232130010+(long long int)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_Lcfc2;
-  struct Lcdc my_Lcdc = {-232130010+(long long int)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_Lcdc2;
-  struct fccc my_fccc = {-11313.1135+(float)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_fccc2;
-  struct fcsc my_fcsc = {-11313.1135+(float)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_fcsc2;
-  struct fcic my_fcic = {-11313.1135+(float)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_fcic2;
-  struct fclc my_fclc = {-11313.1135+(float)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_fclc2;
-  struct fcLc my_fcLc = {-11313.1135+(float)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_fcLc2;
-  struct fcfc my_fcfc = {-11313.1135+(float)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_fcfc2;
-  struct fcdc my_fcdc = {-11313.1135+(float)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_fcdc2;
-  struct dccc my_dccc = {1424420.11331+(double)1,'w'+(char)2,'w'+(char)3,'w'+(char)4}, my_dccc2;
-  struct dcsc my_dcsc = {1424420.11331+(double)1,'w'+(char)2,134+(short int)3,'w'+(char)4}, my_dcsc2;
-  struct dcic my_dcic = {1424420.11331+(double)1,'w'+(char)2,-11249+(int)3,'w'+(char)4}, my_dcic2;
-  struct dclc my_dclc = {1424420.11331+(double)1,'w'+(char)2,31319919+(long int)3,'w'+(char)4}, my_dclc2;
-  struct dcLc my_dcLc = {1424420.11331+(double)1,'w'+(char)2,-232130010+(long long int)3,'w'+(char)4}, my_dcLc2;
-  struct dcfc my_dcfc = {1424420.11331+(double)1,'w'+(char)2,-11313.1135+(float)3,'w'+(char)4}, my_dcfc2;
-  struct dcdc my_dcdc = {1424420.11331+(double)1,'w'+(char)2,1424420.11331+(double)3,'w'+(char)4}, my_dcdc2;
-  XBT_INFO("---- Test on all possible struct having 4 fields (49 structs) ----");
-  write_read("cccc", &my_cccc, &my_cccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_cccc.a == my_cccc2.a);
-     test(my_cccc.b == my_cccc2.b);
-     test(my_cccc.c == my_cccc2.c);
-     test(my_cccc.d == my_cccc2.d);
-     if (!failed) XBT_VERB("Passed cccc");
-  }
-  write_read("ccsc", &my_ccsc, &my_ccsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_ccsc.a == my_ccsc2.a);
-     test(my_ccsc.b == my_ccsc2.b);
-     test(my_ccsc.c == my_ccsc2.c);
-     test(my_ccsc.d == my_ccsc2.d);
-     if (!failed) XBT_VERB("Passed ccsc");
-  }
-  write_read("ccic", &my_ccic, &my_ccic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_ccic.a == my_ccic2.a);
-     test(my_ccic.b == my_ccic2.b);
-     test(my_ccic.c == my_ccic2.c);
-     test(my_ccic.d == my_ccic2.d);
-     if (!failed) XBT_VERB("Passed ccic");
-  }
-  write_read("cclc", &my_cclc, &my_cclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_cclc.a == my_cclc2.a);
-     test(my_cclc.b == my_cclc2.b);
-     test(my_cclc.c == my_cclc2.c);
-     test(my_cclc.d == my_cclc2.d);
-     if (!failed) XBT_VERB("Passed cclc");
-  }
-  write_read("ccLc", &my_ccLc, &my_ccLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_ccLc.a == my_ccLc2.a);
-     test(my_ccLc.b == my_ccLc2.b);
-     test(my_ccLc.c == my_ccLc2.c);
-     test(my_ccLc.d == my_ccLc2.d);
-     if (!failed) XBT_VERB("Passed ccLc");
-  }
-  write_read("ccfc", &my_ccfc, &my_ccfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_ccfc.a == my_ccfc2.a);
-     test(my_ccfc.b == my_ccfc2.b);
-     test(my_ccfc.c == my_ccfc2.c);
-     test(my_ccfc.d == my_ccfc2.d);
-     if (!failed) XBT_VERB("Passed ccfc");
-  }
-  write_read("ccdc", &my_ccdc, &my_ccdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_ccdc.a == my_ccdc2.a);
-     test(my_ccdc.b == my_ccdc2.b);
-     test(my_ccdc.c == my_ccdc2.c);
-     test(my_ccdc.d == my_ccdc2.d);
-     if (!failed) XBT_VERB("Passed ccdc");
-  }
-  write_read("sccc", &my_sccc, &my_sccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_sccc.a == my_sccc2.a);
-     test(my_sccc.b == my_sccc2.b);
-     test(my_sccc.c == my_sccc2.c);
-     test(my_sccc.d == my_sccc2.d);
-     if (!failed) XBT_VERB("Passed sccc");
-  }
-  write_read("scsc", &my_scsc, &my_scsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_scsc.a == my_scsc2.a);
-     test(my_scsc.b == my_scsc2.b);
-     test(my_scsc.c == my_scsc2.c);
-     test(my_scsc.d == my_scsc2.d);
-     if (!failed) XBT_VERB("Passed scsc");
-  }
-  write_read("scic", &my_scic, &my_scic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_scic.a == my_scic2.a);
-     test(my_scic.b == my_scic2.b);
-     test(my_scic.c == my_scic2.c);
-     test(my_scic.d == my_scic2.d);
-     if (!failed) XBT_VERB("Passed scic");
-  }
-  write_read("sclc", &my_sclc, &my_sclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_sclc.a == my_sclc2.a);
-     test(my_sclc.b == my_sclc2.b);
-     test(my_sclc.c == my_sclc2.c);
-     test(my_sclc.d == my_sclc2.d);
-     if (!failed) XBT_VERB("Passed sclc");
-  }
-  write_read("scLc", &my_scLc, &my_scLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_scLc.a == my_scLc2.a);
-     test(my_scLc.b == my_scLc2.b);
-     test(my_scLc.c == my_scLc2.c);
-     test(my_scLc.d == my_scLc2.d);
-     if (!failed) XBT_VERB("Passed scLc");
-  }
-  write_read("scfc", &my_scfc, &my_scfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_scfc.a == my_scfc2.a);
-     test(my_scfc.b == my_scfc2.b);
-     test(my_scfc.c == my_scfc2.c);
-     test(my_scfc.d == my_scfc2.d);
-     if (!failed) XBT_VERB("Passed scfc");
-  }
-  write_read("scdc", &my_scdc, &my_scdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_scdc.a == my_scdc2.a);
-     test(my_scdc.b == my_scdc2.b);
-     test(my_scdc.c == my_scdc2.c);
-     test(my_scdc.d == my_scdc2.d);
-     if (!failed) XBT_VERB("Passed scdc");
-  }
-  write_read("iccc", &my_iccc, &my_iccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_iccc.a == my_iccc2.a);
-     test(my_iccc.b == my_iccc2.b);
-     test(my_iccc.c == my_iccc2.c);
-     test(my_iccc.d == my_iccc2.d);
-     if (!failed) XBT_VERB("Passed iccc");
-  }
-  write_read("icsc", &my_icsc, &my_icsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_icsc.a == my_icsc2.a);
-     test(my_icsc.b == my_icsc2.b);
-     test(my_icsc.c == my_icsc2.c);
-     test(my_icsc.d == my_icsc2.d);
-     if (!failed) XBT_VERB("Passed icsc");
-  }
-  write_read("icic", &my_icic, &my_icic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_icic.a == my_icic2.a);
-     test(my_icic.b == my_icic2.b);
-     test(my_icic.c == my_icic2.c);
-     test(my_icic.d == my_icic2.d);
-     if (!failed) XBT_VERB("Passed icic");
-  }
-  write_read("iclc", &my_iclc, &my_iclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_iclc.a == my_iclc2.a);
-     test(my_iclc.b == my_iclc2.b);
-     test(my_iclc.c == my_iclc2.c);
-     test(my_iclc.d == my_iclc2.d);
-     if (!failed) XBT_VERB("Passed iclc");
-  }
-  write_read("icLc", &my_icLc, &my_icLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_icLc.a == my_icLc2.a);
-     test(my_icLc.b == my_icLc2.b);
-     test(my_icLc.c == my_icLc2.c);
-     test(my_icLc.d == my_icLc2.d);
-     if (!failed) XBT_VERB("Passed icLc");
-  }
-  write_read("icfc", &my_icfc, &my_icfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_icfc.a == my_icfc2.a);
-     test(my_icfc.b == my_icfc2.b);
-     test(my_icfc.c == my_icfc2.c);
-     test(my_icfc.d == my_icfc2.d);
-     if (!failed) XBT_VERB("Passed icfc");
-  }
-  write_read("icdc", &my_icdc, &my_icdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_icdc.a == my_icdc2.a);
-     test(my_icdc.b == my_icdc2.b);
-     test(my_icdc.c == my_icdc2.c);
-     test(my_icdc.d == my_icdc2.d);
-     if (!failed) XBT_VERB("Passed icdc");
-  }
-  write_read("lccc", &my_lccc, &my_lccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lccc.a == my_lccc2.a);
-     test(my_lccc.b == my_lccc2.b);
-     test(my_lccc.c == my_lccc2.c);
-     test(my_lccc.d == my_lccc2.d);
-     if (!failed) XBT_VERB("Passed lccc");
-  }
-  write_read("lcsc", &my_lcsc, &my_lcsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lcsc.a == my_lcsc2.a);
-     test(my_lcsc.b == my_lcsc2.b);
-     test(my_lcsc.c == my_lcsc2.c);
-     test(my_lcsc.d == my_lcsc2.d);
-     if (!failed) XBT_VERB("Passed lcsc");
-  }
-  write_read("lcic", &my_lcic, &my_lcic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lcic.a == my_lcic2.a);
-     test(my_lcic.b == my_lcic2.b);
-     test(my_lcic.c == my_lcic2.c);
-     test(my_lcic.d == my_lcic2.d);
-     if (!failed) XBT_VERB("Passed lcic");
-  }
-  write_read("lclc", &my_lclc, &my_lclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lclc.a == my_lclc2.a);
-     test(my_lclc.b == my_lclc2.b);
-     test(my_lclc.c == my_lclc2.c);
-     test(my_lclc.d == my_lclc2.d);
-     if (!failed) XBT_VERB("Passed lclc");
-  }
-  write_read("lcLc", &my_lcLc, &my_lcLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lcLc.a == my_lcLc2.a);
-     test(my_lcLc.b == my_lcLc2.b);
-     test(my_lcLc.c == my_lcLc2.c);
-     test(my_lcLc.d == my_lcLc2.d);
-     if (!failed) XBT_VERB("Passed lcLc");
-  }
-  write_read("lcfc", &my_lcfc, &my_lcfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lcfc.a == my_lcfc2.a);
-     test(my_lcfc.b == my_lcfc2.b);
-     test(my_lcfc.c == my_lcfc2.c);
-     test(my_lcfc.d == my_lcfc2.d);
-     if (!failed) XBT_VERB("Passed lcfc");
-  }
-  write_read("lcdc", &my_lcdc, &my_lcdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_lcdc.a == my_lcdc2.a);
-     test(my_lcdc.b == my_lcdc2.b);
-     test(my_lcdc.c == my_lcdc2.c);
-     test(my_lcdc.d == my_lcdc2.d);
-     if (!failed) XBT_VERB("Passed lcdc");
-  }
-  write_read("Lccc", &my_Lccc, &my_Lccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lccc.a == my_Lccc2.a);
-     test(my_Lccc.b == my_Lccc2.b);
-     test(my_Lccc.c == my_Lccc2.c);
-     test(my_Lccc.d == my_Lccc2.d);
-     if (!failed) XBT_VERB("Passed Lccc");
-  }
-  write_read("Lcsc", &my_Lcsc, &my_Lcsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lcsc.a == my_Lcsc2.a);
-     test(my_Lcsc.b == my_Lcsc2.b);
-     test(my_Lcsc.c == my_Lcsc2.c);
-     test(my_Lcsc.d == my_Lcsc2.d);
-     if (!failed) XBT_VERB("Passed Lcsc");
-  }
-  write_read("Lcic", &my_Lcic, &my_Lcic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lcic.a == my_Lcic2.a);
-     test(my_Lcic.b == my_Lcic2.b);
-     test(my_Lcic.c == my_Lcic2.c);
-     test(my_Lcic.d == my_Lcic2.d);
-     if (!failed) XBT_VERB("Passed Lcic");
-  }
-  write_read("Lclc", &my_Lclc, &my_Lclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lclc.a == my_Lclc2.a);
-     test(my_Lclc.b == my_Lclc2.b);
-     test(my_Lclc.c == my_Lclc2.c);
-     test(my_Lclc.d == my_Lclc2.d);
-     if (!failed) XBT_VERB("Passed Lclc");
-  }
-  write_read("LcLc", &my_LcLc, &my_LcLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_LcLc.a == my_LcLc2.a);
-     test(my_LcLc.b == my_LcLc2.b);
-     test(my_LcLc.c == my_LcLc2.c);
-     test(my_LcLc.d == my_LcLc2.d);
-     if (!failed) XBT_VERB("Passed LcLc");
-  }
-  write_read("Lcfc", &my_Lcfc, &my_Lcfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lcfc.a == my_Lcfc2.a);
-     test(my_Lcfc.b == my_Lcfc2.b);
-     test(my_Lcfc.c == my_Lcfc2.c);
-     test(my_Lcfc.d == my_Lcfc2.d);
-     if (!failed) XBT_VERB("Passed Lcfc");
-  }
-  write_read("Lcdc", &my_Lcdc, &my_Lcdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_Lcdc.a == my_Lcdc2.a);
-     test(my_Lcdc.b == my_Lcdc2.b);
-     test(my_Lcdc.c == my_Lcdc2.c);
-     test(my_Lcdc.d == my_Lcdc2.d);
-     if (!failed) XBT_VERB("Passed Lcdc");
-  }
-  write_read("fccc", &my_fccc, &my_fccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fccc.a == my_fccc2.a);
-     test(my_fccc.b == my_fccc2.b);
-     test(my_fccc.c == my_fccc2.c);
-     test(my_fccc.d == my_fccc2.d);
-     if (!failed) XBT_VERB("Passed fccc");
-  }
-  write_read("fcsc", &my_fcsc, &my_fcsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fcsc.a == my_fcsc2.a);
-     test(my_fcsc.b == my_fcsc2.b);
-     test(my_fcsc.c == my_fcsc2.c);
-     test(my_fcsc.d == my_fcsc2.d);
-     if (!failed) XBT_VERB("Passed fcsc");
-  }
-  write_read("fcic", &my_fcic, &my_fcic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fcic.a == my_fcic2.a);
-     test(my_fcic.b == my_fcic2.b);
-     test(my_fcic.c == my_fcic2.c);
-     test(my_fcic.d == my_fcic2.d);
-     if (!failed) XBT_VERB("Passed fcic");
-  }
-  write_read("fclc", &my_fclc, &my_fclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fclc.a == my_fclc2.a);
-     test(my_fclc.b == my_fclc2.b);
-     test(my_fclc.c == my_fclc2.c);
-     test(my_fclc.d == my_fclc2.d);
-     if (!failed) XBT_VERB("Passed fclc");
-  }
-  write_read("fcLc", &my_fcLc, &my_fcLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fcLc.a == my_fcLc2.a);
-     test(my_fcLc.b == my_fcLc2.b);
-     test(my_fcLc.c == my_fcLc2.c);
-     test(my_fcLc.d == my_fcLc2.d);
-     if (!failed) XBT_VERB("Passed fcLc");
-  }
-  write_read("fcfc", &my_fcfc, &my_fcfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fcfc.a == my_fcfc2.a);
-     test(my_fcfc.b == my_fcfc2.b);
-     test(my_fcfc.c == my_fcfc2.c);
-     test(my_fcfc.d == my_fcfc2.d);
-     if (!failed) XBT_VERB("Passed fcfc");
-  }
-  write_read("fcdc", &my_fcdc, &my_fcdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_fcdc.a == my_fcdc2.a);
-     test(my_fcdc.b == my_fcdc2.b);
-     test(my_fcdc.c == my_fcdc2.c);
-     test(my_fcdc.d == my_fcdc2.d);
-     if (!failed) XBT_VERB("Passed fcdc");
-  }
-  write_read("dccc", &my_dccc, &my_dccc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dccc.a == my_dccc2.a);
-     test(my_dccc.b == my_dccc2.b);
-     test(my_dccc.c == my_dccc2.c);
-     test(my_dccc.d == my_dccc2.d);
-     if (!failed) XBT_VERB("Passed dccc");
-  }
-  write_read("dcsc", &my_dcsc, &my_dcsc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dcsc.a == my_dcsc2.a);
-     test(my_dcsc.b == my_dcsc2.b);
-     test(my_dcsc.c == my_dcsc2.c);
-     test(my_dcsc.d == my_dcsc2.d);
-     if (!failed) XBT_VERB("Passed dcsc");
-  }
-  write_read("dcic", &my_dcic, &my_dcic2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dcic.a == my_dcic2.a);
-     test(my_dcic.b == my_dcic2.b);
-     test(my_dcic.c == my_dcic2.c);
-     test(my_dcic.d == my_dcic2.d);
-     if (!failed) XBT_VERB("Passed dcic");
-  }
-  write_read("dclc", &my_dclc, &my_dclc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dclc.a == my_dclc2.a);
-     test(my_dclc.b == my_dclc2.b);
-     test(my_dclc.c == my_dclc2.c);
-     test(my_dclc.d == my_dclc2.d);
-     if (!failed) XBT_VERB("Passed dclc");
-  }
-  write_read("dcLc", &my_dcLc, &my_dcLc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dcLc.a == my_dcLc2.a);
-     test(my_dcLc.b == my_dcLc2.b);
-     test(my_dcLc.c == my_dcLc2.c);
-     test(my_dcLc.d == my_dcLc2.d);
-     if (!failed) XBT_VERB("Passed dcLc");
-  }
-  write_read("dcfc", &my_dcfc, &my_dcfc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dcfc.a == my_dcfc2.a);
-     test(my_dcfc.b == my_dcfc2.b);
-     test(my_dcfc.c == my_dcfc2.c);
-     test(my_dcfc.d == my_dcfc2.d);
-     if (!failed) XBT_VERB("Passed dcfc");
-  }
-  write_read("dcdc", &my_dcdc, &my_dcdc2, sock,direction);
-  if (direction == READ || direction == RW) {
-     int failed = 0;
-     test(my_dcdc.a == my_dcdc2.a);
-     test(my_dcdc.b == my_dcdc2.b);
-     test(my_dcdc.c == my_dcdc2.c);
-     test(my_dcdc.d == my_dcdc2.d);
-     if (!failed) XBT_VERB("Passed dcdc");
-  }
-}
diff --git a/teshsuite/gras/datadesc/datadesc_usage.c b/teshsuite/gras/datadesc/datadesc_usage.c
deleted file mode 100644 (file)
index 2460d7f..0000000
+++ /dev/null
@@ -1,797 +0,0 @@
-/* datadesc: test of data description (using file transport).               */
-
-/* Copyright (c) 2007, 2009, 2010. 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. */
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#include <stdio.h>
-#include "xbt/datadesc.h"
-#include "xbt/datadesc/datadesc_interface.h"
-#include "gras.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this test");
-
-#define READ  0
-#define WRITE 1
-#define COPY  2
-
-const char *filename = "datadesc_usage.out";
-
-void
-write_read(const char *msgtype, void *src, void *dst,
-           xbt_socket_t sock, int direction);
-
-void
-write_read(const char *msgtype, void *src, void *dst,
-           xbt_socket_t sock, int direction)
-{
-
-  switch (direction) {
-  case READ:
-    gras_msg_wait(15, msgtype, NULL, dst);
-    break;
-
-  case WRITE:
-    gras_msg_send(sock, msgtype, src);
-    break;
-
-  case COPY:
-    xbt_datadesc_memcpy(xbt_datadesc_by_name(msgtype), src, dst);
-    break;
-  }
-}
-
-
-/* defined in datadesc_structures.c, which in perl generated */
-void register_structures(void);
-void test_structures(xbt_socket_t sock, int direction);
-
-/************************
- * Each and every tests *
- ************************/
-
-static void test_int(xbt_socket_t sock, int direction)
-{
-  int i = 5, j;
-
-  XBT_INFO("---- Test on integer ----");
-  write_read("int", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY)
-    xbt_assert(i == j);
-}
-
-static void test_float(xbt_socket_t sock, int direction)
-{
-  float i = 5.0, j;
-
-  XBT_INFO("---- Test on float ----");
-  write_read("float", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY)
-    xbt_assert(i == j, "%f != %f", i, j);
-}
-
-static void test_double(xbt_socket_t sock, int direction)
-{
-  double i = -3252355.1234, j;
-
-  XBT_INFO("---- Test on double ----");
-  write_read("double", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY)
-    xbt_assert(i == j, "%f != %f", i, j);
-}
-
-#define FIXED_ARRAY_SIZE 5
-typedef int array[FIXED_ARRAY_SIZE];
-static void test_array(xbt_socket_t sock, int direction)
-{
-  array i = { 35212, -6226, 74337, 11414, 7733 };
-  array j;
-  int cpt;
-
-  XBT_INFO("---- Test on fixed array ----");
-
-  write_read("fixed int array", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    for (cpt = 0; cpt < FIXED_ARRAY_SIZE; cpt++) {
-      XBT_DEBUG("Test spot %d", cpt);
-      xbt_assert(i[cpt] == j[cpt], "i[%d]=%d  !=  j[%d]=%d",
-                  cpt, i[cpt], cpt, j[cpt]);
-    }
-  }
-}
-
-/*** Dynar of scalar ***/
-
-static void test_dynar_scal(xbt_socket_t sock, int direction)
-{
-  xbt_dynar_t i, j;
-  int cpt;
-
-  XBT_INFO("---- Test on dynar containing integers ----");
-  i = xbt_dynar_new(sizeof(int), NULL);
-  for (cpt = 0; cpt < 64; cpt++) {
-    xbt_dynar_push_as(i, int, cpt);
-    XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(i));
-  }
-  /*  xbt_dynar_dump(i); */
-  write_read("xbt_dynar_of_int", &i, &j, sock, direction);
-  /*  xbt_dynar_dump(j); */
-  if (direction == READ || direction == COPY) {
-    for (cpt = 0; cpt < 64; cpt++) {
-      int ret = xbt_dynar_get_as(j, cpt, int);
-      if (cpt != ret) {
-        XBT_CRITICAL
-            ("The retrieved value for cpt=%d is not the same than the injected one (%d!=%d)",
-             cpt, ret, cpt);
-        xbt_abort();
-      }
-    }
-    xbt_dynar_free(&j);
-  }
-  xbt_dynar_free(&i);
-}
-
-/*** Empty dynar ***/
-
-static void test_dynar_empty(xbt_socket_t sock, int direction)
-{
-  xbt_dynar_t i, j;
-
-  XBT_INFO("---- Test on empty dynar of integers ----");
-  i = xbt_dynar_new(sizeof(int), NULL);
-  write_read("xbt_dynar_of_int", &i, &j, sock, direction);
-  /*  xbt_dynar_dump(j); */
-  if (direction == READ || direction == COPY) {
-    xbt_assert(xbt_dynar_is_empty(j));
-    xbt_dynar_free(&j);
-  }
-  xbt_dynar_free(&i);
-}
-
-static void test_intref(xbt_socket_t sock, int direction)
-{
-  int *i, *j;
-
-  i = xbt_new(int, 1);
-  *i = 12345;
-
-  XBT_INFO("---- Test on a reference to an integer ----");
-
-  write_read("int*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(*i == *j, "*i != *j (%d != %d)", *i, *j);
-    free(j);
-  }
-  free(i);
-}
-
-/***
- *** string (dynamic array)
- ***/
-static void test_string(xbt_socket_t sock, int direction)
-{
-  char *i = xbt_strdup("Some data"), *j = NULL;
-  int cpt;
-
-  XBT_INFO("---- Test on string (ref to dynamic array) ----");
-  write_read("string", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    for (cpt = 0; cpt < strlen(i); cpt++) {
-      xbt_assert(i[cpt] == j[cpt], "i[%d]=%c  !=  j[%d]=%c",
-                  cpt, i[cpt], cpt, j[cpt]);
-    }
-    free(j);
-  }
-  free(i);
-}
-
-
-/***
- *** homogeneous struct
- ***/
-typedef struct {
-  int a, b, c, d;
-} homostruct;
-static void test_homostruct(xbt_socket_t sock, int direction)
-{
-  homostruct *i, *j;
-
-  XBT_INFO("---- Test on homogeneous structure ----");
-  /* init a value, exchange it and check its validity */
-  i = xbt_new(homostruct, 1);
-  i->a = 2235;
-  i->b = 433425;
-  i->c = -23423;
-  i->d = -235235;
-
-  write_read("homostruct*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(i->a == j->a, "i->a=%d != j->a=%d", i->a, j->a);
-    xbt_assert(i->b == j->b);
-    xbt_assert(i->c == j->c);
-    xbt_assert(i->d == j->d);
-    free(j);
-  }
-  free(i);
-}
-
-/***
- *** heterogeneous struct
- ***/
-typedef struct {
-  unsigned char c1;
-  unsigned long int l1;
-  unsigned char c2;
-  unsigned long int l2;
-} hetestruct;
-static void test_hetestruct(xbt_socket_t sock, int direction)
-{
-  hetestruct *i, *j;
-
-  XBT_INFO("---- Test on heterogeneous structure ----");
-  /* init a value, exchange it and check its validity */
-  i = xbt_new(hetestruct, 1);
-  i->c1 = 's';
-  i->l1 = 123455;
-  i->c2 = 'e';
-  i->l2 = 774531;
-
-  write_read("hetestruct*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(i->c1 == j->c1);
-    xbt_assert(i->c2 == j->c2);
-    xbt_assert(i->l1 == j->l1, "i->l1(=%lu)  !=  j->l1(=%lu)", i->l1,
-                j->l1);
-    xbt_assert(i->l2 == j->l2);
-    free(j);
-  }
-  free(i);
-}
-
-static void test_hetestruct_array(xbt_socket_t sock, int direction)
-{
-  hetestruct *i, *j, *p, *q;
-  int cpt;
-
-  XBT_INFO("---- Test on heterogeneous structure arrays ----");
-  /* init a value, exchange it and check its validity */
-  i = xbt_malloc(sizeof(hetestruct) * 10);
-  for (cpt = 0, p = i; cpt < 10; cpt++, p++) {
-    p->c1 = 's' + cpt;
-    p->l1 = 123455 + cpt;
-    p->c2 = 'e' + cpt;
-    p->l2 = 774531 + cpt;
-  }
-
-  write_read("hetestruct[10]*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    for (cpt = 0, p = i, q = j; cpt < 10; cpt++, p++, q++) {
-      xbt_assert(p->c1 == q->c1);
-      xbt_assert(p->c2 == q->c2);
-      xbt_assert(p->l1 == p->l1,
-                  "for cpt=%d i->l1(=%lu)  !=  j->l1(=%lu)", cpt, p->l1,
-                  q->l1);
-      xbt_assert(q->l2 == p->l2);
-    }
-    free(j);
-  }
-  free(i);
-}
-
-/***
- *** nested struct
- ***/
-typedef struct {
-  hetestruct hete;
-  homostruct homo;
-} nestedstruct;
-static void test_nestedstruct(xbt_socket_t sock, int direction)
-{
-  nestedstruct *i, *j;
-
-  XBT_INFO("---- Test on nested structures ----");
-  /* init a value, exchange it and check its validity */
-  i = xbt_new(nestedstruct, 1);
-  i->homo.a = 235231;
-  i->homo.b = -124151;
-  i->homo.c = 211551;
-  i->homo.d = -664222;
-  i->hete.c1 = 's';
-  i->hete.l1 = 123455;
-  i->hete.c2 = 'e';
-  i->hete.l2 = 774531;
-
-  write_read("nestedstruct*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(i->homo.a == j->homo.a);
-    xbt_assert(i->homo.b == j->homo.b);
-    xbt_assert(i->homo.c == j->homo.c);
-    xbt_assert(i->homo.d == j->homo.d);
-    xbt_assert(i->hete.c1 == j->hete.c1);
-    xbt_assert(i->hete.c2 == j->hete.c2);
-    xbt_assert(i->hete.l1 == j->hete.l1);
-    xbt_assert(i->hete.l2 == j->hete.l2);
-    free(j);
-  }
-  free(i);
-}
-
-/***
- *** chained list
- ***/
-typedef struct s_chained_list chained_list_t;
-struct s_chained_list {
-  int v;
-  chained_list_t *l;
-};
-chained_list_t *cons(int v, chained_list_t * l);
-void list_free(chained_list_t * l);
-int list_eq(chained_list_t * i, chained_list_t * j);
-
-chained_list_t *cons(int v, chained_list_t * l)
-{
-  chained_list_t *nl = xbt_new(chained_list_t, 1);
-
-  nl->v = v;
-  nl->l = l;
-
-  return nl;
-}
-
-void list_free(chained_list_t * l)
-{
-  if (l) {
-    list_free(l->l);
-    free(l);
-  }
-}
-
-int list_eq(chained_list_t * i, chained_list_t * j)
-{
-  if (!i || !j)
-    return i == j;
-  if (i->v != j->v)
-    return 0;
-  return list_eq(i->l, j->l);
-}
-
-static void test_chain_list(xbt_socket_t sock, int direction)
-{
-  chained_list_t *i, *j;
-
-  XBT_INFO("---- Test on chained list ----");
-
-  /* init a value, exchange it and check its validity */
-  i = cons(12355, cons(246264, cons(23263, NULL)));
-  j = NULL;
-
-  write_read("chained_list_t*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(list_eq(i, j));
-    list_free(j);
-  }
-
-  list_free(i);
-}
-
-/***
- *** graph
- ***/
-static void test_graph(xbt_socket_t sock, int direction)
-{
-  chained_list_t *i, *j;
-
-  XBT_INFO("---- Test on graph (cyclique chained list of 3 items) ----");
-  /* init a value, exchange it and check its validity */
-  i = cons(1151515, cons(-232362, cons(222552, NULL)));
-  i->l->l->l = i;
-  j = NULL;
-
-  write_read("chained_list_t*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-
-    XBT_DEBUG("i=%p", i);
-    XBT_DEBUG("i->l=%p", i->l);
-    XBT_DEBUG("i->l->l=%p", i->l->l);
-    XBT_DEBUG("i->l->l->l=%p", i->l->l->l);
-    XBT_DEBUG("j=%p", j);
-    XBT_DEBUG("j->l=%p", j->l);
-    XBT_DEBUG("j->l->l=%p", j->l->l);
-    XBT_DEBUG("j->l->l->l=%p", j->l->l->l);
-    xbt_assert(j->l->l->l == j,
-                "Received list is not cyclic. j=%p != j->l->l->l=%p\n"
-                "j=%p; &j=%p", j, j->l->l->l, j, &j);
-    j->l->l->l = NULL;
-    i->l->l->l = NULL;
-    xbt_assert(list_eq(i, j));
-
-    list_free(j);
-  }
-  i->l->l->l = NULL;            /* do this even in WRITE mode */
-  list_free(i);
-}
-
-
-/*** Dynar of references ***/
-static void free_string(void *d)
-{                               /* used to free the data in dynar */
-  free(*(void **) d);
-}
-
-static void test_dynar_ref(xbt_socket_t sock, int direction)
-{
-  xbt_dynar_t i, j;
-  char buf[1024];
-  char *s1, *s2;
-  int cpt;
-
-  XBT_INFO("---- Test on dynar containing integers ----");
-
-  i = xbt_dynar_new(sizeof(char *), &free_string);
-  for (cpt = 0; cpt < 64; cpt++) {
-    sprintf(buf, "%d", cpt);
-    s1 = strdup(buf);
-    xbt_dynar_push(i, &s1);
-  }
-
-  write_read("xbt_dynar_of_string", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    for (cpt = 0; cpt < 64; cpt++) {
-      sprintf(buf, "%d", cpt);
-      xbt_dynar_shift(j, &s2);
-      xbt_assert(!strcmp(buf, s2),
-                  "The retrieved value is not the same than the injected one (%s!=%s)",
-                  buf, s2);
-      free(s2);
-    }
-    xbt_dynar_free(&j);
-  }
-  xbt_dynar_free(&i);
-}
-
-
-/**** PBIO *****/
-XBT_DEFINE_TYPE(s_pbio, struct s_pbio {        /* structure presented in the IEEE article */
-                int Cnstatv;
-                double Cstatev[12]; int Cnprops; double Cprops[110];
-                int Cndi[4];
-                int Cnshr;
-                int Cnpt; double Cdtime; double Ctime[2]; int Cntens;
-                double Cdfgrd0[373][3];
-                double Cdfgrd1[3][3]; double Cstress[106];
-                double Cddsdde[106][106];
-                };
-
-    )
-
-typedef struct s_pbio pbio_t;
-
-static void test_pbio(xbt_socket_t sock, int direction)
-{
-  int cpt;
-  int cpt2;
-  pbio_t i, j;
-
-  XBT_INFO
-      ("---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----");
-  xbt_datadesc_by_symbol(s_pbio);
-
-  /* Fill in that damn struct */
-  i.Cnstatv = 325115;
-  for (cpt = 0; cpt < 12; cpt++)
-    i.Cstatev[cpt] = ((double) cpt) * -2361.11;
-  i.Cnprops = -37373;
-  for (cpt = 0; cpt < 110; cpt++)
-    i.Cprops[cpt] = cpt * 100.0;
-  for (cpt = 0; cpt < 4; cpt++)
-    i.Cndi[cpt] = cpt * 23262;
-  i.Cnshr = -4634;
-  i.Cnpt = 114142;
-  i.Cdtime = -11515.662;
-  i.Ctime[0] = 332523.226;
-  i.Ctime[1] = -26216.113;
-  i.Cntens = 235211411;
-
-  for (cpt = 0; cpt < 3; cpt++) {
-    for (cpt2 = 0; cpt2 < 373; cpt2++)
-      i.Cdfgrd0[cpt2][cpt] = ((double) cpt) * ((double) cpt2);
-    for (cpt2 = 0; cpt2 < 3; cpt2++)
-      i.Cdfgrd1[cpt][cpt2] = -((double) cpt) * ((double) cpt2);
-  }
-  for (cpt = 0; cpt < 106; cpt++) {
-    i.Cstress[cpt] = (double) cpt *22.113;
-    for (cpt2 = 0; cpt2 < 106; cpt2++)
-      i.Cddsdde[cpt][cpt2] = ((double) cpt) * ((double) cpt2);
-  }
-  write_read("s_pbio", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    /* Check that the data match */
-    xbt_assert(i.Cnstatv == j.Cnstatv);
-    for (cpt = 0; cpt < 12; cpt++)
-      xbt_assert(i.Cstatev[cpt] == j.Cstatev[cpt],
-                  "i.Cstatev[%d] (=%f) != j.Cstatev[%d] (=%f)",
-                  cpt, i.Cstatev[cpt], cpt, j.Cstatev[cpt]);
-    xbt_assert(i.Cnprops == j.Cnprops);
-    for (cpt = 0; cpt < 110; cpt++)
-      xbt_assert(i.Cprops[cpt] == j.Cprops[cpt]);
-    for (cpt = 0; cpt < 4; cpt++)
-      xbt_assert(i.Cndi[cpt] == j.Cndi[cpt]);
-    xbt_assert(i.Cnshr == j.Cnshr);
-    xbt_assert(i.Cnpt == j.Cnpt);
-    xbt_assert(i.Cdtime == j.Cdtime);
-    xbt_assert(i.Ctime[0] == j.Ctime[0]);
-    xbt_assert(i.Ctime[1] == j.Ctime[1]);
-    xbt_assert(i.Cntens == j.Cntens);
-    for (cpt = 0; cpt < 3; cpt++) {
-      for (cpt2 = 0; cpt2 < 373; cpt2++)
-        xbt_assert(i.Cdfgrd0[cpt2][cpt] == j.Cdfgrd0[cpt2][cpt]);
-      for (cpt2 = 0; cpt2 < 3; cpt2++)
-        xbt_assert(i.Cdfgrd1[cpt][cpt2] == j.Cdfgrd1[cpt][cpt2]);
-    }
-    for (cpt = 0; cpt < 106; cpt++) {
-      xbt_assert(i.Cstress[cpt] == j.Cstress[cpt]);
-      for (cpt2 = 0; cpt2 < 106; cpt2++)
-        xbt_assert(i.Cddsdde[cpt][cpt2] == j.Cddsdde[cpt][cpt2],
-                    "%f=i.Cddsdde[%d][%d] != j.Cddsdde[cpt][cpt2]=%f",
-                    i.Cddsdde[cpt][cpt2], cpt, cpt2, j.Cddsdde[cpt][cpt2]);
-    }
-  }
-}
-
-XBT_DEFINE_TYPE(s_clause, struct s_clause {
-                int num_lits;
-                int *literals XBT_ANNOTE(size, num_lits);     /* Tells GRAS where to find the size */
-                };)
-
-typedef struct s_clause Clause;
-
-static void test_clause(xbt_socket_t sock, int direction)
-{
-  Clause *i, *j;
-  int cpt;
-
-  XBT_INFO
-      ("---- Test on struct containing dynamic array and its size (cbps test) ----");
-
-  /* create and fill the struct */
-  i = xbt_new(Clause, 1);
-
-  i->num_lits = 5432;
-  i->literals = xbt_new(int, i->num_lits);
-  for (cpt = 0; cpt < i->num_lits; cpt++)
-    i->literals[cpt] = cpt * cpt - ((cpt * cpt) / 2);
-  XBT_DEBUG("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
-  XBT_DEBUG("created count=%d", i->num_lits);
-
-  write_read("Clause*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(i->num_lits == j->num_lits);
-    for (cpt = 0; cpt < i->num_lits; cpt++)
-      xbt_assert(i->literals[cpt] == j->literals[cpt]);
-
-    free(j->literals);
-    free(j);
-  }
-  free(i->literals);
-  free(i);
-}
-
-static void test_clause_empty(xbt_socket_t sock, int direction)
-{
-  Clause *i, *j;
-
-  XBT_INFO
-      ("---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----");
-
-  /* create and fill the struct */
-  i = xbt_new(Clause, 1);
-
-  i->num_lits = 0;
-  i->literals = NULL;
-  XBT_DEBUG("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
-  XBT_DEBUG("created count=%d", i->num_lits);
-
-  write_read("Clause*", &i, &j, sock, direction);
-  if (direction == READ || direction == COPY) {
-    xbt_assert(i->num_lits == j->num_lits);
-
-    free(j->literals);
-    free(j);
-  }
-  free(i->literals);
-  free(i);
-}
-
-static void register_types(void)
-{
-  xbt_datadesc_type_t my_type, ref_my_type;
-
-  gras_msgtype_declare("char", xbt_datadesc_by_name("char"));
-  gras_msgtype_declare("int", xbt_datadesc_by_name("int"));
-  gras_msgtype_declare("float", xbt_datadesc_by_name("float"));
-  gras_msgtype_declare("double", xbt_datadesc_by_name("double"));
-
-  my_type = xbt_datadesc_array_fixed("fixed int array",
-                                      xbt_datadesc_by_name("int"),
-                                      FIXED_ARRAY_SIZE);
-  gras_msgtype_declare("fixed int array", my_type);
-
-  my_type = xbt_datadesc_dynar(xbt_datadesc_by_name("int"), NULL);
-  gras_msgtype_declare("xbt_dynar_of_int", my_type);
-
-  my_type = xbt_datadesc_ref("int*", xbt_datadesc_by_name("int"));
-  gras_msgtype_declare("int*", my_type);
-
-  gras_msgtype_declare("string", xbt_datadesc_by_name("string"));
-
-  my_type = xbt_datadesc_struct("homostruct");
-  xbt_datadesc_struct_append(my_type, "a",
-                              xbt_datadesc_by_name("signed int"));
-  xbt_datadesc_struct_append(my_type, "b", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(my_type, "c", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(my_type, "d", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_close(my_type);
-  my_type =
-      xbt_datadesc_ref("homostruct*",
-                        xbt_datadesc_by_name("homostruct"));
-  gras_msgtype_declare("homostruct*", my_type);
-
-  my_type = xbt_datadesc_struct("hetestruct");
-  xbt_datadesc_struct_append(my_type, "c1",
-                              xbt_datadesc_by_name("unsigned char"));
-  xbt_datadesc_struct_append(my_type, "l1",
-                              xbt_datadesc_by_name("unsigned long int"));
-  xbt_datadesc_struct_append(my_type, "c2",
-                              xbt_datadesc_by_name("unsigned char"));
-  xbt_datadesc_struct_append(my_type, "l2",
-                              xbt_datadesc_by_name("unsigned long int"));
-  xbt_datadesc_struct_close(my_type);
-  my_type =
-      xbt_datadesc_ref("hetestruct*",
-                        xbt_datadesc_by_name("hetestruct"));
-  gras_msgtype_declare("hetestruct*", my_type);
-
-  my_type =
-      xbt_datadesc_array_fixed("hetestruct[10]",
-                                xbt_datadesc_by_name("hetestruct"), 10);
-  my_type = xbt_datadesc_ref("hetestruct[10]*", my_type);
-  gras_msgtype_declare("hetestruct[10]*", my_type);
-
-  my_type = xbt_datadesc_struct("nestedstruct");
-  xbt_datadesc_struct_append(my_type, "hete",
-                              xbt_datadesc_by_name("hetestruct"));
-  xbt_datadesc_struct_append(my_type, "homo",
-                              xbt_datadesc_by_name("homostruct"));
-  xbt_datadesc_struct_close(my_type);
-  my_type =
-      xbt_datadesc_ref("nestedstruct*",
-                        xbt_datadesc_by_name("nestedstruct"));
-  gras_msgtype_declare("nestedstruct*", my_type);
-
-  my_type = xbt_datadesc_struct("chained_list_t");
-  ref_my_type = xbt_datadesc_ref("chained_list_t*", my_type);
-  xbt_datadesc_struct_append(my_type, "v", xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(my_type, "l", ref_my_type);
-  xbt_datadesc_struct_close(my_type);
-  xbt_datadesc_cycle_set(xbt_datadesc_by_name("chained_list_t*"));
-  gras_msgtype_declare("chained_list_t", my_type);
-  gras_msgtype_declare("chained_list_t*", ref_my_type);
-
-  my_type =
-      xbt_datadesc_dynar(xbt_datadesc_by_name("string"), &free_string);
-  gras_msgtype_declare("xbt_dynar_of_string", my_type);
-
-  my_type = xbt_datadesc_by_symbol(s_pbio);
-  gras_msgtype_declare("s_pbio", my_type);
-
-  my_type = xbt_datadesc_by_symbol(s_clause);
-  my_type = xbt_datadesc_ref("Clause*", my_type);
-  gras_msgtype_declare("Clause*", my_type);
-
-}
-
-#ifdef __BORLANDC__
-#pragma argsused
-#endif
-
-int main(int argc, char *argv[])
-{
-  xbt_socket_t sock = NULL;
-  int direction = WRITE;
-  int cpt;
-  char local_arch, remote_arch;
-
-  gras_init(&argc, argv);
-  register_types();
-  register_structures();
-
-  for (cpt = 1; cpt < argc; cpt++) {
-    if (!strcmp(argv[cpt], "--arch")) {
-      XBT_INFO("We are on %s (#%d)",
-            xbt_datadesc_arch_name(xbt_arch_selfid()),
-            (int) xbt_arch_selfid());
-      exit(0);
-    } else if (!strcmp(argv[cpt], "--help")) {
-      printf("Usage: datadesc_usage [option] [filename]\n");
-      printf(" --arch: display the current architecture and quit.\n");
-      printf(" --read file: reads the description from the given file\n");
-      printf(" --write file: writes the description to the given file\n");
-      printf(" --copy: copy the description in memory\n");
-      printf
-          (" --regen: write the description to the file of the current architecture\n");
-      printf(" --help: displays this message\n");
-      exit(0);
-    } else if (!strcmp(argv[cpt], "--regen")) {
-      direction = WRITE;
-      filename =
-          bprintf("datadesc.%s",
-                  xbt_datadesc_arch_name(xbt_arch_selfid()));
-    } else if (!strcmp(argv[cpt], "--read")) {
-      direction = READ;
-    } else if (!strcmp(argv[cpt], "--write")) {
-      direction = WRITE;
-    } else if (!strcmp(argv[cpt], "--copy")) {
-      direction = COPY;
-    } else {
-      filename = argv[cpt];
-    }
-  }
-
-  if (direction == WRITE) {
-    XBT_INFO("Write to file %s",
-          strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
-    sock = gras_socket_client_from_file(filename);
-  }
-  if (direction == READ) {
-    XBT_INFO("Read from file %s",
-          strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
-    sock = gras_socket_server_from_file(filename);
-  }
-  if (direction == COPY) {
-    XBT_INFO("Memory copy");
-  }
-
-  local_arch = xbt_arch_selfid();
-  write_read("char", &local_arch, &remote_arch, sock, direction);
-  if (direction == READ)
-    XBT_VERB("This file was generated on %s (%d)",
-          xbt_datadesc_arch_name(remote_arch), (int) remote_arch);
-
-
-  test_int(sock, direction);
-  test_float(sock, direction);
-  test_double(sock, direction);
-  test_array(sock, direction);
-  test_intref(sock, direction);
-
-  test_string(sock, direction);
-  test_dynar_scal(sock, direction);
-  test_dynar_empty(sock, direction);
-
-  test_structures(sock, direction);
-
-  test_homostruct(sock, direction);
-  test_hetestruct(sock, direction);
-  test_nestedstruct(sock, direction);
-  test_hetestruct_array(sock, direction);
-
-  test_chain_list(sock, direction);
-  test_graph(sock, direction);
-  test_dynar_ref(sock, direction);
-
-  test_pbio(sock, direction);
-
-  test_clause(sock, direction);
-  test_clause_empty(sock, direction);
-
-  if (direction != COPY)
-    gras_socket_close(sock);
-
-  gras_exit();
-  return 0;
-}
diff --git a/teshsuite/gras/datadesc/mk_datadesc_structs.pl b/teshsuite/gras/datadesc/mk_datadesc_structs.pl
deleted file mode 100755 (executable)
index cc16f5a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-
-my @types;
-my @abrev;
-my @val;
-
-push @types,"char";          push @abrev, "c"; push @val, "'w'";
-push @types,"short int";     push @abrev, "s"; push @val, '134';
-push @types,"int";           push @abrev, "i"; push @val, '-11249';
-push @types,"long int";      push @abrev, "l"; push @val, '31319919';
-push @types,"long long int"; push @abrev, "L"; push @val, '-232130010';
-push @types,"float";         push @abrev, "f"; push @val, '-11313.1135';
-push @types,"double";        push @abrev, "d"; push @val, '1424420.11331';
-
-die 'scalar @types != scalar @abrev' unless (scalar @types == scalar @abrev);
-
-print "/* This file is perl-generated, of course */\n\n";
-
-print "#include \"gras.h\"\n\n";
-
-print "XBT_LOG_NEW_DEFAULT_SUBCATEGORY(structs,test,\"Logs about the gigantic struct test\");\n\n";
-
-print "#define READ  0\n#define WRITE 1\n#define RW    2\n\n";
-  
-print "void write_read(const char *type,void *src, void *dst, xbt_socket_t *sock, int direction);\n\n";
-
-my ($i,$j,$k,$l);
-my $max=scalar @types;
-# Those max variables can be used to tune how much test you are ready to do.
-# But WARNING! changing them naturally invalidate any existing data file.
-my $max_i=$max-1;
-my $max_j=0;     
-my $max_k=$max-1;
-my $max_l=0;     
-for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
-    print "XBT_DEFINE_TYPE(".$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l].",".
-      "struct ".$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l]." { ".
-        $types[$i]." a; ".
-        $types[$j]." b; ".
-        $types[$k]." c;".
-        $types[$l]." d;".
-      "};)\n";
-}}}}
-
-# print "\n#define test(a) do {if (!(a)) { failed = 1; XBT_ERROR(\"%s failed\",#a);}} while (0)\n";
- print "\n#define test(a) xbt_assert(a)\n";
-
-print "void register_structures(void);\n";
-print "void register_structures(void) {\n";
-for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
-    my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
-    print "  gras_msgtype_declare(\"$struct\", xbt_datadesc_by_symbol($struct));\n";
-}}}}
-print "}\n";
-
-print "void test_structures(xbt_socket_t *sock, int direction);\n";
-print "void test_structures(xbt_socket_t *sock, int direction) {\n";
-for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
-    my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
-    print "  struct $struct my_$struct = {".$val[$i]."+(".$types[$i].")1,"
-                                           .$val[$j]."+(".$types[$j].")2,"
-                                           .$val[$k]."+(".$types[$k].")3,"
-                                           .$val[$l]."+(".$types[$l].")4}, my_${struct}2;\n";
-}}}}
-
-print "  XBT_INFO(\"---- Test on all possible struct having 4 fields (".(($max_i+1)*($max_j+1)*($max_k+1)*($max_l+1))." structs) ----\");\n";
-for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
-    my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
-    print "  write_read(\"$struct\", &my_$struct, &my_${struct}2, sock,direction);\n";
-    print "  if (direction == READ || direction == RW) {\n";
-    print "     int failed = 0;\n";
-    print "     test(my_$struct.a == my_${struct}2.a);\n";
-    print "     test(my_$struct.b == my_${struct}2.b);\n";
-    print "     test(my_$struct.c == my_${struct}2.c);\n";
-    print "     test(my_$struct.d == my_${struct}2.d);\n";
-    print "     if (!failed) XBT_VERB(\"Passed $struct\");\n";
-    print "  }\n";
-}}}}
-    print "}\n";
-    ;
diff --git a/teshsuite/gras/empty_main/CMakeLists.txt b/teshsuite/gras/empty_main/CMakeLists.txt
deleted file mode 100644 (file)
index 7439d20..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_empty_main_function.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_empty_main_simulator.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-add_executable(empty_main_function     ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_empty_main_function.c)
-add_executable(empty_main_simulator    ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_empty_main_simulator.c)
-
-add_custom_command(
-  OUTPUT       ${CMAKE_CURRENT_BINARY_DIR}/_empty_main_function.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_empty_main_simulator.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator empty_main ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(empty_main_simulator simgrid m pthread)
-  target_link_libraries(empty_main_function gras m pthread)
-else()
-  target_link_libraries(empty_main_simulator simgrid)
-  target_link_libraries(empty_main_function gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.xml
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/empty_main.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/empty_main/empty_main.c b/teshsuite/gras/empty_main/empty_main.c
deleted file mode 100644 (file)
index 83e6d5c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* empty_main.c -- check what happens when the processes do nothing         */
-/* Thanks to Loris Marshal for reporting a problem in that case             */
-
-/* Copyright (c) 2008, 2009, 2010. 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. */
-
-
-#include "gras.h"
-
-int function(int argc, char *argv[]);
-
-int function(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-  //  gras_os_sleep(3);
-  gras_exit();
-  return 0;
-}
diff --git a/teshsuite/gras/empty_main/empty_main.xml b/teshsuite/gras/empty_main/empty_main.xml
deleted file mode 100644 (file)
index cc4cf8e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="function" />
-</platform>
diff --git a/teshsuite/gras/empty_main/test_rl.tesh b/teshsuite/gras/empty_main/test_rl.tesh
deleted file mode 100755 (executable)
index b94f15c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_ENV ${bindir:=.}/empty_main_function$EXEEXT --log=root.fmt=%P:%t%e%m%n
-> function:main Exiting GRAS
diff --git a/teshsuite/gras/empty_main/test_sg.tesh b/teshsuite/gras/empty_main/test_sg.tesh
deleted file mode 100755 (executable)
index 285f80d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-p Runs the 'empty_main' test within the simulator
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ${bindir:=.}/empty_main_simulator${EXEEXT:=} ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/empty_main/empty_main.xml
-> [Tremblay:function:(1) 0.000000] [gras/INFO] Exiting GRAS
diff --git a/teshsuite/gras/gras.tesh b/teshsuite/gras/gras.tesh
deleted file mode 100644 (file)
index 89a1f5f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#! ./tesh
-
-# Description of this tesh file
-! D This tesh file contains all the tesh files relative with Gras
-
-# includes the Gras marshaling facilities tesh suite
-! include datadesc.tesh
diff --git a/teshsuite/gras/msg_handle/CMakeLists.txt b/teshsuite/gras/msg_handle/CMakeLists.txt
deleted file mode 100644 (file)
index 7f5a916..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-add_executable(msg_handle_simulator ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_simulator.c)
-add_executable(msg_handle_client       ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_client.c)
-add_executable(msg_handle_server       ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_server.c)
-
-add_custom_command(
-  OUTPUT       ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_msg_handle_server.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator msg_handle ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(msg_handle_simulator simgrid m pthread )
-  target_link_libraries(msg_handle_client gras m pthread )
-  target_link_libraries(msg_handle_server gras m pthread )
-else()
-  target_link_libraries(msg_handle_simulator simgrid)
-  target_link_libraries(msg_handle_client gras)
-  target_link_libraries(msg_handle_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.xml
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/msg_handle.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/msg_handle/msg_handle.c b/teshsuite/gras/msg_handle/msg_handle.c
deleted file mode 100644 (file)
index 675cb00..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* msg_handle - ensures the semantic of gras_msg_handle(i) for i<0,=0 or >0 */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
- * All rights reserved.                                                     */
-/* Thanks to Flavien Vernier for reporting an issue around this             */
-
-/* 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 "gras.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this test");
-
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-static int server_cb_hello_handler(gras_msg_cb_ctx_t ctx,
-                                   void *payload_data)
-{
-  XBT_INFO("Got the message");
-  return 0;
-}
-
-int server(int argc, char *argv[])
-{
-  volatile xbt_socket_t me = NULL, pal = NULL;
-  int myport;
-  char *palstr;
-
-  xbt_ex_t e;
-  _XBT_GNUC_UNUSED int got_expected;
-  _XBT_GNUC_UNUSED double now;
-
-
-  gras_init(&argc, argv);
-
-  xbt_assert(argc == 3, "Usage: server <myport> <client>");
-  myport = atoi(argv[1]);
-  palstr = argv[2];
-
-  gras_msgtype_declare("hello", NULL);
-  gras_cb_register("hello", &server_cb_hello_handler);
-
-  XBT_INFO("Launch server (port=%d)", myport);
-  TRY {
-    me = gras_socket_server(myport);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a server socket: %s");
-  }
-  gras_os_sleep(1);             /* Wait for pal to startup */
-  TRY {
-    pal = gras_socket_client_from_string(palstr);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a socket to %s: %s", palstr);
-  }
-  XBT_INFO("Initialization done.");
-  now = gras_os_time();
-
-  /* Launch handle(0) when there is no message. Timeout expected */
-  got_expected = 0;
-  TRY {
-    gras_msg_handle(0);
-  }
-  CATCH(e) {
-    if (e.category == timeout_error) {
-      got_expected = 1;
-      xbt_ex_free(e);
-    } else {
-      RETHROWF("Didn't got the expected timeout: %s");
-    }
-  }
-  xbt_assert(got_expected,
-              "gras_msg_handle(0) do not lead to any timeout exception");
-  xbt_assert(gras_os_time() - now < 0.01,
-              "gras_msg_handle(0) do not anwser immediately (%.4fsec)",
-              gras_os_time() - now);
-  XBT_INFO("gras_msg_handle(0) works as expected (immediate timeout)");
-  /* Launch handle(0) when there is no message. Timeout expected */
-  got_expected = 0;
-  TRY {
-    gras_msg_handle(1);
-  }
-  CATCH(e) {
-    if (e.category == timeout_error) {
-      got_expected = 1;
-      xbt_ex_free(e);
-    } else {
-      RETHROWF("Didn't got the expected timeout: %s");
-    }
-  }
-  xbt_assert(got_expected,
-              "gras_msg_handle(1) do not lead to any timeout exception");
-  xbt_assert(gras_os_time() - now < 1.5,
-              "gras_msg_handle(1) needs more than 1.5 sec to answer (%.4fsec)",
-              gras_os_time() - now);
-  xbt_assert(gras_os_time() - now >= 1.0,
-              "gras_msg_handle(1) answers in less than one second (%.4fsec)",
-              gras_os_time() - now);
-  XBT_INFO("gras_msg_handle(1) works as expected (delayed timeout)");
-  gras_os_sleep(3);
-
-  /* Send an hello to the client to unlock it */
-  XBT_INFO("Unlock pal");
-  gras_msg_send(pal, "hello", NULL);
-
-  /* Frees the allocated resources, and shut GRAS down */
-  gras_socket_close(me);
-  gras_socket_close(pal);
-  gras_exit();
-  return 0;
-}
-
-int client(int argc, char *argv[])
-{
-  volatile xbt_socket_t me = NULL, pal = NULL;
-  int myport;
-  char *palstr;
-
-  gras_init(&argc, argv);
-  xbt_assert(argc == 3, "Usage: client <myport> <server>");
-  myport = atoi(argv[1]);
-  palstr = argv[2];
-
-  gras_msgtype_declare("hello", NULL);
-  gras_cb_register("hello", &server_cb_hello_handler);
-
-  XBT_INFO("Launch client (port=%d)", myport);
-  TRY {
-    me = gras_socket_server(myport);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a server socket: %s");
-  }
-  gras_os_sleep(1);             /* Wait for pal to startup */
-  TRY {
-    pal = gras_socket_client_from_string(palstr);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("Unable to establish a socket to %s: %s", palstr);
-  }
-  XBT_INFO("Initialization done.");
-
-  /* Launch handle(-1). Lock until message from server expected */
-  TRY {
-    gras_msg_handle(-1);
-  }
-  CATCH_ANONYMOUS {
-    RETHROWF("No exception expected during handle(-1), but got %s");
-  }
-  XBT_INFO("gras_msg_handle(-1) works as expected (locked)");
-
-  /* Frees the allocated resources, and shut GRAS down */
-  gras_socket_close(me);
-  gras_socket_close(pal);
-  gras_exit();
-  return 0;
-}
diff --git a/teshsuite/gras/msg_handle/msg_handle.xml b/teshsuite/gras/msg_handle/msg_handle.xml
deleted file mode 100644 (file)
index df6f7f7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="server">
-     <argument value="4000"/>       <!-- my port number -->
-     <argument value="Fafard:4000"/>   <!-- client location -->
-  </process>
-  <process host="Fafard" function="client">
-     <argument value="4000"/>       <!-- my port number -->
-     <argument value="Tremblay:4000"/>   <!-- server location -->
-  </process>
-</platform>
diff --git a/teshsuite/gras/msg_handle/test_rl.tesh b/teshsuite/gras/msg_handle/test_rl.tesh
deleted file mode 100755 (executable)
index c0b34f4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_ENV gras/msg_handle/msg_handle_server$EXEEXT 4002 127.0.0.1:4003 --log=root.fmt=%P:%t%e%m%n
-> server:main Launch server (port=4002)
-> server:main Initialization done.
-> server:main gras_msg_handle(0) works as expected (immediate timeout)
-> server:main gras_msg_handle(1) works as expected (delayed timeout)
-> server:main Unlock pal
-> server:main Exiting GRAS
-
-! timeout 20
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-& $SG_TEST_ENV gras/msg_handle/msg_handle_client$EXEEXT 4003 127.0.0.1:4002 --log=root.fmt=%P:%t%e%m%n
-> client:main Launch client (port=4003)
-> client:main Initialization done.
-> client:main Got the message
-> client:main gras_msg_handle(-1) works as expected (locked)
-> client:main Exiting GRAS
diff --git a/teshsuite/gras/msg_handle/test_sg_32.tesh b/teshsuite/gras/msg_handle/test_sg_32.tesh
deleted file mode 100644 (file)
index 648ed08..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-p Runs the 'msg_handle' test within the simulator (simulation times valid for 32bits architectures)
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (port=4000)
-> [  1.000390] (1:server@Tremblay) Initialization done.
-> [  1.000390] (1:server@Tremblay) gras_msg_handle(0) works as expected (immediate timeout)
-> [  1.000390] (2:client@Fafard) Initialization done.
-> [  2.000390] (1:server@Tremblay) gras_msg_handle(1) works as expected (delayed timeout)
-> [  5.000390] (1:server@Tremblay) Unlock pal
-> [  5.026098] (1:server@Tremblay) Exiting GRAS
-> [  5.026098] (2:client@Fafard) Got the message
-> [  5.026098] (2:client@Fafard) gras_msg_handle(-1) works as expected (locked)
-> [  5.026098] (2:client@Fafard) Exiting GRAS
diff --git a/teshsuite/gras/msg_handle/test_sg_64.tesh b/teshsuite/gras/msg_handle/test_sg_64.tesh
deleted file mode 100644 (file)
index aa927ab..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-p Runs the 'msg_handle' test within the simulator (simulation times valid for 64bits architectures)
-
-! output sort
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
-> [  0.000000] (2:client@Fafard) Launch client (port=4000)
-> [  1.000390] (1:server@Tremblay) Initialization done.
-> [  1.000390] (1:server@Tremblay) gras_msg_handle(0) works as expected (immediate timeout)
-> [  1.000390] (2:client@Fafard) Initialization done.
-> [  2.000390] (1:server@Tremblay) gras_msg_handle(1) works as expected (delayed timeout)
-> [  5.000390] (1:server@Tremblay) Unlock pal
-> [  5.026098] (1:server@Tremblay) Exiting GRAS
-> [  5.026098] (2:client@Fafard) Got the message
-> [  5.026098] (2:client@Fafard) gras_msg_handle(-1) works as expected (locked)
-> [  5.026098] (2:client@Fafard) Exiting GRAS
diff --git a/teshsuite/gras/numerous_rpc/CMakeLists.txt b/teshsuite/gras/numerous_rpc/CMakeLists.txt
deleted file mode 100644 (file)
index 9c155aa..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_simulator.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-add_executable(numerous_rpc_client    ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c)
-add_executable(numerous_rpc_server    ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c)
-
-add_custom_command(OUTPUT            ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c
-  DEPENDS           gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.xml
-  COMMAND           ${CMAKE_BINARY_DIR}/bin/gras_stub_generator numerous_rpc ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(numerous_rpc_client gras m pthread )
-  target_link_libraries(numerous_rpc_server gras m pthread )
-else()
-  target_link_libraries(numerous_rpc_client gras)
-  target_link_libraries(numerous_rpc_server gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.xml
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
-
-set(EXAMPLES_CMAKEFILES_TXT
-  ${EXAMPLES_CMAKEFILES_TXT}
-  ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/numerous_rpc/numerous_rpc.c b/teshsuite/gras/numerous_rpc/numerous_rpc.c
deleted file mode 100644 (file)
index 35d7649..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* numerous_rpc -- ensures that no race condition occurs when there is a    */
-/*                 huge amount of very small messages                       */
-
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.               */
-/* Thanks to Soumeya Leila Hernane for reporting an issue around this       */
-
-/* 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 "gras.h"
-
-#define RPC_AMOUNT 50000 /* amount of RPC calls to do in a raw */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(numerous_rpc,"logs attached to the RPC crash test");
-
-int give_hostname(gras_msg_cb_ctx_t ctx, void *payload);
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-/*************************************/
-
-/* callback used for the test */
-int give_hostname(gras_msg_cb_ctx_t ctx, void *payload) {            /* rpc, return hostname */
-  const char* myself = gras_os_myname();
-
-  gras_msg_rpcreturn(-1,ctx,&myself);
-
-  gras_socket_close(gras_msg_cb_ctx_from(ctx));
-  return 0;
-}
-
-/*************************************/
-int server(int argc, char *argv[]) {
-  xbt_socket_t mysock;
-  int i;
-
-  gras_init(&argc, argv);
-  gras_msgtype_declare_rpc("give_hostname",xbt_datadesc_by_name("xbt_string_t"),xbt_datadesc_by_name("xbt_string_t"));
-  gras_cb_register("give_hostname", &give_hostname);
-
-  mysock = gras_socket_server(2222);
-
-  for (i=0;i<RPC_AMOUNT;i++)
-    gras_msg_handle(-1);
-
-  gras_socket_close(mysock);
-  gras_exit();
-  return 0;
-
-}
-
-/* ****************** Code of the client ****************************** */
-int client(int argc, char *argv[]) {
-  long int i;
-  xbt_socket_t server_sock,client_sock;
-  xbt_string_t myself = xbt_strdup(gras_os_myname());
-  xbt_string_t hostname = xbt_malloc(60);
-
-  gras_init(&argc, argv);
-  gras_msgtype_declare_rpc("give_hostname",xbt_datadesc_by_name("xbt_string_t"),xbt_datadesc_by_name("xbt_string_t"));
-
-  client_sock = gras_socket_server_range(1024, 10000, 0, 0);
-
-  for(i=0;i<RPC_AMOUNT;i++) {
-    server_sock = gras_socket_client(argv[1], 2222);
-    //if (i%1000==0)
-      XBT_INFO("iteration %ld",i);
-    gras_msg_rpccall(server_sock,-1,"give_hostname",&myself,&hostname);
-    gras_socket_close(server_sock) ;
-  }
-
-  gras_socket_close(client_sock);
-
-  xbt_free(hostname);
-  xbt_free(myself);
-  gras_exit();
-
-  return 0;
-}
-
-
-
-
-
-
-
-
diff --git a/teshsuite/gras/numerous_rpc/numerous_rpc.xml b/teshsuite/gras/numerous_rpc/numerous_rpc.xml
deleted file mode 100644 (file)
index 5308234..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
-<!-- this file is not really intended to start the code in simulation
-     mode, but mainly to allow the use of the gras_stub_generator.
-     In particular, don't trust the argument passed here -->
-
-<process host='suno-9.sophia.grid5000.fr'  function='server'>
-  <argument value="Ressource_A:2222:1"/>
-  <argument value="owner"/>
-</process>
-
-<process        host='suno-9.sophia.grid5000.fr'  function='client'/>
-
-</platform>
diff --git a/teshsuite/gras/small_sleep/CMakeLists.txt b/teshsuite/gras/small_sleep/CMakeLists.txt
deleted file mode 100644 (file)
index e215f2e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c
-  PROPERTIES GENERATED true)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-
-add_executable(small_sleep_function    ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c)
-add_executable(small_sleep_simulator   ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c)
-
-add_custom_command(
-  OUTPUT       ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_function.c
-  ${CMAKE_CURRENT_BINARY_DIR}/_small_sleep_simulator.c
-  DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.xml
-  COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator small_sleep ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.xml
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(small_sleep_simulator simgrid m pthread)
-  target_link_libraries(small_sleep_function gras m pthread)
-else()
-  target_link_libraries(small_sleep_simulator simgrid)
-  target_link_libraries(small_sleep_function gras)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.xml
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/small_sleep.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/gras/small_sleep/small_sleep.c b/teshsuite/gras/small_sleep/small_sleep.c
deleted file mode 100644 (file)
index e5fd687..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* small_sleep.c -- check what happens when the processes do sleeps very shortly*/
-
-/* Copyright (c) 2008, 2009, 2010. 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. */
-
-
-#include "gras.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Small sleep test");
-
-int function(int argc, char *argv[]);
-
-
-int function(int argc, char *argv[])
-{
-  gras_init(&argc, argv);
-  gras_msg_handleall(100);
-  XBT_INFO("Let's go 1E-5");
-  gras_msg_handleall(1E-5);
-  XBT_INFO("Let's go 1E-10");
-  gras_msg_handleall(1E-10);
-  XBT_INFO("Let's go 1E-15");
-  gras_msg_handleall(1E-15);
-  XBT_INFO("Let's go 1E-20");
-  gras_msg_handleall(1E-20);
-  XBT_INFO("done");
-  gras_exit();
-  return 0;
-}
diff --git a/teshsuite/gras/small_sleep/small_sleep.xml b/teshsuite/gras/small_sleep/small_sleep.xml
deleted file mode 100644 (file)
index cc4cf8e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Tremblay" function="function" />
-</platform>
diff --git a/teshsuite/gras/small_sleep/test_sg_32.tesh b/teshsuite/gras/small_sleep/test_sg_32.tesh
deleted file mode 100755 (executable)
index f56d806..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-p Runs the 'small_sleep' test within the simulator
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ${bindir:=.}/small_sleep_simulator${EXEEXT:=} ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/small_sleep/small_sleep.xml
-> [Tremblay:function:(1) 100.000000] [test/INFO] Let's go 1E-5
-> [Tremblay:function:(1) 100.000010] [test/INFO] Let's go 1E-10
-> [Tremblay:function:(1) 100.000020] [test/INFO] Let's go 1E-15
-> [Tremblay:function:(1) 100.000030] [test/INFO] Let's go 1E-20
-> [Tremblay:function:(1) 100.000030] [test/INFO] done
-> [Tremblay:function:(1) 100.000030] [gras/INFO] Exiting GRAS
diff --git a/teshsuite/gras/small_sleep/test_sg_64.tesh b/teshsuite/gras/small_sleep/test_sg_64.tesh
deleted file mode 100755 (executable)
index 6684c57..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-p Runs the 'empty_main' test within the simulator
-
-! setenv GRAS_NO_WARN_EXPERIMENTAL=1
-$ $SG_TEST_EXENV ${bindir:=.}/small_sleep_simulator${EXEEXT:=} ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/small_sleep/small_sleep.xml
-> [Tremblay:function:(1) 100.000000] [test/INFO] Let's go 1E-5
-> [Tremblay:function:(1) 100.000010] [test/INFO] Let's go 1E-10
-> [Tremblay:function:(1) 100.000020] [test/INFO] Let's go 1E-15
-> [Tremblay:function:(1) 100.000020] [test/INFO] Let's go 1E-20
-> [Tremblay:function:(1) 100.000020] [test/INFO] done
-> [Tremblay:function:(1) 100.000020] [gras/INFO] Exiting GRAS
index ba27cec..b27529c 100644 (file)
@@ -6,7 +6,7 @@
 /* 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 "gras.h"
+#include "xbt.h"
 #include "xbt/synchro.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
 #include "xbt/synchro.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
diff --git a/tools/gras/CMakeLists.txt b/tools/gras/CMakeLists.txt
deleted file mode 100644 (file)
index f95e278..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
-
-add_executable(gras_stub_generator stub_generator.c unix_stub_generator.c windows_stub_generator.c)
-add_executable(struct_diff struct_diff.c)
-
-### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(gras_stub_generator simgrid pthread m)
-  target_link_libraries(struct_diff         simgrid pthread m)
-else()
-  target_link_libraries(gras_stub_generator simgrid)
-  target_link_libraries(struct_diff         simgrid)
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(tools_src
-  ${tools_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/windows_stub_generator.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/unix_stub_generator.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/struct_diff.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/stub_generator.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/gras_stub_generator.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/s_smx_process_t
-  ${CMAKE_CURRENT_SOURCE_DIR}/s_smx_simcall_t
-  ${CMAKE_CURRENT_SOURCE_DIR}/stub_generator4borland.mak
-  ${CMAKE_CURRENT_SOURCE_DIR}/stub_generator.bpf
-  ${CMAKE_CURRENT_SOURCE_DIR}/stub_generator.bpr
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
diff --git a/tools/gras/gras_stub_generator.h b/tools/gras/gras_stub_generator.h
deleted file mode 100644 (file)
index 8fa5f45..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* gras_stub_generator - creates the main() to use a GRAS program           */
-
-/* Copyright (c) 2003-2007 Martin Quinson, Arnaud Legrand, Malek Cherier.   */
-/* 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 GRAS_STUB_GENERATOR_H
-#define GRAS_STUB_GENERATOR_H
-
-#define WARN "/***********\n * DO NOT EDIT! THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM %s BY gras_stub_generator\n ***********/\n"
-
-#include "xbt/dynar.h"
-#include "xbt/dict.h"
-extern xbt_dict_t process_function_set;
-extern xbt_dynar_t process_list;
-extern xbt_dict_t machine_set;
-extern char *warning;
-
-typedef struct s_process_t {
-  int argc;
-  char **argv;
-  char *host;
-} s_process_t;
-
-void s_process_free(void *process);
-
-/* UNIX files */
-void generate_sim(char *project);
-void generate_rl(char *project);
-void generate_makefile_am(char *project, char *deployment);
-void generate_makefile_local(char *project, char *deployment);
-
-/* the gras.h header directory (used only in windows)*/
-extern char *__gras_path;
-
-/*
- * Generate a borland simulation poject file.
- * @param name The name of the simulation project
- */
-void generate_borland_simulation_project(const char *name);
-
-/*
- * Generate a borland project file for real life.
- * @param name The name of the project to create.
- */
-void generate_borland_real_life_project(const char *name);
-
-
-/*
- * Create the Microsoft visual C++ file project for the simulation.
- */
-int generate_simulation_dsp_file(const char *project_name);
-
-/*
- * Create the Microsoft visual C++ real life project file.
- */
-int generate_real_live_dsp_file(const char *project_name);
-
-
-#endif
diff --git a/tools/gras/s_smx_process_t b/tools/gras/s_smx_process_t
deleted file mode 100644 (file)
index 877d527..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-struct s_smx_process_t {
-  s_xbt_swag_hookup_t process_hookup;
-  s_xbt_swag_hookup_t synchro_hookup;
-  s_xbt_swag_hookup_t host_proc_hookup;
-  s_xbt_swag_hookup_t destroy_hookup;
-
-  unsigned long pid;
-  char *name                XBT_ANNOTE(size,1);
-  smx_host_t smx_host;          
-  smx_context_t context;        
-  xbt_running_ctx_t *running_ctx XBT_ANNOTE(size,1);
-  short int FLAGS;
-  smx_host_t new_host;          
-  smx_action_t waiting_action;  
-  xbt_fifo_t comms;       
-  xbt_dict_t properties;
-  
-
-} s_smx_process_t;
-
diff --git a/tools/gras/s_smx_simcall_t b/tools/gras/s_smx_simcall_t
deleted file mode 100644 (file)
index 28ae88f..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-typedef struct s_smx_simcall {
-  e_smx_simcall_t call;
-  smx_process_t issuer;
-
-  union {
-
-    struct {
-      const char *name;
-      smx_host_t result;
-    } host_get_by_name;
-
-    struct {
-      smx_host_t host;
-      const char* result;
-    } host_get_name;
-
-    struct {
-      smx_host_t host;
-      xbt_dict_t result;
-    } host_get_properties;
-
-    struct {
-      smx_host_t host;
-      double result;
-    } host_get_speed;
-
-    struct {
-      smx_host_t host;
-      double result;
-    } host_get_available_speed;
-
-    struct {
-      smx_host_t host;
-      int result;
-    } host_get_state;
-
-    struct {
-      smx_host_t host;
-      void* result;
-    } host_get_data;
-
-    struct {
-      smx_host_t host;
-      void* data;
-    } host_set_data;
-
-    struct {
-      const char* name;
-      smx_host_t host;
-      double computation_amount;
-      double priority;
-      smx_action_t result;
-    } host_execute;
-
-    struct {
-      const char *name;
-      int host_nb;
-      smx_host_t *host_list;
-      double *computation_amount;
-      double *communication_amount;
-      double amount;
-      double rate;
-      smx_action_t result;
-    } host_parallel_execute;
-
-    struct {
-      smx_action_t execution;
-    } host_execution_destroy;
-
-    struct {
-      smx_action_t execution;
-    } host_execution_cancel;
-
-    struct {
-      smx_action_t execution;
-      double result;
-    } host_execution_get_remains;
-
-    struct {
-      smx_action_t execution;
-      e_smx_state_t result;
-    } host_execution_get_state;
-
-    struct {
-      smx_action_t execution;
-      double priority;
-    } host_execution_set_priority;
-
-    struct {
-      smx_action_t execution;
-      e_smx_state_t result;
-    } host_execution_wait;
-
-    struct {
-      smx_process_t *process;
-      const char *name;
-      xbt_main_func_t code;
-      void *data;
-      const char *hostname;
-      int argc;
-      char **argv;
-      xbt_dict_t properties;
-    } process_create;
-
-    struct {
-      smx_process_t process;
-    } process_kill;
-
-    struct {
-      smx_process_t process;
-    } process_cleanup;
-
-    struct {
-      smx_process_t process;
-      smx_host_t dest;
-    } process_change_host;
-
-    struct {
-      smx_process_t process;
-    } process_suspend;
-
-    struct {
-      smx_process_t process;
-    } process_resume;
-
-    struct {
-      int result;
-    } process_count;
-
-    struct {
-      smx_process_t process;
-      void* result;
-    } process_get_data;
-
-    struct {
-      smx_process_t process;
-      void* data;
-    } process_set_data;
-
-    struct {
-      smx_process_t process;
-      smx_host_t result;
-    } process_get_host;
-
-    struct {
-      smx_process_t process;
-      const char *result;
-    } process_get_name;
-
-    struct {
-      smx_process_t process;
-      int result;
-    } process_is_suspended;
-
-    struct {
-      smx_process_t process;
-      xbt_dict_t result;
-    } process_get_properties;
-
-    struct {
-      double duration;
-      e_smx_state_t result;
-    } process_sleep;
-
-    struct {
-      const char *name;
-      smx_rdv_t result;
-    } rdv_create;
-
-    struct {
-      smx_rdv_t rdv;
-    } rdv_destroy;
-
-    struct {
-      const char* name;
-      smx_rdv_t result;
-    } rdv_get_by_name;
-
-    struct {
-      smx_rdv_t rdv;
-      smx_host_t host;
-      unsigned int result;
-    } rdv_comm_count_by_host;
-
-    struct {
-      smx_rdv_t rdv;
-      smx_action_t result;
-    } rdv_get_head;
-
-    struct {
-      smx_rdv_t rdv;
-      double task_size;
-      double rate;
-      void *src_buff;
-      size_t src_buff_size;
-      int (*match_fun)(void *, void *);
-      void *data;
-      double timeout;
-    } comm_send;
-
-    struct {
-      smx_rdv_t rdv;
-      double task_size;
-      double rate;
-      void *src_buff;
-      size_t src_buff_size;
-      int (*match_fun)(void *, void *);
-      void (*clean_fun)(void *);
-      void *data;
-      int detached;
-      smx_action_t result;
-    } comm_isend;
-
-    struct {
-      smx_rdv_t rdv;
-      void *dst_buff;
-      size_t *dst_buff_size;
-      int (*match_fun)(void *, void *);
-      void *data;
-      double timeout;
-    } comm_recv;
-
-    struct {
-      smx_rdv_t rdv;
-      void *dst_buff;
-      size_t *dst_buff_size;
-      int (*match_fun)(void *, void *);
-          void *data;
-      smx_action_t result;
-    } comm_irecv;
-
-    struct {
-      smx_action_t comm;
-    } comm_destroy;
-
-    struct {
-      smx_action_t comm;
-    } comm_cancel;
-
-    struct {
-      xbt_dynar_t comms;
-      unsigned int result;
-    } comm_waitany;
-
-    struct {
-      smx_action_t comm;
-      double timeout;
-    } comm_wait;
-
-    struct {
-      smx_action_t comm;
-      int result;
-    } comm_test;
-
-    struct {
-      xbt_dynar_t comms;
-      int result;
-    } comm_testany;
-
-    struct {
-      smx_action_t comm;
-      double result;
-    } comm_get_remains;
-
-    struct {
-      smx_action_t comm;
-      e_smx_state_t result;
-    } comm_get_state;
-
-    struct {
-      smx_action_t comm;
-      void *result;
-    } comm_get_src_data;
-
-    struct {
-      smx_action_t comm;
-      void *result;
-    } comm_get_dst_data;
-
-    struct {
-      smx_action_t comm;
-      smx_process_t result;
-    } comm_get_src_proc;
-
-    struct {
-      smx_action_t comm;
-      smx_process_t result;
-    } comm_get_dst_proc;
-
-    struct {
-      smx_action_t comm;
-      int result;
-    } comm_is_latency_bounded;
-
-    struct {
-      smx_action_t action;
-      const char *category;
-    } set_category;
-
-    struct {
-      smx_mutex_t result;
-    } mutex_init;
-
-    struct {
-      smx_mutex_t mutex;
-    } mutex_lock;
-
-    struct {
-      smx_mutex_t mutex;
-      int result;
-    } mutex_trylock;
-
-    struct {
-      smx_mutex_t mutex;
-    } mutex_unlock;
-
-    struct {
-      smx_mutex_t mutex;
-    } mutex_destroy;
-
-    struct {
-      smx_cond_t result;
-    } cond_init;
-
-    struct {
-      smx_cond_t cond;
-    } cond_destroy;
-
-    struct {
-      smx_cond_t cond;
-    } cond_signal;
-
-    struct {
-      smx_cond_t cond;
-      smx_mutex_t mutex;
-    } cond_wait;
-
-    struct {
-      smx_cond_t cond;
-      smx_mutex_t mutex;
-      double timeout;
-    } cond_wait_timeout;
-
-    struct {
-      smx_cond_t cond;
-    } cond_broadcast;
-
-    struct {
-      int capacity;
-      smx_sem_t result;
-    } sem_init;
-
-    struct {
-      smx_sem_t sem;
-    } sem_destroy;
-
-    struct {
-      smx_sem_t sem;
-    } sem_release;
-
-    struct {
-      smx_sem_t sem;
-      int result;
-    } sem_would_block;
-
-    struct {
-      smx_sem_t sem;
-    } sem_acquire;
-
-    struct {
-      smx_sem_t sem;
-      double timeout;
-    } sem_acquire_timeout;
-
-    struct {
-      smx_sem_t sem;
-      int result;
-    } sem_get_capacity;
-
-    struct {
-      const char* storage;
-      void *ptr;
-      size_t size;
-      size_t nmemb;
-      m_file_t stream;
-      size_t result;
-    } file_read;
-
-    struct {
-      const char* storage;
-      const void *ptr;
-      size_t size;
-      size_t nmemb;
-      m_file_t stream;
-      size_t result;
-    } file_write;
-
-    struct {
-      const char* storage;
-      const char* path;
-      const char* mode;
-      m_file_t result;
-    } file_open;
-
-    struct {
-      const char* storage;
-      m_file_t fp;
-      int result;
-    } file_close;
-
-    struct {
-      const char* storage;
-      int fd;
-      //Next should be struct stat* buf
-      void* buf;
-      int result;
-    } file_stat;
-
-  };
-} s_smx_simcall_t, *smx_simcall_t;
-
-
-
-
diff --git a/tools/gras/struct_diff.c b/tools/gras/struct_diff.c
deleted file mode 100644 (file)
index 8e25f90..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/* struct_diff -- little tool to see which structure's field are modified on mc_diff */
-
-/* Copyright (c) 2012. 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. */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "xbt.h"
-#include "xbt/datadesc.h"
-#include "xbt/file_stat.h"
-#include "../../src/xbt/datadesc/datadesc_private.h" // RAAAAH! ugly relative path, but it's late, I want it to be done NOW.
-#include "simgrid/simix.h"
-#include "../../src/simix/smx_smurf_private.h" // RAAAAH! ugly relative path, but it's even later and it still doesn't work
-
-static void define_types(void) {
-  xbt_datadesc_type_t desc;
-
-  /* typedef struct xbt_swag_hookup {
-   *    void *next;
-   *    void *prev;
-   *  } s_xbt_swag_hookup_t; */
-  desc = xbt_datadesc_struct("s_xbt_swag_hookup_t");
-  xbt_datadesc_struct_append(desc,"next",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_struct_append(desc,"prev",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_struct_close(desc);
-
-  /* FIXME: maybe we should provide the internal details */
-  xbt_datadesc_copy("smx_host_t",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_copy("smx_context_t",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_copy("smx_action_t",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_copy("xbt_dict_t",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_copy("xbt_fifo_t",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_copy("smx_process_t",xbt_datadesc_by_name("data pointer"));
-
-  /* typedef struct {
-   *   char *msg;
-   *   xbt_errcat_t category;
-
-   *   int value;
-   *   short int remote;
-   *   char *host;
-   *   char *procname;
-   *
-   *   int pid;
-   *   char *file;
-   *   int line;
-   *   char *func;
-
-   *   int used;
-   *   char **bt_strings;
-   *   void *bt[XBT_BACKTRACE_SIZE];
-   * } xbt_ex_t;   */
-  desc = xbt_datadesc_struct("xbt_ex_t");
-  xbt_datadesc_struct_append(desc,"msg",xbt_datadesc_by_name("string"));
-
-  xbt_assert(sizeof(xbt_errcat_t)==sizeof(int),
-      "I was assuming that xbt_errcat_t is of the same size than integer, but it's not true: it's %zu (int:%zu)\n",
-      sizeof(xbt_errcat_t),sizeof(int));
-  xbt_datadesc_struct_append(desc,"category",xbt_datadesc_by_name("short int"));
-
-  xbt_datadesc_struct_append(desc,"value",xbt_datadesc_by_name("short int"));
-  xbt_datadesc_struct_append(desc,"remote",xbt_datadesc_by_name("short int"));
-  xbt_datadesc_struct_append(desc,"host",xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(desc,"procname",xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(desc,"pid",xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(desc,"file",xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(desc,"line",xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(desc,"func",xbt_datadesc_by_name("string"));
-  xbt_datadesc_struct_append(desc,"used",xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(desc,"bt_strings",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_struct_append(desc,"bt",xbt_datadesc_array_fixed("xbt_bt",xbt_datadesc_by_name("data pointer"),XBT_BACKTRACE_SIZE));
-  xbt_datadesc_struct_close(desc);
-
-  /* typedef struct {
-   *   __ex_mctx_t *ctx_mctx;
-   *   volatile int ctx_caught;
-   *   volatile xbt_ex_t exception;
-   * } xbt_running_ctx_t;   */
-  desc = xbt_datadesc_struct("xbt_running_ctx_t");
-  xbt_datadesc_struct_append(desc,"ctx_mctx",xbt_datadesc_by_name("data pointer"));
-  xbt_datadesc_struct_append(desc,"ctx_caught",xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_append(desc,"exception",xbt_datadesc_by_name("int"));
-  xbt_datadesc_struct_close(desc);
-
-  xbt_assert(sizeof(e_smx_simcall_t)==sizeof(int),
-      "I was assuming that e_smx_simcall_t is of the same size than integer, but it's not true: it's %zu (int:%zu)\n",
-      sizeof(e_smx_simcall_t),sizeof(int));
-  xbt_datadesc_copy("e_smx_simcall_t", xbt_datadesc_by_name("int"));
-}
-
-static void parse_from_file(const char *name){
-  int in=open(name,O_RDONLY);
-  if (in==-1){
-    fprintf(stderr,"Cannot read structure file from %s: %s\n",name,strerror(errno));
-    exit(1);
-  }
-
-  xbt_strbuff_t strbuff = xbt_strbuff_new();
-  int r;
-  do {
-    char buffer[1024];
-    r = read(in,&buffer,1023);
-    buffer[r] = '\0';
-    xbt_strbuff_append(strbuff,buffer);
-  } while (r!=0);
-
-  printf("File %s content:\n%s\n",name,strbuff->data);
-  xbt_datadesc_parse(name,strbuff->data);
-
-}
-
-int main(int argc, char** argv) {
-  xbt_init(&argc, argv);
-  define_types();
-
-  if (argc<3) {
-    fprintf(stderr,"Usage: %s struct-file offset1 offset2 ...\n",argv[0]);
-    exit(1);
-  }
-
-//  parse_from_file("s_smx_simcall_t");
-  parse_from_file(argv[1]);
-
-  int cpt;
-  xbt_datadesc_type_t type = xbt_datadesc_by_name(argv[1]);
-  for (cpt=2;cpt<argc;cpt++) {
-    int offset = atoi(argv[cpt]);
-    unsigned int cursor;
-    xbt_dd_cat_field_t field;
-    int found = 0;
-
-    printf ("Offset: %d in struct %s (there is %lu fields)\n",
-        offset, type->name, xbt_dynar_length(type->category.struct_data.fields));
-    xbt_dynar_foreach(type->category.struct_data.fields,cursor,field) {
-      if (field->offset[GRAS_THISARCH]<= offset&&
-          field->offset[GRAS_THISARCH]+field->type->size[GRAS_THISARCH] >= offset) {
-        found = 1;
-        printf("This offset is somewhere in field %s, which starts at offset %ld and is of size %ld\n",
-              field->name,field->offset[GRAS_THISARCH],field->type->size[GRAS_THISARCH]);
-
-      }
-    }
-    if (!found) {
-
-      printf("Damnit, the structure is too short to find the the field (last field %s was at offset %ld, with size %ld). Weird.\n",
-          field->name,field->offset[GRAS_THISARCH],field->type->size[GRAS_THISARCH]);
-    }
-  }
-  return 0;
-}
-
-
-
diff --git a/tools/gras/stub_generator.bpf b/tools/gras/stub_generator.bpf
deleted file mode 100644 (file)
index 12ae5a4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Ce fichier est uniquement utilisé par le gestionnaire de projets et doit être traité comme le fichier projet
-
-
-main 
\ No newline at end of file
diff --git a/tools/gras/stub_generator.bpr b/tools/gras/stub_generator.bpr
deleted file mode 100644 (file)
index a6b5828..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!-- C++Builder XML Project -->
-<PROJECT>
-  <MACROS>
-    <VERSION value="BCB.06.00"/>
-    <PROJECT value="stub_generator.exe"/>
-    <OBJFILES value="stub_generator.obj ..\..\src\surf\surfxml_parse.obj 
-      ..\..\src\surf\trace_mgr.obj ..\..\src\xbt\snprintf.obj 
-      ..\..\src\surf\surf.obj ..\..\src\surf\maxmin.obj"/>
-    <RESFILES value="stub_generator.res"/>
-    <IDLFILES value=""/>
-    <IDLGENFILES value=""/>
-    <DEFFILE value=""/>
-    <RESDEPEN value="$(RESFILES)"/>
-    <LIBFILES value="simgrid.lib"/>
-    <LIBRARIES value="rtl.lib vcl.lib"/>
-    <SPARELIBS value="vcl.lib rtl.lib"/>
-    <PACKAGES value="vcl.bpi vclx.bpi bcbsmp.bpi dbrtl.bpi vcldb.bpi adortl.bpi ibsmp.bpi 
-      bdertl.bpi vcldbx.bpi qrpt.bpi teeui.bpi teedb.bpi tee.bpi dss.bpi 
-      teeqr.bpi ibxpress.bpi dsnap.bpi vclie.bpi inetdb.bpi inet.bpi nmfast.bpi 
-      webdsnap.bpi bcbie.bpi dclocx.bpi bcb2kaxserver.bpi PackageLableDate.bpi"/>
-    <PATHCPP value=".;..\..\src\surf;..\..\src\surf;..\..\src\xbt;..\..\src\surf;..\..\src\surf"/>
-    <PATHPAS value=".;"/>
-    <PATHRC value=".;"/>
-    <PATHASM value=".;"/>
-    <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
-    <RELEASELIBPATH value="$(BCB)\lib\release"/>
-    <LINKER value="ilink32"/>
-    <USERDEFINES value="_DEBUG"/>
-    <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
-    <MAINSOURCE value="stub_generator.bpf"/>
-    <INCLUDEPATH value="..\..\src\gras;..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;C:\dev\cvs\simgrid\src;C:\dev\cvs\simgrid\src\gras;C:\dev\cvs\simgrid\inc"/>
-    <LIBPATH value="..\..\src\gras;..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj"/>
-    <WARNINGS value="-w-rvl -w-rch -w-pia -w-pch -w-par -w-csu -w-ccc -w-aus"/>
-    <OTHERFILES value=""/>
-  </MACROS>
-  <OPTIONS>
-    <IDLCFLAGS value="-I..\..\src\gras -I..\..\src\gras\Virtu -I..\..\src\xbt -I..\..\src\surf 
-      -I..\..\..\tools\gras -I$(BCB)\include -I$(BCB)\include\vcl 
-      -IC:\dev\cvs\simgrid\include -IC:\dev\cvs\simgrid\src\include 
-      -IC:\dev\cvs\simgrid\src -IC:\dev\cvs\simgrid\src\gras 
-      -IC:\dev\cvs\simgrid\inc -src_suffix cpp -D_DEBUG -boa"/>
-    <CFLAG1 value="-Od -H=c:\PROGRA~1\borland\CBUILD~1\lib\vcl60.csm -Hh=100 -Hc -Vx -Ve -Vmp 
-      -X- -r- -ps -a1 -b- -k -y -v -vi- -tWC -tWM- -c"/>
-    <PFLAGS value="-$Y+ -$W -$O- -$A8 -v -JPHNE -M"/>
-    <RFLAGS value=""/>
-    <AFLAGS value="/mx /w2 /zi"/>
-    <LFLAGS value="-D&quot;&quot; -c- -ap -Tpe -x -Gn -w -v"/>
-    <OTHERFILES value=""/>
-  </OPTIONS>
-  <LINKER>
-    <ALLOBJ value="c0x32.obj $(OBJFILES)"/>
-    <ALLRES value="$(RESFILES)"/>
-    <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32.lib"/>
-    <OTHERFILES value=""/>
-  </LINKER>
-  <FILELIST>
-      <FILE FILENAME="stub_generator.res" FORMNAME="" UNITNAME="stub_generator.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="stub_generator.bpf" FORMNAME="" UNITNAME="stub_generator" CONTAINERID="BPF" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="stub_generator.c" FORMNAME="" UNITNAME="stub_generator" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="simgrid.lib" FORMNAME="" UNITNAME="simgrid.lib" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="..\..\src\surf\surfxml_parse.c" FORMNAME="" UNITNAME="surfxml_parse" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="..\..\src\surf\trace_mgr.c" FORMNAME="" UNITNAME="trace_mgr" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="..\..\src\xbt\snprintf.c" FORMNAME="" UNITNAME="snprintf" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="..\..\src\surf\surf.c" FORMNAME="" UNITNAME="surf" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="..\..\src\surf\maxmin.c" FORMNAME="" UNITNAME="maxmin" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-  </FILELIST>
-  <BUILDTOOLS>
-  </BUILDTOOLS>
-
-  <IDEOPTIONS>
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1036
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[Excluded Packages]
-c:\program files\borland\cbuilder6\Bin\dclclxdb60.bpl=Composants BD CLX Borland
-C:\Program Files\Borland\CBuilder6\Bin\dclclxstd60.bpl=Composants Standard CLX Borland
-
-[HistoryLists\hlIncludePath]
-Count=16
-Item0=..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;C:\dev\cvs\simgrid\src;C:\dev\cvs\simgrid\src\gras;C:\dev\cvs\simgrid\inc
-Item1=..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;C:\dev\cvs\simgrid\src\;C:\dev\cvs\simgrid\src\xbt;C:\dev\cvs\simgrid\src\surf;C:\dev\cvs\simgrid\src\gras;C:\dev\cvs\simgrid\inc
-Item2=..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;..\..\src
-Item3=..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;..\..\src
-Item4=..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;..\..\src\
-Item5=..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include
-Item6=..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include
-Item7=..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include
-Item8=..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl
-Item9=..\..\..\tools\gras
-Item10=..\..\..\src\xbt\collection;C:\Program Files\Borland\CBuilder5;$(BCB)\include;$(BCB)\include\vcl;..\..\..\include
-Item11=C:\Program Files\Borland\CBuilder5;$(BCB)\include;$(BCB)\include\vcl;..\..\..\include
-Item12=..\..\..\src\xbt\collection;C:\Program Files\Borland\CBuilder5\;$(BCB)\include;$(BCB)\include\vcl;..\..\..\include
-Item13=C:\Program Files\Borland\CBuilder5\;$(BCB)\include;$(BCB)\include\vcl;C:\com\inria\projects\sg\include
-Item14=..\..\..\src\xbt\collection;C:\Program Files\Borland\CBuilder5\;$(BCB)\include;$(BCB)\include\vcl
-Item15=C:\Program Files\Borland\CBuilder5\;$(BCB)\include;$(BCB)\include\vcl
-
-[HistoryLists\hlLibraryPath]
-Count=9
-Item0=..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj
-Item1=..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj
-Item2=..\..\src\surf;..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj
-Item3=..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj
-Item4=..\..\..\tools\gras
-Item5=..\..\..\src\xbt\collection;C:\Program Files\Borland\CBuilder5;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
-Item6=C:\Program Files\Borland\CBuilder5;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
-Item7=..\..\..\src\xbt\collection;C:\Program Files\Borland\CBuilder5\;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
-Item8=C:\Program Files\Borland\CBuilder5\;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[HistoryLists\hlConditionals]
-Count=1
-Item0=_DEBUG
-
-[HistoryLists\hlIntOutputDir]
-Count=2
-Item0=..\..\..\lib
-Item1=C:\com\inria\projects\sg\lib
-
-[HistoryLists\hlFinalOutputDir]
-Count=2
-Item0=..\..\..\bin\test\
-Item1=C:\com\inria\projects\sg\bin\test
-
-[Debugging]
-DebugSourceDirs=$(BCB)\source\vcl
-
-[Parameters]
-RunParams=essai C:\dev\cvs\simgrid\examples\bandwidth\bandwidth_deployment.xml
-Launcher=
-UseLauncher=0
-DebugCWD=
-HostApplication=
-RemoteHost=
-RemotePath=
-RemoteLauncher=
-RemoteCWD=
-RemoteDebug=0
-
-[Compiler]
-ShowInfoMsgs=0
-LinkDebugVcl=0
-LinkCGLIB=0
-
-[CORBA]
-AddServerUnit=1
-AddClientUnit=1
-PrecompiledHeaders=1
-
-[Language]
-ActiveLang=
-ProjectLang=
-RootDir=
-  </IDEOPTIONS>
-</PROJECT>
\ No newline at end of file
diff --git a/tools/gras/stub_generator.c b/tools/gras/stub_generator.c
deleted file mode 100644 (file)
index 3d32883..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* gras_stub_generator - creates the main() to use a GRAS program           */
-
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. 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. */
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma hdrstop
-#endif
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "xbt/function_types.h"
-#include "xbt/log.h"
-#include "surf/surfxml_parse.h"
-#include "surf/surf.h"
-#include "portable.h"           /* Needed for the time of the SIMIX convertion */
-
-#include "gras_stub_generator.h"
-#include <stdarg.h>
-XBT_PUBLIC(char*)xbt_binary_name;
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
-
-#ifdef _XBT_WIN32
-#include <windows.h>
-#endif
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma argsused
-#endif
-
-
-/**********************************************/
-/********* Parse XML deployment file **********/
-/**********************************************/
-xbt_dict_t process_function_set = NULL;
-xbt_dynar_t process_list = NULL;
-xbt_dict_t machine_set = NULL;
-char *warning = NULL;
-
-void s_process_free(void *process)
-{
-  s_process_t *p = (s_process_t *) process;
-  free(p->host);
-}
-
-static s_process_t process;
-
-static void parse_process(sg_platf_process_cbarg_t process_arg)
-{
-  xbt_dict_set(process_function_set, process_arg->function, NULL, NULL);
-  xbt_dict_set(machine_set, process_arg->host, NULL, NULL);
-  process.argc = process_arg->argc;
-  process.argv = (char**)(process_arg->argv);
-  process.host = strdup(process_arg->host);
-  /*XBT_VERB("Function: %s",A_surfxml_process_function); */
-  xbt_dynar_push(process_list, &process);
-}
-
-int main(int argc, char *argv[])
-{
-  char *project_name = NULL;
-  char *deployment_file = NULL;
-  int i;
-
-  XBT_LOG_CONNECT(stubgen);
-
-  xbt_binary_name=xbt_strdup(argv[0]);
-
-  surf_init(&argc, argv);
-  process_function_set = xbt_dict_new_homogeneous(NULL);
-  process_list = xbt_dynar_new(sizeof(s_process_t), s_process_free);
-  machine_set = xbt_dict_new_homogeneous(NULL);
-
-  for (i = 1; i < argc; i++) {
-    int need_removal = 0;
-    if (!strncmp("--extra-process=", argv[i], strlen("--extra-process="))) {
-      xbt_dict_set(process_function_set,
-                   argv[i] + strlen("--extra-process="), NULL, NULL);
-      need_removal = 1;
-    }
-
-
-    if (need_removal) {         /* remove the handled argument from argv */
-      int j;
-      for (j = i + 1; j < argc; j++) {
-        argv[j - 1] = argv[j];
-      }
-      argv[j - 1] = NULL;
-      argc--;
-      i--;                      /* compensate effect of next loop incrementation */
-    }
-  }
-
-  xbt_assert((argc >= 3),
-              "Usage: %s project_name deployment_file [deployment_file...]\n",
-              argv[0]);
-
-  project_name = argv[1];
-
-  surf_parse_reset_callbacks();
-  sg_platf_process_add_cb(parse_process);
-
-  for (i = 2; i < argc; i++) {
-    deployment_file = argv[i];
-    surf_parse_open(deployment_file);
-    if (surf_parse())
-      xbt_die("Parse error in %s", deployment_file);
-
-    surf_parse_close();
-  }
-
-
-  warning = xbt_new(char, strlen(WARN) + strlen(deployment_file) + 10);
-  sprintf(warning, WARN, deployment_file);
-
-  /*if(XBT_LOG_ISENABLED(stubgen, xbt_log_priority_debug)) {
-     xbt_dict_cursor_t cursor=NULL;
-     char *key = NULL;
-     void *data = NULL;
-
-     for (cursor=NULL, xbt_dict_cursor_first((process_function_set),&(cursor)) ;
-     xbt_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data));
-     xbt_dict_cursor_step(cursor) ) {
-     XBT_DEBUG("Function %s", key);
-     }
-
-     xbt_dict_dump(process_function_set,print);
-     } */
-
-  generate_sim(project_name);
-  generate_rl(project_name);
-  generate_makefile_local(project_name, deployment_file);
-#ifdef __BORLANDC__
-  generate_borland_simulation_project(project_name);
-  generate_borland_real_life_project(project_name);
-  generate_simulation_dsp_file(project_name);
-  generate_real_live_dsp_file(project_name);
-
-  xbt_free(__gras_path);
-#endif
-
-  free(warning);
-
-
-  xbt_free(process.argv);
-
-  xbt_dict_free(&process_function_set);
-  xbt_dynar_free(&process_list);
-  xbt_dict_free(&machine_set);
-  surf_exit();
-
-  return 0;
-}
diff --git a/tools/gras/stub_generator4borland.mak b/tools/gras/stub_generator4borland.mak
deleted file mode 100644 (file)
index 1422f90..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-# ---------------------------------------------------------------------------
-!if !$d(BCB)
-BCB = $(MAKEDIR)\..
-!endif
-
-# ---------------------------------------------------------------------------
-# IDE SECTION
-# ---------------------------------------------------------------------------
-# The following section of the project makefile is managed by the BCB IDE.
-# It is recommended to use the IDE to change any of the values in this
-# section.
-# ---------------------------------------------------------------------------
-
-VERSION = BCB.06.00
-# ---------------------------------------------------------------------------
-PROJECT = _stub_generator.exe
-OBJFILES = _stub_generator.obj ..\..\src\surf\surfxml_parse.obj \
-    ..\..\src\surf\trace_mgr.obj ..\..\src\xbt\snprintf.obj \
-    ..\..\src\surf\surf.obj ..\..\src\surf\maxmin.obj
-RESFILES = _stub_generator.res
-MAINSOURCE = _stub_generator.bpf
-RESDEPEN = $(RESFILES)
-LIBFILES = simgrid.lib
-IDLFILES = 
-IDLGENFILES = 
-LIBRARIES = rtl.lib vcl.lib
-PACKAGES = vcl.bpi vclx.bpi bcbsmp.bpi dbrtl.bpi vcldb.bpi adortl.bpi ibsmp.bpi \
-    bdertl.bpi vcldbx.bpi qrpt.bpi teeui.bpi teedb.bpi tee.bpi dss.bpi \
-    teeqr.bpi ibxpress.bpi dsnap.bpi vclie.bpi inetdb.bpi inet.bpi nmfast.bpi \
-    webdsnap.bpi bcbie.bpi dclocx.bpi bcb2kaxserver.bpi PackageLableDate.bpi
-SPARELIBS = vcl.lib rtl.lib
-DEFFILE = 
-OTHERFILES = 
-# ---------------------------------------------------------------------------
-DEBUGLIBPATH = $(BCB)\lib\debug
-RELEASELIBPATH = $(BCB)\lib\release
-USERDEFINES = _DEBUG
-SYSDEFINES = NO_STRICT;_NO_VCL
-INCLUDEPATH = ..\..\src\gras;..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\include;$(BCB)\include\vcl;C:\dev\cvs\simgrid\include;C:\dev\cvs\simgrid\src\include;C:\dev\cvs\simgrid\src;C:\dev\cvs\simgrid\src\gras;C:\dev\cvs\simgrid\inc
-LIBPATH = ..\..\src\gras;..\..\src\gras\Virtu;..\..\src\xbt;..\..\src\surf;..\..\..\tools\gras;$(BCB)\lib;$(BCB)\lib\obj
-WARNINGS= -w-rvl -w-rch -w-pia -w-pch -w-par -w-csu -w-ccc -w-aus
-PATHCPP = .;..\..\src\surf;..\..\src\surf;..\..\src\xbt;..\..\src\surf;..\..\src\surf
-PATHASM = .;
-PATHPAS = .;
-PATHRC = .;
-PATHOBJ = .;$(LIBPATH)
-# ---------------------------------------------------------------------------
-CFLAG1 = -Od -H=c:\PROGRA~1\borland\CBUILD~1\lib\vcl60.csm -Hh=100 -Hc -Vx -Ve -Vmp \
-    -X- -r- -ps -a1 -b- -k -y -v -vi- -tWC -tWM- -c
-IDLCFLAGS = -I..\..\src\gras -I..\..\src\gras\Virtu -I..\..\src\xbt -I..\..\src\surf \
-    -I..\..\..\tools\gras -I$(BCB)\include -I$(BCB)\include\vcl \
-    -IC:\dev\cvs\simgrid\include -IC:\dev\cvs\simgrid\src\include \
-    -IC:\dev\cvs\simgrid\src -IC:\dev\cvs\simgrid\src\gras \
-    -IC:\dev\cvs\simgrid\inc -src_suffix cpp -D_DEBUG -boa
-PFLAGS = -$Y+ -$W -$O- -$A8 -v -JPHNE -M
-RFLAGS = 
-AFLAGS = /mx /w2 /zi
-LFLAGS = -D"" -c- -ap -Tpe -x -Gn -w -v
-# ---------------------------------------------------------------------------
-ALLOBJ = c0x32.obj $(OBJFILES)
-ALLRES = $(RESFILES)
-ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32.lib
-# ---------------------------------------------------------------------------
-!ifdef IDEOPTIONS
-
-[Version Info]
-IncludeVerInfo=0
-AutoIncBuild=0
-MajorVer=1
-MinorVer=0
-Release=0
-Build=0
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-
-[Version Info Keys]
-CompanyName=
-FileDescription=
-FileVersion=1.0.0.0
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=1.0.0.0
-Comments=
-
-[Debugging]
-DebugSourceDirs=$(BCB)\source\vcl
-
-!endif
-
-
-
-
-
-# ---------------------------------------------------------------------------
-# MAKE SECTION
-# ---------------------------------------------------------------------------
-# This section of the project file is not used by the BCB IDE.  It is for
-# the benefit of building from the command-line using the MAKE utility.
-# ---------------------------------------------------------------------------
-
-.autodepend
-# ---------------------------------------------------------------------------
-!if "$(USERDEFINES)" != ""
-AUSERDEFINES = -d$(USERDEFINES:;= -d)
-!else
-AUSERDEFINES =
-!endif
-
-!if !$d(BCC32)
-BCC32 = bcc32
-!endif
-
-!if !$d(CPP32)
-CPP32 = cpp32
-!endif
-
-!if !$d(DCC32)
-DCC32 = dcc32
-!endif
-
-!if !$d(TASM32)
-TASM32 = tasm32
-!endif
-
-!if !$d(LINKER)
-LINKER = ilink32
-!endif
-
-!if !$d(BRCC32)
-BRCC32 = brcc32
-!endif
-
-
-# ---------------------------------------------------------------------------
-!if $d(PATHCPP)
-.PATH.CPP = $(PATHCPP)
-.PATH.C   = $(PATHCPP)
-!endif
-
-!if $d(PATHPAS)
-.PATH.PAS = $(PATHPAS)
-!endif
-
-!if $d(PATHASM)
-.PATH.ASM = $(PATHASM)
-!endif
-
-!if $d(PATHRC)
-.PATH.RC  = $(PATHRC)
-!endif
-
-!if $d(PATHOBJ)
-.PATH.OBJ  = $(PATHOBJ)
-!endif
-# ---------------------------------------------------------------------------
-$(PROJECT): $(OTHERFILES) $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE)
-    $(BCB)\BIN\$(LINKER) @&&!
-    $(LFLAGS) -L$(LIBPATH) +
-    $(ALLOBJ), +
-    $(PROJECT),, +
-    $(ALLLIB), +
-    $(DEFFILE), +
-    $(ALLRES)
-!
-# ---------------------------------------------------------------------------
-.pas.hpp:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< }
-
-.pas.obj:
-    $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< }
-
-.cpp.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< }
-
-.c.obj:
-    $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< }
-
-.c.i:
-    $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< }
-
-.cpp.i:
-    $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< }
-
-.asm.obj:
-    $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@
-
-.rc.res:
-    $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $<
-
-
-
-# ---------------------------------------------------------------------------
-
-
-
-
diff --git a/tools/gras/unix_stub_generator.c b/tools/gras/unix_stub_generator.c
deleted file mode 100644 (file)
index 4642ef3..0000000
+++ /dev/null
@@ -1,456 +0,0 @@
-/* gras_stub_generator - creates the main() to use a GRAS program           */
-
-/* Copyright (c) 2003-2007 Martin Quinson, Arnaud Legrand, Malek Cherier.   */
-/* 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. */
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma hdrstop
-#endif
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "xbt/function_types.h"
-#include "xbt/log.h"
-#include "surf/surfxml_parse.h"
-#include "surf/surf.h"
-#include "portable.h"           /* Needed for the time of the SIMIX convertion */
-#include "gras_stub_generator.h"
-
-#include <stdarg.h>
-
-#ifdef __BORLANDC__
-/* stupid stubs so that it compiles on windows */
-void generate_sim(char *project)
-{
-}
-
-void generate_rl(char *project)
-{
-}
-
-void generate_makefile_local(char *project, char *deployment)
-{
-}
-#else
-/* real implementation */
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(stubgen);
-
-
-#define WARN "/***********\n * DO NOT EDIT! THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM %s BY gras_stub_generator\n ***********/\n"
-#define SIM_SOURCENAME  "_%s_simulator.c"
-#define SIM_OBJNAME  "_%s_simulator.o"
-#define SIM_BINARYNAME  "%s_simulator"
-#define SIM_SOURCENAME_LDADD  "%s_simulator_LDADD"
-#define SIM_SOURCENAME_SOURCES  "%s_simulator_SOURCES"
-#define RL_SOURCENAME  "_%s_%s.c"
-#define RL_OBJNAME  "_%s_%s.o"
-#define RL_BINARYNAME  "%s_%s"
-#define RL_SOURCENAME_LDADD  "%s_%s_LDADD"
-#define RL_SOURCENAME_SOURCES  "%s_%s_SOURCES"
-#define MAKEFILE_FILENAME_AM  "%s.Makefile.am"
-#define MAKEFILE_FILENAME_LOCAL  "%s.mk"
-#define MAKEFILE_FILENAME_REMOTE  "%s.Makefile.remote"
-#define DEPLOYMENT  "%s.deploy.sh"
-
-/**********************************************/
-/**** Generate the file for the simulator *****/
-/**********************************************/
-
-const char *SIM_PREEMBULE =
-    "/* specific to Borland Compiler */\n"
-    "#ifdef __BORLANDC__\n"
-    "#pragma hdrstop\n"
-    "#endif\n\n"
-    "#include <stdlib.h>\n"
-    "#include <stdio.h>\n"
-    "#include \"msg/msg.h\"\n"
-    "#include <gras.h>\n" "\n" "char *gras_log=NULL;\n";
-
-
-#define SIM_LAUNCH_FUNC  \
-"int launch_%s(int argc, char **argv) {\n" \
-"  char **myargv=argv;\n" \
-"  int myargc=argc;\n" \
-"  int i;\n" \
-"  int retcode;\n"\
-"    \n"\
-"  if (gras_log) {\n"\
-"    myargv=malloc((argc+1) * sizeof(char**));\n" \
-"    for (i=0; i<argc; i++)\n" \
-"      myargv[i] = argv[i];\n" \
-"    myargv[myargc++] = gras_log;\n" \
-"  }\n" \
-"  retcode = %s(myargc,myargv);\n" \
-"  if (myargv != argv)\n" \
-"    free(myargv);\n" \
-"  return retcode;\n" \
-"}\n"
-
-const char *SIM_MAIN_POSTEMBULE = "\n"
-    "\n"
-    "  gras_launch_application(argv[2]);\n"
-    "\n"
-    "  /*  Run the simulation */\n"
-    "  gras_main();\n"
-    "\n"
-    "  /* cleanup the place */\n"
-    "  gras_clean();\n"
-    "  if (gras_log)\n" "    free(gras_log);\n" "  return 0;\n" "}\n";
-
-
-
-
-void generate_sim(char *project)
-{
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  char *filename = NULL;
-  FILE *FICOUT = NULL;
-
-  /* Output file: <projet>_simulator.c */
-  filename = xbt_new(char, strlen(project) + strlen(SIM_SOURCENAME));
-  sprintf(filename, SIM_SOURCENAME, project);
-
-  FICOUT = fopen(filename, "w");
-
-  xbt_assert(FICOUT, "Unable to open %s for writing", filename);
-
-  fprintf(FICOUT, "%s\n", warning);
-  fprintf(FICOUT, "%s", SIM_PREEMBULE);
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, "int %s(int argc,char *argv[]);\n", key);
-  }
-
-  fprintf(FICOUT, "\n");
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, "int launch_%s(int argc,char *argv[]);\n", key);
-  }
-
-  fprintf(FICOUT, "\n%s\n", warning);
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, SIM_LAUNCH_FUNC, key, key);
-  }
-  fprintf(FICOUT, "\n%s\n", warning);
-
-  fprintf(FICOUT, "%s", "/* specific to Borland Compiler */\n"
-          "#ifdef __BORLANDDC__\n" "#pragma argsused\n" "#endif\n\n");
-
-  fprintf(FICOUT, "%s", "int main (int argc,char *argv[]) {\n"
-          "\n"
-          "  /*  Simulation setup */\n"
-          "  gras_global_init(&argc,argv);\n"
-          "  if (argc != 3) {\n"
-          "    fprintf(stderr, \"Usage: %s platform.xml deployment.xml [--log=...]\\n\",argv[0]);\n"
-          "    exit(1);\n" "  }\n" "\n");
-  fprintf(FICOUT,
-          "  gras_create_environment(argv[1]);\n"
-          "\n" "  /*  Application deployment */\n");
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, "  gras_function_register(\"%s\", launch_%s);\n", key,
-            key);
-  }
-  fprintf(FICOUT, "%s", SIM_MAIN_POSTEMBULE);
-  fclose(FICOUT);
-  free(filename);
-}
-
-/**********************************************/
-/**** Generate the file for the real life *****/
-/**********************************************/
-void generate_rl(char *project)
-{
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  char *filename = NULL;
-  FILE *FICOUT = NULL;
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    filename =
-        xbt_new(char,
-                strlen(project) + strlen(RL_SOURCENAME) + strlen(key));
-
-    sprintf(filename, RL_SOURCENAME, project, key);
-
-    FICOUT = fopen(filename, "w");
-    xbt_assert(FICOUT, "Unable to open %s for writing", filename);
-
-    fprintf(FICOUT, "\n%s\n", warning);
-    fprintf(FICOUT, "/* specific to Borland Compiler */\n"
-            "#ifdef __BORLANDC__\n"
-            "#pragma hdrstop\n"
-            "#endif\n\n"
-            "#include <stdio.h>\n"
-            "#include <signal.h>\n"
-            "#include <gras.h>\n"
-            "\n"
-            "XBT_PUBLIC_DATA(const char *) _gras_procname;\n"
-            "/* user code */\n"
-            "int %s(int argc, char *argv[]);\n"
-            "\n"
-            "/* specific to Borland Compiler */\n"
-            "#ifdef __BORLANDC__\n"
-            "#pragma argsused\n"
-            "#endif\n\n"
-            "int main(int argc, char *argv[]){\n"
-            "  int errcode;\n"
-            "\n"
-            "  _gras_procname = \"%s\";\n"
-            "  errcode=%s(argc,argv);\n"
-            " \n" "  return errcode;\n" "}\n", key, key, key);
-    fprintf(FICOUT, "\n%s\n", warning);
-    fclose(FICOUT);
-    free(filename);
-  }
-}
-
-void generate_makefile_am(char *project, char *deployment)
-{
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  char *filename = NULL;
-  FILE *FICOUT = NULL;
-
-  filename = xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_AM));
-  sprintf(filename, MAKEFILE_FILENAME_AM, project);
-
-  FICOUT = fopen(filename, "w");
-  xbt_assert(FICOUT, "Unable to open %s for writing", filename);
-
-  fprintf(FICOUT, "# AUTOMAKE variable definition\n");
-  fprintf(FICOUT, "INCLUDES= @CFLAGS_SimGrid@\n\n");
-  fprintf(FICOUT, "PROGRAMS=");
-  fprintf(FICOUT, SIM_BINARYNAME, project);
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, " ");
-    fprintf(FICOUT, RL_BINARYNAME, project, key);
-  }
-
-  fprintf(FICOUT, "\n\n");
-  fprintf(FICOUT, SIM_SOURCENAME_SOURCES, project);
-  fprintf(FICOUT, "=\t");
-  fprintf(FICOUT, SIM_SOURCENAME, project);
-  fprintf(FICOUT, " %s.c\n", project);
-  fprintf(FICOUT, SIM_SOURCENAME_LDADD, project);
-  fprintf(FICOUT, "=\tpath/to/libsimgrid.a\n\n");
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_SOURCENAME_SOURCES, project, key);
-    fprintf(FICOUT, "=\t");
-    fprintf(FICOUT, RL_SOURCENAME, project, key);
-    fprintf(FICOUT, " %s.c\n", project);
-    fprintf(FICOUT, RL_SOURCENAME_LDADD, project, key);
-    fprintf(FICOUT, "=\tpath/to/libgras.a\n\n");
-  }
-
-  fprintf(FICOUT,
-          "\n# cleanup temps (allowing the user to add extra clean files)\n");
-  fprintf(FICOUT, "CLEANFILES?= \n");
-  fprintf(FICOUT, "CLEANFILES+= ");
-  fprintf(FICOUT, SIM_SOURCENAME, project);
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, " ");
-    fprintf(FICOUT, RL_SOURCENAME, project, key);
-  }
-  fprintf(FICOUT, "\n");
-
-  fprintf(FICOUT, "\n# generate temps\n");
-  fprintf(FICOUT,
-          "\n# A rule to generate the source file each time the deployment file changes\n");
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_SOURCENAME, project, key);
-    fprintf(FICOUT, " ");
-  }
-  fprintf(FICOUT, SIM_SOURCENAME, project);
-  fprintf(FICOUT, ": %s\n", deployment);
-  fprintf(FICOUT, "\tgras_stub_generator %s %s >/dev/null\n", project,
-          deployment);
-  fclose(FICOUT);
-}
-
-void generate_makefile_local(char *project, char *deployment)
-{
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  char *filename = NULL;
-  FILE *FICOUT = NULL;
-
-  filename =
-      xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_LOCAL));
-  sprintf(filename, MAKEFILE_FILENAME_LOCAL, project);
-
-  FICOUT = fopen(filename, "w");
-  xbt_assert(FICOUT, "Unable to open %s for writing", filename);
-  free(filename);
-
-  fprintf(FICOUT,
-          "\n"
-          "####\n"
-          "#### THIS FILE WAS GENERATED, DO NOT EDIT BEFORE RENAMING IT\n"
-          "####\n\n\n");
-
-  fprintf(FICOUT, "## Variable declarations\n"
-          "PROJECT_NAME=%s\n" "DISTDIR=gras-$(PROJECT_NAME)\n\n", project);
-
-  fprintf(FICOUT,
-          "# Set the GRAS_ROOT environment variable to the path under which you installed SimGrid\n"
-          "# Compilation will fail if you don't do so\n"
-          "GRAS_ROOT?= $(shell if [ -e /usr/local/lib/libgras.so ] ; then echo /usr/local ; else echo \"\\\"<<<< GRAS_ROOT undefined !!! >>>>\\\"\"; fi)\n\n"
-          "# You can fiddle the following to make it fit your taste\n"
-          "INCLUDES = -I$(GRAS_ROOT)/include\n"
-          "CFLAGS ?= -O3 -w -g -Wall\n"
-          "LIBS_SIM = -lm  -L$(GRAS_ROOT)/lib/ -lsimgrid\n"
-          "LIBS_RL = -lm  -L$(GRAS_ROOT)/lib/ -lgras\n" "LIBS = \n" "\n");
-
-  fprintf(FICOUT, "PRECIOUS_C_FILES ?= %s.c\n", project);
-
-  fprintf(FICOUT, "GENERATED_C_FILES = ");
-  fprintf(FICOUT, SIM_SOURCENAME " ", project);
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_SOURCENAME " ", project, key);
-  }
-  fprintf(FICOUT, "\n");
-
-  fprintf(FICOUT,
-          "OBJ_FILES = $(patsubst %%.c,%%.o,$(PRECIOUS_C_FILES))\n");
-
-  fprintf(FICOUT, "BIN_FILES = ");
-
-  fprintf(FICOUT, SIM_BINARYNAME " ", project);
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_BINARYNAME " ", project, key);
-  }
-  fprintf(FICOUT, "\n");
-
-  fprintf(FICOUT,
-          "\n"
-          "## By default, build all the binaries\n"
-          "all: $(BIN_FILES)\n" "\n");
-
-  fprintf(FICOUT,
-          "\n## generate temps: regenerate the source file each time the deployment file changes\n");
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_SOURCENAME, project, key);
-    fprintf(FICOUT, " ");
-  }
-  fprintf(FICOUT, SIM_SOURCENAME, project);
-  fprintf(FICOUT, ": %s\n", deployment);
-  fprintf(FICOUT, "\tgras_stub_generator %s %s >/dev/null\n", project,
-          deployment);
-
-  fprintf(FICOUT, "\n## Generate the binaries\n");
-  fprintf(FICOUT, SIM_BINARYNAME ": " SIM_OBJNAME " $(OBJ_FILES)\n",
-          project, project);
-  fprintf(FICOUT,
-          "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS_SIM) $(LIBS) $(LDADD) -o $@ \n");
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, RL_BINARYNAME " : " RL_OBJNAME " $(OBJ_FILES)\n",
-            project, key, project, key);
-    fprintf(FICOUT,
-            "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS_RL) $(LIBS) $(LDADD) -o $@ \n");
-  }
-  fprintf(FICOUT,
-          "\n"
-          "%%: %%.o\n"
-          "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS) $(LDADD) -o $@ \n"
-          "\n"
-          "%%.o: %%.c\n"
-          "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) -c -o $@ $<\n" "\n");
-
-  fprintf(FICOUT,
-          "## Rules for tarballs and cleaning\n"
-          "DIST_FILES= $(EXTRA_DIST) $(GENERATED_C_FILES) $(PRECIOUS_C_FILES) "
-          MAKEFILE_FILENAME_LOCAL " " /*MAKEFILE_FILENAME_REMOTE */ "\n"
-          "distdir: $(DIST_FILES)\n" "\trm -rf $(DISTDIR)\n"
-          "\tmkdir -p $(DISTDIR)\n" "\tcp $^ $(DISTDIR)\n" "\n"
-          "dist: clean distdir\n"
-          "\ttar c $(DISTDIR) | gzip -c9 > $(DISTDIR).tar.gz\n" "\n",
-          project /*, project */ );
-
-  fprintf(FICOUT,
-          "clean:\n"
-          "\trm -f $(CLEANFILES) $(BIN_FILES) $(OBJ_FILES) *~ %s.o "
-          SIM_OBJNAME, project, project);
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    fprintf(FICOUT, " " RL_OBJNAME, project, key);
-  }
-  fprintf(FICOUT,
-          "\n"
-          "\trm -rf $(DISTDIR)\n"
-          "\n" ".SUFFIXES:\n" ".PHONY : clean\n" "\n");
-  /* 
-     fprintf(FICOUT, "############ REMOTE COMPILING #########\n");
-     fprintf(FICOUT,
-     "MACHINES ?= ");
-     xbt_dict_foreach(machine_set,cursor,key,data) {
-     fprintf(FICOUT, "%s ",key);
-     }
-     fprintf(FICOUT,"\n");
-
-     fprintf(FICOUT,
-     "INSTALL_PATH ?='$$HOME/tmp/src' ### Has to be an absolute path !!! \n"
-     "GRAS_ROOT ?='$(INSTALL_PATH)' ### Has to be an absolute path !!! \n"
-     "SRCDIR ?= ./\n"
-     "SIMGRID_URL ?=http://gcl.ucsd.edu/simgrid/dl/\n"
-     "SIMGRID_VERSION ?=2.92\n"
-     "GRAS_PROJECT ?= %s\n"
-     "GRAS_PROJECT_URL ?= http://www-id.imag.fr/Laboratoire/Membres/Legrand_Arnaud/gras_test/\n"
-     "\n"
-     "remote:\n"
-     "\t@echo;echo \"----[ Compile the package on remote hosts ]----\"\n"
-     "\t@test -e $(SRCDIR)/buildlogs/ || mkdir -p $(SRCDIR)/buildlogs/\n"
-     "\t for site in $(MACHINES) ; do \\\n"
-     "\t   machine=`echo $$site |sed 's/^\\([^%%]*\\)%%.*$$/\\1/'`;\\\n"
-     "\t   machine2=`echo $$site |sed 's/^\\([^%%]*\\)%%\\(.*\\)$$/\\2/'`;\\\n"
-     "\t   cmd_mkdir=\"\\\"sh -c 'env INSTALL_PATH=$(INSTALL_PATH) GRAS_ROOT=$(GRAS_ROOT) \\\n"
-     "\t                        SIMGRID_URL=$(SIMGRID_URL) SIMGRID_VERSION=$(SIMGRID_VERSION) GRAS_PROJECT=$(GRAS_PROJECT) \\\n"
-     "\t                        GRAS_PROJECT_URL=$(GRAS_PROJECT_URL)  mkdir -p $(INSTALL_PATH) 2>&1'\\\"\";\\\n"
-     "\t   cmd_make=\"\\\"sh -c 'env INSTALL_PATH=$(INSTALL_PATH) GRAS_ROOT=$(GRAS_ROOT) \\\n"
-     "\t                        SIMGRID_URL=$(SIMGRID_URL) SIMGRID_VERSION=$(SIMGRID_VERSION) GRAS_PROJECT=$(GRAS_PROJECT) \\\n"
-     "\t                        GRAS_PROJECT_URL=$(GRAS_PROJECT_URL)  make -C $(INSTALL_PATH) -f "MAKEFILE_FILENAME_REMOTE" $(ACTION) 2>&1'\\\"\";\\\n"
-     "\t   if echo $$site | grep  '%%' >/dev/null ; then \\\n"
-     "\t     echo \"----[ Compile on $$machine2 (behind $$machine) ]----\";\\\n"
-     "\t   else \\\n"
-     "\t     machine=$$site;\\\n"
-     "\t     echo \"----[ Compile on $$machine ]----\";\\\n"
-     "\t   fi;\\\n"
-     "\t   if echo $$site | grep  '%%' >/dev/null ; then \\\n"
-     "\t     if ssh $$machine \"ssh -A $$machine2 $$cmd_mkdir\" 2>&1 > $(SRCDIR)/buildlogs/$$site.log;\\\n"
-     "\t     then true; else failed=1;echo \"Failed (check $(SRCDIR)/buildlogs/$$site.log)\"; fi;\\\n"
-     "\t   else \\\n"
-     "\t     if ssh $$machine \"eval $$cmd_mkdir\" 2>&1 > $(SRCDIR)/buildlogs/$$site.log ;\\\n"
-     "\t     then true; else failed=1;echo \"Failed (check $(SRCDIR)/buildlogs/$$site.log)\"; fi; \\\n"
-     "\t   fi;\\\n"
-     "\t   echo \"-- Copy the data over\"; \\\n"
-     "\t   scp "MAKEFILE_FILENAME_REMOTE" $$site:$(INSTALL_PATH) ;\\\n"
-     "\t   echo \"-- Compiling... (the output gets into $(SRCDIR)/buildlogs/$$site.log)\"; \\\n"
-     "\t   if echo $$site | grep  '%%' >/dev/null ; then \\\n"
-     "\t     if ssh $$machine \"ssh -A $$machine2 $$cmd_make\" 2>&1 >> $(SRCDIR)/buildlogs/$$site.log;\\\n"
-     "\t     then echo \"Sucessful\"; else failed=1;echo \"Failed (check $(SRCDIR)/buildlogs/$$site.log)\"; fi;echo; \\\n"
-     "\t   else \\\n"
-     "\t     if ssh $$machine \"eval $$cmd_make\" 2>&1 >> $(SRCDIR)/buildlogs/$$site.log ;\\\n"
-     "\t     then echo \"Sucessful\"; else failed=1;echo \"Failed (check $(SRCDIR)/buildlogs/$$site.log)\"; fi;echo; \\\n"
-     "\t   fi;\\\n"
-     "\t done;\n",project,project,project);
-   */
-  fclose(FICOUT);
-}
-
-static void print(void *p)
-{
-  printf("%p", p);
-}
-#endif
diff --git a/tools/gras/windows_stub_generator.c b/tools/gras/windows_stub_generator.c
deleted file mode 100644 (file)
index ddb4299..0000000
+++ /dev/null
@@ -1,1060 +0,0 @@
-/* gras_stub_generator - creates the main() to use a GRAS program           */
-
-/* Copyright (c) 2003-2007 Martin Quinson, Arnaud Legrand, Malek Cherier.   */
-/* 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 "gras_stub_generator.h"
-
-/* specific to Borland Compiler */
-#ifdef __BORLANDDC__
-#pragma hdrstop
-#endif
-
-#include <stdio.h>
-#include "xbt/sysdep.h"
-#include "xbt/function_types.h"
-#include "xbt/log.h"
-#include "surf/surfxml_parse.h"
-#include "surf/surf.h"
-#include "portable.h"           /* Needed for the time of the SIMIX convertion */
-
-#include <stdarg.h>
-
-
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(stubgen);
-
-#ifdef __BORLANDDC__
-
-char *__gras_path = NULL;
-
-/* tabulation level (used to indent the lines of the borland project file */
-static unsigned int level = 0;
-
-
-#ifndef MAX_PATH
-#define MAX_PATH 260
-#endif
-
-/*
- * A structure which represents a borland project file.
- */
-typedef struct s_borland_project {
-  const char *xml_version;      /* the xml version used to write the borland project file                   */
-  const char *encoding;         /* the encoding used to write the borland project file                      */
-  const char *comment;          /* the xml comment to write at the begining of the borland project file     */
-  char *name;                   /* the name of the borland project file                                                                         */
-  FILE *stream;                 /* the stream to the borland project file                                                                       */
-  const char *version;          /* the builder version of the borland project file                                                      */
-  char *bin_dir;                /* the directory used to store the generated program                                            */
-  char *obj_dir;                /* the directory used to store the generated object files                                       */
-  char *lib_dir;                /* the directory used to store the librairies used in the borland project       */
-  char *src_dir;                /* the directory use to store the source files of the project                           */
-} s_borland_project_t, *borland_project_t;
-
-
-/*
- * A structure which represents a visual C++ project file.
- */
-typedef struct s_dsp {
-  FILE *stream;
-  char *lib_dir;
-  char *src_dir;
-  char *name;
-} s_dsp_t, *dsp_t;
-
-/*
- * Write tabs in a borland project file.
- * @param project The project concerned by the operation.
- * @param count The count tab to write
- */
-static void
-borland_project_write_tabs(borland_project_t project, unsigned int count);
-
-/*
- * Write the begin of an xml node in the borland project file.
- * @param project The borland project concerned by this operation.
- * @param name The name of the node.
- */
-static void
-borland_project_begin_xml_node(borland_project_t project,
-                               const char *name);
-
-
-/*
- * Write the end of an xml node in the borland project file.
- * @param project The borland project concerned by this operation.
- * @param name The name of the node.
- */
-static void
-borland_project_end_xml_node(borland_project_t project, const char *name);
-
-/*
- * Write an xml element in a borland project file.
- * @param project The borland project concerned by this operation.
- * @param name The name of the element to write
- * @param value The value of the element  
- */
-static void
-borland_project_write_xml_element(borland_project_t project,
-                                  const char *name, const char *value);
-
-/*
- * Write a FILE xml element in the borland project file.
- * @param project The borland project concerned by this operation.
- * @param file_name The value of the attribute FILENAME.
- * @param form_name The value of the attribute FORMNAME.
- * @param unit_name The value of the attribute UNITNAME.
- * @param container_id The value of the attribute CONTAINERID.
- * @param design_claas The value of the attribute DESIGNCLASS.
- * @param local_command The value of the attribute LOCALCOMMAND.
- */
-static void
-borland_project_write_file_element(borland_project_t project,
-                                   const char *file_name,
-                                   const char *form_name,
-                                   const char *unit_name,
-                                   const char *container_id,
-                                   const char *design_class,
-                                   const char *local_command);
-/*
- * Write all options of the IDE of the Borland Builder C++ compiler.
- * @ param project The project concerned by this operation.
- */
-
-static void borland_project_write_ide_options(borland_project_t project);
-
-/*
- * Write the xml header of the xml document.
- * @param project The project concerned by the operation.
- */
-static void borland_project_write_xml_header(borland_project_t project);
-
-/*
- * Write an xml comment in a borland project file
- * @param project The project concerned by this operation.
- */
-static void borland_project_write_xml_comment(borland_project_t project);
-
-/*
- * Create a bpf file used by a borland project file.
- * @param name The name of the bpf file to create.
- */
-static void borland_project_create_main_file(const char *name);
-
-/*
- * Create a borland project file.
- * @param project The project concerned by this operation.
- */
-static void borland_project_create(borland_project_t project);
-
-/*
- * Close a borland project file.
- * @param project the borland project file to close.
- */
-static void borland_project_close(borland_project_t project);
-
-
-/*
- * Generate a borland project file.
- * @param project The borland project to generate.
- */
-static void
-generate_borland_project(borland_project_t project, int is_rl,
-                         const char *name);
-
-/*
- * Find the path of a file.
- * @param file_name The file name to find.
- * @path path If founded this parameter will contain the path of file.
- * @return If successful the function returns 1. Otherwise the function
- *  retruns 0;
- */
-static int
-find_file_path(const char *root_dir, const char *file_name, char *path);
-
-
-/*
- * Functions used to create a Microsoft Visual C++ project file (*.dsp).
- */
-
-/*
- * generate a Microsoft Visual project file*/
-static void generate_dsp_project(dsp_t project, int is_rl,
-                                 const char *name);
-
-static void
-generate_borland_project(borland_project_t project, int is_rl,
-                         const char *name)
-{
-  char *binary_path;            /* the path of the generated binary file                                */
-  char *obj_path;               /* the path of the generated object file                                */
-  char *lib_files;              /* a list of the libraries used in the borland project  */
-  char *main_source;            /* the name of the bpf file used by the borland project */
-  char *file_name;              /* the file name of the main source file                                */
-  char *include_path;           /* the include path                                     */
-  char *buffer;
-
-  /* create the borland project file */
-  borland_project_create(project);
-
-  /* write the xml document header */
-  borland_project_write_xml_header(project);
-
-  /* write the xml comment to identify a borland project file */
-  borland_project_write_xml_comment(project);
-
-  /* write the begin of the node PROJECT */
-  borland_project_begin_xml_node(project, "PROJECT");
-
-  /* write the begin of node MACROS */
-  borland_project_begin_xml_node(project, "MACROS");
-
-  /* write the borland project version */
-  borland_project_write_xml_element(project, "VERSION", project->version);
-
-  /* construct and write the borland project binary path */
-  binary_path =
-      xbt_new0(char, strlen(project->name) + strlen(project->bin_dir) + 6);
-  sprintf(binary_path, "%s\\%s.exe", project->bin_dir, project->name);
-  borland_project_write_xml_element(project, "PROJECT", binary_path);
-  xbt_free(binary_path);
-
-  /* construct an write the object files to generate by the compiler */
-  obj_path =
-      xbt_new0(char,
-               strlen(project->name) + strlen(name) +
-               (2 * strlen(project->obj_dir)) + 11);
-  sprintf(binary_path, "%s\\%s.obj\n%s\\%s.obj", project->obj_dir,
-          project->name, project->obj_dir, name);
-  borland_project_write_xml_element(project, "OBJFILES", obj_path);
-  xbt_free(obj_path);
-
-  /* write the resource files used by the compiler (no resource file used) */
-  borland_project_write_xml_element(project, "RESFILES", "");
-
-  /* write the IDL files of the project (no IDL files used) */
-  borland_project_write_xml_element(project, "IDLFILES", "");
-
-  /* write the IDLGENFILES element (not used) */
-  borland_project_write_xml_element(project, "IDLGENFILES", "");
-
-  /* write the DEFFILE element (not used) */
-  borland_project_write_xml_element(project, "DEFFILE", "");
-
-  /* write the RESDEPEN element (not used, no resource file used) */
-  borland_project_write_xml_element(project, "RESDEPEN", "$(RESFILES)");
-
-  /* construct and write the list of libraries used by the project */
-  /*
-     lib_files = xbt_new0(char,(2 * (strlen(project->lib_dir) + 1)) + strlen("simgrid.lib") + strlen("libgras.lib") + 3);
-     sprintf(lib_files,"%s\\simgrid.lib %s\\libgras.lib",project->lib_dir,project->lib_dir);
-   */
-
-  if (is_rl) {
-    lib_files =
-        xbt_new0(char,
-                 (2 * (strlen(project->lib_dir) + 1)) +
-                 strlen("libgras.lib") + 2);
-    sprintf(lib_files, "%s\\libgras.lib", project->lib_dir);
-  } else {
-    lib_files =
-        xbt_new0(char,
-                 (2 * (strlen(project->lib_dir) + 1)) +
-                 strlen("simgrid.lib") + 2);
-    sprintf(lib_files, "%s\\simgrid.lib", project->lib_dir);
-  }
-
-  borland_project_write_xml_element(project, "LIBFILES", lib_files);
-  xbt_free(lib_files);
-
-  /* write the SPARELIBS element (not used) */
-  borland_project_write_xml_element(project, "SPARELIBS", "");
-
-  /* write the PACKAGES element (no package used) */
-  borland_project_write_xml_element(project, "PACKAGES", "");
-
-  /* write the PATHCPP element (the path of the source files of the project) */
-  borland_project_write_xml_element(project, "PATHCPP", ".;");
-
-  /* write the PATHPAS element (not used) */
-  borland_project_write_xml_element(project, "PATHPAS", "");
-
-  /* write the PATHRC element (not used) */
-  borland_project_write_xml_element(project, "PATHRC", "");
-
-  /* write the PATHASM element (not used) */
-  borland_project_write_xml_element(project, "PATHASM", "");
-
-  /* write the DEBUGLIBPATH element (the path for debug) */
-  borland_project_write_xml_element(project, "DEBUGLIBPATH",
-                                    "$(BCB)\\lib\\debug");
-
-  /* write the RELEASELIBPATH element (the path for release) */
-  borland_project_write_xml_element(project, "RELEASELIBPATH",
-                                    "$(BCB)\\lib\\release");
-
-  /* specify the linker to use */
-  borland_project_write_xml_element(project, "LINKER", "ilink32");
-
-  /* write the USERDEFINES element (user definitions (#define _DEBUG)) */
-  borland_project_write_xml_element(project, "USERDEFINES", "_DEBUG");
-
-  /* write the SYSDEFINES element (use the system definitions, not used strict ANSI and no use the VCL) */
-  borland_project_write_xml_element(project, "SYSDEFINES",
-                                    "NO_STRICT;_NO_VCL");
-
-  /* construct and write the MAINSOURCE element */
-  main_source = xbt_new0(char, strlen(project->name) + 5);
-  sprintf(main_source, "%s.bpf", project->name);
-  /* write the main source file to use in the borland project file */
-  borland_project_write_xml_element(project, "MAINSOURCE", main_source);
-
-  /* create the bpf file used by the borland project */
-  borland_project_create_main_file(main_source);
-
-  /* FIXME resolve the include path */
-  /* write the INCLUDEPATH element  */
-
-  if (!__gras_path) {
-    buffer = xbt_new0(char, MAX_PATH);
-    GetEnvironmentVariable("SG_INSTALL_DIR", buffer, MAX_PATH);
-
-    __gras_path = xbt_new0(char, MAX_PATH);
-    sprintf(__gras_path, "%s\\simgrid\\include", buffer);
-    free(buffer);
-
-    /*find_file_path("C:\\","gras.h",__gras_path); */
-  }
-
-  include_path =
-      xbt_new0(char, strlen("$(BCB)\\include") + strlen(__gras_path) + 2);
-  sprintf(include_path, "$(BCB)\\include;%s", __gras_path);
-
-  borland_project_write_xml_element(project, "INCLUDEPATH", include_path);
-
-  xbt_free(include_path);
-
-  /* write the LIBPATH element (no librarie paths specified) */
-  borland_project_write_xml_element(project, "LIBPATH",
-                                    "$(BCB)\\lib;$(BCB)\\lib\\obj");
-
-  /*
-   * write the WARNINGS element :
-   *  -w-sus (-w-8075) disabled the suspect conversion pointer warning
-   *  -w-rvl (-w-8070) disabled the function must return warning
-   *  -w-rch (-w-8066) disabled the warning which specify that we can't attain the code
-   *  -w-pia (-w-8060) disabled the warning that detect a possible bad assignement
-   *  -w-pch (-w-8058) disabled the warning throw when the compiler can't precompile a header file
-   *  -w-par (-w-8057) disabled the warning that detect an unused variable
-   *  -w-csu (-w-8012) disabled the warning that detect a comparison between a signed number and an unsigned number
-   *  -w-ccc (-w-8008) disabled the warning that detect une conditon which is always true
-   *  -w-aus (-w-8008) disabled the warning that detect an affected value which is never used
-   */
-  borland_project_write_xml_element(project, "WARNINGS",
-                                    "-w-sus -w-rvl -w-rch -w-pia -w-pch -w-par -w-csu -w-ccc -w-aus");
-
-  /* write the OTHERFILES element (no other files used used) */
-  borland_project_write_xml_element(project, "OTHERFILES", "");
-
-  /* write the end of the node MACROS */
-  borland_project_end_xml_node(project, "MACROS");
-
-  /* write the begin of the node OPTIONS */
-  borland_project_begin_xml_node(project, "OPTIONS");
-
-  /* FIXME check the idlcflags */
-  /* write the IDLCFLAGS element */
-  borland_project_write_xml_element(project, "IDLCFLAGS", "");
-
-  /*
-   * write the CFLAG1 element (compiler options ) :
-   *
-   *  -Od     this flag disable all compiler optimisation
-   *  -H      this flag specify the name of the file which will contain the precompiled header
-   *  -Hc     this flag specify to the compiler to cach the precompiled header
-   *  -Vx     this flag specify to the compiler to allow the empty structures
-   *  -Ve     this flag specify to the compiler to allow the empty base classes
-   *  -X-     this flag activate the auto-depend informations of the compiler
-   *  -r-     this flag disabled the use of the processor register
-   *  -a1     this flag specify that the data must be aligned on one byte
-   *  -b-     this flag specify that the enums are the smallest size of the integer
-   *  -k      (used during debug)
-   *  -y      this flag generate the line number for debug
-   *  -v      this flag enabled the debugging of the source files
-   *  -vi     check the expansion of the inline functions
-   *  -tWC    specify that it's a console application
-   *  -tWM-   specify that the application is not multithread
-   *  -c      generate the object file, no link
-   */
-  borland_project_write_xml_element(project, "CFLAG1",
-                                    "-Od -H=$(BCB)\\lib\\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -tWC -tWM- -c");
-
-  /* write the PFLAGS element */
-  borland_project_write_xml_element(project, "PFLAGS",
-                                    "-N2obj -N0obj -$YD -$W -$O- -$A8 -v -JPHNE ");
-
-  /* write the RFLAGS element */
-  borland_project_write_xml_element(project, "RFLAGS", "");
-
-  /* write the AFLAGS element (assembler flags) :
-   *
-   *  /mx (not documented)
-   *  /w2 (not documented)
-   *  /zd (not documented)
-   *
-   */
-  borland_project_write_xml_element(project, "AFLAGS", "/mx /w2 /zd");
-
-  /* write the LFLAGS element (linker flags) :
-   *
-   *  -I      specify the output directory for object files
-   *  -D      register the specified description (no description "")
-   *  -ap     build a win32 console application
-   *  -Tpe    generate a exe file
-   *  -x      do not create the map file
-   *  -Gn     do not generate the state file
-   *  -v      include the complete debug informations  
-   */
-  borland_project_write_xml_element(project, "LFLAGS",
-                                    "-Iobj -D&quot;&quot; -ap -Tpe -x -Gn -v");
-
-  /* write the OTHERFILES element (not used) */
-  borland_project_write_xml_element(project, "OTHERFILES", "");
-
-  /* write the end of the node OPTIONS */
-  borland_project_end_xml_node(project, "OPTIONS");
-
-  /* write the begin of the node LINKER */
-  borland_project_begin_xml_node(project, "LINKER");
-
-  /* write the ALLOBJ element */
-  borland_project_write_xml_element(project, "ALLOBJ",
-                                    "c0x32.obj $(OBJFILES)");
-
-  /* write the ALLRES element (not used) */
-  borland_project_write_xml_element(project, "ALLRES", "");
-
-  /* write the ALLLIB element */
-  borland_project_write_xml_element(project, "ALLLIB",
-                                    "$(LIBFILES) $(LIBRARIES) import32.lib cw32.lib");
-
-  /* write the OTHERFILES element (not used) */
-  borland_project_write_xml_element(project, "OTHERFILES", "");
-
-  /* write the end of the node LINKER */
-  borland_project_end_xml_node(project, "LINKER");
-
-  /* write the begin of the node FILELIST */
-  borland_project_begin_xml_node(project, "FILELIST");
-
-  /* construct and write the list of file elements */
-
-  /* add the bpf file to the list */
-  borland_project_write_file_element(project, main_source, "",
-                                     project->name, "BPF", "", "");
-  xbt_free(main_source);
-
-  /* FIXME : check the source file directory */
-  /* add the generated source file to the list */
-
-  file_name =
-      xbt_new0(char, strlen(project->src_dir) + strlen(project->name) + 5);
-  sprintf(file_name, "%s\\_%s.c", project->src_dir, project->name);
-  borland_project_write_file_element(project, file_name, "", project->name,
-                                     "CCompiler", "", "");
-
-  memset(file_name, 0,
-         strlen(project->src_dir) + strlen(project->name) + 4);
-  sprintf(file_name, "%s\\%s.c", project->src_dir, name);
-  borland_project_write_file_element(project, file_name, "", name,
-                                     "CCompiler", "", "");
-
-  xbt_free(file_name);
-
-  /* FIXME : check the libraries directory */
-  /* add the simgrid library to the list */
-
-  if (is_rl) {
-    file_name =
-        xbt_new0(char,
-                 strlen(project->lib_dir) + strlen("libgras.lib") + 2);
-    sprintf(file_name, "%s\\libgras.lib", project->lib_dir);
-    borland_project_write_file_element(project, file_name, "",
-                                       "libgras.lib", "LibTool", "", "");
-  } else {
-    file_name =
-        xbt_new0(char,
-                 strlen(project->lib_dir) + strlen("simgrid.lib") + 2);
-    sprintf(file_name, "%s\\simgrid.lib", project->lib_dir);
-    borland_project_write_file_element(project, file_name, "",
-                                       "simgrid.lib", "LibTool", "", "");
-  }
-
-
-  xbt_free(file_name);
-
-  /* write the end of the node FILELIST */
-  borland_project_end_xml_node(project, "FILELIST");
-
-  /* write the begin of the node BUILDTOOLS (not used) */
-  borland_project_begin_xml_node(project, "BUILDTOOLS");
-
-  /* write the end of the node BUILDTOOLS (not used) */
-  borland_project_end_xml_node(project, "BUILDTOOLS");
-
-  /* write the begin of the node IDEOPTIONS */
-  borland_project_begin_xml_node(project, "IDEOPTIONS");
-
-  /* write all of the option of the IDE of Borland C++ Builder */
-  borland_project_write_ide_options(project);
-
-  /* write the end of the node IDEOPTIONS */
-  borland_project_end_xml_node(project, "IDEOPTIONS");
-
-  /* write the end of the node PROJECT */
-  borland_project_end_xml_node(project, "PROJECT");
-
-  /* close the borland project file */
-  borland_project_close(project);
-}
-
-void borland_project_write_tabs(borland_project_t project,
-                                unsigned int count)
-{
-  unsigned int pos;
-
-  for (pos = 0; pos < count; pos++)
-    fprintf(project->stream, "\t");
-}
-
-void
-borland_project_begin_xml_node(borland_project_t project, const char *name)
-{
-  if (level)
-    borland_project_write_tabs(project, level);
-
-  fprintf(project->stream, "<%s>\n", name);
-
-  level++;
-}
-
-void borland_project_end_xml_node(borland_project_t project,
-                                  const char *name)
-{
-  level--;
-
-  if (level)
-    borland_project_write_tabs(project, level);
-
-  fprintf(project->stream, "</%s>\n", name);
-}
-
-
-void
-borland_project_write_xml_element(borland_project_t project,
-                                  const char *name, const char *value)
-{
-  borland_project_write_tabs(project, level);
-  fprintf(project->stream, "<%s value=\"%s\"/>\n", name, value);
-}
-
-void borland_project_write_xml_header(borland_project_t project)
-{
-  fprintf(project->stream, "<?xml version='%s' encoding='%s' ?>\n",
-          project->xml_version, project->encoding);
-}
-
-void borland_project_create_main_file(const char *name)
-{
-  FILE *stream = fopen(name, "w+");
-
-  fprintf(stream,
-          "Ce fichier est uniquement utilis� par le gestionnaire de projets et doit �tre trait� comme le fichier projet\n\n\nmain\n");
-
-  fclose(stream);
-}
-
-void borland_project_create(borland_project_t project)
-{
-  char *file_name = xbt_new0(char, strlen(project->name) + 5);
-  sprintf(file_name, "%s.bpr", project->name);
-  project->stream = fopen(file_name, "w+");
-  xbt_free(file_name);
-}
-
-void borland_project_write_xml_comment(borland_project_t project)
-{
-  fprintf(project->stream, "<!-- %s -->\n", project->comment);
-}
-
-void
-borland_project_write_file_element(borland_project_t project,
-                                   const char *file_name,
-                                   const char *form_name,
-                                   const char *unit_name,
-                                   const char *container_id,
-                                   const char *design_class,
-                                   const char *local_command)
-{
-  borland_project_write_tabs(project, level);
-
-  fprintf(project->stream,
-          "<FILE FILENAME=\"%s\" FORMNAME=\"%s\" UNITNAME=\"%s\" CONTAINERID=\"%s\" DESIGNCLASS=\"%s\" LOCALCOMMAND=\"%s\"/>\n",
-          file_name, form_name, unit_name, container_id, design_class,
-          local_command);
-}
-
-void borland_project_write_ide_options(borland_project_t project)
-{
-
-  const char *ide_options =
-      "[Version Info]\nIncludeVerInfo=0\nAutoIncBuild=0\nMajorVer=1\nMinorVer=0\nRelease=0\nBuild=0\nDebug=0\nPreRelease=0\nSpecial=0\nPrivate=0\nDLL=0\nLocale=1036\nCodePage=1252\n\n"
-      "[Version Info Keys]\nCompanyName=\nFileDescription=\nFileVersion=1.0.0.0\nInternalName=\nLegalCopyright=\nLegalTrademarks=\nOriginalFilename=\nProductName=\nProductVersion=1.0.0.0\nComments=\n\n"
-      "[Excluded Packages]\n$(BCB)\\dclclxdb60.bpl=Composants BD CLX Borland\n$(BCB)\\Bin\\dclclxstd60.bpl=Composants Standard CLX Borland\n\n"
-      "[HistoryLists\\hlIncludePath]\nCount=1\nItem0=$(BCB)\\include;$(BCB)\\include\\vcl;\n\n"
-      "[HistoryLists\\hlLibraryPath]\nCount=1\nItem0=$(BCB)\\lib\\obj;$(BCB)\\lib\n\n"
-      "[HistoryLists\\hlDebugSourcePath]\nCount=1\nItem0=$(BCB)\\source\\vcl\\\n\n"
-      "[HistoryLists\\hlConditionals]\nCount=1\nItem0=_DEBUG\n\n"
-      "[HistoryLists\\hlIntOutputDir]\nCount=0\n\n"
-      "[HistoryLists\\hlFinalOutputDir]\nCount=0\n\n"
-      "[HistoryLists\\hIBPIOutputDir]\nCount=0\n\n"
-      "[Debugging]\nDebugSourceDirs=$(BCB)\\source\\vcl\n\n"
-      "[Parameters]\nRunParams=\nLauncher=\nUseLauncher=0\nDebugCWD=\nHostApplication=\nRemoteHost=\nRemotePath=\nRemoteLauncher=\nRemoteCWD=\nRemoteDebug=0\n\n"
-      "[Compiler]\nShowInfoMsgs=0\nLinkDebugVcl=0\nLinkCGLIB=0\n\n"
-      "[CORBA]\nAddServerUnit=1\nAddClientUnit=1\nPrecompiledHeaders=1\n\n"
-      "[Language]\nActiveLang=\nProjectLang=\nRootDir=\n";
-
-  fprintf(project->stream, ide_options);
-}
-
-void borland_project_close(borland_project_t project)
-{
-  fclose(project->stream);
-}
-
-void generate_borland_simulation_project(const char *name)
-{
-  char buffer[MAX_PATH] = { 0 };
-
-  HANDLE hDir;
-  WIN32_FIND_DATA wfd = { 0 };
-
-  s_borland_project_t borland_project = { 0 };
-  borland_project.xml_version = "1.0";
-  borland_project.encoding = "utf-8";
-  borland_project.comment = "C++Builder XML Project";
-  borland_project.version = "BCB.06.00";
-
-  borland_project.lib_dir = xbt_new0(char, MAX_PATH);
-
-
-  GetEnvironmentVariable("LIB_SIMGRID_PATH", borland_project.lib_dir,
-                         MAX_PATH);
-
-
-  GetCurrentDirectory(MAX_PATH, buffer);
-
-  borland_project.src_dir = xbt_strdup(buffer);
-
-  borland_project.name =
-      xbt_new0(char, strlen(name) + strlen("simulator") + 2);
-  sprintf(borland_project.name, "%s_simulator", name);
-
-  borland_project.bin_dir =
-      xbt_new0(char, strlen(buffer) + strlen("\\bin") + 1);
-  sprintf(borland_project.bin_dir, "%s\\bin", buffer);
-
-  hDir = FindFirstFile(borland_project.bin_dir, &wfd);
-
-  if (!hDir)
-    CreateDirectory(borland_project.bin_dir, NULL);
-
-  borland_project.obj_dir =
-      xbt_new0(char, strlen(buffer) + strlen("\\obj") + 1);
-  sprintf(borland_project.obj_dir, "%s\\obj", buffer);
-
-  hDir = FindFirstFile(borland_project.obj_dir, &wfd);
-
-  if (INVALID_HANDLE_VALUE == hDir)
-    CreateDirectory(borland_project.obj_dir, NULL);
-
-  generate_borland_project(&borland_project, 0, name);
-
-  xbt_free(borland_project.name);
-  xbt_free(borland_project.src_dir);
-  xbt_free(borland_project.bin_dir);
-  xbt_free(borland_project.obj_dir);
-  xbt_free(borland_project.lib_dir);
-}
-
-void generate_borland_real_life_project(const char *name)
-{
-  HANDLE hDir;
-  WIN32_FIND_DATA wfd = { 0 };
-  char buffer[MAX_PATH] = { 0 };
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  s_borland_project_t borland_project = { 0 };
-
-  borland_project.xml_version = "1.0";
-  borland_project.encoding = "utf-8";
-  borland_project.comment = "C++Builder XML Project";
-  borland_project.version = "BCB.06.00";
-
-  borland_project.lib_dir = xbt_new0(char, MAX_PATH);
-
-  GetEnvironmentVariable("LIB_GRAS_PATH", borland_project.lib_dir,
-                         MAX_PATH);
-
-  GetCurrentDirectory(MAX_PATH, buffer);
-
-  borland_project.src_dir = xbt_strdup(buffer);
-
-  borland_project.bin_dir =
-      xbt_new0(char, strlen(buffer) + strlen("\\bin") + 1);
-  sprintf(borland_project.bin_dir, "%s\\bin", buffer);
-
-  hDir = FindFirstFile(borland_project.bin_dir, &wfd);
-
-  if (INVALID_HANDLE_VALUE == hDir)
-    CreateDirectory(borland_project.bin_dir, NULL);
-
-  borland_project.obj_dir =
-      xbt_new0(char, strlen(buffer) + strlen("\\obj") + 1);
-  sprintf(borland_project.obj_dir, "%s\\obj", buffer);
-
-  hDir = FindFirstFile(borland_project.obj_dir, &wfd);
-
-  if (!hDir)
-    CreateDirectory(borland_project.obj_dir, NULL);
-
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    borland_project.name = xbt_new0(char, strlen(name) + strlen(key) + 2);
-
-    sprintf(borland_project.name, "%s_%s", name, key);
-
-    generate_borland_project(&borland_project, 1, name);
-    xbt_free(borland_project.name);
-  }
-
-  xbt_free(borland_project.src_dir);
-  xbt_free(borland_project.bin_dir);
-  xbt_free(borland_project.obj_dir);
-  xbt_free(borland_project.lib_dir);
-}
-
-int find_file_path(const char *root_dir, const char *file_name, char *path)
-{
-  HANDLE hFind;
-  WIN32_FIND_DATA wfd;
-  char *prev_dir = xbt_new(char, MAX_PATH);
-  GetCurrentDirectory(MAX_PATH, prev_dir);
-  SetCurrentDirectory(root_dir);
-
-  // begining of the scan
-  hFind = FindFirstFile("*.*", &wfd);
-
-  if (hFind != INVALID_HANDLE_VALUE) {
-
-    /* it's a file */
-    if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
-
-      if (!strcmp(file_name, wfd.cFileName)) {
-        GetCurrentDirectory(MAX_PATH, path);
-        SetCurrentDirectory(prev_dir);
-        xbt_free(prev_dir);
-        FindClose(hFind);
-        return 1;
-      }
-
-    }
-    /* it's a directory, scan it */
-    else {
-
-      if (strcmp(wfd.cFileName, ".") && strcmp(wfd.cFileName, "..")) {
-        if (find_file_path(wfd.cFileName, file_name, path)) {
-          FindClose(hFind);
-          SetCurrentDirectory(prev_dir);
-          return 1;
-        }
-      }
-    }
-
-    /* next file or directory */
-    while (FindNextFile(hFind, &wfd)) {
-      /* it's a file */
-      if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
-        if (!strcmp(file_name, wfd.cFileName)) {
-          GetCurrentDirectory(MAX_PATH, path);
-          SetCurrentDirectory(prev_dir);
-          xbt_free(prev_dir);
-          FindClose(hFind);
-          return 1;
-        }
-      }
-      /* it's a file scan it */
-      else {
-
-        if (strcmp(wfd.cFileName, ".") && strcmp(wfd.cFileName, "..")) {
-
-          if (find_file_path(wfd.cFileName, file_name, path)) {
-            SetCurrentDirectory(prev_dir);
-            FindClose(hFind);
-            return 1;
-          }
-
-        }
-
-      }
-    }
-  }
-
-  SetCurrentDirectory(prev_dir);
-  xbt_free(prev_dir);
-  FindClose(hFind);
-  return 0;
-}
-
-/* Implementation of the functions used to create a Visual C++ project.*/
-
-int generate_simulation_dsp_file(const char *name)
-{
-  char buffer[MAX_PATH] = { 0 };
-  s_dsp_t dsp = { 0 };
-  dsp.lib_dir = xbt_new0(char, MAX_PATH);
-
-  GetEnvironmentVariable("LIB_SIMGRID_PATH", dsp.lib_dir, MAX_PATH);
-  GetCurrentDirectory(MAX_PATH, buffer);
-
-  dsp.src_dir = xbt_strdup(buffer);
-  dsp.name = xbt_new0(char, strlen(name) + strlen("simulator") + 2);
-  sprintf(dsp.name, "%s_simulator", name);
-
-  generate_dsp_project(&dsp, 0, name);
-
-  xbt_free(dsp.name);
-  xbt_free(dsp.src_dir);
-  xbt_free(dsp.lib_dir);
-
-  return 0;
-}
-
-/*
- * Create the Microsoft visual C++ real life project file.
- */
-int generate_real_live_dsp_file(const char *name)
-{
-
-  char buffer[MAX_PATH] = { 0 };
-  xbt_dict_cursor_t cursor = NULL;
-  char *key = NULL;
-  void *data = NULL;
-  s_dsp_t dsp = { 0 };
-
-
-  dsp.lib_dir = xbt_new0(char, MAX_PATH);
-
-  GetEnvironmentVariable("LIB_GRAS_PATH", dsp.lib_dir, MAX_PATH);
-
-  GetCurrentDirectory(MAX_PATH, buffer);
-
-  dsp.src_dir = xbt_strdup(buffer);
-
-
-  xbt_dict_foreach(process_function_set, cursor, key, data) {
-    dsp.name = xbt_new0(char, strlen(name) + strlen(key) + 2);
-
-    sprintf(dsp.name, "%s_%s", name, key);
-
-    generate_dsp_project(&dsp, 1, name);
-    xbt_free(dsp.name);
-  }
-
-  xbt_free(dsp.src_dir);
-  xbt_free(dsp.lib_dir);
-  return 0;
-}
-
-void generate_dsp_project(dsp_t project, int is_rl, const char *name)
-{
-  /* create the visual C++ project file */
-  char *buffer;
-  char *file_name = xbt_new0(char, strlen(project->name) + 5);
-  sprintf(file_name, "%s.dsp", project->name);
-  project->stream = fopen(file_name, "w+");
-  xbt_free(file_name);
-
-  if (!__gras_path) {
-    buffer = xbt_new0(char, MAX_PATH);
-    GetEnvironmentVariable("SG_INSTALL_DIR", buffer, MAX_PATH);
-
-    __gras_path = xbt_new0(char, MAX_PATH);
-    sprintf(__gras_path, "%s\\simgrid\\include", buffer);
-    free(buffer);
-  }
-
-  /* dsp file header */
-  fprintf(project->stream,
-          "# Microsoft Developer Studio Project File - Name=\"%s\" - Package Owner=<4>\n",
-          project->name);
-  fprintf(project->stream,
-          "# Microsoft Developer Studio Generated Build File, Format Version 6.00\n");
-  fprintf(project->stream, "# ** DO NOT EDIT **\n\n");
-
-  /* target type is a win32 x86 console application */
-  fprintf(project->stream,
-          "# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\n");
-
-  /* the current config is win32-debug */
-  fprintf(project->stream, "CFG=%s - Win32 Debug\n", project->name);
-
-  /* warning */
-  fprintf(project->stream,
-          "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n");
-
-  /* NMAKE usage */
-  fprintf(project->stream,
-          "!MESSAGE use the Export Makefile command and run\n");
-  fprintf(project->stream, "!MESSAGE\n");
-  fprintf(project->stream, "!MESSAGE NMAKE /f \"%s.mak\".\n",
-          project->name);
-  fprintf(project->stream, "!MESSAGE\n");
-  fprintf(project->stream,
-          "!MESSAGE You can specify a configuration when running NMAKE\n");
-  fprintf(project->stream,
-          "!MESSAGE by defining the macro CFG on the command line. For example:\n");
-  fprintf(project->stream, "!MESSAGE\n");
-  fprintf(project->stream,
-          "!MESSAGE NMAKE /f \"%s.mak\" CFG=\"%s - Win32 Debug\"\n",
-          project->name, project->name);
-  fprintf(project->stream, "!MESSAGE\n");
-  fprintf(project->stream,
-          "!MESSAGE Possible choices for configuration are:\n");
-  fprintf(project->stream, "!MESSAGE\n");
-  fprintf(project->stream,
-          "!MESSAGE \"%s - Win32 Release\" (based on \"Win32 (x86) Console Application\")\n",
-          project->name);
-  fprintf(project->stream,
-          "!MESSAGE \"%s - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\n",
-          project->name);
-  fprintf(project->stream, "!MESSAGE\n\n");
-
-  fprintf(project->stream, "# Begin Project\n\n");
-  fprintf(project->stream, "# PROP AllowPerConfigDependencies 0\n");
-  fprintf(project->stream, "# PROP Scc_ProjName\n");
-  fprintf(project->stream, "# PROP Scc_LocalPath\n");
-  fprintf(project->stream, "CPP=cl.exe\n");
-  fprintf(project->stream, "RSC=rc.exe\n\n");
-
-  fprintf(project->stream, "!IF  \"$(CFG)\" == \"%s - Win32 Release\"\n\n",
-          project->name);
-
-  fprintf(project->stream, "# PROP BASE Use_MFC 0\n");
-  fprintf(project->stream, "# PROP BASE Use_Debug_Libraries 0\n");
-  fprintf(project->stream, "# PROP BASE Output_Dir \"Release\"\n");
-  fprintf(project->stream, "# PROP BASE Intermediate_Dir \"Release\"\n");
-  fprintf(project->stream, "# PROP BASE Target_Dir \"\"\n");
-  fprintf(project->stream, "# PROP Use_MFC 0\n");
-  fprintf(project->stream, "# PROP Use_Debug_Libraries 0\n");
-  fprintf(project->stream, "# PROP Output_Dir \"Release\"\n");
-  fprintf(project->stream, "# PROP Intermediate_Dir \"Release\"\n");
-  fprintf(project->stream, "# PROP Target_Dir \"\"\n");
-  /* TODO : the include directory */
-  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /GX /O2 /I \"./%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",__gras_path); */
-  fprintf(project->stream,
-          "# ADD BASE CPP /nologo /W3 /GX /O2 /I \"%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",
-          __gras_path);
-  fprintf(project->stream,
-          "# ADD CPP /nologo /W3 /GX /O2 /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n");
-  fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"NDEBUG\"\n");
-  fprintf(project->stream, "# ADD RSC /l 0x40c /d \"NDEBUG\n");
-  fprintf(project->stream, "BSC32=bscmake.exe\n");
-  fprintf(project->stream, "# ADD BASE BSC32 /nologo\n");
-  fprintf(project->stream, "# ADD BSC32 /nologo\n");
-  fprintf(project->stream, "LINK32=link.exe\n");
-  fprintf(project->stream,
-          "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n");
-
-  if (is_rl)
-    fprintf(project->stream,
-            "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libgras.lib /nologo /subsystem:console /machine:I386\n\n");
-  else
-    fprintf(project->stream,
-            "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib simgrid.lib /nologo /subsystem:console /machine:I386\n\n");
-
-  fprintf(project->stream, "!ELSEIF  \"$(CFG)\" == \"%s - Win32 Debug\"\n",
-          project->name);
-
-  fprintf(project->stream, "# PROP BASE Use_MFC 0\n");
-  fprintf(project->stream, "# PROP BASE Use_Debug_Libraries 1\n");
-  fprintf(project->stream, "# PROP BASE Output_Dir \"Debug\"\n");
-  fprintf(project->stream, "# PROP BASE Intermediate_Dir \"Debug\"\n");
-  fprintf(project->stream, "# PROP BASE Target_Dir \"\"\n");
-  fprintf(project->stream, "# PROP Use_MFC 0\n");
-  fprintf(project->stream, "# PROP Use_Debug_Libraries 1\n");
-  fprintf(project->stream, "# PROP Output_Dir \"Debug\"\n");
-  fprintf(project->stream, "# PROP Intermediate_Dir \"Debug\"\n");
-  fprintf(project->stream, "# PROP Ignore_Export_Lib 0\n");
-  fprintf(project->stream, "# PROP Target_Dir \"\"\n");
-  /* TODO : the include directory */
-  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"./%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",__gras_path); */
-  fprintf(project->stream,
-          "# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",
-          __gras_path);
-  fprintf(project->stream,
-          "# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n");
-  fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"_DEBUG\"\n");
-  fprintf(project->stream, "# ADD RSC /l 0x40c /d \"_DEBUG\"\n");
-  fprintf(project->stream, "BSC32=bscmake.exe\n");
-  fprintf(project->stream, "# ADD BASE BSC32 /nologo\n");
-  fprintf(project->stream, "# ADD BSC32 /nologo\n");
-  fprintf(project->stream, "LINK32=link.exe\n");
-  fprintf(project->stream,
-          "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n");
-
-  if (is_rl)
-    fprintf(project->stream,
-            "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib simgrid.lib  libgras.lib  /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n\n");
-  else
-    fprintf(project->stream,
-            "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib simgrid.lib  simgrid.lib  /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n\n");
-
-  fprintf(project->stream, "!ENDIF\n\n");
-
-  fprintf(project->stream, "# Begin Target\n\n");
-  fprintf(project->stream, "# Name \"%s - Win32 Release\"\n",
-          project->name);
-  fprintf(project->stream, "# Name \"%s - Win32 Debug\"\n", project->name);
-  fprintf(project->stream, "# Begin Group \"Source Files\"\n\n");
-  fprintf(project->stream,
-          "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n\n");
-
-  fprintf(project->stream, "# Begin Source File\n");
-  fprintf(project->stream, "SOURCE=%s\\_%s.c\n", project->src_dir,
-          project->name);
-  fprintf(project->stream, "# End Source File\n\n");
-
-  fprintf(project->stream, "# Begin Source File\n");
-  fprintf(project->stream, "SOURCE=%s\\%s.c\n", project->src_dir, name);
-  fprintf(project->stream, "# End Source File\n\n");
-
-  fprintf(project->stream, "# End Group\n");
-  fprintf(project->stream, "# Begin Group \"Header Files\"\n\n");
-  fprintf(project->stream, "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n");
-  fprintf(project->stream, "# End Group\n");
-  fprintf(project->stream, "# Begin Group \"Resource Files\"\n\n");
-  fprintf(project->stream,
-          "# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n");
-  fprintf(project->stream, "# End Group\n");
-  fprintf(project->stream, "# End Target\n");
-  fprintf(project->stream, "# End Project\n");
-
-}
-
-#endif