Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
merge branches
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 08:25:30 +0000 (10:25 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 20 Oct 2011 08:25:30 +0000 (10:25 +0200)
414 files changed:
.gitignore
CMakeLists.txt
COPYING
ChangeLog
NEWS
README.git [new file with mode: 0644]
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/AddTestsWin.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Diff.pm [new file with mode: 0644]
buildtools/Cmake/Distrib.cmake
buildtools/Cmake/Flags.cmake
buildtools/Cmake/GenerateDoc.cmake
buildtools/Cmake/MaintainerMode.cmake
buildtools/Cmake/MakeExe.cmake
buildtools/Cmake/MakeLib.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindGTnets.cmake
buildtools/Cmake/Modules/FindNS3.cmake [new file with mode: 0644]
buildtools/Cmake/Modules/FindPCRE.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/generate_g5k_platform.pl [new file with mode: 0755]
buildtools/Cmake/generate_g5k_platform_cabinets.pl [new file with mode: 0644]
buildtools/Cmake/generate_peer_platform.pl
buildtools/Cmake/gras_config.h.in
buildtools/Cmake/memcheck_tests.cmake
buildtools/Cmake/simgrid.nsi.in [new file with mode: 0644]
buildtools/Cmake/tesh.pl
buildtools/Cmake/test_g5k.xml [new file with mode: 0644]
buildtools/Cmake/test_prog/prog_mutex_timedlock.c
buildtools/Cmake/test_prog/prog_sem_init.c
buildtools/Cmake/test_prog/prog_sem_open.c [new file with mode: 0644]
buildtools/Cmake/test_prog/prog_thread_storage.c [new file with mode: 0644]
buildtools/Cmake/transform_optorsim_platform.pl [new file with mode: 0644]
buildtools/Cmake/update_tesh.pl [changed mode: 0644->0755]
buildtools/pipol/Experimental.sh [changed mode: 0644->0755]
buildtools/pipol/Experimental_bindings.sh [changed mode: 0644->0755]
buildtools/pipol/MemCheck.sh [changed mode: 0644->0755]
buildtools/pipol/Nightly_memCheck.sh [new file with mode: 0755]
buildtools/pipol/Nightly_simgrid.sh [changed mode: 0644->0755]
buildtools/pipol/deploy.sh [changed mode: 0644->0755]
buildtools/pipol/install_ns3.sh [new file with mode: 0644]
buildtools/pipol/pre-simgrid.sh
buildtools/pipol/rc.debian
buildtools/pipol/rc.fedora
buildtools/pipol/rc.mac
buildtools/pipol/rc.ubuntu
buildtools/pipol/rc.windows
configure
doc/.gitignore [deleted file]
doc/Doxyfile.in
doc/FAQ.doc [deleted file]
doc/HelloWorld/CMakeLists.txt [new file with mode: 0644]
doc/HelloWorld/FindPCRE.cmake [new file with mode: 0644]
doc/HelloWorld/HelloWorld.c [new file with mode: 0644]
doc/HelloWorld/README [new file with mode: 0644]
doc/all.bib [deleted file]
doc/bindings.doc [new file with mode: 0644]
doc/contrib.doc [deleted file]
doc/gtut-files/.gitignore [deleted file]
doc/gtut-files/10-rpc.c
doc/gtut-introduction.doc
doc/gtut-tour-00-install.doc [new file with mode: 0644]
doc/gtut-tour-08-exceptions.doc
doc/gtut-tour-13-pointers.doc
doc/gtut-tour-recap-messages.doc
doc/gtut-tour.doc
doc/history.doc [deleted file]
doc/index.doc
doc/index.php.in [deleted file]
doc/installSimgrid.doc [new file with mode: 0644]
doc/module-msg.doc
doc/options.doc [new file with mode: 0644]
doc/people.doc [deleted file]
doc/pls.doc [new file with mode: 0644]
doc/publis.doc [deleted file]
doc/tracing.doc [new file with mode: 0644]
doc/use.doc [new file with mode: 0644]
doc/webcruft/SimGrid.ico [new file with mode: 0644]
doc/webcruft/robots.txt [deleted file]
doc/webcruft/simgrid_logo_smaller.png [new file with mode: 0644]
doc/webcruft/simgrid_logo_win.bmp [new file with mode: 0644]
doc/webcruft/win_install_01.png [new file with mode: 0644]
doc/webcruft/win_install_02.png [new file with mode: 0644]
doc/webcruft/win_install_03.png [new file with mode: 0644]
doc/webcruft/win_install_04.png [new file with mode: 0644]
examples/amok/bandwidth/bandwidth.c
examples/amok/saturate/env.c
examples/amok/saturate/saturate.c
examples/gras/all2all/test_sg_32.tesh
examples/gras/all2all/test_sg_64.tesh
examples/gras/console/ping_client.c
examples/gras/console/ping_server.c
examples/gras/mmrpc/mmrpc.c
examples/gras/mmrpc/mmrpc_server.c
examples/gras/mutual_exclusion/simple_token/simple_token.c
examples/gras/p2p/can/can.c
examples/gras/p2p/can/can_tests.c
examples/gras/p2p/chord/chord.c
examples/gras/ping/ping_client.c
examples/gras/ping/ping_server.c
examples/gras/pmm/pmm.c
examples/gras/replay/replay.c
examples/gras/rpc/rpc.c
examples/gras/rpc/test_rl.tesh
examples/gras/rpc/test_sg_32.tesh
examples/gras/rpc/test_sg_64.tesh
examples/gras/spawn/spawn.c
examples/gras/synchro/test_sg_32.tesh
examples/gras/synchro/test_sg_64.tesh
examples/gras/timer/timer.c
examples/lua/SimSplay/TODO [new file with mode: 0644]
examples/lua/SimSplay/chord.lua [new file with mode: 0644]
examples/lua/SimSplay/platform_script.lua [new file with mode: 0644]
examples/lua/SimSplay/sim_splay.lua [new file with mode: 0644]
examples/lua/SimSplay/splay_school.lua [new file with mode: 0644]
examples/lua/console/master_slave_bypass.tesh
examples/msg/actions/actions.c
examples/msg/chord/chord.c
examples/msg/chord/chord.tesh [new file with mode: 0644]
examples/msg/gtnets/gtnets.c
examples/msg/masterslave/masterslave_bypass.c
examples/msg/masterslave/masterslave_vivaldi.tesh
examples/msg/mc/bugged1.tesh
examples/msg/mc/bugged2.c
examples/msg/mc/bugged2.tesh
examples/msg/mc/centralized.tesh
examples/msg/ns3/3hosts_2links_d.xml [new file with mode: 0644]
examples/msg/ns3/3hosts_2links_p.xml [new file with mode: 0644]
examples/msg/ns3/3links-d-timer.xml [new file with mode: 0644]
examples/msg/ns3/3links-d.xml [new file with mode: 0644]
examples/msg/ns3/3links-p.xml [new file with mode: 0644]
examples/msg/ns3/CMakeLists.txt [new file with mode: 0644]
examples/msg/ns3/One_cluster-d.xml [new file with mode: 0644]
examples/msg/ns3/One_cluster.xml [new file with mode: 0644]
examples/msg/ns3/Two_clusters-d.xml [new file with mode: 0644]
examples/msg/ns3/Two_clusters.xml [new file with mode: 0644]
examples/msg/ns3/dogbone-d.xml [new file with mode: 0644]
examples/msg/ns3/dogbone-p.xml [new file with mode: 0644]
examples/msg/ns3/ns3.c [new file with mode: 0644]
examples/msg/ns3/ns3.tesh [new file with mode: 0644]
examples/msg/pmm/msg_pmm.c
examples/msg/sendrecv/sendrecv_CLM03.tesh
examples/msg/token_ring/token_ring.tesh
examples/msg/tracing/CMakeLists.txt
examples/msg/tracing/categories.c
examples/msg/tracing/categories.tesh
examples/msg/tracing/ms.c
examples/msg/tracing/ms.tesh
examples/msg/tracing/platform.xml
examples/msg/tracing/procmig.c
examples/msg/tracing/procmig.tesh
examples/msg/tracing/tasks.tesh
examples/msg/tracing/volume.c [deleted file]
examples/msg/tracing/volume.tesh [deleted file]
examples/platforms/One_cluster.xml [moved from examples/platforms/cluster_with_100_hosts.xml with 50% similarity]
examples/platforms/One_cluster_no_backbone.xml [new file with mode: 0644]
examples/platforms/Two_clusters.xml [moved from examples/platforms/2_clusters_with_30000_hosts.xml with 84% similarity]
examples/platforms/cluster_with_100000_hosts.xml [deleted file]
examples/platforms/cluster_with_10000_hosts.xml [deleted file]
examples/platforms/cluster_with_1000_hosts.xml [deleted file]
examples/platforms/cluster_with_300000_hosts.xml [deleted file]
examples/platforms/cluster_with_30000_hosts.xml [deleted file]
examples/platforms/g5k.xml
examples/platforms/g5k_cabinets.xml [new file with mode: 0644]
examples/platforms/gdx.xml [new file with mode: 0644]
examples/platforms/gridpp_grid_2004.conf [new file with mode: 0644]
examples/platforms/gridpp_grid_2004.xml [new file with mode: 0644]
examples/platforms/griffon.xml [new file with mode: 0644]
examples/platforms/lcg_sept2004_grid.conf [new file with mode: 0644]
examples/platforms/lcg_sept2004_grid.xml [new file with mode: 0644]
examples/platforms/median_harvard.syscoord [new file with mode: 0644]
examples/platforms/median_harvard.xml [new file with mode: 0644]
examples/platforms/median_meridian.syscoord [new file with mode: 0644]
examples/platforms/median_p2psim.syscoord [new file with mode: 0644]
examples/platforms/nancy.xml [new file with mode: 0644]
examples/simdag/dot/dot_test.c
examples/simdag/goal/CMakeLists.txt [new file with mode: 0644]
examples/simdag/goal/goal_test.c [new file with mode: 0644]
examples/simdag/scheduling/CMakeLists.txt
examples/simdag/scheduling/minmin_test.c
examples/smpi/NAS/EP-sampling/Makefile [new file with mode: 0644]
examples/smpi/NAS/EP-sampling/ep.c
examples/smpi/smpi_traced.tesh
include/gras/process.h
include/instr/instr.h
include/msg/msg.h
include/simdag/datatypes.h
include/simgrid_config.h.in
include/simix/context.h
include/smpi/smpi.h
include/surf/simgrid_dtd.h
include/surf/surf_routing.h [new file with mode: 0644]
include/surf/surfxml_parse.h
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/ex.h
include/xbt/fifo.h
include/xbt/graph.h
include/xbt/graphxml.h
include/xbt/log.h
include/xbt/str.h
include/xbt/strbuff.h
include/xbt/swag.h
include/xbt/synchro_core.h
include/xbt/sysdep.h
src/.gitignore [deleted file]
src/amok/Bandwidth/bandwidth.c
src/amok/Bandwidth/saturate.c
src/bindings/lua/lua_console.c
src/bindings/lua/lua_stub_generator.c
src/bindings/lua/lua_stub_generator.h [deleted file]
src/bindings/lua/simgrid_lua.c
src/bindings/lua/simgrid_lua.h
src/gras/DataDesc/cbps.c
src/gras/DataDesc/datadesc_private.h
src/gras/DataDesc/ddt_convert.c
src/gras/DataDesc/ddt_create.c
src/gras/DataDesc/ddt_exchange.c
src/gras/DataDesc/ddt_parse.c
src/gras/Msg/gras_msg_types.c
src/gras/Msg/msg_interface.h
src/gras/Msg/rl_msg.c
src/gras/Transport/transport.c
src/gras/Transport/transport_plugin_tcp.c
src/gras/Virtu/process.c
src/gras/Virtu/sg_process.c
src/gras/gras.c
src/include/surf/surf.h
src/include/xbt/xbt_os_thread.h
src/instr/instr_config.c
src/instr/instr_interface.c
src/instr/instr_msg_process.c
src/instr/instr_msg_task.c
src/instr/instr_msg_volume.c [deleted file]
src/instr/instr_paje.c
src/instr/instr_paje_trace.c
src/instr/instr_private.h
src/instr/instr_resource_utilization.c
src/instr/instr_routing.c
src/instr/instr_simdag.c
src/instr/instr_smpi.c
src/instr/instr_smx.c [deleted file]
src/instr/instr_surf.c
src/instr/jedule/jedule_sd_binding.c
src/mc/mc_checkpoint.c
src/mc/mc_global.c
src/mc/mc_memory.c
src/mc/mc_request.c
src/mc/private.h
src/mk_supernovae.pl
src/msg/global.c
src/msg/gos.c
src/msg/host.c
src/msg/m_process.c
src/msg/msg_mailbox.c
src/msg/task.c
src/simdag/dax_dtd.c
src/simdag/dax_dtd.h
src/simdag/dax_dtd.l [deleted file]
src/simdag/private.h
src/simdag/sd_dotloader.c
src/simdag/sd_global.c
src/simdag/sd_task.c
src/simix/private.h
src/simix/process_private.h
src/simix/smurf_private.h
src/simix/smx_context.c
src/simix/smx_context_base.c
src/simix/smx_context_raw.c
src/simix/smx_context_sysv.c
src/simix/smx_context_thread.c
src/simix/smx_deployment.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_network.c
src/simix/smx_process.c
src/simix/smx_smurf.c
src/simix/smx_synchro.c
src/simix/smx_user.c
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_comm.c
src/smpi/smpi_global.c
src/smpi/smpi_mpi.c
src/smpi/smpi_mpi_dt.c
src/smpi/smpi_pmpi.c
src/smpi/smpicc.in
src/smpi/smpirun.in
src/surf/cpu.c
src/surf/cpu_im.c
src/surf/cpu_ti.c
src/surf/fair_bottleneck.c
src/surf/gtnets/gtnets_interface.cc
src/surf/network.c
src/surf/network_constant.c
src/surf/network_gtnets.c
src/surf/network_gtnets_private.h
src/surf/network_im.c
src/surf/network_ns3.c [new file with mode: 0644]
src/surf/network_ns3_private.h [new file with mode: 0644]
src/surf/ns3/my-point-to-point-helper.cc [new file with mode: 0644]
src/surf/ns3/my-point-to-point-helper.h [new file with mode: 0644]
src/surf/ns3/ns3_interface.cc [new file with mode: 0644]
src/surf/ns3/ns3_interface.h [new file with mode: 0644]
src/surf/ns3/ns3_simulator.cc [new file with mode: 0644]
src/surf/ns3/ns3_simulator.h [new file with mode: 0644]
src/surf/ns3/red-queue.cc [new file with mode: 0644]
src/surf/ns3/red-queue.h [new file with mode: 0644]
src/surf/simgrid.dtd
src/surf/simgrid_dtd.c
src/surf/simgrid_dtd.l [deleted file]
src/surf/surf.c
src/surf/surf_config.c
src/surf/surf_private.h
src/surf/surf_routing.c
src/surf/surf_routing_dijkstra.c [new file with mode: 0644]
src/surf/surf_routing_floyd.c [new file with mode: 0644]
src/surf/surf_routing_full.c [new file with mode: 0644]
src/surf/surf_routing_none.c [new file with mode: 0644]
src/surf/surf_routing_private.h [new file with mode: 0644]
src/surf/surf_routing_rulebased.c [new file with mode: 0644]
src/surf/surfxml_parse.c
src/xbt/backtrace_linux.c
src/xbt/config.c
src/xbt/dict.c
src/xbt/dict_multi.c
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/graph.c
src/xbt/graphxml.c
src/xbt/graphxml.l [deleted file]
src/xbt/log.c
src/xbt/mallocator.c
src/xbt/mmalloc/attach.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mmap-sup.c
src/xbt/parmap.c
src/xbt/parmap_private.h
src/xbt/set.c
src/xbt/swag.c
src/xbt/win32_ucontext.c
src/xbt/xbt_main.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_queue.c
src/xbt/xbt_str.c
src/xbt/xbt_strbuff.c
src/xbt/xbt_synchro.c
teshsuite/gras/datadesc/datadesc.big32_8_4
teshsuite/gras/datadesc/datadesc.little32_4
teshsuite/gras/datadesc/datadesc.little64
teshsuite/gras/datadesc/datadesc_mem.tesh
teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh
teshsuite/gras/datadesc/datadesc_r_little32_4.tesh
teshsuite/gras/datadesc/datadesc_r_little64.tesh
teshsuite/gras/datadesc/datadesc_rw.tesh
teshsuite/gras/datadesc/datadesc_structs.c
teshsuite/gras/datadesc/datadesc_usage.c
teshsuite/gras/datadesc/mk_datadesc_structs.pl
teshsuite/gras/msg_handle/msg_handle.c
teshsuite/simdag/.gitignore [deleted file]
teshsuite/simdag/network/.gitignore [deleted file]
teshsuite/simdag/network/mxn/.gitignore [deleted file]
teshsuite/simdag/network/p2p/.gitignore [deleted file]
teshsuite/simdag/partask/.gitignore [deleted file]
teshsuite/simdag/platforms/CMakeLists.txt
teshsuite/simdag/platforms/Evaluate_get_route_time.c [new file with mode: 0644]
teshsuite/simdag/platforms/Evaluate_parse_time.c [new file with mode: 0644]
teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/basic_parsing_test.tesh
teshsuite/simdag/platforms/basic_parsing_test_sym_full.tesh
teshsuite/simdag/platforms/clusterA.xml [new file with mode: 0644]
teshsuite/simdag/platforms/clusterB.xml [new file with mode: 0644]
teshsuite/simdag/platforms/flatifier.c
teshsuite/simdag/platforms/flatifier.tesh
teshsuite/simdag/platforms/four_hosts_Dijkstra_ns3.xml [new file with mode: 0644]
teshsuite/simdag/platforms/four_hosts_floyd_ns3.xml [new file with mode: 0644]
teshsuite/simdag/platforms/one_cluster_router_id.xml [new file with mode: 0644]
teshsuite/simdag/platforms/platform_include.xml [new file with mode: 0644]
teshsuite/simdag/platforms/test_of_is_router.xml
teshsuite/simdag/platforms/two_clusters_router_id.xml [new file with mode: 0644]
teshsuite/xbt/.gitignore [deleted file]
testsuite/.gitignore [deleted file]
testsuite/surf/.gitignore [deleted file]
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c
testsuite/xbt/.gitignore [deleted file]
tools/.gitignore [deleted file]
tools/doxygen/doxygen_postprocesser.pl
tools/doxygen/index_php.pl
tools/graphicator/CMakeLists.txt
tools/graphicator/graphicator.c
tools/graphicator/graphicator.tesh
tools/gras/.gitignore [deleted file]
tools/gras/gras_stub_generator.h
tools/gras/stub_generator.c
tools/gras/unix_stub_generator.c
tools/simgrid_update_xml.pl
tools/tesh/.gitignore [deleted file]
tools/tesh/IO-orders.tesh
tools/tesh/basic.tesh
tools/tesh/basic2.tesh [new file with mode: 0644]
tools/tesh/catch-return.tesh
tools/tesh/catch-signal.tesh
tools/tesh/catch-timeout.tesh
tools/tesh/catch-wrong-output.tesh
tools/tesh/cd.tesh
tools/tesh/run_context.c
tools/tesh/set-ignore-output.tesh
tools/tesh/tesh.c
tools/tesh/tesh.h

index c6bdbe9..f25af12 100644 (file)
@@ -9,6 +9,19 @@
 *.mk\r
 *.swp\r
 *.patch\r
+*.plist\r
+*.trace\r
+\r
+################################################\r
+### Maintainer mode\r
+src/simdag/dax_dtd.l\r
+src/surf/simgrid_dtd.l\r
+src/xbt/graphxml.l\r
+\r
+################################################\r
+### Jedule\r
+examples/simdag/scheduling/simgrid.jed\r
+teshsuite/simdag/platforms/simgrid.jed\r
 \r
 ################################################\r
 ### Libraries links \r
@@ -30,6 +43,7 @@ src/supernovae_*.c
 ### Generated files\r
 _*.c\r
 include/simgrid_config.h\r
+include/xbt/version.h\r
 include/instr/tracing_config.h\r
 include/smpi/smpif.h\r
 src/context_sysv_config.h\r
@@ -51,6 +65,7 @@ _CPack_Packages/
 CMakeFiles\r
 CMakeCache.txt\r
 DartConfiguration.tcl\r
+simgrid.nsi\r
 Testing/\r
 Makefile\r
 bin/\r
@@ -69,6 +84,18 @@ buildtools/Cmake/test_prog/prog_va_copy.c
 ### Documentation\r
 doc/all_bib.html\r
 doc/logcategories.sh\r
+doc/realtoc.sh\r
+doc/tmp.realtoc\r
+doc/using_bib.html\r
+doc/Doxyfile\r
+doc/footer.html\r
+*.doc.toc\r
+doc/latex/\r
+doc/html\r
+doc/index-API.doc\r
+doc/index.php\r
+doc/simgrid.tag\r
+doc/simgrid_modules.map\r
 doc/publis_core.bib\r
 doc/publis_core_bib.html\r
 doc/publis_count.html\r
@@ -76,11 +103,6 @@ doc/publis_extern.bib
 doc/publis_extern_bib.html\r
 doc/publis_intra.bib\r
 doc/publis_intra_bib.html\r
-doc/realtoc.sh\r
-doc/tmp.realtoc\r
-doc/using_bib.html\r
-doc/Doxyfile\r
-doc/footer.html\r
 \r
 ################################################\r
 ### Specific of project \r
@@ -186,6 +208,7 @@ examples/msg/mc/bugged2
 examples/msg/mc/bugged1\r
 examples/msg/parallel_contexts/pcontexts\r
 examples/msg/parallel_contexts/pcontexts2\r
+examples/msg/pmm/msg_pmm\r
 examples/simdag/ex_sd_test\r
 examples/simdag/ex_sd_test2\r
 examples/simdag/metaxml/sd_meta\r
@@ -193,6 +216,7 @@ examples/simdag/properties/sd_prop
 examples/simdag/sd_test\r
 examples/simdag/sd_test2\r
 examples/simdag/dax/dax_test\r
+examples/simdag/goal/goal_test\r
 examples/simdag/scheduling/minmin_test\r
 examples/smpi/reduce\r
 examples/smpi/bcast\r
@@ -276,3 +300,28 @@ test_sg
 examples/smpi/smpi_traced.trace\r
 examples/simdag/dot/simulate_dot\r
 teshsuite/simdag/platforms/graphicator\r
+\r
+#########################################""\r
+## tutorial files\r
+doc/gtut-files/01-bones_client\r
+doc/gtut-files/01-bones_server\r
+doc/gtut-files/02-simple_client\r
+doc/gtut-files/02-simple_server\r
+doc/gtut-files/03-args_client\r
+doc/gtut-files/03-args_server\r
+doc/gtut-files/04-callback_client\r
+doc/gtut-files/04-callback_server\r
+doc/gtut-files/05-globals_client\r
+doc/gtut-files/05-globals_server\r
+doc/gtut-files/06-logs_client\r
+doc/gtut-files/06-logs_server\r
+doc/gtut-files/07-timers_client\r
+doc/gtut-files/07-timers_server\r
+doc/gtut-files/08-exceptions_client\r
+doc/gtut-files/08-exceptions_server\r
+doc/gtut-files/09-simpledata_client\r
+doc/gtut-files/09-simpledata_server\r
+doc/gtut-files/10-rpc_client\r
+doc/gtut-files/10-rpc_server\r
+doc/gtut-files/11-explicitwait_client\r
+doc/gtut-files/11-explicitwait_server\r
index 6ae37c9..db45e7e 100644 (file)
@@ -7,23 +7,35 @@ project(simgrid CXX C)
 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_CXX_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
-### Version 3.5.99, aka 3.6 svn
+
+## Mapping version number -> version name
+# 3.5.99 -> alpha1 (oops)
+# 3.5.9{1,2} -> beta{1,2}
+# 3.5.9{3,4,5} -> rc{1,2,3}
+# 3.6.{0,1,2} -> release 3.6, 3.6.1, 3.6.2
+
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "5")
-set(SIMGRID_VERSION_PATCH "99")
-set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
+set(SIMGRID_VERSION_MINOR "6")
+set(SIMGRID_VERSION_PATCH "2")
+
+if(${SIMGRID_VERSION_PATCH} EQUAL "0")
+       set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
+else(${SIMGRID_VERSION_PATCH} EQUAL "0")
+       set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
+endif(${SIMGRID_VERSION_PATCH} EQUAL "0")
 set(libsimgrid_version "${release_version}")
 set(libgras_version "${release_version}")
 set(libsmpi_version "${release_version}")
 set(GCC_NEED_VERSION "4.0")
+set(APPLE_NEED_GCC_VERSION "4.6")
 
 ### SET THE LIBRARY EXTENSION AND GCC VERSION
 if(APPLE) #MAC
-    set(GCC_NEED_VERSION "4.5")
        set(LIB_EXE "dylib")
 else(APPLE)
     if(WIN32) #WINDOWS
         set(LIB_EXE "a")
+        set(BIN_EXE ".exe")
     else(WIN32) #UNIX
            set(LIB_EXE "so")
     endif(WIN32)
@@ -107,12 +119,12 @@ endif(NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/include/)
 
 ### Check 32bits or 64bits
 INCLUDE (CheckTypeSize)
-CHECK_TYPE_SIZE("long" SIZEOF_LONG)
-IF(SIZEOF_LONG EQUAL 4)
+CHECK_TYPE_SIZE("void*" SIZEOF_VOIDSTAR)
+IF(SIZEOF_VOIDSTAR EQUAL 4)
   SET(ARCH_32_BITS 1)
-ELSE(SIZEOF_LONG EQUAL 4)
+ELSE(SIZEOF_VOIDSTAR EQUAL 4)
   SET(ARCH_32_BITS 0)
-ENDIF(SIZEOF_LONG EQUAL 4)
+ENDIF(SIZEOF_VOIDSTAR EQUAL 4)
 
 if(WIN32)
 
@@ -159,9 +171,12 @@ if(WIN32)
     
     if(ARCH_32_BITS)   ### Arch 32bits
         set(_WIN32 1)
+        set(NSIS_WIN_VERSION "win32")
     else(ARCH_32_BITS) ### Arch 64bits
         set(_WIN64 1)
+        set(NSIS_WIN_VERSION "win64")
     endif(ARCH_32_BITS)
+
     
     set(_XBT_WIN32 1)
     
@@ -215,12 +230,7 @@ endif(NOT WIN32)
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeExe.cmake)
 
 ### Make tests
-if(NOT WIN32)
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
-else(NOT WIN32)
-
-endif(NOT WIN32)
-
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
 
 ### Setup the distrib
diff --git a/COPYING b/COPYING
index 7f93632..37b50f0 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -7,6 +7,30 @@ Some perticular files distributed with the project have other
 licenses. More specifically, these files are listed below, along with
 their license.
 
+=========================================================================
+
+We have embeded pcre 8.12 library into the windows installer.
+
+PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+Release 8 of PCRE is distributed under the terms of the "BSD" licence.
+The basic library functions are written in C and are freestanding. Also
+included in the distribution is a set of C++ wrapper functions.
+
+/*
+*      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+*      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+*      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+*      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+*      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+*      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+*      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+*      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+*      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+*      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+*      POSSIBILITY OF SUCH DAMAGE.
+*/
+
 ==========================================================================
 
 The file src/xbt/snprintf.c contains this license text:
index 35da579..b3d154b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,98 @@
-SimGrid (3.6) unstable; urgency=low
+SimGrid (3.7) NOT RELEASED; urgency=low 
+
+  Models:
+  * Use the partial invalidation optimization by default for the
+    network too. Should produce the exact same results, only faster.
+
+  SimDag:
+  * Performance boost by using a swag internally to compute the set of
+    tasks that are finished and should constitute the return value of
+    SD_simulate.
+
+  -- $date Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+
+SimGrid (3.6.2) stable; urgency=low 
+
+ The "Not coding new stuff allows to polish old things" release.
+
+ General
+ * New bindings to the NS3 packet level simulator (experimental)
+ * Use the raw (efficient) execution contextes instead of the sysv
+   (portable) ones when possible.
+ * libpcre is now mandatory in any cases since not using it led to
+    severe performance loss and possibly other issues
+ * Update the XML platforms:
+   - G5K: include the lastest machine in Nancy 
+   - GridPP and LCG: new platforms
+ * Documentation was partially updated, at least (more to come)
+   
+ Bug fixes, cosmetics and small improvements
+ * Free terminated processes before the end of the simulation to avoid
+   exhausting the memory of users having very dynamic amount of
+   processes.
+ * Bug fix and cosmetics about canceling non-running tasks
+ * Bug fix about the dot loader's issues when using libcgraph
+
+ Portability
+ * Create an installer for windows with nsis (amd64 and win32)
+   - Add an hello world project to illustrate simgrid project creation.
+   - Embed libpcre into the Simgrid installer to avoid 
+     its compilation burden 
+ * The raw execution contextes should work on Apple now
+ * Port to Windows 64 bits
+    - Sysv contextes now have an implementation for this arch
+    - GRAS communication features now support this arch
+ * Drop support for borland compiler on windows
+    - this code was not maintained, and we kinda depend on gcc nowadays
+ * Fix portability issues on kfreebsd/gnu: build error about semaphores
+ * Fix portability issue on unstable ubuntu: linker became picky on
+   argument order
+
+ -- Wed Oct  5 15:51:01 CEST 2011 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+
+
+SimGrid (3.6.1) stable; urgency=low 
+
+ The "Oops, we broke Macs too" release
+
+ Portability
+ * Fixed contextes detection so that raw ones are used when possible   
+ * On Mac, do not use Posix Ucontextes with gcc v4.[1-5] since this
+   leads to a strange error, with user code segfaulting sometimes when
+   the generated code is not perfectly aligned (which is not
+   controlable from the user side, depends on the amount of code)
+
+ XBT
+ * New macro: CATCH_ANONYMOUS, which is like CATCH(e) but without argument.
+
+ -- Mon Jun 27 13:59:03 CEST 2011 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+
+SimGrid (3.6) stable; urgency=medium
+
+ The Summer Release, also known as the "OMG! They Killed Kenny!" version
+
+ Java and Ruby: 
+ * Bindings now constitute their own package, separated from the main one.
+   Rationale: reduce our maintainance nightmare by reducing the module coupling
+   They will soon be released on their own on gforge. 
+ * In the meanwhile:
+   svn co svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/simgrid-java
+   svn co svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/simgrid-ruby
+ GRAS: It is not considered as stable anymore, but experimental. Sorry.
+ * It's not quite deprecated for now because we have no replacement,
+   but it may soon become the case.
+
+ SMPI
+ * New MPI functions supported: MPI_Comm_disconnect, MPI_Comm_get_name
+ * Fortran: New user-level cache variable to store the rank of the running
+   process. This improves performance by an order of magnitude.
+ * C: New coccinelle script to automatically locate and modifiy global and
+   local static variables.
+ * Improved SMPI network model with a sender-side gap to account for multiple
+   parallel sends.
 
  MSG
- * Change the prototypes of action replay. Sorry for inconvenience,
-   but this is really more efficient this way (and to adapt your code,
-   you just have to fix the initialization, that shouldn't be too long)
- * Kill the braindead MSG_task_refcount_dec() function. I guess nobody
-   ever managed to do anything useful with it.
- * New function MSG_comm_testany(). Similarly to MSG_comm_waitany(), it
-   takes a dynar of communications. It returns immediately and gives the
-   index of a finished communication (if any).
  * New function MSG_comm_get_status(). MSG_comm_test() and MSG_comm_testany()
    only say if a communication is finished, no matter whether it succeeded or
    failed. You can call MSG_comm_get_status() to know the status of a finished
@@ -17,12 +101,21 @@ SimGrid (3.6) unstable; urgency=low
    communication is detached, you are never notified of its success or failure
    and the memory is released automatically once it is finished. This function
    is useful when you don't care about the end nor the success of a
-   communication you send.
+   communication.
+ * Change the prototypes of action replay. Sorry for inconvenience,
+   but this is really more efficient this way (and to adapt your code,
+   you just have to fix the initialization, that shouldn't be too long)
+ * Kill the braindead MSG_task_refcount_dec() function. I guess nobody
+   ever managed to do anything useful with it.
+ * New function MSG_comm_testany(). Similarly to MSG_comm_waitany(), it
+   takes a dynar of communications. It returns immediately and gives the
+   index of a finished communication (if any).
+ * New example: a basic implementation of the Chord P2P algorithm.
 
  SURF
  * New model for multi-core CPUs. You can now use the core attribute to
    precise the number of cores of a host. This is a basic model. Every
-   process running on the host receive at most the power provided in
+   process running on the host receives at most the power provided in
    the DTD (throughput<=power). Total throughput of process cannot exceed
    power * num_cores.
  * New peer tag. This peer tag creates a tiny AS comprising a host and a
@@ -34,7 +127,7 @@ SimGrid (3.6) unstable; urgency=low
    into a Vivaldi routing model (based on the rule-based model). This allows to
    combine Vivaldi based latencies with last-mile platforms.
 
- Simix
+ SIMIX
  * Added a check for NaN of IEEE754 infinite in the double entries of 
    the smx_user.c file
  * Introduce a new context factory "raw", highly inspirated from the
@@ -49,14 +142,17 @@ SimGrid (3.6) unstable; urgency=low
    with N parallel threads (the default is 1, meaning no parallelism).
  * Allow to decide dynamically between sequential and parallel modes.
    When nthreads > 1, you can use --cfg=contexts/threshold:P to run the user
-   processes in parallel only when their number is greater than or equal to P.
+   processes in parallel only when their number is greater than or equal to P
+   (the default is 2).
+ * Added a check for NaN of IEEE754 infinite in the double entries of 
+   the smx_user.c file
 
  XBT
  * New command line option: if you pass --cfg=verbose-exit:0, SimGrid
    won't output the state of processes when interrupted with Ctrl-C
  * Add a new function xbt_dynar_to_array that transforms a dynar into a
    NULL-terminated array. This may solve backward compatibility issues
-   due to the change to return type of SD_Simulate. See also:
+   due to the change to return type of SD_simulate. See also:
    http://lists.gforge.inria.fr/pipermail/simgrid-user/2010-December/002206.html
  * Add new macros with variable number of arguments.
    - in xbt/log.h: XBT_DEBUG, XBT_VERB, XBT_INFO, etc.
@@ -66,6 +162,8 @@ SimGrid (3.6) unstable; urgency=low
    Define XBT_USE_DEPRECATED if you want to use the old numbered macros like
    INFO1, INFO2, etc.
  * Change xbt_die() to accept a format string with arguments, just like printf.
+ * New data structure: xbt_lib_t, like a dict but more general and with better
+   memory handling.
 
  INSTR
  * New configuration options
@@ -75,7 +173,8 @@ SimGrid (3.6) unstable; urgency=low
  * XBT logging makes tracing error checks easier, new root log hierarchy: instr
  * New TRACE_user_link_variable interface:
    User provides the name of the link and the tracing variable to attach to it
- * the declaration of tracing categories must be done after the environment creation
+ * the declaration of tracing categories must be done after the environment
+   creation
  * simpler tracing interface, just one way to declare categories
     TRACE_category or TRACE_category_with_color, it is up to you
  * links in the trace file are again identified by their names
@@ -85,6 +184,14 @@ SimGrid (3.6) unstable; urgency=low
    these options generate traces that are suited to gantt-charts, such as the space-time view of Paje
  * The experimental option tracing/msg/volume is deprecated
    its functionality may be reincorporated if needed
+ * Buffering
+   The tracing generates a trace file with unordered timestamped events,
+   because of the way the core simulator (surf) works. A script available
+   at the tools directory (fix-paje-trace.sh) can be used to put the events
+   in order. We have changed the tracing so it can generate ordered timestamped
+   events in the final trace, but depending on the simulator (and how much time
+   is simulated) that can lead to a huge memory utilization. It is desactivated 
+   by default, but it can be activated using the --cfg=tracing/buffer:1 switch.
    
  Build Infrastructure
  * Define a SIMGRID_VERSION macro in simgrid_config.h.
@@ -95,8 +202,10 @@ SimGrid (3.6) unstable; urgency=low
    - current value: 30600 for 3.06.00, aka 3.6
  * Define macro MAKE_SIMGRID_VERSION(major, minor, patch) to help building
    a number that can be compared with SIMGRID_VERSION.
+ * Add a build option -Denable_debug (set to ON by default): when set to OFF,
+   assertions and verbose/debug logging events are disabled at compile time.
 
- -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+ -- Tue Jun 21 08:57:43 CEST 2011 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.5) stable; urgency=medium
 
diff --git a/NEWS b/NEWS
index cd9cc3a..d24f363 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,59 @@
+
+
+                    _               _____  __    ____  
+__   _____ _ __ ___(_) ___  _ __   |___ / / /_  |___ \ 
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \   __) | 
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) | / __/  
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___(_)_____|
+                Oct 5 2011
+
+The "Not coding new stuff allows to polish old things" release.
+
+ * Portability to Mac and Windows improved.
+ * Possible misconfigurations (contextes, libPCRE) made impossible by 
+   removing the option or providing sane default value.
+ * Exerimental support to NS3 simulator as a backend.
+                    _               _____  __    _ 
+__   _____ _ __ ___(_) ___  _ __   |___ / / /_  / |
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \ | |
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) || |  
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___(_)_|
+                Jun 27 2011  
+                                                   
+The "Oops, we broke Macs too" release. 
+Bug fix to an issue preventing SimGrid from working on Mac OSX.
+
+                    _               _____  __   
+__   _____ _ __ ___(_) ___  _ __   |___ / / /_  
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| '_ \ 
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | (_) |         
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)___/ 
+                Jun 21 2011
+
+The "OMG! They Killed Kenny!" version. Major changes:
+
+ * Java and Ruby bindings were removed from the main archive
+   - They are now distributed separately
+ * GRAS is not considered as stable anymore, but experimental. Sorry.
+ * First support for parallel simulation:
+   - Can run the user code of any simulation in parallel.
+   - Basic support for multi-cores hosts in platform files
+ * Improved P2P support:
+   - Peer tag in platform files for DSL connected nodes
+   - Vivaldi routing scheme for lightweigted yet accurate models
+ * Improved SMPI: Faster Fortran, automatic privatization of C globals
+ * Tracing: trace contains the full platform hierarchy
+   exactly as declared using the ASes of the platform file
+Plus numerous other goodies (check the ChangeLog for details)
+
                     _               _____  ____                    
 __   _____ _ __ ___(_) ___  _ __   |___ / | ___| 
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ |___ \ 
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/
+                01 Dec 2010
 
 The "Winter in Frejus" release. Also known as "ANR/ADT funding helps"
 Major changes are:
@@ -22,12 +73,12 @@ Major changes are:
     - Windows port: should be usable now but still considered experimental
     - Autotools have now been completely removed
 
-
                     _               _____ _  _    _ 
 __   _____ _ __ ___(_) ___  _ __   |___ /| || |  / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| || |_ | |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) |__   _|| |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_) |_|(_)_|
+                04 May 2010
 
 The "Polishing easter eggs is probably a good idea" release.
 This is a bug fixes release only. 
@@ -36,7 +87,7 @@ __   _____ _ __ ___(_) ___  _ __   |___ /| || |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \| || |_ 
  \ V /  __/ |  \__ \ | (_) | | | |  ___) |__   _|
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_) |_|  
-
+                28 Apr 2010
 
 The "Easter in Cargese" release. Also known as (major changes):
  
@@ -52,7 +103,8 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ /| || |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \| || |_ 
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |__   _|
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_) |_|  
-                                           
+                24 Dec 2009
+
 The "Desktop Grid needs love too" release (also called "Xmas release").
 Most important changes:
  * Big speedup through lazy evaluation of the linear models
@@ -66,7 +118,8 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ /
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \   |_ \ 
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) | ___) |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)____/ 
-                                                        
+                20 Aug 2009
+               
 The "Need for Speed" release.
 Big speedup through some function inlining.
 
@@ -75,7 +128,8 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ / |___ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \   __) |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) | / __/ 
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)_____|
-                                                        
+                19 Aug 2009
+               
 The "Simplicity does not preceed complexity, but follows it" release.
 Most important changes:
  * surf and simix modules reworked for simplification.
@@ -89,7 +143,7 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ / / |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ | |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) || |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____(_)_|
-
+                27 Jun 2009
 
 This dot release is mainly a maintainance one. Most important changes:
  * We fixed a large amount of bugs all around
@@ -113,12 +167,12 @@ fixed in a latter release.
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ / 
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ 
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |  
-  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/ 
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/
                _             _           _ 
      _  _ _ _ | |___ __ _ __| |_  ___ __| |
     | || | ' \| / -_) _` (_-< ' \/ -_) _` |
      \_,_|_||_|_\___\__,_/__/_||_\___\__,_|
-                                       
+               Mar 16 2007
 
 homepage: http://simgrid.gforge.inria.fr/
 download: http://gforge.inria.fr/frs/?group_id=12
diff --git a/README.git b/README.git
new file mode 100644 (file)
index 0000000..7e11c81
--- /dev/null
@@ -0,0 +1,185 @@
+Using Git for SimGrid
+=====================
+
+SimGrid developement tree is now managed with Git. 
+So, you need to use Git to :
+
+- follow the last development of SimGrid
+- propose some new commit to SimGrid developpers
+
+
+Installing Git and finding documentation
+----------------------------------------
+Refer to your OS documentation for installing Git.
+
+On Debian/Unbuntu, you can install the following packages :
+  apt-get install git-core git-gui gitk git-email
+
+Git website is http://git.or.cz/ . A **lot** of documentation is available on
+this website. You can read for example the
+link:http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html[Tutorial
+Introduction to Git] to begin with Git.
+
+
+Setting up GIT on your computer
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Be sure that git will use your right name and email for commits:
+
+  git config --global user.name "Firstname Lastname"
+  git config --global user.email Firstname.Lastname@imag.fr
+
+Note: the "--global" switch ensure that these setups will be used for all
+git projects. You can change these settings per project without this flags
+(see "man gitconfig" for more information)
+
+
+Getting a working copy of SimGrid developement tree
+------------------------------------------------
+
+Read-only access:
+  git clone git://scm.gforge.inria.fr/simgrid/simgrid.git
+Read-write access (for people with account on the forge and in the SimGrid
+project):
+  git clone git+ssh://USER@scm.gforge.inria.fr//gitroot//simgrid/simgrid.git
+(replace USER by your login name on the forge)
+
+Note: due to the distributed nature of Git, it is probably better to checkout
+with a read-only access and later push in the official repo with another
+"remote" setup (see later).
+
+Creating a commit
+~~~~~~~~~~~~~~~~~
+A commit is a self-contained modification of the sources associated to
+meta-data such as author, date, message, etc.
+
+Several rules must be repected as much as possible :
+
+- all commits in public branches should lead to a state where "make"
+  works (required in order git-bisect to be useful)
+- all commits in public branches must never be rebased (use "git revert" if you
+  need to revert a public commit)
+- each commit should contain only one logical modification
+- this modification must be described in the log message. The first line of the
+  log is a summary, the second line should be empty, the next lines can
+  describe more precisely the modifications. 
+
+
+Your first line of commit message can begin with a [flag] telling which global
+part of SimGrid you are changing. It can be for example [doc], [network], [build
+system], [bugfix], etc.
+
+[bugfix] commits will probably be considered to be also applied in the last
+stable branch.
+
+If you need to modify your commits (changeset) before publishing them (better
+log message, splitting/merging of commits, ...), you can use :
+
+- "git gui" to modify (ammend) the last commit (check the good box)
+- "gitk" to cherry pick interresting commits (right-clic on interesting
+  commits) and (re)create a linear branch
+- "git rebase -i" to merge/split/reorder commits in a linear branch
+- your email or your feet to go ask for help ;-)
+
+
+Writing in the official repo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+People with an accound on the forge (and in the SimGrid group) are allowed
+to publish their changes in the main repo. However, they can only
+create/modify/remove heads under refs/heads/$forge_login/*
+
+Global branches $global such as 'master', 'stable-*', ... are only writable
+if they are a subset of a refs/heads/$forge_login/official/$global .
+Restrictions to push to these global branches can be added if required.
+
+To publish some commit, the easiest way is to create a "remote" config
+such as:
+  git remote add inria-forge git+ssh://$forge_login@scm.gforge.inria.fr//gitroot//simgrid/simgrid.git
+
+And then, you should add to the configuration (in the [remote "sourceforge"]
+section of .git/config) some lines such as (replace $forge_login by your
+login on the forge):
+  push = refs/heads/master:refs/heads/$forge_login/wip/master
+  push = refs/heads/public/*:refs/heads/$forge_login/*
+  push = +refs/heads/wip/*:refs/heads/$forge_login/wip/*
+The idea here is to establish a correspondance between local heads and remote
+heads. As said before, remote heads **must** match refs/heads/$forge_login/*
+in order the push to succeed.
+
+Note: you can also add the previous config directly into the [remote "origin"]
+section if your clone has been done with the ssh protocol.
+
+You can create one-to-one correspondances (lines 1) or global correspondances
+(lines 2 and 3) as you wish. If you add a '+' in front of the line (line 3),
+then non fast-forward updates will be allowed. See 'man git-push' for more
+information.
+
+You can them push your commits with:
+  git push sourceforge
+
+
+To summary, with this setup:
+- local branch named master is pushed to '$forge_login/wip/master'
+- local branches named 'public/*' are pushed to '$forge_login/*'
+- local branches named 'wip/*' are pushed to '$forge_login/wip/*'
+- other local branches are not pushed
+
+Putting something in the 'master', 'stable-*', ... branches
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Just create a branch that merge the current 'master', 'stable-*', ... branch
+(called $global in this text) you want to update, push it first as
+$forge_login/official/$global and then push it as $global.
+  With the previous example setup, if you want to update 'master' to include
+your current commit, you have to type something like:
+  git merge sourceforge/master
+  git push sourceforge HEAD:$forge_login/official/master
+  git push sourceforge HEAD:master
+You can also add some config in .git/config such as
+  push = refs/heads/user-master:refs/heads/$forge_login/official/master
+  push = refs/heads/global-master:refs/heads/master
+
+  You can also ask one official maintainer of this branch to pull from your one
+(ie publish your branch and give its name to the official maintainers).
+
+Note: take care to ask to push only well commented, well formed changeset.
+Use 'git-rebase' to cleanup your branch if needed. Do not hesitate to ask for
+help if you do not know how to do it.
+
+Publishing branches
+~~~~~~~~~~~~~~~~~~~
+There is mainly two reasons for which you might want to publish some of your
+commits:
+
+- to merge your work into the main (master) developement branch. You must then
+ensure that the branch you want to publish is ready to be merged (well
+commented, well formed, bug free changeset) and then ask for a merge (see
+previous paragraph). If 'make' does not produce a working binary, you should
+reconsider seriously your request.
+
+Even if your work is not merged immediately, you should never rebase this
+branch (ie only fast-forward commits should be done). SimGrid developers should
+use public/* heads to track these kind of works;
+
+- to allow you/other people to test some experimental features. Rebase can
+occurs here, so other developers must never merge from theses branches unless
+they really know what they do. SimGrid developers should use wip/* heads to
+track these kind of works;
+
+To summary: commits in public/* heads (and 'master', 'stable-*' heads) must
+never be rebased as they can be used by other people. Take care before
+pushing such heads!
+
+Essential commands
+------------------
+
+You can probably do most of your work with the following commands:
+
+- git clone: get a new repo
+- git gui: commit some changes (graphical program)
+  You can very easily modify your last commit with this program
+- gitk: look at commits and manage branches (graphical program)
+- git rebase: rewrite/reorganize your (not yet public) commits
+- git fetch: get upstream changes
+- git merge: merge commits present on other branches
+- git pull: do a fetch and a merge
+- git push: publish your changes
+
index f1bb101..06b05c2 100644 (file)
@@ -9,7 +9,7 @@ if(enable_smpi AND NOT WIN32)
        exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff" OUTPUT_VARIABLE "OKITOKI")
        exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE "OKITOKI")
 endif(enable_smpi AND NOT WIN32)
-
+       
 ### For code coverage
 ### Set some variables
 SET(UPDATE_TYPE "svn")
@@ -24,381 +24,404 @@ INCLUDE(CTest)
 ENABLE_TESTING()
 
 if(NOT enable_memcheck)
-ADD_TEST(tesh-self-basic               ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" basic.tesh)
-ADD_TEST(tesh-self-cd                  ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh)
-ADD_TEST(tesh-self-IO-broken-pipe      ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-broken-pipe.tesh)
-ADD_TEST(tesh-self-IO-orders           ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh)
-ADD_TEST(tesh-self-IO-bigsize          ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-bigsize.tesh)
-ADD_TEST(tesh-self-set-return          ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-return.tesh)
-ADD_TEST(tesh-self-set-signal          ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-signal.tesh)
-ADD_TEST(tesh-self-set-timeout         ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-timeout.tesh)
-ADD_TEST(tesh-self-set-ignore-output   ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-ignore-output.tesh)
-ADD_TEST(tesh-self-catch-return                ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh)
-ADD_TEST(tesh-self-catch-signal                ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh)
-ADD_TEST(tesh-self-catch-timeout       ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh)
-ADD_TEST(tesh-self-catch-wrong-output  ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh)
-ADD_TEST(tesh-self-bg-basic            ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-basic.tesh)
-ADD_TEST(tesh-self-bg-set-signal       ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-set-signal.tesh)
-ADD_TEST(tesh-self-background          ${CMAKE_BINARY_DIR}/bin/tesh --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" background.tesh)
+ADD_TEST(tesh-self-basic               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" basic.tesh)
+ADD_TEST(tesh-self-cd                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh)
+ADD_TEST(tesh-self-IO-broken-pipe      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-broken-pipe.tesh)
+ADD_TEST(tesh-self-IO-orders           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh)
+ADD_TEST(tesh-self-IO-bigsize          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-bigsize.tesh)
+ADD_TEST(tesh-self-set-return          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-return.tesh)
+ADD_TEST(tesh-self-set-signal          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-signal.tesh)
+ADD_TEST(tesh-self-set-timeout         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-timeout.tesh)
+ADD_TEST(tesh-self-set-ignore-output   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-ignore-output.tesh)
+ADD_TEST(tesh-self-catch-return                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh)
+ADD_TEST(tesh-self-catch-signal                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh)
+ADD_TEST(tesh-self-catch-timeout       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh)
+ADD_TEST(tesh-self-catch-wrong-output  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh)
+ADD_TEST(tesh-self-bg-basic            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-basic.tesh)
+ADD_TEST(tesh-self-bg-set-signal       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-set-signal.tesh)
+ADD_TEST(tesh-self-background          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" background.tesh)
 
 # BEGIN TESH TESTS
 
 # teshsuite/xbt
-ADD_TEST(tesh-log-large                ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
-ADD_TEST(tesh-log-parallel     ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
+ADD_TEST(tesh-log-large                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
+ADD_TEST(tesh-log-parallel     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
 
 # teshsuite/gras/datadesc directory
-ADD_TEST(tesh-gras-dd-mem      ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_mem.tesh)
-ADD_TEST(tesh-gras-dd-rw       ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_rw.tesh)
-ADD_TEST(tesh-gras-dd-r-little32-4     ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite  --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_little32_4.tesh)
-ADD_TEST(tesh-gras-dd-r-little64       ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite  --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_little64.tesh)
-ADD_TEST(tesh-gras-dd-r-big32-8-4      ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite  --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh)
+ADD_TEST(tesh-gras-dd-mem      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_mem.tesh)
+ADD_TEST(tesh-gras-dd-rw       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_rw.tesh)
+ADD_TEST(tesh-gras-dd-r-little32-4     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite   --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_little32_4.tesh)
+ADD_TEST(tesh-gras-dd-r-little64       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite   --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_little64.tesh)
+ADD_TEST(tesh-gras-dd-r-big32-8-4      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite   --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_r_big32_8_4.tesh)
 
 IF(${ARCH_32_BITS})
-  ADD_TEST(tesh-gras-msg-handle-sg-32  ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/msg_handle/test_sg_32.tesh)
+  ADD_TEST(tesh-gras-msg-handle-sg-32  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/msg_handle/test_sg_32.tesh)
 ELSE(${ARCH_32_BITS})
-  ADD_TEST(tesh-gras-msg-handle-sg-64  ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/msg_handle/test_sg_64.tesh)
+  ADD_TEST(tesh-gras-msg-handle-sg-64  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/msg_handle/test_sg_64.tesh)
 ENDIF(${ARCH_32_BITS})
 
-ADD_TEST(tesh-gras-empty-main-rl       ${CMAKE_BINARY_DIR}/bin/tesh --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/empty_main      --cd ${CMAKE_HOME_DIRECTORY}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/empty_main/test_rl.tesh)
-ADD_TEST(tesh-gras-empty-main-sg       ${CMAKE_BINARY_DIR}/bin/tesh --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/empty_main      --cd ${CMAKE_HOME_DIRECTORY}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/empty_main/test_sg.tesh)
+ADD_TEST(tesh-gras-empty-main-rl       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/empty_main       --cd ${CMAKE_HOME_DIRECTORY}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/empty_main/test_rl.tesh)
+ADD_TEST(tesh-gras-empty-main-sg       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/empty_main       --cd ${CMAKE_HOME_DIRECTORY}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/empty_main/test_sg.tesh)
 
 IF(${ARCH_32_BITS})
-  ADD_TEST(tesh-gras-small-sleep-sg-32 ${CMAKE_BINARY_DIR}/bin/tesh --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/small_sleep     --cd ${CMAKE_HOME_DIRECTORY}/teshsuite gras/small_sleep/test_sg_32.tesh)
+  ADD_TEST(tesh-gras-small-sleep-sg-32 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/small_sleep      --cd ${CMAKE_HOME_DIRECTORY}/teshsuite gras/small_sleep/test_sg_32.tesh)
 ELSE(${ARCH_32_BITS})
-  ADD_TEST(tesh-gras-small-sleep-sg-64 ${CMAKE_BINARY_DIR}/bin/tesh --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/small_sleep     --cd ${CMAKE_HOME_DIRECTORY}/teshsuite gras/small_sleep/test_sg_64.tesh)
+  ADD_TEST(tesh-gras-small-sleep-sg-64 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/gras/small_sleep      --cd ${CMAKE_HOME_DIRECTORY}/teshsuite gras/small_sleep/test_sg_64.tesh)
 ENDIF(${ARCH_32_BITS})
 
 # GRAS examples
-ADD_TEST(gras-ping-rl                  ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/ping     ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_rl.tesh)
-ADD_TEST(gras-rpc-rl                   ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc              ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_rl.tesh)
-ADD_TEST(gras-spawn-rl                 ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn    ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_rl.tesh)
-ADD_TEST(gras-timer-rl                 ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/timer    ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_rl.tesh)
-ADD_TEST(gras-chrono-rl                        ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono   ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_rl.tesh)
-ADD_TEST(gras-simple-token-rl  ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_rl.tesh)
-ADD_TEST(gras-mmrpc-rl                 ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc    ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_rl.tesh)
-ADD_TEST(gras-all2all-rl               ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all  ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_rl.tesh)
-ADD_TEST(gras-pmm-rl                   ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm              ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_rl.tesh)
-ADD_TEST(gras-synchro-rl               ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro  ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_rl.tesh)
-ADD_TEST(gras-properties-rl            ${CMAKE_BINARY_DIR}/bin/tesh    --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_rl.tesh)
+ADD_TEST(gras-ping-rl                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/ping     ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_rl.tesh)
+ADD_TEST(gras-rpc-rl                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc              ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_rl.tesh)
+ADD_TEST(gras-spawn-rl                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn    ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_rl.tesh)
+ADD_TEST(gras-timer-rl                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer    ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_rl.tesh)
+ADD_TEST(gras-chrono-rl                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono   ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_rl.tesh)
+ADD_TEST(gras-simple-token-rl  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_rl.tesh)
+ADD_TEST(gras-mmrpc-rl                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc    ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_rl.tesh)
+ADD_TEST(gras-all2all-rl               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all  ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_rl.tesh)
+ADD_TEST(gras-pmm-rl                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm              ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_rl.tesh)
+ADD_TEST(gras-synchro-rl               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro  ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_rl.tesh)
+ADD_TEST(gras-properties-rl            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_rl.tesh)
 
 # BEGIN CONTEXTS FACTORY
-ADD_TEST(tesh-msg-get-sender-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
-ADD_TEST(tesh-msg-get-sender-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
-ADD_TEST(tesh-msg-get-sender-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
-ADD_TEST(tesh-simdag-reinit-costs-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
-ADD_TEST(tesh-simdag-reinit-costs-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
-ADD_TEST(tesh-simdag-reinit-costs-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
-ADD_TEST(tesh-simdag-parser-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
-ADD_TEST(tesh-simdag-parser-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
-ADD_TEST(tesh-simdag-parser-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
-ADD_TEST(tesh-simdag-parser-bogus-symmetric-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
-ADD_TEST(tesh-simdag-parser-bogus-symmetric-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
-ADD_TEST(tesh-simdag-parser-bogus-symmetric-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
-ADD_TEST(tesh-simdag-parser-sym-full-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
-ADD_TEST(tesh-simdag-parser-sym-full-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
-ADD_TEST(tesh-simdag-parser-sym-full-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
-ADD_TEST(tesh-simdag-flatifier-raw             ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
-ADD_TEST(tesh-simdag-flatifier-thread  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
-ADD_TEST(tesh-simdag-flatifier-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
-ADD_TEST(tesh-simdag-full-links-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
-ADD_TEST(tesh-simdag-full-links-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
-ADD_TEST(tesh-simdag-full-links-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
-ADD_TEST(tesh-simdag-basic0-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
-ADD_TEST(tesh-simdag-basic0-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
-ADD_TEST(tesh-simdag-basic0-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
-ADD_TEST(tesh-simdag-basic1-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
-ADD_TEST(tesh-simdag-basic1-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
-ADD_TEST(tesh-simdag-basic1-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
-ADD_TEST(tesh-simdag-basic2-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
-ADD_TEST(tesh-simdag-basic2-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
-ADD_TEST(tesh-simdag-basic2-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
-ADD_TEST(tesh-simdag-basic3-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
-ADD_TEST(tesh-simdag-basic3-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
-ADD_TEST(tesh-simdag-basic3-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
-ADD_TEST(tesh-simdag-basic4-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
-ADD_TEST(tesh-simdag-basic4-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
-ADD_TEST(tesh-simdag-basic4-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
-ADD_TEST(tesh-simdag-basic5-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
-ADD_TEST(tesh-simdag-basic5-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
-ADD_TEST(tesh-simdag-basic5-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
-ADD_TEST(tesh-simdag-basic6-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
-ADD_TEST(tesh-simdag-basic6-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
-ADD_TEST(tesh-simdag-basic6-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
-ADD_TEST(tesh-simdag-p2p-1-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
-ADD_TEST(tesh-simdag-p2p-1-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
-ADD_TEST(tesh-simdag-p2p-1-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
-ADD_TEST(tesh-simdag-p2p-2-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
-ADD_TEST(tesh-simdag-p2p-2-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
-ADD_TEST(tesh-simdag-p2p-2-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
-ADD_TEST(tesh-simdag-p2p-3-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
-ADD_TEST(tesh-simdag-p2p-3-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
-ADD_TEST(tesh-simdag-p2p-3-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
-ADD_TEST(tesh-simdag-p2p-4-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
-ADD_TEST(tesh-simdag-p2p-4-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
-ADD_TEST(tesh-simdag-p2p-4-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
-ADD_TEST(tesh-simdag-mxn-1-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
-ADD_TEST(tesh-simdag-mxn-1-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
-ADD_TEST(tesh-simdag-mxn-1-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
-ADD_TEST(tesh-simdag-mxn-2-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
-ADD_TEST(tesh-simdag-mxn-2-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
-ADD_TEST(tesh-simdag-mxn-2-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
-ADD_TEST(tesh-simdag-mxn-3-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
-ADD_TEST(tesh-simdag-mxn-3-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
-ADD_TEST(tesh-simdag-mxn-3-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
-ADD_TEST(tesh-simdag-par-1-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
-ADD_TEST(tesh-simdag-par-1-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
-ADD_TEST(tesh-simdag-par-1-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
-ADD_TEST(tesh-simdag-par-2-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
-ADD_TEST(tesh-simdag-par-2-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
-ADD_TEST(tesh-simdag-par-2-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
+ADD_TEST(tesh-msg-get-sender-thread    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+ADD_TEST(tesh-simdag-reinit-costs-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
+ADD_TEST(tesh-simdag-parser-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
+if(HAVE_RAWCTX)
+       ADD_TEST(tesh-msg-get-sender-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+       ADD_TEST(tesh-simdag-reinit-costs-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
+       ADD_TEST(tesh-simdag-parser-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
+endif(HAVE_RAWCTX)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(tesh-msg-get-sender-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+       ADD_TEST(tesh-simdag-reinit-costs-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
+       ADD_TEST(tesh-simdag-parser-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
+endif(HAVE_UCONTEXT_H)
+
+IF(enable_debug) # these tests need the assertion mechanism
+       if(HAVE_RAWCTX)
+               ADD_TEST(tesh-simdag-parser-bogus-symmetric-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
+       endif(HAVE_RAWCTX)
+       if(HAVE_UCONTEXT_H)
+               ADD_TEST(tesh-simdag-parser-bogus-symmetric-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
+       endif(HAVE_UCONTEXT_H)
+       ADD_TEST(tesh-simdag-parser-bogus-symmetric-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
+ENDIF(enable_debug)
+
+ADD_TEST(tesh-simdag-parser-sym-full           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
+ADD_TEST(tesh-simdag-flatifier         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
+ADD_TEST(tesh-simdag-full-links                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms  --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
+ADD_TEST(tesh-simdag-basic0            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
+ADD_TEST(tesh-simdag-basic1            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
+ADD_TEST(tesh-simdag-basic2            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
+ADD_TEST(tesh-simdag-basic3            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
+ADD_TEST(tesh-simdag-basic4            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
+ADD_TEST(tesh-simdag-basic5            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
+ADD_TEST(tesh-simdag-basic6            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
+ADD_TEST(tesh-simdag-p2p-1             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
+ADD_TEST(tesh-simdag-p2p-2             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
+ADD_TEST(tesh-simdag-p2p-3             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
+ADD_TEST(tesh-simdag-p2p-4             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
+ADD_TEST(tesh-simdag-mxn-1             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
+ADD_TEST(tesh-simdag-mxn-2             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
+ADD_TEST(tesh-simdag-mxn-3             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
+ADD_TEST(tesh-simdag-par-1             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
+ADD_TEST(tesh-simdag-par-2             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite       --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
 
 # MSG examples
-ADD_TEST(msg-sendrecv-CLM03-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-ADD_TEST(msg-sendrecv-CLM03-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-ADD_TEST(msg-sendrecv-CLM03-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-ADD_TEST(msg-sendrecv-Vegas-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-ADD_TEST(msg-sendrecv-Vegas-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-ADD_TEST(msg-sendrecv-Vegas-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-ADD_TEST(msg-sendrecv-Reno-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-ADD_TEST(msg-sendrecv-Reno-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-ADD_TEST(msg-sendrecv-Reno-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-ADD_TEST(msg-suspend-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-ADD_TEST(msg-suspend-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-ADD_TEST(msg-suspend-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-ADD_TEST(msg-masterslave-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-ADD_TEST(msg-masterslave-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-ADD_TEST(msg-masterslave-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-ADD_TEST(msg-masterslave-forwarder-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-ADD_TEST(msg-masterslave-forwarder-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-ADD_TEST(msg-masterslave-forwarder-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-ADD_TEST(msg-masterslave-failure-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-ADD_TEST(msg-masterslave-failure-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-ADD_TEST(msg-masterslave-failure-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-ADD_TEST(msg-masterslave-bypass-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-ADD_TEST(msg-masterslave-bypass-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-ADD_TEST(msg-masterslave-bypass-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-ADD_TEST(msg-masterslave-mailbox-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-ADD_TEST(msg-masterslave-mailbox-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-ADD_TEST(msg-masterslave-mailbox-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-ADD_TEST(msg-masterslave-vivaldi-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-ADD_TEST(msg-masterslave-vivaldi-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-ADD_TEST(msg-masterslave-vivaldi-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-ADD_TEST(msg-masterslave-multicore-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-ADD_TEST(msg-masterslave-multicore-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-ADD_TEST(msg-masterslave-multicore-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-ADD_TEST(msg-migration-raw             ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-ADD_TEST(msg-migration-thread  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-ADD_TEST(msg-migration-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-ADD_TEST(msg-ptask-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-ADD_TEST(msg-ptask-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-ADD_TEST(msg-ptask-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-ADD_TEST(msg-priority-raw              ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-ADD_TEST(msg-priority-thread   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-ADD_TEST(msg-priority-ucontext ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-ADD_TEST(msg-properties-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-ADD_TEST(msg-properties-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-ADD_TEST(msg-properties-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-ADD_TEST(msg-icomms-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-ADD_TEST(msg-icomms-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-ADD_TEST(msg-icomms-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-ADD_TEST(msg-actions-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-ADD_TEST(msg-actions-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-ADD_TEST(msg-actions-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-ADD_TEST(msg-masterslave-cpu-ti-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
-ADD_TEST(msg-masterslave-cpu-ti-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
-ADD_TEST(msg-masterslave-cpu-ti-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
-ADD_TEST(msg-trace-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
-ADD_TEST(msg-trace-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
-ADD_TEST(msg-trace-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
-ADD_TEST(msg-token-ring-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
-ADD_TEST(msg-token-ring-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
-ADD_TEST(msg-token-ring-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+ADD_TEST(msg-sendrecv-CLM03-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+ADD_TEST(msg-sendrecv-Vegas-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+ADD_TEST(msg-sendrecv-Reno-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+ADD_TEST(msg-suspend-thread    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+ADD_TEST(msg-masterslave-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+ADD_TEST(msg-masterslave-forwarder-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+ADD_TEST(msg-masterslave-failure-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+ADD_TEST(msg-masterslave-bypass-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+ADD_TEST(msg-masterslave-mailbox-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(msg-sendrecv-CLM03-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+       ADD_TEST(msg-sendrecv-Vegas-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+       ADD_TEST(msg-sendrecv-Reno-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+       ADD_TEST(msg-suspend-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+       ADD_TEST(msg-masterslave-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+       ADD_TEST(msg-masterslave-forwarder-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+       ADD_TEST(msg-masterslave-failure-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+       ADD_TEST(msg-masterslave-bypass-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+       ADD_TEST(msg-masterslave-mailbox-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+endif(HAVE_UCONTEXT_H)
+
+if(HAVE_RAWCTX)
+  ADD_TEST(msg-sendrecv-CLM03-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+  ADD_TEST(msg-sendrecv-Vegas-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+  ADD_TEST(msg-sendrecv-Reno-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+  ADD_TEST(msg-suspend-raw             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+  ADD_TEST(msg-masterslave-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+  ADD_TEST(msg-masterslave-forwarder-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+  ADD_TEST(msg-masterslave-failure-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+  ADD_TEST(msg-masterslave-bypass-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+  ADD_TEST(msg-masterslave-mailbox-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+endif(HAVE_RAWCTX)
+
+if (enable_pcre)
+  ADD_TEST(msg-masterslave-vivaldi-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+  ADD_TEST(msg-token-ring-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+  if(HAVE_RAWCTX)
+    ADD_TEST(msg-masterslave-vivaldi-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+    ADD_TEST(msg-token-ring-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+  endif(HAVE_RAWCTX)
+  if(HAVE_UCONTEXT_H)
+       ADD_TEST(msg-masterslave-vivaldi-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+       ADD_TEST(msg-token-ring-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring         --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+  endif(HAVE_UCONTEXT_H)
+endif (enable_pcre)
+
+ADD_TEST(msg-masterslave-multicore-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+ADD_TEST(msg-migration-thread  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+ADD_TEST(msg-ptask-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+ADD_TEST(msg-priority-thread   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+ADD_TEST(msg-properties-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+ADD_TEST(msg-icomms-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+ADD_TEST(msg-actions-thread    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+ADD_TEST(msg-masterslave-cpu-ti-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
+ADD_TEST(msg-trace-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
+ADD_TEST(msg-chord-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+ADD_TEST(msg-chord-thread-parallel     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --cfg contexts/nthreads:4       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(msg-masterslave-multicore-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+       ADD_TEST(msg-migration-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+       ADD_TEST(msg-ptask-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+       ADD_TEST(msg-priority-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+       ADD_TEST(msg-properties-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+       ADD_TEST(msg-icomms-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+       ADD_TEST(msg-actions-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+       ADD_TEST(msg-masterslave-cpu-ti-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
+       ADD_TEST(msg-trace-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
+       ADD_TEST(msg-chord-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+       ADD_TEST(msg-chord-ucontext-parallel    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --cfg contexts/nthreads:4       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+  ADD_TEST(msg-masterslave-multicore-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+  ADD_TEST(msg-migration-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+  ADD_TEST(msg-ptask-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+  ADD_TEST(msg-priority-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+  ADD_TEST(msg-actions-raw             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+  ADD_TEST(msg-icomms-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms     --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+  ADD_TEST(msg-properties-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+  ADD_TEST(msg-masterslave-cpu-ti-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave    --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh)
+  ADD_TEST(msg-trace-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg trace/trace.tesh)
+  ADD_TEST(msg-chord-raw       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+  ADD_TEST(msg-chord-raw-parallel      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw      --cfg contexts/nthreads:4       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord  --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+endif(HAVE_RAWCTX)
 
 IF(${ARCH_32_BITS})
-ADD_TEST(gras-ping-sg-32-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
-ADD_TEST(gras-ping-sg-32-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
-ADD_TEST(gras-ping-sg-32-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
-ADD_TEST(gras-rpc-sg-32-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
-ADD_TEST(gras-rpc-sg-32-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
-ADD_TEST(gras-rpc-sg-32-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
-ADD_TEST(gras-spawn-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
-ADD_TEST(gras-spawn-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
-ADD_TEST(gras-spawn-sg-32-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
-ADD_TEST(gras-timer-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
-ADD_TEST(gras-timer-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
-ADD_TEST(gras-timer-sg-32-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
-ADD_TEST(gras-chrono-sg-32-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
-ADD_TEST(gras-chrono-sg-32-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
-ADD_TEST(gras-chrono-sg-32-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
-ADD_TEST(gras-simple-token-sg-32-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
-ADD_TEST(gras-simple-token-sg-32-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
-ADD_TEST(gras-simple-token-sg-32-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
-ADD_TEST(gras-mmrpc-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
-ADD_TEST(gras-mmrpc-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
-ADD_TEST(gras-mmrpc-sg-32-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
-ADD_TEST(gras-all2all-sg-32-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
-ADD_TEST(gras-all2all-sg-32-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
-ADD_TEST(gras-all2all-sg-32-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
-ADD_TEST(gras-pmm-sg-32-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
-ADD_TEST(gras-pmm-sg-32-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
-ADD_TEST(gras-pmm-sg-32-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
-ADD_TEST(gras-synchro-sg-32-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
-ADD_TEST(gras-synchro-sg-32-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
-ADD_TEST(gras-synchro-sg-32-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
+ADD_TEST(gras-ping-sg-32-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
+ADD_TEST(gras-rpc-sg-32-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
+ADD_TEST(gras-spawn-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
+ADD_TEST(gras-timer-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
+ADD_TEST(gras-chrono-sg-32-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
+ADD_TEST(gras-simple-token-sg-32-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
+ADD_TEST(gras-mmrpc-sg-32-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
+ADD_TEST(gras-all2all-sg-32-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
+ADD_TEST(gras-pmm-sg-32-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
+ADD_TEST(gras-synchro-sg-32-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(gras-ping-sg-32-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
+       ADD_TEST(gras-rpc-sg-32-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
+       ADD_TEST(gras-spawn-sg-32-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
+       ADD_TEST(gras-timer-sg-32-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
+       ADD_TEST(gras-chrono-sg-32-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
+       ADD_TEST(gras-simple-token-sg-32-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
+       ADD_TEST(gras-mmrpc-sg-32-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
+       ADD_TEST(gras-all2all-sg-32-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
+       ADD_TEST(gras-pmm-sg-32-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
+       ADD_TEST(gras-synchro-sg-32-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+  ADD_TEST(gras-ping-sg-32-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_32.tesh)
+  ADD_TEST(gras-rpc-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_32.tesh)
+  ADD_TEST(gras-spawn-sg-32-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_32.tesh)
+  ADD_TEST(gras-timer-sg-32-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_32.tesh)
+  ADD_TEST(gras-chrono-sg-32-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_32.tesh)
+  ADD_TEST(gras-simple-token-sg-32-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_32.tesh)
+  ADD_TEST(gras-mmrpc-sg-32-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_32.tesh)
+  ADD_TEST(gras-all2all-sg-32-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_32.tesh)
+  ADD_TEST(gras-pmm-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_32.tesh)
+  ADD_TEST(gras-synchro-sg-32-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_32.tesh)
+endif(HAVE_RAWCTX)
+
 ELSE(${ARCH_32_BITS})
-ADD_TEST(gras-ping-sg-64-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
-ADD_TEST(gras-ping-sg-64-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
-ADD_TEST(gras-ping-sg-64-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
-ADD_TEST(gras-rpc-sg-64-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
-ADD_TEST(gras-rpc-sg-64-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
-ADD_TEST(gras-rpc-sg-64-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
-ADD_TEST(gras-spawn-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
-ADD_TEST(gras-spawn-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
-ADD_TEST(gras-spawn-sg-64-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
-ADD_TEST(gras-timer-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
-ADD_TEST(gras-timer-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
-ADD_TEST(gras-timer-sg-64-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
-ADD_TEST(gras-chrono-sg-64-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
-ADD_TEST(gras-chrono-sg-64-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
-ADD_TEST(gras-chrono-sg-64-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
-ADD_TEST(gras-simple-token-sg-64-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
-ADD_TEST(gras-simple-token-sg-64-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
-ADD_TEST(gras-simple-token-sg-64-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
-ADD_TEST(gras-mmrpc-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
-ADD_TEST(gras-mmrpc-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
-ADD_TEST(gras-mmrpc-sg-64-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
-ADD_TEST(gras-all2all-sg-64-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
-ADD_TEST(gras-all2all-sg-64-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
-ADD_TEST(gras-all2all-sg-64-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
-ADD_TEST(gras-pmm-sg-64-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
-ADD_TEST(gras-pmm-sg-64-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
-ADD_TEST(gras-pmm-sg-64-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
-ADD_TEST(gras-synchro-sg-64-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
-ADD_TEST(gras-synchro-sg-64-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
-ADD_TEST(gras-synchro-sg-64-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
+ADD_TEST(gras-ping-sg-64-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
+ADD_TEST(gras-rpc-sg-64-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
+ADD_TEST(gras-spawn-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
+ADD_TEST(gras-timer-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
+ADD_TEST(gras-chrono-sg-64-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
+ADD_TEST(gras-simple-token-sg-64-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
+ADD_TEST(gras-mmrpc-sg-64-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
+ADD_TEST(gras-all2all-sg-64-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
+ADD_TEST(gras-pmm-sg-64-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
+ADD_TEST(gras-synchro-sg-64-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(gras-ping-sg-64-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
+       ADD_TEST(gras-rpc-sg-64-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
+       ADD_TEST(gras-spawn-sg-64-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
+       ADD_TEST(gras-timer-sg-64-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
+       ADD_TEST(gras-chrono-sg-64-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
+       ADD_TEST(gras-simple-token-sg-64-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
+       ADD_TEST(gras-mmrpc-sg-64-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
+       ADD_TEST(gras-all2all-sg-64-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
+       ADD_TEST(gras-pmm-sg-64-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
+       ADD_TEST(gras-synchro-sg-64-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+  ADD_TEST(gras-ping-sg-64-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/ping      --cd ${CMAKE_BINARY_DIR}/examples/gras/ping ${CMAKE_HOME_DIRECTORY}/examples/gras/ping/test_sg_64.tesh)
+  ADD_TEST(gras-rpc-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/rpc       --cd ${CMAKE_BINARY_DIR}/examples/gras/rpc ${CMAKE_HOME_DIRECTORY}/examples/gras/rpc/test_sg_64.tesh)
+  ADD_TEST(gras-spawn-sg-64-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/spawn     --cd ${CMAKE_BINARY_DIR}/examples/gras/spawn ${CMAKE_HOME_DIRECTORY}/examples/gras/spawn/test_sg_64.tesh)
+  ADD_TEST(gras-timer-sg-64-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/timer     --cd ${CMAKE_BINARY_DIR}/examples/gras/timer ${CMAKE_HOME_DIRECTORY}/examples/gras/timer/test_sg_64.tesh)
+  ADD_TEST(gras-chrono-sg-64-raw               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/chrono    --cd ${CMAKE_BINARY_DIR}/examples/gras/chrono ${CMAKE_HOME_DIRECTORY}/examples/gras/chrono/test_sg_64.tesh)
+  ADD_TEST(gras-simple-token-sg-64-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token     --cd ${CMAKE_BINARY_DIR}/examples/gras/mutual_exclusion/simple_token ${CMAKE_HOME_DIRECTORY}/examples/gras/mutual_exclusion/simple_token/test_sg_64.tesh)
+  ADD_TEST(gras-mmrpc-sg-64-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc     --cd ${CMAKE_BINARY_DIR}/examples/gras/mmrpc ${CMAKE_HOME_DIRECTORY}/examples/gras/mmrpc/test_sg_64.tesh)
+  ADD_TEST(gras-all2all-sg-64-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/all2all   --cd ${CMAKE_BINARY_DIR}/examples/gras/all2all ${CMAKE_HOME_DIRECTORY}/examples/gras/all2all/test_sg_64.tesh)
+  ADD_TEST(gras-pmm-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/pmm       --cd ${CMAKE_BINARY_DIR}/examples/gras/pmm ${CMAKE_HOME_DIRECTORY}/examples/gras/pmm/test_sg_64.tesh)
+  ADD_TEST(gras-synchro-sg-64-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/synchro   --cd ${CMAKE_BINARY_DIR}/examples/gras/synchro ${CMAKE_HOME_DIRECTORY}/examples/gras/synchro/test_sg_64.tesh)
+endif(HAVE_RAWCTX)
+
 ENDIF(${ARCH_32_BITS})
-ADD_TEST(gras-properties-sg-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
-ADD_TEST(gras-properties-sg-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
-ADD_TEST(gras-properties-sg-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
+ADD_TEST(gras-properties-sg-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(gras-properties-sg-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+  ADD_TEST(gras-properties-sg-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/gras/properties        --cd ${CMAKE_BINARY_DIR}/examples/gras/properties ${CMAKE_HOME_DIRECTORY}/examples/gras/properties/test_sg.tesh)
+endif(HAVE_RAWCTX)
 
 # amok examples
-ADD_TEST(amok-bandwidth-rl-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_rl.tesh)
-ADD_TEST(amok-bandwidth-rl-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_rl.tesh)
-ADD_TEST(amok-bandwidth-rl-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_rl.tesh)
-ADD_TEST(amok-saturate-rl-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_rl.tesh)
-ADD_TEST(amok-saturate-rl-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_rl.tesh)
-ADD_TEST(amok-saturate-rl-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_rl.tesh)
+ADD_TEST(amok-bandwidth-rl     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_rl.tesh)
+ADD_TEST(amok-saturate-rl      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_rl.tesh)
+
 IF(${ARCH_32_BITS})
-ADD_TEST(amok-bandwidth-sg-32-raw              ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
-ADD_TEST(amok-bandwidth-sg-32-thread   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
-ADD_TEST(amok-bandwidth-sg-32-ucontext ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
-ADD_TEST(amok-saturate-sg-32-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
-ADD_TEST(amok-saturate-sg-32-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
-ADD_TEST(amok-saturate-sg-32-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
+  ADD_TEST(amok-bandwidth-sg-32-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
+  ADD_TEST(amok-saturate-sg-32-thread  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
+  if(HAVE_RAWCTX)
+    ADD_TEST(amok-bandwidth-sg-32-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
+    ADD_TEST(amok-saturate-sg-32-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
+  endif(HAVE_RAWCTX)
+  if(HAVE_UCONTEXT_H)
+       ADD_TEST(amok-bandwidth-sg-32-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_32.tesh)
+       ADD_TEST(amok-saturate-sg-32-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_32.tesh)
+  endif(HAVE_UCONTEXT_H)
 ELSE(${ARCH_32_BITS})
-ADD_TEST(amok-bandwidth-sg-64-raw              ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
-ADD_TEST(amok-bandwidth-sg-64-thread   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
-ADD_TEST(amok-bandwidth-sg-64-ucontext ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
-ADD_TEST(amok-saturate-sg-64-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
-ADD_TEST(amok-saturate-sg-64-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
-ADD_TEST(amok-saturate-sg-64-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
+  ADD_TEST(amok-bandwidth-sg-64-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
+  ADD_TEST(amok-saturate-sg-64-thread  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
+  if(HAVE_RAWCTX)
+    ADD_TEST(amok-bandwidth-sg-64-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
+    ADD_TEST(amok-saturate-sg-64-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
+  endif(HAVE_RAWCTX)
+  if(HAVE_UCONTEXT_H)
+         ADD_TEST(amok-saturate-sg-64-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/saturate/saturate_sg_64.tesh)
+         ADD_TEST(amok-bandwidth-sg-64-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/amok   --cd ${CMAKE_BINARY_DIR}/examples/amok ${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth/bandwidth_sg_64.tesh)
+  endif(HAVE_UCONTEXT_H)
 ENDIF(${ARCH_32_BITS})
 
 # simdag examples
-ADD_TEST(simdag-test-simdag-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
-ADD_TEST(simdag-test-simdag-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
-ADD_TEST(simdag-test-simdag-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
-ADD_TEST(simdag-test-simdag2-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
-ADD_TEST(simdag-test-simdag2-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
-ADD_TEST(simdag-test-simdag2-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
-ADD_TEST(simdag-test-simdag-seq-access-raw             ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
-ADD_TEST(simdag-test-simdag-seq-access-thread  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
-ADD_TEST(simdag-test-simdag-seq-access-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
-ADD_TEST(simdag-test-prop-raw          ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
-ADD_TEST(simdag-test-prop-thread       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
-ADD_TEST(simdag-test-prop-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
-ADD_TEST(simdag-minmin-test-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling  --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
-ADD_TEST(simdag-minmin-test-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling  --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
-ADD_TEST(simdag-minmin-test-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling  --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
+ADD_TEST(simdag-test-simdag            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
+ADD_TEST(simdag-test-simdag2           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
+ADD_TEST(simdag-test-simdag-seq-access         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
+ADD_TEST(simdag-test-prop              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag         --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
+ADD_TEST(simdag-minmin-test            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling  --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
 
 if(HAVE_GTNETS)
-ADD_TEST(msg-gtnets-waxman-raw         ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-ADD_TEST(msg-gtnets-waxman-thread      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-ADD_TEST(msg-gtnets-waxman-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-ADD_TEST(msg-gtnets-dogbone-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-ADD_TEST(msg-gtnets-dogbone-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-ADD_TEST(msg-gtnets-dogbone-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-ADD_TEST(msg-gtnets-onelink-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-ADD_TEST(msg-gtnets-onelink-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-ADD_TEST(msg-gtnets-onelink-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-ADD_TEST(msg-gtnets-dogbone-lv08-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-ADD_TEST(msg-gtnets-dogbone-lv08-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-ADD_TEST(msg-gtnets-dogbone-lv08-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-ADD_TEST(msg-gtnets-onelink-lv08-raw           ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
-ADD_TEST(msg-gtnets-onelink-lv08-thread        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
-ADD_TEST(msg-gtnets-onelink-lv08-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
-ADD_TEST(msg-gtnets-fullduplex-raw             ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
-ADD_TEST(msg-gtnets-fullduplex-thread  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
-ADD_TEST(msg-gtnets-fullduplex-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
+ADD_TEST(msg-gtnets-waxman-thread      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+ADD_TEST(msg-gtnets-dogbone-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+ADD_TEST(msg-gtnets-onelink-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+ADD_TEST(msg-gtnets-dogbone-lv08-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+ADD_TEST(msg-gtnets-onelink-lv08-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+ADD_TEST(msg-gtnets-fullduplex-thread  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(msg-gtnets-waxman-ucontext     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+       ADD_TEST(msg-gtnets-dogbone-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+       ADD_TEST(msg-gtnets-onelink-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+       ADD_TEST(msg-gtnets-dogbone-lv08-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+       ADD_TEST(msg-gtnets-onelink-lv08-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+       ADD_TEST(msg-gtnets-fullduplex-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+       ADD_TEST(msg-gtnets-waxman-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+       ADD_TEST(msg-gtnets-dogbone-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+       ADD_TEST(msg-gtnets-onelink-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+       ADD_TEST(msg-gtnets-dogbone-lv08-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+       ADD_TEST(msg-gtnets-onelink-lv08-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+       ADD_TEST(msg-gtnets-fullduplex-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-fullduplex.tesh)
+endif(HAVE_RAWCTX)
+
   if(HAVE_TRACING)
-  ADD_TEST(msg-tracing-gtnets-waxman                   ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg       --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh)
-  ADD_TEST(msg-tracing-gtnets-dogbone                  ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg       --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh)
-  ADD_TEST(msg-tracing-gtnets-onelink                  ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg       --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh)
-  ADD_TEST(msg-tracing-gtnets-dogbone-lv08             ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg       --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh)
-  ADD_TEST(msg-tracing-gtnets-onelink-lv08             ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg       --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh)
+  ADD_TEST(msg-tracing-gtnets-waxman                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg        --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh)
+  ADD_TEST(msg-tracing-gtnets-dogbone                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg        --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh)
+  ADD_TEST(msg-tracing-gtnets-onelink                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg        --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh)
+  ADD_TEST(msg-tracing-gtnets-dogbone-lv08             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg        --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh)
+  ADD_TEST(msg-tracing-gtnets-onelink-lv08             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg        --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh)
   endif(HAVE_TRACING)
 endif(HAVE_GTNETS)
 
+if(HAVE_NS3)
+ADD_TEST(msg-ns3-thread            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread           --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+ADD_TEST(msg-ns3-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+ADD_TEST(msg-ns3-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}        --cfg contexts/factory:raw              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg    --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+endif(HAVE_NS3)
+
 IF(HAVE_TRACING)
-  ADD_TEST(tracing-ms                          ${CMAKE_BINARY_DIR}/bin/tesh    --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh)
-  ADD_TEST(tracing-categories          ${CMAKE_BINARY_DIR}/bin/tesh    --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh)
-  ADD_TEST(tracing-volume                      ${CMAKE_BINARY_DIR}/bin/tesh    --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/volume.tesh)
-  ADD_TEST(tracing-tasks                       ${CMAKE_BINARY_DIR}/bin/tesh    --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/tasks.tesh)
-  ADD_TEST(tracing-process-migration ${CMAKE_BINARY_DIR}/bin/tesh      --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh)
+  ADD_TEST(tracing-ms                          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh)
+  ADD_TEST(tracing-categories          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh)
+  ADD_TEST(tracing-tasks                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/tasks.tesh)
+  ADD_TEST(tracing-process-migration ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}       --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg        --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh)
+  ADD_TEST(graphicator ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
 ENDIF(HAVE_TRACING)
 
 # Lua examples
 if(HAVE_LUA)
-ADD_TEST(lua-masterslave                               ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh)
-ADD_TEST(lua-mult-matrix                               ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh)
-ADD_TEST(lua-masterslave-bypass                ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh)
-ADD_TEST(lua-msg-masterslave-console   ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/examples/msg/masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_console.tesh)
+ADD_TEST(lua-masterslave                               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh)
+ADD_TEST(lua-mult-matrix                               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh)
+ADD_TEST(lua-masterslave-bypass                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh)
+ADD_TEST(lua-msg-masterslave-console   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/msg/masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave  ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_console.tesh)
 set_tests_properties(lua-masterslave                           PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
 set_tests_properties(lua-mult-matrix                           PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
 set_tests_properties(lua-masterslave-bypass            PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
 set_tests_properties(lua-msg-masterslave-console       PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
 endif(HAVE_LUA)
 
-add_test(graphicator ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
-
-
 # END TESH TESTS
 
 if(enable_smpi)
 # smpi examples
-ADD_TEST(smpi-bcast-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
-ADD_TEST(smpi-bcast-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
-ADD_TEST(smpi-bcast-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
-ADD_TEST(smpi-reduce-raw               ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
-ADD_TEST(smpi-reduce-thread    ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
-ADD_TEST(smpi-reduce-ucontext  ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
+ADD_TEST(smpi-bcast-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
+ADD_TEST(smpi-reduce-thread    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread                   --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
+if(HAVE_RAWCTX)
+  ADD_TEST(smpi-bcast-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
+  ADD_TEST(smpi-reduce-raw             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw                      --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
+endif(HAVE_RAWCTX)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(smpi-bcast-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh)
+       ADD_TEST(smpi-reduce-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext                 --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh)
+endif(HAVE_UCONTEXT_H)
 if(HAVE_TRACING)
-  ADD_TEST(smpi-tracing-ptp ${CMAKE_BINARY_DIR}/bin/tesh --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_traced.tesh)
+  ADD_TEST(smpi-tracing-ptp ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_traced.tesh)
 endif(HAVE_TRACING)
 endif(enable_smpi)
                                                                
 # examples/msg/mc
 if(HAVE_MC)
-ADD_TEST(mc-bugged1-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
-ADD_TEST(mc-bugged1-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
-ADD_TEST(mc-bugged1-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
-ADD_TEST(mc-bugged2-raw                ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
-ADD_TEST(mc-bugged2-thread     ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
-ADD_TEST(mc-bugged2-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
-ADD_TEST(mc-centralized-raw            ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
-ADD_TEST(mc-centralized-thread ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
-ADD_TEST(mc-centralized-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh    --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
+ADD_TEST(mc-bugged1-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
+ADD_TEST(mc-bugged2-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
+ADD_TEST(mc-centralized-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:thread           --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
+if(HAVE_UCONTEXT_H)
+       ADD_TEST(mc-bugged1-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
+       ADD_TEST(mc-bugged2-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
+       ADD_TEST(mc-centralized-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
+endif(HAVE_UCONTEXT_H)
+if(HAVE_RAWCTX)
+  ADD_TEST(mc-bugged1-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
+  ADD_TEST(mc-bugged2-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
+  ADD_TEST(mc-centralized-raw          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION}     --cfg contexts/factory:raw              --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc     --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
+endif(HAVE_RAWCTX)
 endif(HAVE_MC)
 
 
@@ -407,16 +430,42 @@ endif(HAVE_MC)
 ###
 
 # Amok is broken in RL since before v3.3 (should fix it one day)
-set_tests_properties(amok-bandwidth-rl-raw amok-bandwidth-rl-thread amok-bandwidth-rl-ucontext PROPERTIES WILL_FAIL true)
-set_tests_properties(amok-saturate-rl-raw amok-saturate-rl-thread amok-saturate-rl-ucontext PROPERTIES WILL_FAIL true)
+set_tests_properties(amok-bandwidth-rl amok-saturate-rl PROPERTIES WILL_FAIL true)
 if(${ARCH_32_BITS})
-set_tests_properties(amok-bandwidth-sg-32-raw amok-bandwidth-sg-32-thread amok-bandwidth-sg-32-ucontext PROPERTIES WILL_FAIL true)   
-set_tests_properties(amok-saturate-sg-32-raw amok-saturate-sg-32-thread amok-saturate-sg-32-ucontext PROPERTIES WILL_FAIL true)  
+  set_tests_properties(amok-bandwidth-sg-32-thread PROPERTIES WILL_FAIL true)   
+  set_tests_properties(amok-saturate-sg-32-thread  PROPERTIES WILL_FAIL true)
+  if(HAVE_UCONTEXT_H)
+       set_tests_properties(amok-bandwidth-sg-32-ucontext amok-saturate-sg-32-ucontext PROPERTIES WILL_FAIL true) 
+  endif(HAVE_UCONTEXT_H)
+  if(HAVE_RAWCTX)
+    set_tests_properties(amok-bandwidth-sg-32-raw amok-saturate-sg-32-raw PROPERTIES WILL_FAIL true)   
+  endif(HAVE_RAWCTX)   
 else(${ARCH_32_BITS})
-set_tests_properties(amok-bandwidth-sg-64-raw amok-bandwidth-sg-64-thread amok-bandwidth-sg-64-ucontext PROPERTIES WILL_FAIL true)   
-set_tests_properties(amok-saturate-sg-64-raw amok-saturate-sg-64-thread amok-saturate-sg-64-ucontext PROPERTIES WILL_FAIL true)  
+  set_tests_properties(amok-bandwidth-sg-64-thread PROPERTIES WILL_FAIL true)   
+  set_tests_properties(amok-saturate-sg-64-thread PROPERTIES WILL_FAIL true)  
+  if(HAVE_UCONTEXT_H)
+       set_tests_properties(amok-bandwidth-sg-64-ucontext amok-saturate-sg-64-ucontext PROPERTIES WILL_FAIL true) 
+  endif(HAVE_UCONTEXT_H)
+  if(HAVE_RAWCTX)
+    set_tests_properties(amok-bandwidth-sg-64-raw amok-saturate-sg-64-raw PROPERTIES WILL_FAIL true)   
+  endif(HAVE_RAWCTX)   
 endif(${ARCH_32_BITS})
 
+# Those tests are broken : set to "fail" for release v3.6
+if(release)
+if(HAVE_MC)
+       set_tests_properties(mc-bugged1-thread PROPERTIES WILL_FAIL true)
+       set_tests_properties(mc-bugged2-thread PROPERTIES WILL_FAIL true)
+       set_tests_properties(mc-centralized-thread PROPERTIES WILL_FAIL true)
+       if(HAVE_UCONTEXT_H)
+           set_tests_properties(mc-centralized-ucontext PROPERTIES WILL_FAIL true)
+    endif(HAVE_UCONTEXT_H)
+       if(HAVE_RAWCTX)
+           set_tests_properties(mc-centralized-raw PROPERTIES WILL_FAIL true)
+       endif(HAVE_RAWCTX)
+endif(HAVE_MC)
+endif(release)
+
 endif(NOT enable_memcheck)
 
 ADD_TEST(tesh-simdag-full-links01              ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters.xml FULL_LINK)
index e50ed69..9174abb 100644 (file)
@@ -33,7 +33,11 @@ ENABLE_TESTING()
 ADD_TEST(tesh-msg-get-sender               perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite msg/get_sender.tesh)\r
 ADD_TEST(tesh-simdag-reinit-costs              perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite simdag/network/test_reinit_costs.tesh)\r
 ADD_TEST(tesh-simdag-parser                        perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)\r
+\r
+IF(enable_debug)\r
 ADD_TEST(tesh-simdag-parser-bogus-symmetric perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)\r
+ENDIF(enable_debug)\r
+\r
 ADD_TEST(tesh-simdag-parser-sym-full           perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)\r
 ADD_TEST(tesh-simdag-flatifier                 perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)\r
 ADD_TEST(tesh-simdag-full-links                        perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)\r
@@ -74,7 +78,6 @@ ADD_TEST(msg-icomms-waitany ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer3 ${
 IF(HAVE_TRACING)\r
   ADD_TEST(tracing-ms perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh)\r
   ADD_TEST(tracing-categories perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh)\r
-  ADD_TEST(tracing-volume perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/volume.tesh)\r
   ADD_TEST(tracing-tasks perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/tasks.tesh)\r
   ADD_TEST(tracing-process-migration perl ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh)\r
 ENDIF(HAVE_TRACING)\r
index 43a8707..57c7461 100644 (file)
@@ -3,6 +3,59 @@ ${CMAKE_MODULE_PATH}
 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Modules
 )
 
+# x86_64
+# x86
+# i.86
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
+    IF(${ARCH_32_BITS})
+        set(PROCESSOR_i686 1)
+        set(SIMGRID_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+        message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
+    ELSE(${ARCH_32_BITS})
+        message(STATUS "System processor: amd64")
+        set(SIMGRID_SYSTEM_PROCESSOR "amd64")
+        set(PROCESSOR_x86_64 1)
+        set(PROCESSOR_i686 0)
+    ENDIF(${ARCH_32_BITS})          
+    set(HAVE_RAWCTX 1)
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+    message(STATUS "System processor: alpha")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+    # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
+    message(STATUS "System processor: arm")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+    # mips* machines are bi-endian mostly so processor does not tell
+    # endianess of the underlying system.
+    message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+    message(STATUS "System processor: ppc64")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+    message(STATUS "System processor: ppc")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+    # Both flavours can run on the same processor
+    message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+    message(STATUS "System processor: parisc" "parisc64")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+    # s390 binaries can run on s390x machines
+    message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+    
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+    message(STATUS "System processor: sh")
+    
+ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #PROCESSOR NOT fIND
+    message(STATUS "PROCESSOR NOT FOUND: ${CMAKE_SYSTEM_PROCESSOR}")
+    
+ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
+
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
 
 include(CheckFunctionExists)
@@ -14,9 +67,9 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
-if(enable_pcre)
 include(FindPCRE)
-endif(enable_pcre)
+
+set(HAVE_GTNETS 0)
 if(enable_gtnets)      
        include(FindGTnets)
 endif(enable_gtnets)
@@ -26,10 +79,15 @@ endif(enable_smpi)
 if(enable_lua)
        include(FindLua51Simgrid)
 endif(enable_lua)
+set(HAVE_NS3 0)
+if(enable_ns3)
+       include(FindNS3)
+endif(enable_ns3)
 
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(pthread   pthread_create                  "" pthread)
 CHECK_LIBRARY_EXISTS(pthread   sem_init                                "" HAVE_SEM_INIT_LIB)
+CHECK_LIBRARY_EXISTS(pthread   sem_open                                "" HAVE_SEM_OPEN_LIB)
 CHECK_LIBRARY_EXISTS(pthread   sem_timedwait                   "" HAVE_SEM_TIMEDWAIT_LIB)
 CHECK_LIBRARY_EXISTS(pthread   pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
 CHECK_LIBRARY_EXISTS(rt                clock_gettime                   "" HAVE_POSIX_GETTIME)
@@ -45,6 +103,7 @@ CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
 CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
 CHECK_INCLUDE_FILE("winsock.h" HAVE_WINSOCK_H)
 CHECK_INCLUDE_FILE("winsock2.h" HAVE_WINSOCK2_H)
+CHECK_INCLUDE_FILE("WinDef.h" HAVE_WINDEF_H)
 CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
 CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
@@ -61,7 +120,6 @@ CHECK_INCLUDE_FILE("ucontext.h" HAVE_UCONTEXT_H)
 CHECK_INCLUDE_FILE("stdio.h" HAVE_STDIO_H)
 CHECK_INCLUDE_FILE("linux/futex.h" HAVE_FUTEX_H)
 
-
 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
 CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
 CHECK_FUNCTION_EXISTS(getdtablesize HAVE_GETDTABLESIZE)
@@ -75,6 +133,22 @@ CHECK_FUNCTION_EXISTS(asprintf HAVE_ASPRINTF)
 CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
 CHECK_FUNCTION_EXISTS(makecontext HAVE_MAKECONTEXT)
 CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
+CHECK_FUNCTION_EXISTS(mergesort HAVE_MERGESORT)
+
+#Check if __thread is defined
+exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_thread_storage.c" 
+                       OUTPUT_VARIABLE HAVE_thread_storage_run)
+if(HAVE_thread_storage_run)
+       set(HAVE_THREAD_LOCAL_STORAGE 0)
+else(HAVE_thread_storage_run)
+       set(HAVE_THREAD_LOCAL_STORAGE 1)
+endif(HAVE_thread_storage_run)
+
+# Our usage of mmap is Linux-specific (flag MAP_ANONYMOUS), but kFreeBSD uses a GNU libc
+IF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU")
+  SET(HAVE_MMAP 0)
+  message(STATUS "Warning: MMAP is thought as non functional on this architecture (${CMAKE_SYSTEM})")
+ENDIF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU")
 
 if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
     set(HAVE_UCONTEXT_H 1)
@@ -131,18 +205,51 @@ elseif(pthread)
 endif(pthread)
 
 if(pthread)
-       ### HAVE_SEM_INIT
+       ### Test that we have a way to create semaphores
        
+       if(HAVE_SEM_OPEN_LIB)
+               exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_open.c -lpthread -o testprog"
+                            OUTPUT_VARIABLE HAVE_SEM_OPEN_run)
+               if(HAVE_SEM_OPEN_run)
+                       set(HAVE_SEM_OPEN 0)
+                       message(STATUS "Warning: sem_open not compilable")
+               else(HAVE_SEM_OPEN_run)
+                       exec_program("./testprog" RETURN_VALUE HAVE_SEM_OPEN_run2 OUTPUT_VARIABLE var_compil)
+                       if(HAVE_SEM_OPEN_run2)
+                               set(HAVE_SEM_OPEN 0)
+                               message(STATUS "Warning: sem_open not executable")
+                       else(HAVE_SEM_OPEN_run2)
+                               set(HAVE_SEM_OPEN 1)
+                       endif(HAVE_SEM_OPEN_run2)       
+               endif(HAVE_SEM_OPEN_run)
+        else(HAVE_SEM_OPEN_LIB)
+               set(HAVE_SEM_OPEN 0)
+       endif(HAVE_SEM_OPEN_LIB)
+
        if(HAVE_SEM_INIT_LIB)
-               exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c" OUTPUT_VARIABLE HAVE_SEM_INIT_run)
+               exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -lpthread -o testprog"
+                            OUTPUT_VARIABLE HAVE_SEM_INIT_run)
                if(HAVE_SEM_INIT_run)
                        set(HAVE_SEM_INIT 0)
+                       message(STATUS "Warning: sem_init not compilable")
                else(HAVE_SEM_INIT_run)
-                       set(HAVE_SEM_INIT 1)
+                       exec_program("./testprog" RETURN_VALUE HAVE_SEM_INIT_run OUTPUT_VARIABLE var_compil)
+                       if(HAVE_SEM_INIT_run)
+                               set(HAVE_SEM_INIT 0)
+                               message(STATUS "Warning: sem_init not executable")
+                       else(HAVE_SEM_INIT_run)
+                               set(HAVE_SEM_INIT 1)
+                       endif(HAVE_SEM_INIT_run)
                endif(HAVE_SEM_INIT_run)
+        else(HAVE_SEM_INIT_LIB)
+               set(HAVE_SEM_INIT 0)
        endif(HAVE_SEM_INIT_LIB)
 
-       ### HAVE_SEM_TIMEDWAIT
+       if(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
+               message(FATAL_ERROR "Semaphores are not usable (neither sem_open nor sem_init is both compilable and executable), but they are mandatory to threads (you may need to mount /dev).")
+       endif(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
+
+       ### Test that we have a way to timewait for semaphores
 
        if(HAVE_SEM_TIMEDWAIT_LIB)
                exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_timedwait.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
@@ -197,11 +304,12 @@ ELSE(CMAKE_CROSSCOMPILING)
                        file(READ "${simgrid_BINARY_DIR}/conftestval" mcsc)
                        STRING(REPLACE "\n" "" mcsc "${mcsc}")
                        if(mcsc)
-                               set(mcsc "yes")
-                       elseif(mcsc)
+                               set(mcsc "yes")
+                               set(HAVE_UCONTEXT_H 1)
+                       else(mcsc)
                                set(mcsc "no")
                        endif(mcsc)
-               else(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
+           else(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
                        set(mcsc "no")
                endif(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
 ENDIF(CMAKE_CROSSCOMPILING)
@@ -241,38 +349,21 @@ endif(pthread)
 ###############
 ## SVN version check
 ##
-if(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
-       find_file(SVN ".svn" ${CMAKE_HOME_DIRECTORY})
-       exec_program("svnversion ${CMAKE_HOME_DIRECTORY}" OUTPUT_VARIABLE "SVN_VERSION")
-       message(STATUS "svn version ${SVN_VERSION}")
-else(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
-       exec_program("git config --get svn-remote.svn.url"
-               OUTPUT_VARIABLE url
-               RETURN_VALUE ret)
-endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
+if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/)
+exec_program("git remote | head -n 1" OUTPUT_VARIABLE remote RETURN_VALUE ret)
+exec_program("git config --get remote.${remote}.url" OUTPUT_VARIABLE url RETURN_VALUE ret)
 
 if(url)
        exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --oneline -1" OUTPUT_VARIABLE "GIT_VERSION")
+       message(STATUS "Git version: ${GIT_VERSION}")
        exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log -n 1 --format=%ai ." OUTPUT_VARIABLE "GIT_DATE")
-       
+       message(STATUS "Git date: ${GIT_DATE}")
        string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
        STRING(REPLACE " +0000" "" GIT_DATE ${GIT_DATE})
        STRING(REPLACE " " "~" GIT_DATE ${GIT_DATE})
        STRING(REPLACE ":" "-" GIT_DATE ${GIT_DATE})
-       
-       exec_program("git svn info" ${CMAKE_HOME_DIRECTORY}
-               OUTPUT_VARIABLE "GIT_SVN_VERSION")
-       string(REPLACE "\n" ";" GIT_SVN_VERSION ${GIT_SVN_VERSION})
-       foreach(line ${GIT_SVN_VERSION})
-               string(REGEX MATCH "^Revision:.*" line_good ${line})
-               if(line_good)
-                       string(REPLACE "Revision: " ""
-                               line_good ${line_good})
-                       set(SVN_VERSION ${line_good})
-               endif(line_good)
-       endforeach(line ${GIT_SVN_VERSION})
 endif(url)
-
+endif(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/)
 
 ###################################
 ## SimGrid and GRAS specific checks
@@ -293,6 +384,36 @@ else(BIGENDIAN)
   set(GRAS_BIGENDIAN 0)
 endif(BIGENDIAN)
 
+# The syntax of this magic string is given in src/gras/DataDesc/ddt_convert.c
+# It kinda matches the values that the gras_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/gras/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)
@@ -318,38 +439,47 @@ 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:")
        SET(GRAS_ARCH_32_BITS 0)
        SET(GRAS_THISARCH 4)
 endif(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:")
+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(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:")
 
 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=5; gras_size=32; gras_arch_name=big32;
+       #gras_arch=6; gras_size=32; gras_arch_name=big32_8;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 5)
+       SET(GRAS_THISARCH 6)
 endif(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:")
 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=6; gras_size=32; gras_arch_name=big32_8_4;
+       #gras_arch=7; gras_size=32; gras_arch_name=big32_8_4;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 6)
+       SET(GRAS_THISARCH 7)
 endif(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:")
 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=7; gras_size=32; gras_arch_name=big32_4;
+       #gras_arch=8; gras_size=32; gras_arch_name=big32_4;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 7)
+       SET(GRAS_THISARCH 8)
 endif(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:")
 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=8; gras_size=32; gras_arch_name=big32_2;
+       #gras_arch=9; gras_size=32; gras_arch_name=big32_2;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 8)
+       SET(GRAS_THISARCH 9)
 endif(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:") 
 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=9; gras_size=64; gras_arch_name=big64;
+       #gras_arch=10; gras_size=64; gras_arch_name=big64;
        SET(GRAS_ARCH_32_BITS 0)
-       SET(GRAS_THISARCH 9)
+       SET(GRAS_THISARCH 10)
 endif(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:")
 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=10;gras_size=64; gras_arch_name=big64_8_4;
+       #gras_arch=11; gras_size=64; gras_arch_name=big64_8_4;
        SET(GRAS_ARCH_32_BITS 0)
-       SET(GRAS_THISARCH 10)
+       SET(GRAS_THISARCH 11)
 endif(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:") 
 
+if(GRAS_THISARCH MATCHES "none")
+    message(STATUS "architecture: ${val_big}")
+    message(FATAL_ERROR "GRAS_THISARCH is empty: '${GRAS_THISARCH}'")  
+endif(GRAS_THISARCH MATCHES "none")
 
 # Check architecture signature end
 try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
@@ -377,7 +507,7 @@ set(makecontext_CPPFLAGS_2 "")
 if(HAVE_MAKECONTEXT OR WIN32)
        set(makecontext_CPPFLAGS "-DTEST_makecontext")
        if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-               set(makecontext_CPPFLAGS_2 "-DOSX")
+               set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE")
        endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
        
     if(WIN32 AND __VISUALC__)
@@ -481,9 +611,9 @@ foreach(fct ${diff_va})
            }
            va_end(ap);
        }
-       int main(int argc, char *argv[])
+       int main(void)
        {
-           test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9);
+           test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9);
            exit(0);
        }"
        )
@@ -618,6 +748,16 @@ if(ADDR2LINE)
 set(ADDR2LINE "${ADDR2LINE}/addr2line")
 endif(ADDR2LINE)
 
+
+
+### Check if OSX can compile with ucontext (with gcc 4.[1-5] it is broken)
+if(APPLE)
+    if(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+        message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)")
+        set(HAVE_UCONTEXT_H 0)
+    endif(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
+endif(APPLE)
+
 ### File to create
 
 configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)
@@ -635,7 +775,7 @@ set(includedir ${CMAKE_INSTALL_PREFIX}/include)
 set(top_builddir ${CMAKE_HOME_DIRECTORY})
 set(libdir ${exec_prefix}/lib)
 set(CMAKE_LINKARGS "${CMAKE_BINARY_DIR}/lib")
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:$LD_LIBRARY_PATH")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
 
 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/bin/smpicc @ONLY)
@@ -648,11 +788,19 @@ exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c" OUTPUT_VARIABLE OKITO
 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff" OUTPUT_VARIABLE OKITOKI)
 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE OKITOKI)
 
-set(generate_files_to_clean
-${CMAKE_BINARY_DIR}/src/context_sysv_config.h
-${CMAKE_BINARY_DIR}/src/gras_config.h
-${CMAKE_BINARY_DIR}/include/simgrid_config.h
-${CMAKE_BINARY_DIR}/include/smpi/smpif.h
+set(generated_headers_to_install
+       ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
+       ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
+)
+
+set(generated_headers
+    ${CMAKE_CURRENT_BINARY_DIR}/src/context_sysv_config.h
+    ${CMAKE_CURRENT_BINARY_DIR}/src/gras_config.h
+)
+
+set(generated_files_to_clean
+${generated_headers}
+${generated_headers_to_install}
 ${CMAKE_BINARY_DIR}/bin/smpicc
 ${CMAKE_BINARY_DIR}/bin/smpif2c
 ${CMAKE_BINARY_DIR}/bin/smpiff
@@ -670,14 +818,24 @@ else("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
        configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
        configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
        configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY)
+       configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY)
        
-       set(generate_files_to_clean
-               ${generate_files_to_clean}
+       set(generated_files_to_clean
+               ${generated_files_to_clean}
                ${CMAKE_BINARY_DIR}/examples/smpi/hostfile
                ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml
                ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
+               ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml
                )
 endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
 
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
-"${generate_files_to_clean}")
+"${generated_files_to_clean}")
+
+
+IF(${ARCH_32_BITS})
+  set(WIN_ARCH "32")
+ELSE(${ARCH_32_BITS})
+    set(WIN_ARCH "64")
+ENDIF(${ARCH_32_BITS})
+configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/simgrid.nsi.in"       "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)
index e443309..c43b79a 100644 (file)
@@ -8,7 +8,6 @@ set(EXTRA_DIST
        src/xbt/fifo_private.h
        src/xbt/graph_private.h
        src/xbt/graphxml_parse.c
-       src/xbt/graphxml.l
        src/xbt/graphxml.c
        src/xbt/graphxml.dtd
        src/xbt/log_private.h
@@ -40,7 +39,6 @@ set(EXTRA_DIST
        src/surf/trace_mgr_private.h
        src/surf/surf_private.h
        src/surf/surfxml_parse.c
-       src/surf/simgrid_dtd.l
        src/surf/simgrid_dtd.c
        src/surf/simgrid.dtd
        src/surf/network_private.h
@@ -49,6 +47,7 @@ set(EXTRA_DIST
        src/surf/gtnets/gtnets_simulator.h
        src/surf/gtnets/gtnets_topology.h
        src/surf/cpu_ti_private.h
+       src/surf/surf_routing_private.h
        src/include/surf/surf_resource.h
        src/include/surf/datatypes.h
        src/include/surf/maxmin.h
@@ -67,7 +66,6 @@ set(EXTRA_DIST
        src/msg/mailbox.h
        src/simdag/private.h
        src/simdag/dax.dtd
-       src/simdag/dax_dtd.l
        src/simdag/dax_dtd.h
        src/simdag/dax_dtd.c
        src/gras/DataDesc/ddt_parse.yy.l
@@ -90,6 +88,20 @@ set(EXTRA_DIST
        src/smpi/smpi_mpi_dt_private.h
        src/smpi/README
        src/mk_supernovae.pl
+       
+       examples/gras/ping/ping.h
+       examples/gras/console/ping.h
+       examples/gras/mmrpc/mmrpc.h
+
+       tools/gras/gras_stub_generator.h
+       tools/tesh/run_context.h  
+       tools/tesh/tesh.h
+       
+       src/surf/network_ns3_private.h
+       src/surf/ns3/ns3_interface.h
+       src/surf/ns3/ns3_simulator.h
+       src/surf/ns3/my-point-to-point-helper.h
+       src/surf/ns3/red-queue.h
 )
 
 set(XBT_RL_SRC 
@@ -183,10 +195,23 @@ set(GTNETS_SRC
        src/surf/network_gtnets.c
 )
 
+set(NS3_SRC
+       src/surf/network_ns3.c
+       src/surf/ns3/ns3_interface.cc
+       src/surf/ns3/ns3_simulator.cc
+       src/surf/ns3/red-queue.cc
+       src/surf/ns3/my-point-to-point-helper.cc
+)
+       
 set(SURF_SRC 
        src/surf/surf_model.c
        src/surf/surf_action.c
        src/surf/surf_routing.c
+       src/surf/surf_routing_full.c
+       src/surf/surf_routing_floyd.c
+       src/surf/surf_routing_rulebased.c
+       src/surf/surf_routing_dijkstra.c
+       src/surf/surf_routing_none.c
        src/surf/surf_config.c
        src/surf/maxmin.c
        src/surf/fair_bottleneck.c
@@ -307,8 +332,6 @@ set(TRACING_SRC
        src/instr/instr_paje_trace.c
        src/instr/instr_msg_task.c
        src/instr/instr_msg_process.c
-       src/instr/instr_msg_volume.c
-       src/instr/instr_smx.c
        src/instr/instr_surf.c
        src/instr/instr_smpi.c
        src/instr/instr_simdag.c
@@ -344,7 +367,7 @@ set(RNGSTREAM_SRC
        src/rngstreams/RngStream.c
 )
 
-set(install_HEADERS
+set(headers_to_install
        include/xbt/misc.h
        include/xbt/sysdep.h
        include/xbt/virtu.h
@@ -364,6 +387,7 @@ set(install_HEADERS
        include/xbt/graph.h
        include/xbt/fifo.h
        include/xbt/swag.h
+       include/xbt/lib.h
        include/xbt/matrix.h
        include/xbt/peer.h
        include/xbt/config.h
@@ -384,11 +408,12 @@ set(install_HEADERS
        include/simdag/simdag.h
        include/simdag/datatypes.h
        include/smpi/smpi.h
-       ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
        include/smpi/mpi.h
        include/smpi/mpif.h
+       include/smpi/smpi_cocci.h
        include/surf/surfxml_parse.h
        include/surf/simgrid_dtd.h
+       include/surf/surf_routing.h
        include/gras/datadesc.h
        include/gras/transport.h
        include/gras/virtu.h
@@ -400,13 +425,16 @@ set(install_HEADERS
        include/amok/peermanagement.h
        include/amok/bandwidth.h
        include/instr/instr.h
-       ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
        include/gras.h 
        include/xbt.h
        include/simix/simix.h
        include/simix/datatypes.h
        include/simix/context.h
 )
+set(source_of_generated_headers
+       include/simgrid_config.h.in
+       include/smpi/smpif.h.in
+       src/context_sysv_config.h.in)
 
 ### depend of some variables setted upper
 # -->CONTEXT_THREADS CONTEXT_UCONTEXT
@@ -472,6 +500,13 @@ if(HAVE_MC)
                )
 endif(HAVE_MC)
 
+if(HAVE_NS3)
+       set(simgrid_sources
+               ${simgrid_sources}
+               ${NS3_SRC}
+       )
+endif(HAVE_NS3)
+
 # WINDOWS
 if(WIN32)
        set(simgrid_sources
@@ -514,13 +549,20 @@ file(GLOB_RECURSE examples_to_install_in_doc
 "examples/*README"
 )
 
+
+    
 set(DOC_SOURCES
-       doc/contrib.doc
-    doc/FAQ.doc
+       doc/installSimgrid.doc
+       doc/bindings.doc
+       doc/options.doc
+       doc/use.doc
+       doc/tracing.doc
+       doc/pls.doc
        doc/gtut-howto-design.doc
        doc/gtut-howto.doc
        doc/gtut-introduction.doc
        doc/gtut-main.doc
+       doc/gtut-tour-00-install.doc
        doc/gtut-tour-01-bones.doc
        doc/gtut-tour-02-simple.doc
        doc/gtut-tour-03-args.doc
@@ -539,7 +581,7 @@ set(DOC_SOURCES
        doc/gtut-tour-16-exchangecb.doc
        doc/gtut-tour.doc
        doc/gtut-tour-recap-messages.doc
-       doc/history.doc
+       
        #doc/index-API.doc
        doc/index.doc
        doc/module-amok.doc
@@ -549,8 +591,6 @@ set(DOC_SOURCES
        doc/modules.doc
        doc/module-surf.doc
        doc/module-xbt.doc
-       doc/people.doc  
-       doc/publis.doc
        
        doc/gtut-files/01-bones.c
        doc/gtut-files/01-bones.output
@@ -591,20 +631,20 @@ set(DOC_SOURCES
        doc/webcruft/Paje_MSG_screenshot.jpg
        doc/webcruft/Paje_MSG_screenshot_thn.jpg
        doc/webcruft/poster_thumbnail.png
-       doc/webcruft/robots.txt
        doc/webcruft/simgrid_logo.png
        doc/webcruft/simgrid_logo_small.png
+       doc/triva-graph_configuration.png
+       doc/triva-graph_visualization.png
+       doc/simgrid.css
        
        doc/Doxyfile.in
        doc/footer.html.in
        
-       tools/doxygen/bibtex2html_table_count.pl
        tools/doxygen/doxygen_postprocesser.pl
        tools/doxygen/index_create.pl
        tools/doxygen/toc_create.pl
        tools/doxygen/bibtex2html_wrapper.pl
        tools/doxygen/fig2dev_postprocessor.pl
-       tools/doxygen/index_php.pl
        tools/doxygen/xbt_log_extract_hierarchy.pl
 )
 
@@ -647,17 +687,6 @@ set(add_src_files
        src/simix/smx_context_sysv_private.h
 )
 
-file(GLOB_RECURSE include_files
-"include/*.h"
-"teshsuite/*.h"
-"testsuite/*.h"
-"tools/*.h"
-"examples/*.h"
-"examples/*.hpp"
-"src/*.h.in"
-"include/*.h.in"
-)
-
 file(GLOB_RECURSE xml_files
 "examples/*.xml"
 "include/*.xml"
@@ -681,13 +710,8 @@ set(txt_files
 "testsuite/surf/trace_A.txt"
 "testsuite/surf/trace_B.txt"
 "examples/smpi/hostfile"
-"examples/msg/procmig.trace"
-"examples/msg/volume.trace"
-"examples/msg/ms.trace"
 "examples/msg/trace/file.trace"
 "examples/msg/link5_state.trace"
-"examples/msg/categories.trace"
-"examples/msg/tasks.trace"
 "examples/msg/fafard_state.trace"
 "examples/msg/jupiter_state.trace"
 "examples/msg/actions/actions_allReduce.txt"
@@ -713,6 +737,10 @@ set(txt_files
 "teshsuite/gras/small_sleep/test_sg_64.tesh"
 "teshsuite/simdag/platforms/bob.fail"
 "teshsuite/simdag/platforms/bob.trace"
+"teshsuite/simdag/platforms/bob0_availability_file.trace"
+"teshsuite/simdag/platforms/bob0_state_file.trace"
+"teshsuite/simdag/platforms/bob2_availability_file.trace"
+"teshsuite/simdag/platforms/bob2_state_file.trace"
 "teshsuite/simdag/platforms/link1.bw"
 "teshsuite/simdag/platforms/link1.fail"
 "teshsuite/simdag/platforms/link1.lat"
@@ -769,6 +797,7 @@ file(GLOB_RECURSE README_files
 string(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" README_files "${README_files}")
 
 file(GLOB_RECURSE CMAKE_SOURCE_FILES
+"buildtools/Cmake/Makefile.default"
 "buildtools/Cmake/test_java.sh"
 "buildtools/Cmake/*.cmake"
 "buildtools/Cmake/*.h.in"
@@ -785,14 +814,17 @@ tools/simgrid_update_xml.pl
 buildtools/Cmake/tesh.pl
 )
 
-# This is the complete lise of what will be added to the source archive
+# This is the complete list of what will be added to the source archive
 set(source_to_pack     
+       ${headers_to_install}
+       ${source_of_generated_headers}
        ${XBT_RL_SRC}
        ${EXTRA_DIST}
        ${SMPI_SRC}
        ${GRAS_RL_SRC}
        ${XBT_SRC}
        ${GTNETS_SRC}
+       ${NS3_SRC}
        ${SURF_SRC}
        ${SIMIX_SRC}
        ${TRACING_SRC}
@@ -806,14 +838,13 @@ set(source_to_pack
        ${JEDULE_SRC}
        ${RNGSTREAM_SRC}
        ${add_src_files}
-       ${include_files}
        ${xml_files}
        ${tesh_files}
        ${txt_files}
-       ${EXTRA_DIST}
        ${CMAKE_SOURCE_FILES}
        ${bin_files}
        ${DOC_SOURCES}
        ${DOC_FIGS}
        ${README_files}
+       buildtools/Cmake/simgrid.nsi.in 
 )
diff --git a/buildtools/Cmake/Diff.pm b/buildtools/Cmake/Diff.pm
new file mode 100644 (file)
index 0000000..5069c22
--- /dev/null
@@ -0,0 +1,1713 @@
+package Diff;
+# Skip to first "=head" line for documentation.
+use strict;
+
+use integer;    # see below in _replaceNextLargerWith() for mod to make
+                # if you don't use this
+use vars qw( $VERSION @EXPORT_OK );
+$VERSION = 1.19_02;
+#          ^ ^^ ^^-- Incremented at will
+#          | \+----- Incremented for non-trivial changes to features
+#          \-------- Incremented for fundamental changes
+require Exporter;
+*import    = \&Exporter::import;
+@EXPORT_OK = qw(
+    prepare LCS LCSidx LCS_length
+    diff sdiff compact_diff
+    traverse_sequences traverse_balanced
+);
+
+# McIlroy-Hunt diff algorithm
+# Adapted from the Smalltalk code of Mario I. Wolczko, <mario@wolczko.com>
+# by Ned Konz, perl@bike-nomad.com
+# Updates by Tye McQueen, http://perlmonks.org/?node=tye
+
+# Create a hash that maps each element of $aCollection to the set of
+# positions it occupies in $aCollection, restricted to the elements
+# within the range of indexes specified by $start and $end.
+# The fourth parameter is a subroutine reference that will be called to
+# generate a string to use as a key.
+# Additional parameters, if any, will be passed to this subroutine.
+#
+# my $hashRef = _withPositionsOfInInterval( \@array, $start, $end, $keyGen );
+
+sub _withPositionsOfInInterval
+{
+    my $aCollection = shift;    # array ref
+    my $start       = shift;
+    my $end         = shift;
+    my $keyGen      = shift;
+    my %d;
+    my $index;
+    for ( $index = $start ; $index <= $end ; $index++ )
+    {
+        my $element = $aCollection->[$index];
+        my $key = &$keyGen( $element, @_ );
+        if ( exists( $d{$key} ) )
+        {
+            unshift ( @{ $d{$key} }, $index );
+        }
+        else
+        {
+            $d{$key} = [$index];
+        }
+    }
+    return wantarray ? %d : \%d;
+}
+
+# Find the place at which aValue would normally be inserted into the
+# array. If that place is already occupied by aValue, do nothing, and
+# return undef. If the place does not exist (i.e., it is off the end of
+# the array), add it to the end, otherwise replace the element at that
+# point with aValue.  It is assumed that the array's values are numeric.
+# This is where the bulk (75%) of the time is spent in this module, so
+# try to make it fast!
+
+sub _replaceNextLargerWith
+{
+    my ( $array, $aValue, $high ) = @_;
+    $high ||= $#$array;
+
+    # off the end?
+    if ( $high == -1 || $aValue > $array->[-1] )
+    {
+        push ( @$array, $aValue );
+        return $high + 1;
+    }
+
+    # binary search for insertion point...
+    my $low = 0;
+    my $index;
+    my $found;
+    while ( $low <= $high )
+    {
+        $index = ( $high + $low ) / 2;
+
+        # $index = int(( $high + $low ) / 2);  # without 'use integer'
+        $found = $array->[$index];
+
+        if ( $aValue == $found )
+        {
+            return undef;
+        }
+        elsif ( $aValue > $found )
+        {
+            $low = $index + 1;
+        }
+        else
+        {
+            $high = $index - 1;
+        }
+    }
+
+    # now insertion point is in $low.
+    $array->[$low] = $aValue;    # overwrite next larger
+    return $low;
+}
+
+# This method computes the longest common subsequence in $a and $b.
+
+# Result is array or ref, whose contents is such that
+#   $a->[ $i ] == $b->[ $result[ $i ] ]
+# foreach $i in ( 0 .. $#result ) if $result[ $i ] is defined.
+
+# An additional argument may be passed; this is a hash or key generating
+# function that should return a string that uniquely identifies the given
+# element.  It should be the case that if the key is the same, the elements
+# will compare the same. If this parameter is undef or missing, the key
+# will be the element as a string.
+
+# By default, comparisons will use "eq" and elements will be turned into keys
+# using the default stringizing operator '""'.
+
+# Additional parameters, if any, will be passed to the key generation
+# routine.
+
+sub _longestCommonSubsequence
+{
+    my $a        = shift;    # array ref or hash ref
+    my $b        = shift;    # array ref or hash ref
+    my $counting = shift;    # scalar
+    my $keyGen   = shift;    # code ref
+    my $compare;             # code ref
+
+    if ( ref($a) eq 'HASH' )
+    {                        # prepared hash must be in $b
+        my $tmp = $b;
+        $b = $a;
+        $a = $tmp;
+    }
+
+    # Check for bogus (non-ref) argument values
+    if ( !ref($a) || !ref($b) )
+    {
+        my @callerInfo = caller(1);
+        die 'error: must pass array or hash references to ' . $callerInfo[3];
+    }
+
+    # set up code refs
+    # Note that these are optimized.
+    if ( !defined($keyGen) )    # optimize for strings
+    {
+        $keyGen = sub { $_[0] };
+        $compare = sub { my ( $a, $b ) = @_; $a eq $b };
+    }
+    else
+    {
+        $compare = sub {
+            my $a = shift;
+            my $b = shift;
+            &$keyGen( $a, @_ ) eq &$keyGen( $b, @_ );
+        };
+    }
+
+    my ( $aStart, $aFinish, $matchVector ) = ( 0, $#$a, [] );
+    my ( $prunedCount, $bMatches ) = ( 0, {} );
+
+    if ( ref($b) eq 'HASH' )    # was $bMatches prepared for us?
+    {
+        $bMatches = $b;
+    }
+    else
+    {
+        my ( $bStart, $bFinish ) = ( 0, $#$b );
+
+        # First we prune off any common elements at the beginning
+        while ( $aStart <= $aFinish
+            and $bStart <= $bFinish
+            and &$compare( $a->[$aStart], $b->[$bStart], @_ ) )
+        {
+            $matchVector->[ $aStart++ ] = $bStart++;
+            $prunedCount++;
+        }
+
+        # now the end
+        while ( $aStart <= $aFinish
+            and $bStart <= $bFinish
+            and &$compare( $a->[$aFinish], $b->[$bFinish], @_ ) )
+        {
+            $matchVector->[ $aFinish-- ] = $bFinish--;
+            $prunedCount++;
+        }
+
+        # Now compute the equivalence classes of positions of elements
+        $bMatches =
+          _withPositionsOfInInterval( $b, $bStart, $bFinish, $keyGen, @_ );
+    }
+    my $thresh = [];
+    my $links  = [];
+
+    my ( $i, $ai, $j, $k );
+    for ( $i = $aStart ; $i <= $aFinish ; $i++ )
+    {
+        $ai = &$keyGen( $a->[$i], @_ );
+        if ( exists( $bMatches->{$ai} ) )
+        {
+            $k = 0;
+            for $j ( @{ $bMatches->{$ai} } )
+            {
+
+                # optimization: most of the time this will be true
+                if ( $k and $thresh->[$k] > $j and $thresh->[ $k - 1 ] < $j )
+                {
+                    $thresh->[$k] = $j;
+                }
+                else
+                {
+                    $k = _replaceNextLargerWith( $thresh, $j, $k );
+                }
+
+                # oddly, it's faster to always test this (CPU cache?).
+                if ( defined($k) )
+                {
+                    $links->[$k] =
+                      [ ( $k ? $links->[ $k - 1 ] : undef ), $i, $j ];
+                }
+            }
+        }
+    }
+
+    if (@$thresh)
+    {
+        return $prunedCount + @$thresh if $counting;
+        for ( my $link = $links->[$#$thresh] ; $link ; $link = $link->[0] )
+        {
+            $matchVector->[ $link->[1] ] = $link->[2];
+        }
+    }
+    elsif ($counting)
+    {
+        return $prunedCount;
+    }
+
+    return wantarray ? @$matchVector : $matchVector;
+}
+
+sub traverse_sequences
+{
+    my $a                 = shift;          # array ref
+    my $b                 = shift;          # array ref
+    my $callbacks         = shift || {};
+    my $keyGen            = shift;
+    my $matchCallback     = $callbacks->{'MATCH'} || sub { };
+    my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
+    my $finishedACallback = $callbacks->{'A_FINISHED'};
+    my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
+    my $finishedBCallback = $callbacks->{'B_FINISHED'};
+    my $matchVector = _longestCommonSubsequence( $a, $b, 0, $keyGen, @_ );
+
+    # Process all the lines in @$matchVector
+    my $lastA = $#$a;
+    my $lastB = $#$b;
+    my $bi    = 0;
+    my $ai;
+
+    for ( $ai = 0 ; $ai <= $#$matchVector ; $ai++ )
+    {
+        my $bLine = $matchVector->[$ai];
+        if ( defined($bLine) )    # matched
+        {
+            &$discardBCallback( $ai, $bi++, @_ ) while $bi < $bLine;
+            &$matchCallback( $ai,    $bi++, @_ );
+        }
+        else
+        {
+            &$discardACallback( $ai, $bi, @_ );
+        }
+    }
+
+    # The last entry (if any) processed was a match.
+    # $ai and $bi point just past the last matching lines in their sequences.
+
+    while ( $ai <= $lastA or $bi <= $lastB )
+    {
+
+        # last A?
+        if ( $ai == $lastA + 1 and $bi <= $lastB )
+        {
+            if ( defined($finishedACallback) )
+            {
+                &$finishedACallback( $lastA, @_ );
+                $finishedACallback = undef;
+            }
+            else
+            {
+                &$discardBCallback( $ai, $bi++, @_ ) while $bi <= $lastB;
+            }
+        }
+
+        # last B?
+        if ( $bi == $lastB + 1 and $ai <= $lastA )
+        {
+            if ( defined($finishedBCallback) )
+            {
+                &$finishedBCallback( $lastB, @_ );
+                $finishedBCallback = undef;
+            }
+            else
+            {
+                &$discardACallback( $ai++, $bi, @_ ) while $ai <= $lastA;
+            }
+        }
+
+        &$discardACallback( $ai++, $bi, @_ ) if $ai <= $lastA;
+        &$discardBCallback( $ai, $bi++, @_ ) if $bi <= $lastB;
+    }
+
+    return 1;
+}
+
+sub traverse_balanced
+{
+    my $a                 = shift;              # array ref
+    my $b                 = shift;              # array ref
+    my $callbacks         = shift || {};
+    my $keyGen            = shift;
+    my $matchCallback     = $callbacks->{'MATCH'} || sub { };
+    my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
+    my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
+    my $changeCallback    = $callbacks->{'CHANGE'};
+    my $matchVector = _longestCommonSubsequence( $a, $b, 0, $keyGen, @_ );
+
+    # Process all the lines in match vector
+    my $lastA = $#$a;
+    my $lastB = $#$b;
+    my $bi    = 0;
+    my $ai    = 0;
+    my $ma    = -1;
+    my $mb;
+
+    while (1)
+    {
+
+        # Find next match indices $ma and $mb
+        do {
+            $ma++;
+        } while(
+                $ma <= $#$matchVector
+            &&  !defined $matchVector->[$ma]
+        );
+
+        last if $ma > $#$matchVector;    # end of matchVector?
+        $mb = $matchVector->[$ma];
+
+        # Proceed with discard a/b or change events until
+        # next match
+        while ( $ai < $ma || $bi < $mb )
+        {
+
+            if ( $ai < $ma && $bi < $mb )
+            {
+
+                # Change
+                if ( defined $changeCallback )
+                {
+                    &$changeCallback( $ai++, $bi++, @_ );
+                }
+                else
+                {
+                    &$discardACallback( $ai++, $bi, @_ );
+                    &$discardBCallback( $ai, $bi++, @_ );
+                }
+            }
+            elsif ( $ai < $ma )
+            {
+                &$discardACallback( $ai++, $bi, @_ );
+            }
+            else
+            {
+
+                # $bi < $mb
+                &$discardBCallback( $ai, $bi++, @_ );
+            }
+        }
+
+        # Match
+        &$matchCallback( $ai++, $bi++, @_ );
+    }
+
+    while ( $ai <= $lastA || $bi <= $lastB )
+    {
+        if ( $ai <= $lastA && $bi <= $lastB )
+        {
+
+            # Change
+            if ( defined $changeCallback )
+            {
+                &$changeCallback( $ai++, $bi++, @_ );
+            }
+            else
+            {
+                &$discardACallback( $ai++, $bi, @_ );
+                &$discardBCallback( $ai, $bi++, @_ );
+            }
+        }
+        elsif ( $ai <= $lastA )
+        {
+            &$discardACallback( $ai++, $bi, @_ );
+        }
+        else
+        {
+
+            # $bi <= $lastB
+            &$discardBCallback( $ai, $bi++, @_ );
+        }
+    }
+
+    return 1;
+}
+
+sub prepare
+{
+    my $a       = shift;    # array ref
+    my $keyGen  = shift;    # code ref
+
+    # set up code ref
+    $keyGen = sub { $_[0] } unless defined($keyGen);
+
+    return scalar _withPositionsOfInInterval( $a, 0, $#$a, $keyGen, @_ );
+}
+
+sub LCS
+{
+    my $a = shift;                  # array ref
+    my $b = shift;                  # array ref or hash ref
+    my $matchVector = _longestCommonSubsequence( $a, $b, 0, @_ );
+    my @retval;
+    my $i;
+    for ( $i = 0 ; $i <= $#$matchVector ; $i++ )
+    {
+        if ( defined( $matchVector->[$i] ) )
+        {
+            push ( @retval, $a->[$i] );
+        }
+    }
+    return wantarray ? @retval : \@retval;
+}
+
+sub LCS_length
+{
+    my $a = shift;                          # array ref
+    my $b = shift;                          # array ref or hash ref
+    return _longestCommonSubsequence( $a, $b, 1, @_ );
+}
+
+sub LCSidx
+{
+    my $a= shift @_;
+    my $b= shift @_;
+    my $match= _longestCommonSubsequence( $a, $b, 0, @_ );
+    my @am= grep defined $match->[$_], 0..$#$match;
+    my @bm= @{$match}[@am];
+    return \@am, \@bm;
+}
+
+sub compact_diff
+{
+    my $a= shift @_;
+    my $b= shift @_;
+    my( $am, $bm )= LCSidx( $a, $b, @_ );
+    my @cdiff;
+    my( $ai, $bi )= ( 0, 0 );
+    push @cdiff, $ai, $bi;
+    while( 1 ) {
+        while(  @$am  &&  $ai == $am->[0]  &&  $bi == $bm->[0]  ) {
+            shift @$am;
+            shift @$bm;
+            ++$ai, ++$bi;
+        }
+        push @cdiff, $ai, $bi;
+        last   if  ! @$am;
+        $ai = $am->[0];
+        $bi = $bm->[0];
+        push @cdiff, $ai, $bi;
+    }
+    push @cdiff, 0+@$a, 0+@$b
+        if  $ai < @$a || $bi < @$b;
+    return wantarray ? @cdiff : \@cdiff;
+}
+
+sub diff
+{
+    my $a      = shift;    # array ref
+    my $b      = shift;    # array ref
+    my $retval = [];
+    my $hunk   = [];
+    my $discard = sub {
+        push @$hunk, [ '-', $_[0], $a->[ $_[0] ] ];
+    };
+    my $add = sub {
+        push @$hunk, [ '+', $_[1], $b->[ $_[1] ] ];
+    };
+    my $match = sub {
+        push @$retval, $hunk
+            if 0 < @$hunk;
+        $hunk = []
+    };
+    traverse_sequences( $a, $b,
+        { MATCH => $match, DISCARD_A => $discard, DISCARD_B => $add }, @_ );
+    &$match();
+    return wantarray ? @$retval : $retval;
+}
+
+sub sdiff
+{
+    my $a      = shift;    # array ref
+    my $b      = shift;    # array ref
+    my $retval = [];
+    my $discard = sub { push ( @$retval, [ '-', $a->[ $_[0] ], "" ] ) };
+    my $add = sub { push ( @$retval, [ '+', "", $b->[ $_[1] ] ] ) };
+    my $change = sub {
+        push ( @$retval, [ 'c', $a->[ $_[0] ], $b->[ $_[1] ] ] );
+    };
+    my $match = sub {
+        push ( @$retval, [ 'u', $a->[ $_[0] ], $b->[ $_[1] ] ] );
+    };
+    traverse_balanced(
+        $a,
+        $b,
+        {
+            MATCH     => $match,
+            DISCARD_A => $discard,
+            DISCARD_B => $add,
+            CHANGE    => $change,
+        },
+        @_
+    );
+    return wantarray ? @$retval : $retval;
+}
+
+########################################
+my $Root= __PACKAGE__;
+package Algorithm::Diff::_impl;
+use strict;
+
+sub _Idx()  { 0 } # $me->[_Idx]: Ref to array of hunk indices
+            # 1   # $me->[1]: Ref to first sequence
+            # 2   # $me->[2]: Ref to second sequence
+sub _End()  { 3 } # $me->[_End]: Diff between forward and reverse pos
+sub _Same() { 4 } # $me->[_Same]: 1 if pos 1 contains unchanged items
+sub _Base() { 5 } # $me->[_Base]: Added to range's min and max
+sub _Pos()  { 6 } # $me->[_Pos]: Which hunk is currently selected
+sub _Off()  { 7 } # $me->[_Off]: Offset into _Idx for current position
+sub _Min() { -2 } # Added to _Off to get min instead of max+1
+
+sub Die
+{
+    require Carp;
+    Carp::confess( @_ );
+}
+
+sub _ChkPos
+{
+    my( $me )= @_;
+    return   if  $me->[_Pos];
+    my $meth= ( caller(1) )[3];
+    Die( "Called $meth on 'reset' object" );
+}
+
+sub _ChkSeq
+{
+    my( $me, $seq )= @_;
+    return $seq + $me->[_Off]
+        if  1 == $seq  ||  2 == $seq;
+    my $meth= ( caller(1) )[3];
+    Die( "$meth: Invalid sequence number ($seq); must be 1 or 2" );
+}
+
+sub getObjPkg
+{
+    my( $us )= @_;
+    return ref $us   if  ref $us;
+    return $us . "::_obj";
+}
+
+sub new
+{
+    my( $us, $seq1, $seq2, $opts ) = @_;
+    my @args;
+    for( $opts->{keyGen} ) {
+        push @args, $_   if  $_;
+    }
+    for( $opts->{keyGenArgs} ) {
+        push @args, @$_   if  $_;
+    }
+    my $cdif= Diff::compact_diff( $seq1, $seq2, @args );
+    my $same= 1;
+    if(  0 == $cdif->[2]  &&  0 == $cdif->[3]  ) {
+        $same= 0;
+        splice @$cdif, 0, 2;
+    }
+    my @obj= ( $cdif, $seq1, $seq2 );
+    $obj[_End] = (1+@$cdif)/2;
+    $obj[_Same] = $same;
+    $obj[_Base] = 0;
+    my $me = bless \@obj, $us->getObjPkg();
+    $me->Reset( 0 );
+    return $me;
+}
+
+sub Reset
+{
+    my( $me, $pos )= @_;
+    $pos= int( $pos || 0 );
+    $pos += $me->[_End]
+        if  $pos < 0;
+    $pos= 0
+        if  $pos < 0  ||  $me->[_End] <= $pos;
+    $me->[_Pos]= $pos || !1;
+    $me->[_Off]= 2*$pos - 1;
+    return $me;
+}
+
+sub Base
+{
+    my( $me, $base )= @_;
+    my $oldBase= $me->[_Base];
+    $me->[_Base]= 0+$base   if  defined $base;
+    return $oldBase;
+}
+
+sub Copy
+{
+    my( $me, $pos, $base )= @_;
+    my @obj= @$me;
+    my $you= bless \@obj, ref($me);
+    $you->Reset( $pos )   if  defined $pos;
+    $you->Base( $base );
+    return $you;
+}
+
+sub Next {
+    my( $me, $steps )= @_;
+    $steps= 1   if  ! defined $steps;
+    if( $steps ) {
+        my $pos= $me->[_Pos];
+        my $new= $pos + $steps;
+        $new= 0   if  $pos  &&  $new < 0;
+        $me->Reset( $new )
+    }
+    return $me->[_Pos];
+}
+
+sub Prev {
+    my( $me, $steps )= @_;
+    $steps= 1   if  ! defined $steps;
+    my $pos= $me->Next(-$steps);
+    $pos -= $me->[_End]   if  $pos;
+    return $pos;
+}
+
+sub Diff {
+    my( $me )= @_;
+    $me->_ChkPos();
+    return 0   if  $me->[_Same] == ( 1 & $me->[_Pos] );
+    my $ret= 0;
+    my $off= $me->[_Off];
+    for my $seq ( 1, 2 ) {
+        $ret |= $seq
+            if  $me->[_Idx][ $off + $seq + _Min ]
+            <   $me->[_Idx][ $off + $seq ];
+    }
+    return $ret;
+}
+
+sub Min {
+    my( $me, $seq, $base )= @_;
+    $me->_ChkPos();
+    my $off= $me->_ChkSeq($seq);
+    $base= $me->[_Base] if !defined $base;
+    return $base + $me->[_Idx][ $off + _Min ];
+}
+
+sub Max {
+    my( $me, $seq, $base )= @_;
+    $me->_ChkPos();
+    my $off= $me->_ChkSeq($seq);
+    $base= $me->[_Base] if !defined $base;
+    return $base + $me->[_Idx][ $off ] -1;
+}
+
+sub Range {
+    my( $me, $seq, $base )= @_;
+    $me->_ChkPos();
+    my $off = $me->_ChkSeq($seq);
+    if( !wantarray ) {
+        return  $me->[_Idx][ $off ]
+            -   $me->[_Idx][ $off + _Min ];
+    }
+    $base= $me->[_Base] if !defined $base;
+    return  ( $base + $me->[_Idx][ $off + _Min ] )
+        ..  ( $base + $me->[_Idx][ $off ] - 1 );
+}
+
+sub Items {
+    my( $me, $seq )= @_;
+    $me->_ChkPos();
+    my $off = $me->_ChkSeq($seq);
+    if( !wantarray ) {
+        return  $me->[_Idx][ $off ]
+            -   $me->[_Idx][ $off + _Min ];
+    }
+    return
+        @{$me->[$seq]}[
+                $me->[_Idx][ $off + _Min ]
+            ..  ( $me->[_Idx][ $off ] - 1 )
+        ];
+}
+
+sub Same {
+    my( $me )= @_;
+    $me->_ChkPos();
+    return wantarray ? () : 0
+        if  $me->[_Same] != ( 1 & $me->[_Pos] );
+    return $me->Items(1);
+}
+
+my %getName;
+BEGIN {
+    %getName= (
+        same => \&Same,
+        diff => \&Diff,
+        base => \&Base,
+        min  => \&Min,
+        max  => \&Max,
+        range=> \&Range,
+        items=> \&Items, # same thing
+    );
+}
+
+sub Get
+{
+    my $me= shift @_;
+    $me->_ChkPos();
+    my @value;
+    for my $arg (  @_  ) {
+        for my $word (  split ' ', $arg  ) {
+            my $meth;
+            if(     $word !~ /^(-?\d+)?([a-zA-Z]+)([12])?$/
+                ||  not  $meth= $getName{ lc $2 }
+            ) {
+                Die( $Root, ", Get: Invalid request ($word)" );
+            }
+            my( $base, $name, $seq )= ( $1, $2, $3 );
+            push @value, scalar(
+                4 == length($name)
+                    ? $meth->( $me )
+                    : $meth->( $me, $seq, $base )
+            );
+        }
+    }
+    if(  wantarray  ) {
+        return @value;
+    } elsif(  1 == @value  ) {
+        return $value[0];
+    }
+    Die( 0+@value, " values requested from ",
+        $Root, "'s Get in scalar context" );
+}
+
+
+my $Obj= getObjPkg($Root);
+no strict 'refs';
+
+for my $meth (  qw( new getObjPkg )  ) {
+    *{$Root."::".$meth} = \&{$meth};
+    *{$Obj ."::".$meth} = \&{$meth};
+}
+for my $meth (  qw(
+    Next Prev Reset Copy Base Diff
+    Same Items Range Min Max Get
+    _ChkPos _ChkSeq
+)  ) {
+    *{$Obj."::".$meth} = \&{$meth};
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Algorithm::Diff - Compute `intelligent' differences between two files / lists
+
+=head1 SYNOPSIS
+
+    require Algorithm::Diff;
+
+    # This example produces traditional 'diff' output:
+
+    my $diff = Algorithm::Diff->new( \@seq1, \@seq2 );
+
+    $diff->Base( 1 );   # Return line numbers, not indices
+    while(  $diff->Next()  ) {
+        next   if  $diff->Same();
+        my $sep = '';
+        if(  ! $diff->Items(2)  ) {
+            printf "%d,%dd%d\n",
+                $diff->Get(qw( Min1 Max1 Max2 ));
+        } elsif(  ! $diff->Items(1)  ) {
+            printf "%da%d,%d\n",
+                $diff->Get(qw( Max1 Min2 Max2 ));
+        } else {
+            $sep = "---\n";
+            printf "%d,%dc%d,%d\n",
+                $diff->Get(qw( Min1 Max1 Min2 Max2 ));
+        }
+        print "< $_"   for  $diff->Items(1);
+        print $sep;
+        print "> $_"   for  $diff->Items(2);
+    }
+
+
+    # Alternate interfaces:
+
+    use Algorithm::Diff qw(
+        LCS LCS_length LCSidx
+        diff sdiff compact_diff
+        traverse_sequences traverse_balanced );
+
+    @lcs    = LCS( \@seq1, \@seq2 );
+    $lcsref = LCS( \@seq1, \@seq2 );
+    $count  = LCS_length( \@seq1, \@seq2 );
+
+    ( $seq1idxref, $seq2idxref ) = LCSidx( \@seq1, \@seq2 );
+
+
+    # Complicated interfaces:
+
+    @diffs  = diff( \@seq1, \@seq2 );
+
+    @sdiffs = sdiff( \@seq1, \@seq2 );
+
+    @cdiffs = compact_diff( \@seq1, \@seq2 );
+
+    traverse_sequences(
+        \@seq1,
+        \@seq2,
+        {   MATCH     => \&callback1,
+            DISCARD_A => \&callback2,
+            DISCARD_B => \&callback3,
+        },
+        \&key_generator,
+        @extra_args,
+    );
+
+    traverse_balanced(
+        \@seq1,
+        \@seq2,
+        {   MATCH     => \&callback1,
+            DISCARD_A => \&callback2,
+            DISCARD_B => \&callback3,
+            CHANGE    => \&callback4,
+        },
+        \&key_generator,
+        @extra_args,
+    );
+
+
+=head1 INTRODUCTION
+
+(by Mark-Jason Dominus)
+
+I once read an article written by the authors of C<diff>; they said
+that they worked very hard on the algorithm until they found the
+right one.
+
+I think what they ended up using (and I hope someone will correct me,
+because I am not very confident about this) was the `longest common
+subsequence' method.  In the LCS problem, you have two sequences of
+items:
+
+    a b c d f g h j q z
+
+    a b c d e f g i j k r x y z
+
+and you want to find the longest sequence of items that is present in
+both original sequences in the same order.  That is, you want to find
+a new sequence I<S> which can be obtained from the first sequence by
+deleting some items, and from the secend sequence by deleting other
+items.  You also want I<S> to be as long as possible.  In this case I<S>
+is
+
+    a b c d f g j z
+
+From there it's only a small step to get diff-like output:
+
+    e   h i   k   q r x y
+    +   - +   +   - + + +
+
+This module solves the LCS problem.  It also includes a canned function
+to generate C<diff>-like output.
+
+It might seem from the example above that the LCS of two sequences is
+always pretty obvious, but that's not always the case, especially when
+the two sequences have many repeated elements.  For example, consider
+
+    a x b y c z p d q
+    a b c a x b y c z
+
+A naive approach might start by matching up the C<a> and C<b> that
+appear at the beginning of each sequence, like this:
+
+    a x b y c         z p d q
+    a   b   c a b y c z
+
+This finds the common subsequence C<a b c z>.  But actually, the LCS
+is C<a x b y c z>:
+
+          a x b y c z p d q
+    a b c a x b y c z
+
+or
+
+    a       x b y c z p d q
+    a b c a x b y c z
+
+=head1 USAGE
+
+(See also the README file and several example
+scripts include with this module.)
+
+This module now provides an object-oriented interface that uses less
+memory and is easier to use than most of the previous procedural
+interfaces.  It also still provides several exportable functions.  We'll
+deal with these in ascending order of difficulty:  C<LCS>,
+C<LCS_length>, C<LCSidx>, OO interface, C<prepare>, C<diff>, C<sdiff>,
+C<traverse_sequences>, and C<traverse_balanced>.
+
+=head2 C<LCS>
+
+Given references to two lists of items, LCS returns an array containing
+their longest common subsequence.  In scalar context, it returns a
+reference to such a list.
+
+    @lcs    = LCS( \@seq1, \@seq2 );
+    $lcsref = LCS( \@seq1, \@seq2 );
+
+C<LCS> may be passed an optional third parameter; this is a CODE
+reference to a key generation function.  See L</KEY GENERATION
+FUNCTIONS>.
+
+    @lcs    = LCS( \@seq1, \@seq2, \&keyGen, @args );
+    $lcsref = LCS( \@seq1, \@seq2, \&keyGen, @args );
+
+Additional parameters, if any, will be passed to the key generation
+routine.
+
+=head2 C<LCS_length>
+
+This is just like C<LCS> except it only returns the length of the
+longest common subsequence.  This provides a performance gain of about
+9% compared to C<LCS>.
+
+=head2 C<LCSidx>
+
+Like C<LCS> except it returns references to two arrays.  The first array
+contains the indices into @seq1 where the LCS items are located.  The
+second array contains the indices into @seq2 where the LCS items are located.
+
+Therefore, the following three lists will contain the same values:
+
+    my( $idx1, $idx2 ) = LCSidx( \@seq1, \@seq2 );
+    my @list1 = @seq1[ @$idx1 ];
+    my @list2 = @seq2[ @$idx2 ];
+    my @list3 = LCS( \@seq1, \@seq2 );
+
+=head2 C<new>
+
+    $diff = Algorithm::Diffs->new( \@seq1, \@seq2 );
+    $diff = Algorithm::Diffs->new( \@seq1, \@seq2, \%opts );
+
+C<new> computes the smallest set of additions and deletions necessary
+to turn the first sequence into the second and compactly records them
+in the object.
+
+You use the object to iterate over I<hunks>, where each hunk represents
+a contiguous section of items which should be added, deleted, replaced,
+or left unchanged.
+
+=over 4
+
+The following summary of all of the methods looks a lot like Perl code
+but some of the symbols have different meanings:
+
+    [ ]     Encloses optional arguments
+    :       Is followed by the default value for an optional argument
+    |       Separates alternate return results
+
+Method summary:
+
+    $obj        = Algorithm::Diff->new( \@seq1, \@seq2, [ \%opts ] );
+    $pos        = $obj->Next(  [ $count : 1 ] );
+    $revPos     = $obj->Prev(  [ $count : 1 ] );
+    $obj        = $obj->Reset( [ $pos : 0 ] );
+    $copy       = $obj->Copy(  [ $pos, [ $newBase ] ] );
+    $oldBase    = $obj->Base(  [ $newBase ] );
+
+Note that all of the following methods C<die> if used on an object that
+is "reset" (not currently pointing at any hunk).
+
+    $bits       = $obj->Diff(  );
+    @items|$cnt = $obj->Same(  );
+    @items|$cnt = $obj->Items( $seqNum );
+    @idxs |$cnt = $obj->Range( $seqNum, [ $base ] );
+    $minIdx     = $obj->Min(   $seqNum, [ $base ] );
+    $maxIdx     = $obj->Max(   $seqNum, [ $base ] );
+    @values     = $obj->Get(   @names );
+
+Passing in C<undef> for an optional argument is always treated the same
+as if no argument were passed in.
+
+=item C<Next>
+
+    $pos = $diff->Next();    # Move forward 1 hunk
+    $pos = $diff->Next( 2 ); # Move forward 2 hunks
+    $pos = $diff->Next(-5);  # Move backward 5 hunks
+
+C<Next> moves the object to point at the next hunk.  The object starts
+out "reset", which means it isn't pointing at any hunk.  If the object
+is reset, then C<Next()> moves to the first hunk.
+
+C<Next> returns a true value iff the move didn't go past the last hunk.
+So C<Next(0)> will return true iff the object is not reset.
+
+Actually, C<Next> returns the object's new position, which is a number
+between 1 and the number of hunks (inclusive), or returns a false value.
+
+=item C<Prev>
+
+C<Prev($N)> is almost identical to C<Next(-$N)>; it moves to the $Nth
+previous hunk.  On a 'reset' object, C<Prev()> [and C<Next(-1)>] move
+to the last hunk.
+
+The position returned by C<Prev> is relative to the I<end> of the
+hunks; -1 for the last hunk, -2 for the second-to-last, etc.
+
+=item C<Reset>
+
+    $diff->Reset();     # Reset the object's position
+    $diff->Reset($pos); # Move to the specified hunk
+    $diff->Reset(1);    # Move to the first hunk
+    $diff->Reset(-1);   # Move to the last hunk
+
+C<Reset> returns the object, so, for example, you could use
+C<< $diff->Reset()->Next(-1) >> to get the number of hunks.
+
+=item C<Copy>
+
+    $copy = $diff->Copy( $newPos, $newBase );
+
+C<Copy> returns a copy of the object.  The copy and the orignal object
+share most of their data, so making copies takes very little memory.
+The copy maintains its own position (separate from the original), which
+is the main purpose of copies.  It also maintains its own base.
+
+By default, the copy's position starts out the same as the original
+object's position.  But C<Copy> takes an optional first argument to set the
+new position, so the following three snippets are equivalent:
+
+    $copy = $diff->Copy($pos);
+
+    $copy = $diff->Copy();
+    $copy->Reset($pos);
+
+    $copy = $diff->Copy()->Reset($pos);
+
+C<Copy> takes an optional second argument to set the base for
+the copy.  If you wish to change the base of the copy but leave
+the position the same as in the original, here are two
+equivalent ways:
+
+    $copy = $diff->Copy();
+    $copy->Base( 0 );
+
+    $copy = $diff->Copy(undef,0);
+
+Here are two equivalent way to get a "reset" copy:
+
+    $copy = $diff->Copy(0);
+
+    $copy = $diff->Copy()->Reset();
+
+=item C<Diff>
+
+    $bits = $obj->Diff();
+
+C<Diff> returns a true value iff the current hunk contains items that are
+different between the two sequences.  It actually returns one of the
+follow 4 values:
+
+=over 4
+
+=item 3
+
+C<3==(1|2)>.  This hunk contains items from @seq1 and the items
+from @seq2 that should replace them.  Both sequence 1 and 2
+contain changed items so both the 1 and 2 bits are set.
+
+=item 2
+
+This hunk only contains items from @seq2 that should be inserted (not
+items from @seq1).  Only sequence 2 contains changed items so only the 2
+bit is set.
+
+=item 1
+
+This hunk only contains items from @seq1 that should be deleted (not
+items from @seq2).  Only sequence 1 contains changed items so only the 1
+bit is set.
+
+=item 0
+
+This means that the items in this hunk are the same in both sequences.
+Neither sequence 1 nor 2 contain changed items so neither the 1 nor the
+2 bits are set.
+
+=back
+
+=item C<Same>
+
+C<Same> returns a true value iff the current hunk contains items that
+are the same in both sequences.  It actually returns the list of items
+if they are the same or an emty list if they aren't.  In a scalar
+context, it returns the size of the list.
+
+=item C<Items>
+
+    $count = $diff->Items(2);
+    @items = $diff->Items($seqNum);
+
+C<Items> returns the (number of) items from the specified sequence that
+are part of the current hunk.
+
+If the current hunk contains only insertions, then
+C<< $diff->Items(1) >> will return an empty list (0 in a scalar conext).
+If the current hunk contains only deletions, then C<< $diff->Items(2) >>
+will return an empty list (0 in a scalar conext).
+
+If the hunk contains replacements, then both C<< $diff->Items(1) >> and
+C<< $diff->Items(2) >> will return different, non-empty lists.
+
+Otherwise, the hunk contains identical items and all of the following
+will return the same lists:
+
+    @items = $diff->Items(1);
+    @items = $diff->Items(2);
+    @items = $diff->Same();
+
+=item C<Range>
+
+    $count = $diff->Range( $seqNum );
+    @indices = $diff->Range( $seqNum );
+    @indices = $diff->Range( $seqNum, $base );
+
+C<Range> is like C<Items> except that it returns a list of I<indices> to
+the items rather than the items themselves.  By default, the index of
+the first item (in each sequence) is 0 but this can be changed by
+calling the C<Base> method.  So, by default, the following two snippets
+return the same lists:
+
+    @list = $diff->Items(2);
+    @list = @seq2[ $diff->Range(2) ];
+
+You can also specify the base to use as the second argument.  So the
+following two snippets I<always> return the same lists:
+
+    @list = $diff->Items(1);
+    @list = @seq1[ $diff->Range(1,0) ];
+
+=item C<Base>
+
+    $curBase = $diff->Base();
+    $oldBase = $diff->Base($newBase);
+
+C<Base> sets and/or returns the current base (usually 0 or 1) that is
+used when you request range information.  The base defaults to 0 so
+that range information is returned as array indices.  You can set the
+base to 1 if you want to report traditional line numbers instead.
+
+=item C<Min>
+
+    $min1 = $diff->Min(1);
+    $min = $diff->Min( $seqNum, $base );
+
+C<Min> returns the first value that C<Range> would return (given the
+same arguments) or returns C<undef> if C<Range> would return an empty
+list.
+
+=item C<Max>
+
+C<Max> returns the last value that C<Range> would return or C<undef>.
+
+=item C<Get>
+
+    ( $n, $x, $r ) = $diff->Get(qw( min1 max1 range1 ));
+    @values = $diff->Get(qw( 0min2 1max2 range2 same base ));
+
+C<Get> returns one or more scalar values.  You pass in a list of the
+names of the values you want returned.  Each name must match one of the
+following regexes:
+
+    /^(-?\d+)?(min|max)[12]$/i
+    /^(range[12]|same|diff|base)$/i
+
+The 1 or 2 after a name says which sequence you want the information
+for (and where allowed, it is required).  The optional number before
+"min" or "max" is the base to use.  So the following equalities hold:
+
+    $diff->Get('min1') == $diff->Min(1)
+    $diff->Get('0min2') == $diff->Min(2,0)
+
+Using C<Get> in a scalar context when you've passed in more than one
+name is a fatal error (C<die> is called).
+
+=back
+
+=head2 C<prepare>
+
+Given a reference to a list of items, C<prepare> returns a reference
+to a hash which can be used when comparing this sequence to other
+sequences with C<LCS> or C<LCS_length>.
+
+    $prep = prepare( \@seq1 );
+    for $i ( 0 .. 10_000 )
+    {
+        @lcs = LCS( $prep, $seq[$i] );
+        # do something useful with @lcs
+    }
+
+C<prepare> may be passed an optional third parameter; this is a CODE
+reference to a key generation function.  See L</KEY GENERATION
+FUNCTIONS>.
+
+    $prep = prepare( \@seq1, \&keyGen );
+    for $i ( 0 .. 10_000 )
+    {
+        @lcs = LCS( $seq[$i], $prep, \&keyGen );
+        # do something useful with @lcs
+    }
+
+Using C<prepare> provides a performance gain of about 50% when calling LCS
+many times compared with not preparing.
+
+=head2 C<diff>
+
+    @diffs     = diff( \@seq1, \@seq2 );
+    $diffs_ref = diff( \@seq1, \@seq2 );
+
+C<diff> computes the smallest set of additions and deletions necessary
+to turn the first sequence into the second, and returns a description
+of these changes.  The description is a list of I<hunks>; each hunk
+represents a contiguous section of items which should be added,
+deleted, or replaced.  (Hunks containing unchanged items are not
+included.)
+
+The return value of C<diff> is a list of hunks, or, in scalar context, a
+reference to such a list.  If there are no differences, the list will be
+empty.
+
+Here is an example.  Calling C<diff> for the following two sequences:
+
+    a b c e h j l m n p
+    b c d e f j k l m r s t
+
+would produce the following list:
+
+    (
+      [ [ '-', 0, 'a' ] ],
+
+      [ [ '+', 2, 'd' ] ],
+
+      [ [ '-', 4, 'h' ],
+        [ '+', 4, 'f' ] ],
+
+      [ [ '+', 6, 'k' ] ],
+
+      [ [ '-',  8, 'n' ],
+        [ '-',  9, 'p' ],
+        [ '+',  9, 'r' ],
+        [ '+', 10, 's' ],
+        [ '+', 11, 't' ] ],
+    )
+
+There are five hunks here.  The first hunk says that the C<a> at
+position 0 of the first sequence should be deleted (C<->).  The second
+hunk says that the C<d> at position 2 of the second sequence should
+be inserted (C<+>).  The third hunk says that the C<h> at position 4
+of the first sequence should be removed and replaced with the C<f>
+from position 4 of the second sequence.  And so on.
+
+C<diff> may be passed an optional third parameter; this is a CODE
+reference to a key generation function.  See L</KEY GENERATION
+FUNCTIONS>.
+
+Additional parameters, if any, will be passed to the key generation
+routine.
+
+=head2 C<sdiff>
+
+    @sdiffs     = sdiff( \@seq1, \@seq2 );
+    $sdiffs_ref = sdiff( \@seq1, \@seq2 );
+
+C<sdiff> computes all necessary components to show two sequences
+and their minimized differences side by side, just like the
+Unix-utility I<sdiff> does:
+
+    same             same
+    before     |     after
+    old        <     -
+    -          >     new
+
+It returns a list of array refs, each pointing to an array of
+display instructions. In scalar context it returns a reference
+to such a list. If there are no differences, the list will have one
+entry per item, each indicating that the item was unchanged.
+
+Display instructions consist of three elements: A modifier indicator
+(C<+>: Element added, C<->: Element removed, C<u>: Element unmodified,
+C<c>: Element changed) and the value of the old and new elements, to
+be displayed side-by-side.
+
+An C<sdiff> of the following two sequences:
+
+    a b c e h j l m n p
+    b c d e f j k l m r s t
+
+results in
+
+    ( [ '-', 'a', ''  ],
+      [ 'u', 'b', 'b' ],
+      [ 'u', 'c', 'c' ],
+      [ '+', '',  'd' ],
+      [ 'u', 'e', 'e' ],
+      [ 'c', 'h', 'f' ],
+      [ 'u', 'j', 'j' ],
+      [ '+', '',  'k' ],
+      [ 'u', 'l', 'l' ],
+      [ 'u', 'm', 'm' ],
+      [ 'c', 'n', 'r' ],
+      [ 'c', 'p', 's' ],
+      [ '+', '',  't' ],
+    )
+
+C<sdiff> may be passed an optional third parameter; this is a CODE
+reference to a key generation function.  See L</KEY GENERATION
+FUNCTIONS>.
+
+Additional parameters, if any, will be passed to the key generation
+routine.
+
+=head2 C<compact_diff>
+
+C<compact_diff> is much like C<sdiff> except it returns a much more
+compact description consisting of just one flat list of indices.  An
+example helps explain the format:
+
+    my @a = qw( a b c   e  h j   l m n p      );
+    my @b = qw(   b c d e f  j k l m    r s t );
+    @cdiff = compact_diff( \@a, \@b );
+    # Returns:
+    #   @a      @b       @a       @b
+    #  start   start   values   values
+    (    0,      0,   #       =
+         0,      0,   #    a  !
+         1,      0,   #  b c  =  b c
+         3,      2,   #       !  d
+         3,      3,   #    e  =  e
+         4,      4,   #    f  !  h
+         5,      5,   #    j  =  j
+         6,      6,   #       !  k
+         6,      7,   #  l m  =  l m
+         8,      9,   #  n p  !  r s t
+        10,     12,   #
+    );
+
+The 0th, 2nd, 4th, etc. entries are all indices into @seq1 (@a in the
+above example) indicating where a hunk begins.  The 1st, 3rd, 5th, etc.
+entries are all indices into @seq2 (@b in the above example) indicating
+where the same hunk begins.
+
+So each pair of indices (except the last pair) describes where a hunk
+begins (in each sequence).  Since each hunk must end at the item just
+before the item that starts the next hunk, the next pair of indices can
+be used to determine where the hunk ends.
+
+So, the first 4 entries (0..3) describe the first hunk.  Entries 0 and 1
+describe where the first hunk begins (and so are always both 0).
+Entries 2 and 3 describe where the next hunk begins, so subtracting 1
+from each tells us where the first hunk ends.  That is, the first hunk
+contains items C<$diff[0]> through C<$diff[2] - 1> of the first sequence
+and contains items C<$diff[1]> through C<$diff[3] - 1> of the second
+sequence.
+
+In other words, the first hunk consists of the following two lists of items:
+
+               #  1st pair     2nd pair
+               # of indices   of indices
+    @list1 = @a[ $cdiff[0] .. $cdiff[2]-1 ];
+    @list2 = @b[ $cdiff[1] .. $cdiff[3]-1 ];
+               # Hunk start   Hunk end
+
+Note that the hunks will always alternate between those that are part of
+the LCS (those that contain unchanged items) and those that contain
+changes.  This means that all we need to be told is whether the first
+hunk is a 'same' or 'diff' hunk and we can determine which of the other
+hunks contain 'same' items or 'diff' items.
+
+By convention, we always make the first hunk contain unchanged items.
+So the 1st, 3rd, 5th, etc. hunks (all odd-numbered hunks if you start
+counting from 1) all contain unchanged items.  And the 2nd, 4th, 6th,
+etc. hunks (all even-numbered hunks if you start counting from 1) all
+contain changed items.
+
+Since @a and @b don't begin with the same value, the first hunk in our
+example is empty (otherwise we'd violate the above convention).  Note
+that the first 4 index values in our example are all zero.  Plug these
+values into our previous code block and we get:
+
+    @hunk1a = @a[ 0 .. 0-1 ];
+    @hunk1b = @b[ 0 .. 0-1 ];
+
+And C<0..-1> returns the empty list.
+
+Move down one pair of indices (2..5) and we get the offset ranges for
+the second hunk, which contains changed items.
+
+Since C<@diff[2..5]> contains (0,0,1,0) in our example, the second hunk
+consists of these two lists of items:
+
+        @hunk2a = @a[ $cdiff[2] .. $cdiff[4]-1 ];
+        @hunk2b = @b[ $cdiff[3] .. $cdiff[5]-1 ];
+    # or
+        @hunk2a = @a[ 0 .. 1-1 ];
+        @hunk2b = @b[ 0 .. 0-1 ];
+    # or
+        @hunk2a = @a[ 0 .. 0 ];
+        @hunk2b = @b[ 0 .. -1 ];
+    # or
+        @hunk2a = ( 'a' );
+        @hunk2b = ( );
+
+That is, we would delete item 0 ('a') from @a.
+
+Since C<@diff[4..7]> contains (1,0,3,2) in our example, the third hunk
+consists of these two lists of items:
+
+        @hunk3a = @a[ $cdiff[4] .. $cdiff[6]-1 ];
+        @hunk3a = @b[ $cdiff[5] .. $cdiff[7]-1 ];
+    # or
+        @hunk3a = @a[ 1 .. 3-1 ];
+        @hunk3a = @b[ 0 .. 2-1 ];
+    # or
+        @hunk3a = @a[ 1 .. 2 ];
+        @hunk3a = @b[ 0 .. 1 ];
+    # or
+        @hunk3a = qw( b c );
+        @hunk3a = qw( b c );
+
+Note that this third hunk contains unchanged items as our convention demands.
+
+You can continue this process until you reach the last two indices,
+which will always be the number of items in each sequence.  This is
+required so that subtracting one from each will give you the indices to
+the last items in each sequence.
+
+=head2 C<traverse_sequences>
+
+C<traverse_sequences> used to be the most general facility provided by
+this module (the new OO interface is more powerful and much easier to
+use).
+
+Imagine that there are two arrows.  Arrow A points to an element of
+sequence A, and arrow B points to an element of the sequence B. 
+Initially, the arrows point to the first elements of the respective
+sequences.  C<traverse_sequences> will advance the arrows through the
+sequences one element at a time, calling an appropriate user-specified
+callback function before each advance.  It willadvance the arrows in
+such a way that if there are equal elements C<$A[$i]> and C<$B[$j]>
+which are equal and which are part of the LCS, there will be some moment
+during the execution of C<traverse_sequences> when arrow A is pointing
+to C<$A[$i]> and arrow B is pointing to C<$B[$j]>.  When this happens,
+C<traverse_sequences> will call the C<MATCH> callback function and then
+it will advance both arrows.
+
+Otherwise, one of the arrows is pointing to an element of its sequence
+that is not part of the LCS.  C<traverse_sequences> will advance that
+arrow and will call the C<DISCARD_A> or the C<DISCARD_B> callback,
+depending on which arrow it advanced.  If both arrows point to elements
+that are not part of the LCS, then C<traverse_sequences> will advance
+one of them and call the appropriate callback, but it is not specified
+which it will call.
+
+The arguments to C<traverse_sequences> are the two sequences to
+traverse, and a hash which specifies the callback functions, like this:
+
+    traverse_sequences(
+        \@seq1, \@seq2,
+        {   MATCH => $callback_1,
+            DISCARD_A => $callback_2,
+            DISCARD_B => $callback_3,
+        }
+    );
+
+Callbacks for MATCH, DISCARD_A, and DISCARD_B are invoked with at least
+the indices of the two arrows as their arguments.  They are not expected
+to return any values.  If a callback is omitted from the table, it is
+not called.
+
+Callbacks for A_FINISHED and B_FINISHED are invoked with at least the
+corresponding index in A or B.
+
+If arrow A reaches the end of its sequence, before arrow B does,
+C<traverse_sequences> will call the C<A_FINISHED> callback when it
+advances arrow B, if there is such a function; if not it will call
+C<DISCARD_B> instead.  Similarly if arrow B finishes first. 
+C<traverse_sequences> returns when both arrows are at the ends of their
+respective sequences.  It returns true on success and false on failure. 
+At present there is no way to fail.
+
+C<traverse_sequences> may be passed an optional fourth parameter; this
+is a CODE reference to a key generation function.  See L</KEY GENERATION
+FUNCTIONS>.
+
+Additional parameters, if any, will be passed to the key generation function.
+
+If you want to pass additional parameters to your callbacks, but don't
+need a custom key generation function, you can get the default by
+passing undef:
+
+    traverse_sequences(
+        \@seq1, \@seq2,
+        {   MATCH => $callback_1,
+            DISCARD_A => $callback_2,
+            DISCARD_B => $callback_3,
+        },
+        undef,     # default key-gen
+        $myArgument1,
+        $myArgument2,
+        $myArgument3,
+    );
+
+C<traverse_sequences> does not have a useful return value; you are
+expected to plug in the appropriate behavior with the callback
+functions.
+
+=head2 C<traverse_balanced>
+
+C<traverse_balanced> is an alternative to C<traverse_sequences>. It
+uses a different algorithm to iterate through the entries in the
+computed LCS. Instead of sticking to one side and showing element changes
+as insertions and deletions only, it will jump back and forth between
+the two sequences and report I<changes> occurring as deletions on one
+side followed immediatly by an insertion on the other side.
+
+In addition to the C<DISCARD_A>, C<DISCARD_B>, and C<MATCH> callbacks
+supported by C<traverse_sequences>, C<traverse_balanced> supports
+a C<CHANGE> callback indicating that one element got C<replaced> by another:
+
+    traverse_balanced(
+        \@seq1, \@seq2,
+        {   MATCH => $callback_1,
+            DISCARD_A => $callback_2,
+            DISCARD_B => $callback_3,
+            CHANGE    => $callback_4,
+        }
+    );
+
+If no C<CHANGE> callback is specified, C<traverse_balanced>
+will map C<CHANGE> events to C<DISCARD_A> and C<DISCARD_B> actions,
+therefore resulting in a similar behaviour as C<traverse_sequences>
+with different order of events.
+
+C<traverse_balanced> might be a bit slower than C<traverse_sequences>,
+noticable only while processing huge amounts of data.
+
+The C<sdiff> function of this module 
+is implemented as call to C<traverse_balanced>.
+
+C<traverse_balanced> does not have a useful return value; you are expected to
+plug in the appropriate behavior with the callback functions.
+
+=head1 KEY GENERATION FUNCTIONS
+
+Most of the functions accept an optional extra parameter.  This is a
+CODE reference to a key generating (hashing) function that should return
+a string that uniquely identifies a given element.  It should be the
+case that if two elements are to be considered equal, their keys should
+be the same (and the other way around).  If no key generation function
+is provided, the key will be the element as a string.
+
+By default, comparisons will use "eq" and elements will be turned into keys
+using the default stringizing operator '""'.
+
+Where this is important is when you're comparing something other than
+strings.  If it is the case that you have multiple different objects
+that should be considered to be equal, you should supply a key
+generation function. Otherwise, you have to make sure that your arrays
+contain unique references.
+
+For instance, consider this example:
+
+    package Person;
+
+    sub new
+    {
+        my $package = shift;
+        return bless { name => '', ssn => '', @_ }, $package;
+    }
+
+    sub clone
+    {
+        my $old = shift;
+        my $new = bless { %$old }, ref($old);
+    }
+
+    sub hash
+    {
+        return shift()->{'ssn'};
+    }
+
+    my $person1 = Person->new( name => 'Joe', ssn => '123-45-6789' );
+    my $person2 = Person->new( name => 'Mary', ssn => '123-47-0000' );
+    my $person3 = Person->new( name => 'Pete', ssn => '999-45-2222' );
+    my $person4 = Person->new( name => 'Peggy', ssn => '123-45-9999' );
+    my $person5 = Person->new( name => 'Frank', ssn => '000-45-9999' );
+
+If you did this:
+
+    my $array1 = [ $person1, $person2, $person4 ];
+    my $array2 = [ $person1, $person3, $person4, $person5 ];
+    Algorithm::Diff::diff( $array1, $array2 );
+
+everything would work out OK (each of the objects would be converted
+into a string like "Person=HASH(0x82425b0)" for comparison).
+
+But if you did this:
+
+    my $array1 = [ $person1, $person2, $person4 ];
+    my $array2 = [ $person1, $person3, $person4->clone(), $person5 ];
+    Algorithm::Diff::diff( $array1, $array2 );
+
+$person4 and $person4->clone() (which have the same name and SSN)
+would be seen as different objects. If you wanted them to be considered
+equivalent, you would have to pass in a key generation function:
+
+    my $array1 = [ $person1, $person2, $person4 ];
+    my $array2 = [ $person1, $person3, $person4->clone(), $person5 ];
+    Algorithm::Diff::diff( $array1, $array2, \&Person::hash );
+
+This would use the 'ssn' field in each Person as a comparison key, and
+so would consider $person4 and $person4->clone() as equal.
+
+You may also pass additional parameters to the key generation function
+if you wish.
+
+=head1 ERROR CHECKING
+
+If you pass these routines a non-reference and they expect a reference,
+they will die with a message.
+
+=head1 AUTHOR
+
+This version released by Tye McQueen (http://perlmonks.org/?node=tye).
+
+=head1 LICENSE
+
+Parts Copyright (c) 2000-2004 Ned Konz.  All rights reserved.
+Parts by Tye McQueen.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl.
+
+=head1 MAILING LIST
+
+Mark-Jason still maintains a mailing list.  To join a low-volume mailing
+list for announcements related to diff and Algorithm::Diff, send an
+empty mail message to mjd-perl-diff-request@plover.com.
+
+=head1 CREDITS
+
+Versions through 0.59 (and much of this documentation) were written by:
+
+Mark-Jason Dominus, mjd-perl-diff@plover.com
+
+This version borrows some documentation and routine names from
+Mark-Jason's, but Diff.pm's code was completely replaced.
+
+This code was adapted from the Smalltalk code of Mario Wolczko
+<mario@wolczko.com>, which is available at
+ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
+
+C<sdiff> and C<traverse_balanced> were written by Mike Schilli
+<m@perlmeister.com>.
+
+The algorithm is that described in
+I<A Fast Algorithm for Computing Longest Common Subsequences>,
+CACM, vol.20, no.5, pp.350-353, May 1977, with a few
+minor improvements to improve the speed.
+
+Much work was done by Ned Konz (perl@bike-nomad.com).
+
+The OO interface and some other changes are by Tye McQueen.
+
+=cut
index a17eb4d..f322349 100644 (file)
@@ -14,6 +14,17 @@ install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/html/"
   PATTERN "*~" EXCLUDE
 )
 
+#### Generate the manpages
+if( NOT MANPAGE_DIR )
+       set( MANPAGE_DIR $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/man/share/man/man1 )
+endif( NOT MANPAGE_DIR)
+
+add_custom_target(TARGET install
+        COMMAND ${CMAKE_COMMAND} -E make_directory ${MANPAGE_DIR}
+       COMMAND pod2man tools/simgrid_update_xml.pl > ${MANPAGE_DIR}/simgrid_update_xml.1
+       COMMENT "Generating manpages"
+)
+
 # binaries
 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
                  ${CMAKE_BINARY_DIR}/bin/smpif2c
@@ -67,12 +78,16 @@ if(enable_lib_static AND NOT WIN32)
 endif(enable_lib_static AND NOT WIN32)
 
 # include files
-foreach(file ${install_HEADERS})
+set(HEADERS
+    ${headers_to_install}
+    ${generated_headers_to_install}
+    )
+foreach(file ${HEADERS})
   get_filename_component(location ${file} PATH)
   string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" location "${location}")
   install(FILES ${file}
           DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${location})
-endforeach(file ${install_HEADERS})
+endforeach(file ${HEADERS})
 
 # example files
 foreach(file ${examples_to_install_in_doc})
@@ -162,6 +177,7 @@ add_custom_target(dist-dir
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/html/ simgrid-${release_version}/doc/html/
 )
 add_dependencies(dist-dir simgrid_documentation)
+add_dependencies(dist-dir maintainer_files)
 
 set(dirs_in_tarball "")
 foreach(file ${source_to_pack})
@@ -304,15 +320,25 @@ WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 add_custom_target(sync-gforge-doc
 COMMAND chmod g+rw -R doc/
 COMMAND chmod a+rX -R doc/
-COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/doc/ || true
-COMMAND scp doc/index.php doc/webcruft/robots.txt scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
-COMMAND scp doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo.png doc/webcruft/simgrid_logo_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
+COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times 
+doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/${release_version}/doc/ || true
+COMMAND scp doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo.png  doc/webcruft/simgrid_logo_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/${release_version}/
 WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 )
+add_dependencies(sync-gforge-doc simgrid_documentation)
+
 add_custom_target(sync-gforge-dtd
-COMMAND scp src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
+COMMAND scp src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/${release_version}/
 WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 )
 
+#PIPOL
+add_custom_target(sync-pipol
+COMMAND scp -r Experimental_bindings.sh Experimental.sh  MemCheck.sh pre-simgrid.sh navarro@pipol.inria.fr:~/
+COMMAND scp -r rc.* navarro@pipol.inria.fr:~/.pipol/
+COMMAND scp -r Nightly* navarro@pipol.inria.fr:~/.pipol/nightly
+COMMAND ssh navarro@pipol.inria.fr "chmod a=rwx ~/* ~/.pipol/rc.* ~/.pipol/nightly/*"
+WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/buildtools/pipol/"
+)
 
 include(CPack)
index 6d0cc56..41e84a0 100644 (file)
@@ -3,6 +3,7 @@ set(optCFLAGS "")
 
 if(NOT __VISUALC__ AND NOT __BORLANDC__)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-g3")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-g3")
 else(NOT __VISUALC__ AND NOT __BORLANDC__)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}/Zi")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/Zi")
@@ -12,10 +13,21 @@ if(enable_compile_warnings)
        set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
 endif(enable_compile_warnings)
 
+if(enable_compile_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+    set(warnCFLAGS "${warnCFLAGS} -Wno-error=unused-but-set-variable ")
+endif(enable_compile_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+
 if(enable_compile_optimizations)
        set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
+else(enable_compile_optimizations)
+        set(optCFLAGS "-O0 ")
 endif(enable_compile_optimizations)
 
+if(APPLE AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")     
+    set(optCFLAGS "-O0 ")
+endif(APPLE AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+
 if(NOT enable_debug)
                set(CMAKE_C_FLAGS "-DNDEBUG ${CMAKE_C_FLAGS}")
 endif(NOT enable_debug)
@@ -23,13 +35,21 @@ endif(NOT enable_debug)
 set(CMAKE_C_FLAGS "${optCFLAGS}${warnCFLAGS}${CMAKE_C_FLAGS}")
 
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${custom_flags}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${optCFLAGS}")
+
+# Try to make Mac a bit more complient to open source standards
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE")
+endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 
+set(TESH_OPTION "")
 if(enable_coverage)
        find_program(GCOV_PATH gcov)
        if(GCOV_PATH)
                SET(COVERAGE_COMMAND "${GCOV_PATH}" CACHE TYPE FILEPATH FORCE)
                set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+               set(TESH_OPTION --enable-coverage)
                add_definitions(-fprofile-arcs -ftest-coverage)
                endif(GCOV_PATH)
 endif(enable_coverage)
index 8be3928..1e152f7 100644 (file)
@@ -1,3 +1,5 @@
+#### Generate the html documentation
+
 if(BIBTEX2HTML)
        set(BIBTEX2HTML_PATH ${BIBTEX2HTML})
 else(BIBTEX2HTML)
@@ -6,8 +8,6 @@ endif(BIBTEX2HTML)
 
 find_path(FIG2DEV_PATH NAMES fig2dev   PATHS NO_DEFAULT_PATHS)
 find_path(DOXYGEN_PATH NAMES doxygen   PATHS NO_DEFAULT_PATHS)
-find_path(BIBTOOL_PATH NAMES bibtool   PATHS NO_DEFAULT_PATHS)
-find_path(ICONV_PATH   NAMES iconv     PATHS NO_DEFAULT_PATHS)
 
 ### Check whether the bibtex2html that we found is the one that Arnaud requires
 exec_program("${BIBTEX2HTML_PATH}/bibtex2html -version" OUTPUT_VARIABLE OUTPUT_BIBTEX2HTML_VERSION)
@@ -25,7 +25,7 @@ else(${OUTPUT_BIBTEX2HTML_VERSION_2} STREQUAL ${OUTPUT_BIBTEX2HTML_VERSION}) # g
        SET(GOOD_BIBTEX2HTML_VERSION 1)
 endif(${OUTPUT_BIBTEX2HTML_VERSION_2} STREQUAL ${OUTPUT_BIBTEX2HTML_VERSION})
 
-if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH AND GOOD_BIBTEX2HTML_VERSION)
+if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
 
        string(REGEX REPLACE ";.*logcategories.doc" "" LISTE_DEUX "${LISTE_DEUX}")
 
@@ -38,6 +38,10 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV
                ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid_logo.png
                ${CMAKE_HOME_DIRECTORY}/doc/webcruft/simgrid_logo_small.png
                ${CMAKE_HOME_DIRECTORY}/doc/webcruft/poster_thumbnail.png
+               ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_01.png
+               ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_02.png
+               ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_03.png
+               ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_04.png
        )
        
        configure_file(${CMAKE_HOME_DIRECTORY}/doc/Doxyfile.in ${CMAKE_HOME_DIRECTORY}/doc/Doxyfile @ONLY)
@@ -46,10 +50,12 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV
        ADD_CUSTOM_TARGET(simgrid_documentation
                COMMENT "Generating the SimGrid documentation..."
                DEPENDS ${DOC_SOURCES} ${DOC_FIGS} ${source_doxygen}
+               COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/html
+           COMMAND ${CMAKE_COMMAND} -E make_directory   ${CMAKE_HOME_DIRECTORY}/doc/html
                COMMAND ${FIG2DEV_PATH}/fig2dev -Lmap ${CMAKE_HOME_DIRECTORY}/doc/fig/simgrid_modules.fig | perl -pe 's/imagemap/simgrid_modules/g'| perl -pe 's/<IMG/<IMG style=border:0px/g' | ${CMAKE_HOME_DIRECTORY}/tools/doxygen/fig2dev_postprocessor.pl > ${CMAKE_HOME_DIRECTORY}/doc/simgrid_modules.map
                WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc
        )
-
+               
        ADD_CUSTOM_COMMAND(
                OUTPUT ${CMAKE_HOME_DIRECTORY}/doc/logcategories.doc
                DEPENDS ${source_doxygen}
@@ -84,16 +90,15 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV
            COMMAND ${CMAKE_COMMAND} -E echo "XX First Doxygen pass"
                COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
                COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/index_create.pl simgrid.tag index-API.doc
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/toc_create.pl FAQ.doc index.doc contrib.doc gtut-introduction.doc history.doc
+               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/toc_create.pl pls.doc index.doc gtut-introduction.doc installSimgrid.doc bindings.doc options.doc tracing.doc
                
                COMMAND ${CMAKE_COMMAND} -E echo "XX Second Doxygen pass"
                COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
                
                COMMAND ${CMAKE_COMMAND} -E echo "XX Post-processing Doxygen result"
                COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/doc/html/dir*
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/index_php.pl index.php.in html/index.html index.php
                COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/doxygen_postprocesser.pl
-       
+               
                COMMAND ${CMAKE_COMMAND} -E echo "XX Create shortcuts pages"
                COMMAND ${CMAKE_COMMAND} -E echo \"<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>\" > ${CMAKE_HOME_DIRECTORY}/doc/html/gras.html
                COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>Grid Reality And Simulation.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/gras.html
@@ -108,30 +113,8 @@ if(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV
                COMMAND ${CMAKE_COMMAND} -E echo \"<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>DAG Simulator.</a></h2></center></html>\" >> ${CMAKE_HOME_DIRECTORY}/doc/html/simdag.html
                WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/
        )
-
-       ADD_CUSTOM_TARGET(bib_files
-               DEPENDS ${CMAKE_HOME_DIRECTORY}/doc/all.bib
-               COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_HOME_DIRECTORY}/doc/html
-               COMMAND ${CMAKE_COMMAND} -E make_directory   ${CMAKE_HOME_DIRECTORY}/doc/html
-               COMMAND ${CMAKE_COMMAND} -E echo "XX Generate publis_core.bib publis_extern.bib publis_intra.bib"
-               COMMAND ${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"core\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' all.bib -o publis_core.bib
-               COMMAND ${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"extern\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' all.bib -o publis_extern.bib
-               COMMAND ${BIBTOOL_PATH}/bibtool -- 'select.by.string={category \"intra\"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' all.bib -o publis_intra.bib
-
-               COMMAND ${CMAKE_COMMAND} -E echo "XX Generate publis_count.html"
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/bibtex2html_table_count.pl < ${CMAKE_HOME_DIRECTORY}/doc/all.bib > ${CMAKE_HOME_DIRECTORY}/doc/publis_count.html
-               
-               COMMAND ${CMAKE_COMMAND} -E echo "XX Generate publis_core.html publis_extern.html publis_intra.html"
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/bibtex2html_wrapper.pl publis_core
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/bibtex2html_wrapper.pl publis_extern
-               COMMAND ${CMAKE_HOME_DIRECTORY}/tools/doxygen/bibtex2html_wrapper.pl publis_intra
-               
-               WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/
-       )
-
-       add_dependencies(simgrid_documentation bib_files)
        
-else(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH AND GOOD_BIBTEX2HTML_VERSION)
+else(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
 
        ADD_CUSTOM_TARGET(simgrid_documentation
                        COMMENT "Generating the SimGrid documentation..."
@@ -150,23 +133,39 @@ else(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICO
        ADD_CUSTOM_COMMAND(TARGET simgrid_documentation
                        COMMAND ${CMAKE_COMMAND} -E echo "DOXYGEN_PATH          = ${DOXYGEN_PATH}"
                        COMMAND ${CMAKE_COMMAND} -E echo "FIG2DEV_PATH          = ${FIG2DEV_PATH}"
-                       COMMAND ${CMAKE_COMMAND} -E echo "BIBTOOL_PATH          = ${BIBTOOL_PATH}"
                        COMMAND ${CMAKE_COMMAND} -E echo "BIBTEX2HTML_PATH      = ${BIBTEX2HTML_PATH}"
-                       COMMAND ${CMAKE_COMMAND} -E echo "ICONV_PATH            = ${ICONV_PATH}"
                        COMMAND ${CMAKE_COMMAND} -E echo "IN ORDER TO GENERATE THE DOCUMENTATION YOU NEED ALL TOOLS !!!"
                        COMMAND ${CMAKE_COMMAND} -E echo "FAIL TO MAKE SIMGRID DOCUMENTATION see previous messages for details ..."
                        COMMAND false
                        )
 
                
-endif(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTOOL_PATH AND BIBTEX2HTML_PATH AND ICONV_PATH AND GOOD_BIBTEX2HTML_VERSION)
+endif(DOXYGEN_PATH AND FIG2DEV_PATH AND BIBTEX2HTML_PATH AND GOOD_BIBTEX2HTML_VERSION)
 
 ##############################################################################"
 
 message(STATUS "Check individual TOCs")
-file(GLOB_RECURSE LISTE_GTUT
-       "${CMAKE_HOME_DIRECTORY}/doc/gtut-tour-*.doc"
+set(LISTE_GTUT
+       doc/gtut-tour-00-install.doc
+       doc/gtut-tour-01-bones.doc
+       doc/gtut-tour-02-simple.doc
+       doc/gtut-tour-03-args.doc
+       doc/gtut-tour-04-callback.doc
+       doc/gtut-tour-05-globals.doc
+       doc/gtut-tour-06-logs.doc
+       doc/gtut-tour-07-timers.doc
+       doc/gtut-tour-08-exceptions.doc
+       doc/gtut-tour-09-simpledata.doc
+       doc/gtut-tour-10-rpc.doc
+       doc/gtut-tour-11-explicitwait.doc
+       doc/gtut-tour-recap-messages.doc
+       doc/gtut-tour-12-staticstruct.doc
+       doc/gtut-tour-13-pointers.doc
+       doc/gtut-tour-14-dynar.doc
+       doc/gtut-tour-15-manualdatadef.doc
+       doc/gtut-tour-16-exchangecb.doc
 )
+
 foreach(file_name ${LISTE_GTUT})
        file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc)
        file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc)
@@ -175,7 +174,8 @@ foreach(file_name ${LISTE_GTUT})
        string(REGEX MATCH "Table of Contents.*<hr>" valeur_line "${file_content}")
        string(REPLACE "\n" ";" valeur_line "${valeur_line}")
        string(REPLACE "\n" ";" file_content "${file_content}")
-       
+              
+       file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.realtoc "\n") # make sure it exists
        foreach(line ${file_content})
                string(REGEX MATCH "[\\]s?u?b?s?u?b?section.*" line2 "${line}")
                string(REGEX MATCH ".*_toc.*" line3 "${line}")
@@ -191,6 +191,7 @@ foreach(file_name ${LISTE_GTUT})
                endif(line2 AND NOT line3)
        endforeach(line ${file_content})
        
+       file(APPEND ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc "\n") # make sure it exists
        foreach(line ${valeur_line})
                string(REGEX MATCH ".*ref.*" line_ok ${line})
                if(line_ok)
@@ -257,3 +258,17 @@ else(compare_files)
 endif(compare_files)   
   
 file(REMOVE ${CMAKE_HOME_DIRECTORY}/doc/tmp.curtoc)
+
+ADD_CUSTOM_TARGET(pdf
+    COMMAND ${CMAKE_COMMAND} -E echo "XX First pass simgrid_documentation.pdf"
+    COMMAND make clean
+    COMMAND make pdf || true
+    COMMAND ${CMAKE_COMMAND} -E echo "XX Second pass simgrid_documentation.pdf"
+    COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf
+    COMMAND make pdf || true
+    COMMAND ${CMAKE_COMMAND} -E echo "XX Write Simgrid_documentation.pdf"
+    COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_HOME_DIRECTORY}/doc/latex/refman.pdf ${CMAKE_HOME_DIRECTORY}/doc/latex/simgrid_documentation.pdf
+  
+    WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/latex/
+)
+add_dependencies(pdf simgrid_documentation)
index 3aaaaae..d1fa739 100644 (file)
@@ -43,6 +43,7 @@ set(string10 "'s/#if defined(_WIN32)/#if defined(_XBT_WIN32)/g'")
 set(string11 "'s/#include <unistd.h>/#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\\n#  ifndef __STRICT_ANSI__\\n#    include <io.h>\\n#    include <process.h>\\n#  endif\\n#else\\n#  include <unistd.h>\\n#endif/g'")
 set(string12 "'s/#if defined(_WIN32)/#if defined(_XBT_WIN32)/g'")
 set(string13 "'s/#include <unistd.h>/#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\\n#  ifndef __STRICT_ANSI__\\n#    include <io.h>\\n#    include <process.h>\\n#  endif\\n#else\\n#  include <unistd.h>\\n#endif/g'")
+set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'")
 
 ADD_CUSTOM_COMMAND(
        OUTPUT  ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h
@@ -58,13 +59,16 @@ ADD_CUSTOM_COMMAND(
                                        
        #${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
        COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid.dtd -S src/surf/simgrid_dtd.l -L src/surf/simgrid.dtd
+       COMMAND ${SED_EXE} -i ${string14} src/surf/simgrid_dtd.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/surf/simgrid_dtd.l"
        #${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.l: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
        COMMAND ${FLEXML_EXE} -b 1000000 -P graphxml --sysid=graphxml.dtd -S src/xbt/graphxml.l -L src/xbt/graphxml.dtd
+       COMMAND ${SED_EXE} -i ${string14} src/xbt/graphxml.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/xbt/graphxml.l"
        #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
-       COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.l -L ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
+       COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S src/simdag/dax_dtd.l -L src/simdag/dax.dtd
        COMMAND ${SED_EXE} -i ${string5} src/simdag/dax_dtd.l
+       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.l"
        
        #${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
@@ -72,18 +76,21 @@ ADD_CUSTOM_COMMAND(
        COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid.dtd -H include/surf/simgrid_dtd.h -L src/surf/simgrid.dtd
        COMMAND ${SED_EXE} -i ${string1} include/surf/simgrid_dtd.h
        COMMAND ${SED_EXE} -i ${string2} include/surf/simgrid_dtd.h     
+       COMMAND ${SED_EXE} -i ${string14} include/surf/simgrid_dtd.h
        COMMAND ${CMAKE_COMMAND} -E echo "include/surf/simgrid_dtd.h"
        #${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
        COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
        COMMAND ${FLEXML_EXE} -P graphxml --sysid=graphxml.dtd -H include/xbt/graphxml.h -L src/xbt/graphxml.dtd
        COMMAND ${SED_EXE} -i ${string3} include/xbt/graphxml.h 
        COMMAND ${SED_EXE} -i ${string4} include/xbt/graphxml.h
+       COMMAND ${SED_EXE} -i ${string14} include/xbt/graphxml.h
        COMMAND ${CMAKE_COMMAND} -E echo "include/xbt/graphxml.h"
        #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
        COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
        COMMAND ${FLEXML_EXE} --root-tags adag -P dax_ --sysid=dax.dtd -H src/simdag/dax_dtd.h -L src/simdag/dax.dtd
        COMMAND ${SED_EXE} -i ${string6} src/simdag/dax_dtd.h   
        COMMAND ${SED_EXE} -i ${string7} src/simdag/dax_dtd.h
+       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.h
        COMMAND ${FLEX_EXE} -o src/gras/DataDesc/ddt_parse.yy.c -Pgras_ddt_parse_ --noline src/gras/DataDesc/ddt_parse.yy.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.h"
        
index 3048580..da26f94 100644 (file)
@@ -69,11 +69,16 @@ if(HAVE_GTNETS)
        add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets)\r
 endif(HAVE_GTNETS)\r
 \r
+if(HAVE_NS3)\r
+       add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/ns3)\r
+endif(HAVE_NS3)\r
+\r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/amok/bandwidth)\r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/amok/saturate)\r
 \r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)\r
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)\r
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)\r
 if(HAVE_GRAPHVIZ)\r
   add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dot)\r
 endif(HAVE_GRAPHVIZ)\r
index 2c1847c..45b347d 100644 (file)
@@ -1,11 +1,5 @@
 ### Make Libs
 
-
-# Try to make Mac a bit more complient to open source standards
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-       add_definitions("-D_XOPEN_SOURCE")
-endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-
 ###############################
 # Declare the library content #
 ###############################
@@ -72,10 +66,7 @@ target_link_libraries(gras   ${GRAS_DEP})
 
 # Compute the dependencies of SimGrid
 #####################################
-set(SIMGRID_DEP "-lm")
-if(HAVE_PCRE_LIB)
-       SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre")
-endif(HAVE_PCRE_LIB)
+set(SIMGRID_DEP "-lm -lpcre")
 
 if(pthread)
        if(${CONTEXT_THREADS})
@@ -123,6 +114,16 @@ if(HAVE_GTNETS)
        SET(SIMGRID_DEP "${SIMGRID_DEP} -lgtnets")
 endif(HAVE_GTNETS)
 
+if(HAVE_NS3)
+    if(${NS3_VERSION} EQUAL 310)
+           SET(SIMGRID_DEP "${SIMGRID_DEP} -lns3")
+           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_NS3_3_10")
+           set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_NS3_3_10")
+       else(${NS3_VERSION} EQUAL 310)
+           SET(SIMGRID_DEP "${SIMGRID_DEP} -lns3-core -lns3-csma -lns3-point-to-point")
+       endif(${NS3_VERSION} EQUAL 310)
+endif(HAVE_NS3)
+
 if(HAVE_POSIX_GETTIME)
        SET(SIMGRID_DEP "${SIMGRID_DEP} -lrt")
 endif(HAVE_POSIX_GETTIME)
index 733f6ca..0047b48 100644 (file)
@@ -19,12 +19,8 @@ else(MSVC)
     endif(CMAKE_COMPILER_IS_GNUCC)\r
 endif(MSVC)\r
 \r
-set(GRAS_DEP "wsock32")\r
-set(SIMGRID_DEP "wsock32")\r
-\r
-if(HAVE_PCRE_LIB)\r
-       SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre")\r
-endif(HAVE_PCRE_LIB)\r
+set(GRAS_DEP "ws2_32")\r
+set(SIMGRID_DEP "ws2_32 -lpcre")\r
 \r
 target_link_libraries(simgrid  ${SIMGRID_DEP})\r
 target_link_libraries(gras     ${GRAS_DEP})\r
index 44eb7a8..a1e39de 100644 (file)
@@ -25,6 +25,7 @@ find_path(HAVE_SIMULATOR_H
     /opt/csw
     /sw
     /usr
+    ${gtnets_path}
 )
 
 string(REPLACE "/libgtnets.${LIB_EXE}" ""  GTNETS_LIB_PATH "${HAVE_GTNETS_LIB}")
diff --git a/buildtools/Cmake/Modules/FindNS3.cmake b/buildtools/Cmake/Modules/FindNS3.cmake
new file mode 100644 (file)
index 0000000..c8e34bb
--- /dev/null
@@ -0,0 +1,110 @@
+find_library(HAVE_NS3_LIB
+    NAME ns3
+    HINTS
+    $ENV{LD_LIBRARY_PATH}
+    $ENV{HOME}
+    PATH_SUFFIXES lib64 lib ns3/lib
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+    ${ns3_path}
+)
+
+find_library(HAVE_NS3_CORE_LIB
+    NAME ns3-core
+    HINTS
+    $ENV{LD_LIBRARY_PATH}
+    $ENV{HOME}
+    PATH_SUFFIXES lib64 lib ns3/lib
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+    ${ns3_path}
+)
+
+find_path(HAVE_CORE_MODULE_H
+       NAME ns3/core-module.h
+    HINTS
+    $ENV{HOME}
+    PATH_SUFFIXES include ns3/include
+    PATHS
+    /opt
+    /opt/local
+    /opt/csw
+    /sw
+    /usr
+    ${ns3_path}
+)
+
+message(STATUS "Looking for core-module.h")
+if(HAVE_CORE_MODULE_H)
+message(STATUS "Looking for core-module.h - found")
+else(HAVE_CORE_MODULE_H)
+message(STATUS "Looking for core-module.h - not found")
+endif(HAVE_CORE_MODULE_H)
+mark_as_advanced(HAVE_CORE_MODULE_H)
+
+message(STATUS "Looking for lib ns3")
+if(HAVE_NS3_LIB)
+message(STATUS "Looking for lib ns3 - found")
+else(HAVE_NS3_LIB)
+message(STATUS "Looking for lib ns3 - not found")
+endif(HAVE_NS3_LIB)
+mark_as_advanced(HAVE_NS3_LIB)
+
+message(STATUS "Looking for lib ns3-core")
+if(HAVE_NS3_CORE_LIB)
+message(STATUS "Looking for lib ns3-core - found")
+else(HAVE_NS3_CORE_LIB)
+message(STATUS "Looking for lib ns3-core - not found")
+endif(HAVE_NS3_CORE_LIB)
+mark_as_advanced(HAVE_NS3_LIB)
+mark_as_advanced(HAVE_NS3_CORE_LIB)
+
+if(HAVE_CORE_MODULE_H)
+    if(HAVE_NS3_LIB)
+        message(STATUS "Warning: NS-3 version <= 3.10")
+        set(HAVE_NS3 1)
+        set(NS3_VERSION 310)
+        string(REPLACE "/libns3.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_LIB}")
+    endif(HAVE_NS3_LIB)
+    if(HAVE_NS3_CORE_LIB)
+        message(STATUS "NS-3 version > 3.10")
+        set(HAVE_NS3 1)
+        set(NS3_VERSION 312)
+        string(REPLACE "/libns3-core.${LIB_EXE}" ""  HAVE_NS3_LIB "${HAVE_NS3_CORE_LIB}")
+    endif(HAVE_NS3_CORE_LIB)
+endif(HAVE_CORE_MODULE_H)
+
+if(HAVE_NS3)
+       string(REGEX MATCH "${HAVE_NS3_LIB}" operation "$ENV{LD_LIBRARY_PATH}")
+       if(NOT operation)
+               message(STATUS "Warning: To use NS-3 don't forget to set LD_LIBRARY_PATH with:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HAVE_NS3_LIB}")
+               set(HAVE_NS3 0)
+       else(NOT operation)
+       
+               string(REGEX MATCH "-L${HAVE_NS3_LIB} " operation1 "${CMAKE_C_FLAGS}")
+               if(NOT operation1)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${HAVE_NS3_LIB} ")
+               endif(NOT operation1)
+               
+               string(REGEX MATCH "-I${HAVE_CORE_MODULE_H} " operation1 "${CMAKE_C_FLAGS}")
+               if(NOT operation1)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_CORE_MODULE_H} ")
+               endif(NOT operation1)
+       
+               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_CORE_MODULE_H} -L${HAVE_NS3_LIB} ")
+       endif(NOT operation)            
+else(HAVE_NS3)
+    message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
+endif(HAVE_NS3)
+
+if(HAVE_NS3 AND enable_supernovae)
+    set(enable_supernovae OFF)
+endif(HAVE_NS3 AND enable_supernovae)
\ No newline at end of file
index 45eddfe..0b3db37 100644 (file)
@@ -1,6 +1,7 @@
 find_library(PATH_PCRE_LIB 
        NAMES pcre
     HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
     $ENV{LD_LIBRARY_PATH}
     $ENV{PCRE_LIBRARY_PATH}
     PATH_SUFFIXES lib/ GnuWin32/lib
@@ -11,8 +12,18 @@ find_library(PATH_PCRE_LIB
     /sw
     /usr)
     
+string(REGEX MATCH ".dll.a" operation "${PATH_PCRE_LIB}")
+
+if(NOT operation)
+    if(WIN32)
+           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-DPCRE_STATIC ")
+    endif(WIN32)
+endif(NOT operation)
+
+
 find_path(PATH_PCRE_H "pcre.h"
     HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
     $ENV{LD_LIBRARY_PATH}
     $ENV{PCRE_LIBRARY_PATH}
     PATH_SUFFIXES include/ GnuWin32/include
@@ -22,24 +33,7 @@ find_path(PATH_PCRE_H "pcre.h"
     /opt/csw
     /sw
     /usr)
-    
-set(HAVE_PCRE_LIB 0)
-if(PATH_PCRE_LIB AND PATH_PCRE_H)
-       string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
-       string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
-       string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
-          if(NOT operation)
-                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
-          endif(NOT operation)
-          string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
-          if(NOT operation)
-                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
-          endif(NOT operation)    
-       set(HAVE_PCRE_LIB 1)
-else(PATH_PCRE_LIB)
-               message(STATUS "Warning : You should install libpcre (please install the libpcre3-dev package or equivalent)")
-endif(PATH_PCRE_LIB AND PATH_PCRE_H)
-    
+
 message(STATUS "Looking for pcre.h")
 if(PATH_PCRE_H)
 message(STATUS "Looking for pcre.h - found")
@@ -54,5 +48,41 @@ else(PATH_PCRE_LIB)
 message(STATUS "Looking for lib pcre - not found")
 endif(PATH_PCRE_LIB)
 
+if(WIN32)
+    find_path(PATH_PCRE_LICENCE "LICENCE"
+        HINTS
+        $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+        $ENV{LD_LIBRARY_PATH}
+        $ENV{PCRE_LIBRARY_PATH}
+        PATH_SUFFIXES GnuWin32
+        PATHS
+        /opt
+        /opt/local
+        /opt/csw
+        /sw
+        /usr)
+    message(STATUS "Looking for pcre licence")
+    if(PATH_PCRE_LICENCE)
+    message(STATUS "Looking for pcre licence - found")
+    else(PATH_PCRE_LICENCE)
+    message(STATUS "Looking for pcre licence - not found")
+    endif(PATH_PCRE_LICENCE)
+endif(WIN32)
+
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
+       string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
+       string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+       string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
+          if(NOT operation)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
+          endif(NOT operation)
+          string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
+          if(NOT operation)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
+          endif(NOT operation)    
+else(PATH_PCRE_LIB)
+          message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using SimGrid.")
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
+    
 mark_as_advanced(PATH_PCRE_H)
 mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
index 60e1b09..9e2bf45 100644 (file)
@@ -1,10 +1,9 @@
 ### ARGs use -D[var]=[ON/OFF] or [1/0] or [true/false](see after)
 ### ex: cmake -Denable_java=ON -Denable_gtnets=ON ./
 
-
-
 set(BIBTEX2HTML ${BIBTEX2HTML} CACHE PATH "Path to bibtex2html")
 set(gtnets_path ${gtnets_path} CACHE PATH "Path to gtnets lib and include")
+set(ns3_path ${ns3_path} CACHE PATH "Path to ns3 lib and include")
 set(custom_flags ${custom_flags} CACHE FORCE "Customers flags add to cmake_c_flag")
 
 if(NOT CMAKE_INSTALL_PREFIX)
@@ -15,10 +14,12 @@ endif(NOT CMAKE_INSTALL_PREFIX)
 
 set(pipol_user ${pipol_user} CACHE TYPE INTERNAL FORCE)
 
-option(enable_gtnets "Whether gtnets model is activated." on)
-option(enable_smpi "This variable set smpi lib." on)
+option(release "Whether Release Mode is activated (disable tests on experimental parts)" on)
+
+option(enable_gtnets "Whether gtnets model is activated." off)
+option(enable_ns3    "Whether ns3 model is activated." off)
+option(enable_smpi "This variable set smpi lib." off)
 option(enable_lua "Whether the lua bindings are activated." on)
-option(enable_pcre "Whether the pcre lib is activated." on) 
 
 if(WIN32 OR APPLE) 
 set(enable_smpi off CACHE TYPE INTERNAL FORCE)
index 4f626b4..2ed1608 100644 (file)
@@ -74,10 +74,10 @@ if(enable_print_message)
        message("")
 endif(enable_print_message)
 
-message("\nConfiguration of package `simgrid' (revision ${SVN_VERSION}) on arch (=${GRAS_THISARCH}):")
+message("\nConfiguration of package `simgrid' on arch (=${GRAS_THISARCH}):")
 message("           BUILDNAME :        ${BUILDNAME}")
 message("           SITE      :        ${SITE}")
-message("           Release   :        simgrid-${release_version}~rev${SVN_VERSION}")
+message("           Release   :        simgrid-${release_version}")
 message("")
 message("       Compiler: c++ :        ${CMAKE_CXX_COMPILER}")
 message("              version:        ${COMPILER_CXX_VERSION}")
@@ -89,7 +89,9 @@ message("            CPPFlags:        ${CMAKE_CXX_FLAGS}")
 message("")
 if(NOT APPLE AND NOT WIN32)
 message("      Compile Gtnets :        ${HAVE_GTNETS}")
+message("      Compile NS-3   :        ${HAVE_NS3}")
 message("      Gtnets path    :        ${gtnets_path}")
+message("      NS-3 path      :        ${ns3_path}")
 endif(NOT APPLE AND NOT WIN32)
 message("      Compile Lua    :        ${HAVE_LUA}")
 message("      Compile Smpi   :        ${enable_smpi}")
diff --git a/buildtools/Cmake/generate_g5k_platform.pl b/buildtools/Cmake/generate_g5k_platform.pl
new file mode 100755 (executable)
index 0000000..b8ba575
--- /dev/null
@@ -0,0 +1,204 @@
+#!/usr/bin/perl -w
+use strict;
+use Switch;
+my $toversion=3;
+
+if($#ARGV!=1) {
+    die "Usage: ./generate_g5k_platform.pl g5k_username g5k_password\n";
+}
+
+print "<?xml version='1.0'?>\n";
+print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
+print "<platform version=\"$toversion\">\n";
+print "\t<AS id=\"AS_grid5000\" routing=\"Floyd\" >\n";
+
+`rm -rf temp_g5k`;
+`mkdir -p temp_g5k`;
+chdir("./temp_g5k");
+`wget https://api.grid5000.fr/2.0/grid5000/sites --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
+
+open SITES_LIGNE, 'sites' or die "Unable to open sites $!\n";
+my $line = "";
+my $site = "";
+my $cluster = "";
+my $nodes = "";
+my @AS_route = ();
+
+print "\t\t<AS id=\"AS_interne\" routing=\"Floyd\">\n";
+printf "\t\t\t<router id=\"lille\"/>\n";
+printf "\t\t\t<router id=\"paris\"/>\n";
+printf "\t\t\t<router id=\"nancy\"/>\n";
+printf "\t\t\t<router id=\"rennes\"/>\n";
+printf "\t\t\t<router id=\"lyon\"/>\n";
+printf "\t\t\t<router id=\"bordeaux\"/>\n";
+printf "\t\t\t<router id=\"grenoble\"/>\n";
+printf "\t\t\t<router id=\"marseille\"/>\n";
+printf "\t\t\t<router id=\"toulouse\"/>\n";
+printf "\t\t\t<router id=\"sophia\"/>\n";
+#printf "\t\t\t<router id=\"luxembourg\">\n";
+print "\n";
+printf "\t\t\t<link id=\"Lille_Paris\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Paris_Nancy\"        bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Paris_Rennes\"       bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Paris_Lyon\"         bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Bordeaux_Lyon\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Lyon_Grenoble\"      bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Lyon_Marseille\"     bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Marseille_Sophia\"   bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+printf "\t\t\t<link id=\"Marseille_Toulouse\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+#printf "\t\t<link id=\"Luxemburg_Nancy\"    bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+print "\n";
+
+print "\t\t<route src=\"lille\"     dst=\"paris\"     ><link_ctn id=\"Lille_Paris\"/></route>\n";
+print "\t\t<route src=\"paris\"     dst=\"nancy\"     ><link_ctn id=\"Paris_Nancy\"/></route>\n";
+print "\t\t<route src=\"paris\"     dst=\"rennes\"    ><link_ctn id=\"Paris_Rennes\"/></route>\n";
+print "\t\t<route src=\"paris\"     dst=\"lyon\"      ><link_ctn id=\"Paris_Lyon\"/></route>\n";
+print "\t\t<route src=\"bordeaux\"  dst=\"lyon\"      ><link_ctn id=\"Bordeaux_Lyon\"/></route>\n";
+print "\t\t<route src=\"lyon\"      dst=\"grenoble\"  ><link_ctn id=\"Lyon_Grenoble\"/></route>\n";
+print "\t\t<route src=\"lyon\"      dst=\"marseille\" ><link_ctn id=\"Lyon_Marseille\"/></route>\n";
+print "\t\t<route src=\"marseille\" dst=\"sophia\"    ><link_ctn id=\"Marseille_Sophia\"/></route>\n";
+print "\t\t<route src=\"marseille\" dst=\"toulouse\"  ><link_ctn id=\"Marseille_Toulouse\"/></route>\n";
+#print "\t\t<route src=\"Luxemburg\" dst=\"Nancy\"     ><link_ctn id=\"Luxemburg_Nancy\"/></route>\n";
+print "\t\t</AS>\n";    
+
+while(defined($line=<SITES_LIGNE>))
+{
+       if($line =~ /"uid": "(.*)",/){
+               $site = $1;
+               print "\t\t<AS id=\"AS_$site\" routing=\"RuleBased\" >\n";
+               `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
+               open CLUSTERS_LIGNE, 'clusters' or die "Unable to open clusters $!\n";
+               while(defined($line=<CLUSTERS_LIGNE>))
+               {
+                       if($line =~ /"uid": "(.*)",/){
+                               $cluster = $1;
+                               print "\t\t\t<cluster id=\"AS_$cluster\" prefix=\"$cluster-\" suffix=\".$site.grid5000.fr\"\n";
+                               `wget https://api.grid5000.fr/2.0/grid5000/sites/$site/clusters/$cluster/nodes --http-user="$ARGV[0]" --http-password="$ARGV[1]" --no-check-certificate --quiet`;
+                               open NODES_LIGNE, 'nodes' or die "Unable to open nodes $!\n";
+                               while(defined($line=<NODES_LIGNE>))
+                               {
+                                       if($line =~ /"total": (.*),/){
+                                               print "\t\t\t\tradical=\"1-$1\" power=\"";
+                                               &get_gflops($cluster);
+                                               print "\" bw=\"1.25E8\" lat=\"1.0E-4\""."\n";
+                                               print "\t\t\t\tbb_bw=\"1.25E9\" bb_lat=\"1.0E-4\"></cluster>\n";
+                                       }
+                               }
+                               print "\t\t\t<link   id=\"link_$cluster\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n\n";
+                               close NODES_LIGNE;
+                               `rm nodes`;
+                       }
+               }
+               close CLUSTERS_LIGNE;
+               `rm clusters`;
+               
+               print "\t\t\t<AS id=\"gw_AS_$site\" routing=\"Full\">\n";
+               print "\t\t\t\t<router id=\"gw_$site\"/>\n";
+               print "\t\t\t</AS>\n";
+               print "\t\t\t<link   id=\"link_gw_$site\" bandwidth=\"1.25E9\" latency=\"1.0E-4\"/>\n";
+               print "\n";
+               
+               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
+               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
+               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
+               print "\t\t\t\tsymmetrical=\"YES\">\n";
+               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
+               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
+               print "\t\t\t</ASroute>\n\n"; 
+
+               print "\t\t\t<ASroute src=\"^AS_(.*)\$\" dst=\"^gw_AS_(.*)\$\"\n";
+               print "\t\t\t\tgw_src=\"\$1src-AS_\$1src_router.$site.grid5000.fr\"\n";
+               print "\t\t\t\tgw_dst=\"gw_\$1dst\"\n";
+               print "\t\t\t\tsymmetrical=\"NO\">\n";
+               print "\t\t\t\t\t<link_ctn id=\"link_\$1src\"/>\n";
+               print "\t\t\t</ASroute>\n\n"; 
+               
+               print "\t\t\t<ASroute src=\"^gw_AS_(.*)\$\" dst=\"^AS_(.*)\$\"\n";
+               print "\t\t\t\tgw_src=\"gw_\$1src\"\n";
+               print "\t\t\t\tgw_dst=\"\$1dst-AS_\$1dst_router.$site.grid5000.fr\"\n";
+               print "\t\t\t\tsymmetrical=\"NO\">\n";
+               print "\t\t\t\t\t<link_ctn id=\"link_\$1dst\"/>\n";
+               print "\t\t\t</ASroute>\n\n"; 
+               
+               print "\t\t</AS>\n";
+               
+               push @AS_route, $site;
+       }
+}
+
+while(@AS_route)
+{
+       $site = pop @AS_route;
+       print "\t\t<ASroute src=\"AS_$site\" dst=\"AS_interne\" gw_src=\"gw_$site\"";
+       if( $site =~ /^orsay$/ )
+       {
+               print " gw_dst=\"paris\"";
+       }
+       else
+       {
+               print " gw_dst=\"$site\"";
+       }
+       print " symmetrical=\"YES\">\n";
+       print "\t\t\t<link_ctn id=\"link_gw_$site\"/>\n";
+       print "\t\t</ASroute>\n";
+       
+#      print "\t\t<ASroute src=\"AS_interne\" dst=\"AS_$site\" gw_dst=\"gw_$site\"";
+#      if( $site =~ /^orsay$/ )
+#      {
+#              print " gw_src=\"paris\"";
+#      }
+#      else
+#      {
+#              print " gw_src=\"$site\"";
+#      }
+#      print " symmetrical=\"NO\">\n";
+#      print "\t\t\t<link_ctn id=\"link_gw_$site\"/>\n";
+#      print "\t\t</ASroute>\n";
+}
+
+print "\t</AS>\n";
+print "</platform>\n";
+`rm sites`;
+close SITES_LIGNE;
+
+
+sub get_gflops {
+       switch ($_[0]) {
+               case "bordeplage" { print "5.2297E9" }
+               case "bordereau"  { print "8.8925E9" }
+               case "borderline" { print "13.357E9" }
+               
+               case "chicon"     { print "8.9618E9" }
+               case "chimint"    { print "23.531E9" }
+               case "chinqchint" { print "22.270E9" }
+               case "chirloute"  { print "24.473E9" }
+               
+               case "adonis"     { print "23.681E9" }
+               case "edel"       { print "23.492E9" }
+               case "genepi"     { print "21.175E9" }
+               
+               case "capricorne" { print "4.7233E9" }
+               case "sagittaire" { print "5.6693E9" }
+               
+               case "graphene"   { print "16.673E9" }
+               case "griffon"    { print "20.678E9" }
+               
+               case "gdx"        { print "4.7153E9" }
+               case "netgdx"     { print "4.7144E9" }
+               
+               case "paradent"   { print "21.496E9" }
+               case "paramount"  { print "12.910E9" }
+               case "parapide"   { print "30.130E9" }
+               case "parapluie"  { print "27.391E9" }
+               
+               case "helios"     { print "7.7318E9" }
+               case "sol"        { print "8.9388E9" }
+               case "suno"       { print "23.530E9" }
+               
+               case "pastel"     {&nbs