Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Biggest commit ever (SIMIX2): the user processes can now run in parallel
authorthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 2 Dec 2010 13:05:32 +0000 (13:05 +0000)
committerthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 2 Dec 2010 13:05:32 +0000 (13:05 +0000)
in SIMIX

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8873 48e7efb5-ca39-0410-a469-dd3cf9ba447f

158 files changed:
ChangeLog
buildtools/Cmake/DefinePackages.cmake
examples/gras/all2all/test_sg_32 [changed mode: 0755->0644]
examples/gras/all2all/test_sg_64 [changed mode: 0755->0644]
examples/gras/mmrpc/test_sg_32 [changed mode: 0755->0644]
examples/gras/mmrpc/test_sg_64 [changed mode: 0755->0644]
examples/gras/ping/ping_client.c
examples/gras/ping/test_sg_32 [changed mode: 0755->0644]
examples/gras/ping/test_sg_64 [changed mode: 0755->0644]
examples/gras/pmm/test_sg_32 [changed mode: 0755->0644]
examples/gras/pmm/test_sg_64 [changed mode: 0755->0644]
examples/gras/properties/test_sg [changed mode: 0755->0644]
examples/gras/rpc/test_sg_32
examples/gras/rpc/test_sg_64
examples/lua/mult_matrix.tesh
examples/msg/actions/actions.c
examples/msg/actions/actions.tesh
examples/msg/icomms/peer.tesh
examples/msg/masterslave/masterslave.tesh
examples/msg/masterslave/masterslave_bypass.tesh
examples/msg/masterslave/masterslave_console.tesh
examples/msg/masterslave/masterslave_cpu_ti.tesh
examples/msg/masterslave/masterslave_failure.tesh
examples/msg/masterslave/masterslave_forwarder.tesh
examples/msg/masterslave/masterslave_mailbox.tesh
examples/msg/mc/bugged1.c
examples/msg/migration/migration.tesh
examples/msg/parallel_task/parallel_task.tesh
examples/msg/priority/priority.tesh
examples/msg/properties/msg_prop.tesh
examples/msg/sendrecv/sendrecv_CLM03.tesh
examples/msg/sendrecv/sendrecv_Reno.tesh
examples/msg/sendrecv/sendrecv_Vegas.tesh
examples/msg/suspend/suspend.tesh
examples/msg/trace/trace.tesh
include/msg/datatypes.h
include/msg/msg.h
include/xbt/dynar.h
include/xbt/ex.h
include/xbt/threadpool.h [new file with mode: 0644]
src/bindings/lua/simgrid_lua.c
src/gras/Msg/rpc.c
src/gras/Msg/sg_msg.c
src/gras/Transport/README
src/gras/Transport/sg_transport.c
src/gras/Transport/transport_plugin_sg.c
src/gras/Virtu/rl_process.c
src/gras/Virtu/sg_dns.c
src/gras/Virtu/sg_emul.c
src/gras/Virtu/sg_process.c
src/gras/Virtu/virtu_sg.h
src/gras/gras.c
src/include/mc/mc.h
src/include/simix/context.h
src/include/simix/datatypes.h
src/include/simix/simix.h
src/include/surf/surf.h
src/include/xbt/xbt_os_thread.h
src/instr/smpi_instr.c
src/instr/smx_instr.c
src/mc/mc_checkpoint.c
src/mc/mc_dfs.c [deleted file]
src/mc/mc_dpor.c
src/mc/mc_global.c
src/mc/mc_memory.c
src/mc/mc_request.c [new file with mode: 0644]
src/mc/mc_state.c [new file with mode: 0644]
src/mc/mc_transition.c [deleted file]
src/mc/memory_map.c
src/mc/private.h
src/msg/environment.c
src/msg/global.c
src/msg/gos.c
src/msg/host.c
src/msg/m_process.c
src/msg/mailbox.h
src/msg/msg_mailbox.c
src/msg/private.h
src/msg/task.c
src/simdag/sd_global.c
src/simix/host_private.h [new file with mode: 0644]
src/simix/network_private.h [new file with mode: 0644]
src/simix/private.h
src/simix/process_private.h [new file with mode: 0644]
src/simix/smurf_private.h [new file with mode: 0644]
src/simix/smx_action.c [deleted file]
src/simix/smx_context_base.c
src/simix/smx_context_java.c
src/simix/smx_context_private.h
src/simix/smx_context_ruby.c
src/simix/smx_context_sysv.c
src/simix/smx_context_sysv_private.h
src/simix/smx_context_thread.c
src/simix/smx_deployment.c
src/simix/smx_environment.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 [new file with mode: 0644]
src/simix/smx_synchro.c
src/simix/smx_user.c [new file with mode: 0644]
src/simix/synchro_private.h [new file with mode: 0644]
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/smpi/smpi_pmpi.c
src/smpi/smpi_util.c
src/surf/surf.c
src/surf/surf_config.c
src/surf/surf_model_timer.c [deleted file]
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/mmalloc/attach.c
src/xbt/mmalloc/detach.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mmprivate.h
src/xbt/threadpool.c [new file with mode: 0644]
src/xbt/threadpool_private.h [new file with mode: 0644]
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_rl_synchro.c
src/xbt/xbt_sg_stubs.c
src/xbt/xbt_sg_synchro.c
src/xbt/xbt_sg_time.c
teshsuite/gras/msg_handle/test_sg_32 [changed mode: 0755->0644]
teshsuite/gras/msg_handle/test_sg_64 [changed mode: 0755->0644]
teshsuite/msg/get_sender.tesh
teshsuite/simdag/basic0.tesh
teshsuite/simdag/basic1.tesh
teshsuite/simdag/basic2.tesh
teshsuite/simdag/basic3.tesh
teshsuite/simdag/basic4.tesh
teshsuite/simdag/basic5.tesh
teshsuite/simdag/basic6.tesh
teshsuite/simdag/network/mxn/test_intra_all2all.tesh
teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh
teshsuite/simdag/network/mxn/test_intra_scatter.tesh
teshsuite/simdag/network/p2p/test_latency1.tesh
teshsuite/simdag/network/p2p/test_latency2.tesh
teshsuite/simdag/network/p2p/test_latency3.tesh
teshsuite/simdag/network/p2p/test_latency_bound.tesh
teshsuite/simdag/network/test_reinit_costs.tesh
teshsuite/simdag/partask/test_comp_only_par.tesh
teshsuite/simdag/partask/test_comp_only_seq.tesh
teshsuite/simdag/platforms/basic_parsing_test.tesh
teshsuite/simdag/platforms/basic_parsing_test_failing.tesh
teshsuite/simdag/platforms/basic_parsing_test_sym_full.tesh
teshsuite/simdag/platforms/flatifier.tesh
teshupdate.pl [new file with mode: 0755]
testsuite/surf/CMakeLists.txt
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c
testsuite/xbt/CMakeLists.txt
tools/tesh/README.tesh
tools/tesh/run_context.c
tools/tesh/run_context.h

index 8716ddd..82f0277 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 SimGrid (3.6) unstable; urgency=low
 
+ Simix
+ * completely rewrote this module to allow parallel execution.
+
  -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.5) stable; urgency=medium
index fe62800..4d08ea5 100644 (file)
@@ -17,6 +17,7 @@ set(EXTRA_DIST
        src/xbt/backtrace_windows.c
        src/xbt/backtrace_dummy.c
        src/xbt/setset_private.h
+       src/xbt/threadpool_private.h
        src/xbt/mmalloc/attach.c
        src/xbt/mmalloc/detach.c        
        src/xbt/mmalloc/keys.c
@@ -197,6 +198,7 @@ set(XBT_SRC
        src/xbt/cunit.c
        src/xbt/graphxml_parse.c
        src/xbt/setset.c
+       src/xbt/threadpool.c
 )
 
 if(HAVE_MMAP)
@@ -230,7 +232,6 @@ set(SURF_SRC
        src/surf/network_vivaldi.c
        src/surf/network_constant.c
        src/surf/workstation.c
-       src/surf/surf_model_timer.c
        src/surf/workstation_ptask_L07.c
        src/surf/cpu_ti.c
        src/surf/cpu_im.c
@@ -242,12 +243,13 @@ set(SIMIX_SRC
        src/simix/smx_deployment.c
        src/simix/smx_environment.c
        src/simix/smx_host.c
-       src/simix/smx_action.c
        src/simix/smx_process.c
        src/simix/smx_context.c
        src/simix/smx_synchro.c
        src/simix/smx_network.c
        src/simix/smx_context_base.c
+       src/simix/smx_user.c
+       src/simix/smx_smurf.c
 )
 
 set(MSG_SRC
@@ -357,11 +359,11 @@ set(RUBY_SRC
 set(MC_SRC
        src/mc/mc_memory.c
        src/mc/mc_checkpoint.c
+       src/mc/mc_state.c
        src/mc/memory_map.c
        src/mc/mc_global.c
-       src/mc/mc_dfs.c
        src/mc/mc_dpor.c
-       src/mc/mc_transition.c
+       src/mc/mc_request.c
        src/mc/private.h
 )
 
old mode 100755 (executable)
new mode 100644 (file)
index 7c84f53..dd06cc4
@@ -1,61 +1,62 @@
-$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml
-> [Tremblay:sender:(1) 0.000000] [all2all/INFO] Launch current node
-> [Jupiter:sender:(3) 0.000000] [all2all/INFO] Launch current node
-> [Fafard:sender:(5) 0.000000] [all2all/INFO] Launch current node
-> [Ginette:sender:(7) 0.000000] [all2all/INFO] Launch current node
-> [Bourassa:sender:(9) 0.000000] [all2all/INFO] Launch current node
-> [Tremblay:receiver:(2) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Jupiter:receiver:(4) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Fafard:receiver:(6) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Ginette:receiver:(8) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Bourassa:receiver:(10) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Jupiter:sender:(3) 0.015433] [all2all/INFO]   Sent Data from Jupiter to Tremblay
-> [Tremblay:receiver:(2) 0.015433] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Tremblay:sender:(1) 0.025433] [all2all/INFO]   Sent Data from Tremblay to Jupiter
-> [Jupiter:receiver:(4) 0.025433] [all2all/INFO] Got Data from Tremblay:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.036085] [all2all/INFO]   Sent Data from Fafard to Tremblay
-> [Tremblay:receiver:(2) 0.036085] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Ginette:sender:(7) 0.049382] [all2all/INFO]   Sent Data from Ginette to Tremblay
-> [Tremblay:receiver:(2) 0.049382] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Jupiter:sender:(3) 0.051516] [all2all/INFO]   Sent Data from Jupiter to Fafard
-> [Fafard:receiver:(6) 0.051516] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Bourassa:sender:(9) 0.069818] [all2all/INFO]   Sent Data from Bourassa to Tremblay
-> [Tremblay:receiver:(2) 0.069818] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Tremblay:receiver:(2) 0.069818] [gras/INFO] Exiting GRAS
-> [Fafard:sender:(5) 0.072168] [all2all/INFO]   Sent Data from Fafard to Jupiter
-> [Jupiter:receiver:(4) 0.072168] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Tremblay:sender:(1) 0.072177] [all2all/INFO]   Sent Data from Tremblay to Fafard
-> [Fafard:receiver:(6) 0.072177] [all2all/INFO] Got Data from Tremblay:5000 (still 2 to go)
-> [Jupiter:sender:(3) 0.080244] [all2all/INFO]   Sent Data from Jupiter to Ginette
-> [Ginette:receiver:(8) 0.080244] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.093415] [all2all/INFO]   Sent Data from Fafard to Ginette
-> [Ginette:receiver:(8) 0.093415] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Ginette:sender:(7) 0.100740] [all2all/INFO]   Sent Data from Ginette to Jupiter
-> [Jupiter:receiver:(4) 0.100740] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Tremblay:sender:(1) 0.106712] [all2all/INFO]   Sent Data from Tremblay to Ginette
-> [Ginette:receiver:(8) 0.106712] [all2all/INFO] Got Data from Tremblay:5000 (still 1 to go)
-> [Ginette:sender:(7) 0.114067] [all2all/INFO]   Sent Data from Ginette to Fafard
-> [Fafard:receiver:(6) 0.114067] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Jupiter:sender:(3) 0.116110] [all2all/INFO]   Sent Data from Jupiter to Bourassa
-> [Jupiter:sender:(3) 0.116110] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.116110] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.121591] [all2all/INFO]   Sent Data from Fafard to Bourassa
-> [Fafard:sender:(5) 0.121591] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.121591] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Bourassa:sender:(9) 0.136451] [all2all/INFO]   Sent Data from Bourassa to Jupiter
-> [Jupiter:receiver:(4) 0.136451] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Jupiter:receiver:(4) 0.136451] [gras/INFO] Exiting GRAS
-> [Tremblay:sender:(1) 0.142030] [all2all/INFO]   Sent Data from Tremblay to Bourassa
-> [Tremblay:sender:(1) 0.142030] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.142030] [all2all/INFO] Got Data from Tremblay:5000 (still 1 to go)
-> [Bourassa:sender:(9) 0.142088] [all2all/INFO]   Sent Data from Bourassa to Fafard
-> [Fafard:receiver:(6) 0.142088] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Fafard:receiver:(6) 0.142088] [gras/INFO] Exiting GRAS
-> [Ginette:sender:(7) 0.154982] [all2all/INFO]   Sent Data from Ginette to Bourassa
-> [Ginette:sender:(7) 0.154982] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.154982] [all2all/INFO] Got Data from Ginette:5000 (still 0 to go)
-> [Bourassa:receiver:(10) 0.154982] [gras/INFO] Exiting GRAS
-> [Bourassa:sender:(9) 0.155196] [all2all/INFO]   Sent Data from Bourassa to Ginette
-> [Bourassa:sender:(9) 0.155196] [gras/INFO] Exiting GRAS
-> [Ginette:receiver:(8) 0.155196] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Ginette:receiver:(8) 0.155196] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) Launch current node
+> [  0.000000] (3:sender@Jupiter) Launch current node
+> [  0.000000] (5:sender@Fafard) Launch current node
+> [  0.000000] (7:sender@Ginette) Launch current node
+> [  0.000000] (9:sender@Bourassa) Launch current node
+> [  0.000156] (10:receiver@Bourassa) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (2:receiver@Tremblay) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (4:receiver@Jupiter) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (6:receiver@Fafard) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (8:receiver@Ginette) Listening on port 4000 (expecting 4 messages)
+> [  0.015433] (2:receiver@Tremblay) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.015433] (3:sender@Jupiter)   Sent Data from Jupiter to Tremblay
+> [  0.025433] (1:sender@Tremblay)   Sent Data from Tremblay to Jupiter
+> [  0.025433] (4:receiver@Jupiter) Got Data from Tremblay:5000 (still 3 to go)
+> [  0.036085] (2:receiver@Tremblay) Got Data from Fafard:5000 (still 2 to go)
+> [  0.036085] (5:sender@Fafard)   Sent Data from Fafard to Tremblay
+> [  0.049382] (2:receiver@Tremblay) Got Data from Ginette:5000 (still 1 to go)
+> [  0.049382] (7:sender@Ginette)   Sent Data from Ginette to Tremblay
+> [  0.051516] (3:sender@Jupiter)   Sent Data from Jupiter to Fafard
+> [  0.051516] (6:receiver@Fafard) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.069818] (2:receiver@Tremblay) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.069818] (2:receiver@Tremblay) Exiting GRAS
+> [  0.069818] (9:sender@Bourassa)   Sent Data from Bourassa to Tremblay
+> [  0.072168] (4:receiver@Jupiter) Got Data from Fafard:5000 (still 2 to go)
+> [  0.072168] (5:sender@Fafard)   Sent Data from Fafard to Jupiter
+> [  0.072177] (1:sender@Tremblay)   Sent Data from Tremblay to Fafard
+> [  0.072177] (6:receiver@Fafard) Got Data from Tremblay:5000 (still 2 to go)
+> [  0.080244] (3:sender@Jupiter)   Sent Data from Jupiter to Ginette
+> [  0.080244] (8:receiver@Ginette) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.093415] (5:sender@Fafard)   Sent Data from Fafard to Ginette
+> [  0.093415] (8:receiver@Ginette) Got Data from Fafard:5000 (still 2 to go)
+> [  0.100740] (4:receiver@Jupiter) Got Data from Ginette:5000 (still 1 to go)
+> [  0.100740] (7:sender@Ginette)   Sent Data from Ginette to Jupiter
+> [  0.106712] (1:sender@Tremblay)   Sent Data from Tremblay to Ginette
+> [  0.106712] (8:receiver@Ginette) Got Data from Tremblay:5000 (still 1 to go)
+> [  0.114067] (6:receiver@Fafard) Got Data from Ginette:5000 (still 1 to go)
+> [  0.114067] (7:sender@Ginette)   Sent Data from Ginette to Fafard
+> [  0.116110] (10:receiver@Bourassa) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.116110] (3:sender@Jupiter)   Sent Data from Jupiter to Bourassa
+> [  0.116110] (3:sender@Jupiter) Exiting GRAS
+> [  0.121591] (10:receiver@Bourassa) Got Data from Fafard:5000 (still 2 to go)
+> [  0.121591] (5:sender@Fafard)   Sent Data from Fafard to Bourassa
+> [  0.121591] (5:sender@Fafard) Exiting GRAS
+> [  0.136451] (4:receiver@Jupiter) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.136451] (4:receiver@Jupiter) Exiting GRAS
+> [  0.136451] (9:sender@Bourassa)   Sent Data from Bourassa to Jupiter
+> [  0.142030] (1:sender@Tremblay)   Sent Data from Tremblay to Bourassa
+> [  0.142030] (1:sender@Tremblay) Exiting GRAS
+> [  0.142030] (10:receiver@Bourassa) Got Data from Tremblay:5000 (still 1 to go)
+> [  0.142088] (6:receiver@Fafard) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.142088] (6:receiver@Fafard) Exiting GRAS
+> [  0.142088] (9:sender@Bourassa)   Sent Data from Bourassa to Fafard
+> [  0.154982] (10:receiver@Bourassa) Got Data from Ginette:5000 (still 0 to go)
+> [  0.154982] (10:receiver@Bourassa) Exiting GRAS
+> [  0.154982] (7:sender@Ginette)   Sent Data from Ginette to Bourassa
+> [  0.154982] (7:sender@Ginette) Exiting GRAS
+> [  0.155196] (8:receiver@Ginette) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.155196] (8:receiver@Ginette) Exiting GRAS
+> [  0.155196] (9:sender@Bourassa)   Sent Data from Bourassa to Ginette
+> [  0.155196] (9:sender@Bourassa) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index 1f0f404..2c3af03
@@ -1,63 +1,64 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml
-> [Tremblay:sender:(1) 0.000000] [all2all/INFO] Launch current node
-> [Jupiter:sender:(3) 0.000000] [all2all/INFO] Launch current node
-> [Fafard:sender:(5) 0.000000] [all2all/INFO] Launch current node
-> [Ginette:sender:(7) 0.000000] [all2all/INFO] Launch current node
-> [Bourassa:sender:(9) 0.000000] [all2all/INFO] Launch current node
-> [Tremblay:receiver:(2) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Jupiter:receiver:(4) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Fafard:receiver:(6) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Ginette:receiver:(8) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Bourassa:receiver:(10) 0.000156] [all2all/INFO] Listening on port 4000 (expecting 4 messages)
-> [Jupiter:sender:(3) 0.015433] [all2all/INFO]   Sent Data from Jupiter to Tremblay
-> [Tremblay:receiver:(2) 0.015433] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Tremblay:sender:(1) 0.025433] [all2all/INFO]   Sent Data from Tremblay to Jupiter
-> [Jupiter:receiver:(4) 0.025433] [all2all/INFO] Got Data from Tremblay:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.036085] [all2all/INFO]   Sent Data from Fafard to Tremblay
-> [Tremblay:receiver:(2) 0.036085] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Ginette:sender:(7) 0.049382] [all2all/INFO]   Sent Data from Ginette to Tremblay
-> [Tremblay:receiver:(2) 0.049382] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Jupiter:sender:(3) 0.051516] [all2all/INFO]   Sent Data from Jupiter to Fafard
-> [Fafard:receiver:(6) 0.051516] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Bourassa:sender:(9) 0.069818] [all2all/INFO]   Sent Data from Bourassa to Tremblay
-> [Tremblay:receiver:(2) 0.069818] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Tremblay:receiver:(2) 0.069818] [gras/INFO] Exiting GRAS
-> [Fafard:sender:(5) 0.072168] [all2all/INFO]   Sent Data from Fafard to Jupiter
-> [Jupiter:receiver:(4) 0.072168] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Tremblay:sender:(1) 0.072177] [all2all/INFO]   Sent Data from Tremblay to Fafard
-> [Fafard:receiver:(6) 0.072177] [all2all/INFO] Got Data from Tremblay:5000 (still 2 to go)
-> [Jupiter:sender:(3) 0.080244] [all2all/INFO]   Sent Data from Jupiter to Ginette
-> [Ginette:receiver:(8) 0.080244] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.093415] [all2all/INFO]   Sent Data from Fafard to Ginette
-> [Ginette:receiver:(8) 0.093415] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Ginette:sender:(7) 0.100740] [all2all/INFO]   Sent Data from Ginette to Jupiter
-> [Jupiter:receiver:(4) 0.100740] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Tremblay:sender:(1) 0.106712] [all2all/INFO]   Sent Data from Tremblay to Ginette
-> [Ginette:receiver:(8) 0.106712] [all2all/INFO] Got Data from Tremblay:5000 (still 1 to go)
-> [Ginette:sender:(7) 0.114067] [all2all/INFO]   Sent Data from Ginette to Fafard
-> [Fafard:receiver:(6) 0.114067] [all2all/INFO] Got Data from Ginette:5000 (still 1 to go)
-> [Jupiter:sender:(3) 0.116110] [all2all/INFO]   Sent Data from Jupiter to Bourassa
-> [Jupiter:sender:(3) 0.116110] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.116110] [all2all/INFO] Got Data from Jupiter:5000 (still 3 to go)
-> [Fafard:sender:(5) 0.121591] [all2all/INFO]   Sent Data from Fafard to Bourassa
-> [Fafard:sender:(5) 0.121591] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.121591] [all2all/INFO] Got Data from Fafard:5000 (still 2 to go)
-> [Bourassa:sender:(9) 0.136451] [all2all/INFO]   Sent Data from Bourassa to Jupiter
-> [Jupiter:receiver:(4) 0.136451] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Jupiter:receiver:(4) 0.136451] [gras/INFO] Exiting GRAS
-> [Tremblay:sender:(1) 0.142030] [all2all/INFO]   Sent Data from Tremblay to Bourassa
-> [Tremblay:sender:(1) 0.142030] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.142030] [all2all/INFO] Got Data from Tremblay:5000 (still 1 to go)
-> [Bourassa:sender:(9) 0.142088] [all2all/INFO]   Sent Data from Bourassa to Fafard
-> [Fafard:receiver:(6) 0.142088] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Fafard:receiver:(6) 0.142088] [gras/INFO] Exiting GRAS
-> [Ginette:sender:(7) 0.154982] [all2all/INFO]   Sent Data from Ginette to Bourassa
-> [Ginette:sender:(7) 0.154982] [gras/INFO] Exiting GRAS
-> [Bourassa:receiver:(10) 0.154982] [all2all/INFO] Got Data from Ginette:5000 (still 0 to go)
-> [Bourassa:receiver:(10) 0.154982] [gras/INFO] Exiting GRAS
-> [Bourassa:sender:(9) 0.155196] [all2all/INFO]   Sent Data from Bourassa to Ginette
-> [Bourassa:sender:(9) 0.155196] [gras/INFO] Exiting GRAS
-> [Ginette:receiver:(8) 0.155196] [all2all/INFO] Got Data from Bourassa:5000 (still 0 to go)
-> [Ginette:receiver:(8) 0.155196] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./all2all_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/all2all.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) Launch current node
+> [  0.000000] (3:sender@Jupiter) Launch current node
+> [  0.000000] (5:sender@Fafard) Launch current node
+> [  0.000000] (7:sender@Ginette) Launch current node
+> [  0.000000] (9:sender@Bourassa) Launch current node
+> [  0.000156] (10:receiver@Bourassa) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (2:receiver@Tremblay) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (4:receiver@Jupiter) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (6:receiver@Fafard) Listening on port 4000 (expecting 4 messages)
+> [  0.000156] (8:receiver@Ginette) Listening on port 4000 (expecting 4 messages)
+> [  0.015433] (2:receiver@Tremblay) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.015433] (3:sender@Jupiter)   Sent Data from Jupiter to Tremblay
+> [  0.025433] (1:sender@Tremblay)   Sent Data from Tremblay to Jupiter
+> [  0.025433] (4:receiver@Jupiter) Got Data from Tremblay:5000 (still 3 to go)
+> [  0.036085] (2:receiver@Tremblay) Got Data from Fafard:5000 (still 2 to go)
+> [  0.036085] (5:sender@Fafard)   Sent Data from Fafard to Tremblay
+> [  0.049382] (2:receiver@Tremblay) Got Data from Ginette:5000 (still 1 to go)
+> [  0.049382] (7:sender@Ginette)   Sent Data from Ginette to Tremblay
+> [  0.051516] (3:sender@Jupiter)   Sent Data from Jupiter to Fafard
+> [  0.051516] (6:receiver@Fafard) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.069818] (2:receiver@Tremblay) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.069818] (2:receiver@Tremblay) Exiting GRAS
+> [  0.069818] (9:sender@Bourassa)   Sent Data from Bourassa to Tremblay
+> [  0.072168] (4:receiver@Jupiter) Got Data from Fafard:5000 (still 2 to go)
+> [  0.072168] (5:sender@Fafard)   Sent Data from Fafard to Jupiter
+> [  0.072177] (1:sender@Tremblay)   Sent Data from Tremblay to Fafard
+> [  0.072177] (6:receiver@Fafard) Got Data from Tremblay:5000 (still 2 to go)
+> [  0.080244] (3:sender@Jupiter)   Sent Data from Jupiter to Ginette
+> [  0.080244] (8:receiver@Ginette) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.093415] (5:sender@Fafard)   Sent Data from Fafard to Ginette
+> [  0.093415] (8:receiver@Ginette) Got Data from Fafard:5000 (still 2 to go)
+> [  0.100740] (4:receiver@Jupiter) Got Data from Ginette:5000 (still 1 to go)
+> [  0.100740] (7:sender@Ginette)   Sent Data from Ginette to Jupiter
+> [  0.106712] (1:sender@Tremblay)   Sent Data from Tremblay to Ginette
+> [  0.106712] (8:receiver@Ginette) Got Data from Tremblay:5000 (still 1 to go)
+> [  0.114067] (6:receiver@Fafard) Got Data from Ginette:5000 (still 1 to go)
+> [  0.114067] (7:sender@Ginette)   Sent Data from Ginette to Fafard
+> [  0.116110] (10:receiver@Bourassa) Got Data from Jupiter:5000 (still 3 to go)
+> [  0.116110] (3:sender@Jupiter)   Sent Data from Jupiter to Bourassa
+> [  0.116110] (3:sender@Jupiter) Exiting GRAS
+> [  0.121591] (10:receiver@Bourassa) Got Data from Fafard:5000 (still 2 to go)
+> [  0.121591] (5:sender@Fafard)   Sent Data from Fafard to Bourassa
+> [  0.121591] (5:sender@Fafard) Exiting GRAS
+> [  0.136451] (4:receiver@Jupiter) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.136451] (4:receiver@Jupiter) Exiting GRAS
+> [  0.136451] (9:sender@Bourassa)   Sent Data from Bourassa to Jupiter
+> [  0.142030] (1:sender@Tremblay)   Sent Data from Tremblay to Bourassa
+> [  0.142030] (1:sender@Tremblay) Exiting GRAS
+> [  0.142030] (10:receiver@Bourassa) Got Data from Tremblay:5000 (still 1 to go)
+> [  0.142088] (6:receiver@Fafard) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.142088] (6:receiver@Fafard) Exiting GRAS
+> [  0.142088] (9:sender@Bourassa)   Sent Data from Bourassa to Fafard
+> [  0.154982] (10:receiver@Bourassa) Got Data from Ginette:5000 (still 0 to go)
+> [  0.154982] (10:receiver@Bourassa) Exiting GRAS
+> [  0.154982] (7:sender@Ginette)   Sent Data from Ginette to Bourassa
+> [  0.154982] (7:sender@Ginette) Exiting GRAS
+> [  0.155196] (8:receiver@Ginette) Got Data from Bourassa:5000 (still 0 to go)
+> [  0.155196] (8:receiver@Ginette) Exiting GRAS
+> [  0.155196] (9:sender@Bourassa)   Sent Data from Bourassa to Ginette
+> [  0.155196] (9:sender@Bourassa) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index 4522d96..9c7cb37
@@ -1,9 +1,10 @@
-$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml
-> [Tremblay:server:(1) 0.000000] [MatMult/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [MatMult/INFO] Launch client (server on Tremblay:4000)
-> [Fafard:client:(2) 0.000156] [MatMult/INFO] Connected to Tremblay:4000.
-> [Fafard:client:(2) 0.000156] [MatMult/INFO] >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.072513] [MatMult/INFO] >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
-> [Tremblay:server:(1) 0.118967] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 0.118967] [MatMult/INFO] >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
-> [Fafard:client:(2) 0.118967] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
+> [  0.000156] (2:client@Fafard) Connected to Tremblay:4000.
+> [  0.000156] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
+> [  0.072513] (2:client@Fafard) >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
+> [  0.118967] (1:server@Tremblay) Exiting GRAS
+> [  0.118967] (2:client@Fafard) >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
+> [  0.118967] (2:client@Fafard) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index 6c15d37..490d4c5
@@ -1,10 +1,11 @@
-$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml
-> [Tremblay:server:(1) 0.000000] [MatMult/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [MatMult/INFO] Launch client (server on Tremblay:4000)
-> [Fafard:client:(2) 0.000156] [MatMult/INFO] Connected to Tremblay:4000.
-> [Fafard:client:(2) 0.000156] [MatMult/INFO] >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.072516] [MatMult/INFO] >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
-> [Tremblay:server:(1) 0.118972] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 0.118972] [MatMult/INFO] >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
-> [Fafard:client:(2) 0.118972] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./mmrpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/mmrpc.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
+> [  0.000156] (2:client@Fafard) Connected to Tremblay:4000.
+> [  0.000156] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
+> [  0.072516] (2:client@Fafard) >>>>>>>> Request sent to Tremblay:4000 <<<<<<<<
+> [  0.118972] (1:server@Tremblay) Exiting GRAS
+> [  0.118972] (2:client@Fafard) >>>>>>>> Got answer from Tremblay:4000 (values are right) <<<<<<<<
+> [  0.118972] (2:client@Fafard) Exiting GRAS
 
index 701499f..3d0796c 100644 (file)
@@ -67,8 +67,7 @@ int client(int argc, char *argv[])
     RETHROW0("Failed to send PING to server: %s");
   }
   INFO3(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
-        ping,
-        gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
+        ping, gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Wait for the answer from the server, and deal with issues */
   TRY {
old mode 100755 (executable)
new mode 100644 (file)
index dbf9fc8..ce11894
@@ -1,19 +1,20 @@
 p Runs the 'ping' test within the simulator (simulation times valid for 32bits architectures)
 
-$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml $ARGS
-> [Tremblay:server:(1) 0.000000] [Ping/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [Ping/INFO] Launch client (server on Tremblay:4000)
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] Messages registered
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] Messages registered
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] >>>>>>>> Listening on port 4000 <<<<<<<<
-> [Fafard:client:(2) 0.000156] [Ping/INFO] Connected to Tremblay:4000.
-> [Fafard:client:(2) 0.000156] [Ping/INFO] Messages registered
-> [Fafard:client:(2) 0.000156] [Ping/INFO] >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.020707] [Ping/INFO] >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
-> [Tremblay:server:(1) 0.020707] [Ping/INFO] >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
-> [Tremblay:server:(1) 0.041259] [Ping/INFO] >>>>>>>> Answered with PONG(4321) <<<<<<<<
-> [Tremblay:server:(1) 0.041259] [Ping/INFO] Done.
-> [Tremblay:server:(1) 0.041259] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 0.041259] [Ping/INFO] >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.041259] [Ping/INFO] Done.
-> [Fafard:client:(2) 0.041259] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml $ARGS --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
+> [  0.000156] (1:server@Tremblay) Messages registered
+> [  0.000156] (1:server@Tremblay) Messages registered
+> [  0.000156] (1:server@Tremblay) >>>>>>>> Listening on port 4000 <<<<<<<<
+> [  0.000156] (2:client@Fafard) Connected to Tremblay:4000.
+> [  0.000156] (2:client@Fafard) Messages registered
+> [  0.000156] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
+> [  0.020707] (1:server@Tremblay) >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
+> [  0.020707] (2:client@Fafard) >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
+> [  0.041259] (1:server@Tremblay) >>>>>>>> Answered with PONG(4321) <<<<<<<<
+> [  0.041259] (1:server@Tremblay) Done.
+> [  0.041259] (1:server@Tremblay) Exiting GRAS
+> [  0.041259] (2:client@Fafard) >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
+> [  0.041259] (2:client@Fafard) Done.
+> [  0.041259] (2:client@Fafard) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index 8b8e087..a19051c
@@ -1,20 +1,21 @@
 p Runs the 'ping' test within the simulator (simulation times valid for 64bits architectures)
 
-$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml
-> [Tremblay:server:(1) 0.000000] [Ping/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [Ping/INFO] Launch client (server on Tremblay:4000)
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] Messages registered
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] Messages registered
-> [Tremblay:server:(1) 0.000156] [Ping/INFO] >>>>>>>> Listening on port 4000 <<<<<<<<
-> [Fafard:client:(2) 0.000156] [Ping/INFO] Connected to Tremblay:4000.
-> [Fafard:client:(2) 0.000156] [Ping/INFO] Messages registered
-> [Fafard:client:(2) 0.000156] [Ping/INFO] >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.020707] [Ping/INFO] >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
-> [Tremblay:server:(1) 0.020707] [Ping/INFO] >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
-> [Tremblay:server:(1) 0.041259] [Ping/INFO] >>>>>>>> Answered with PONG(4321) <<<<<<<<
-> [Tremblay:server:(1) 0.041259] [Ping/INFO] Done.
-> [Tremblay:server:(1) 0.041259] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 0.041259] [Ping/INFO] >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
-> [Fafard:client:(2) 0.041259] [Ping/INFO] Done.
-> [Fafard:client:(2) 0.041259] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./ping_simulator${EXEEXT:=} ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/ping.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (server on Tremblay:4000)
+> [  0.000156] (1:server@Tremblay) Messages registered
+> [  0.000156] (1:server@Tremblay) Messages registered
+> [  0.000156] (1:server@Tremblay) >>>>>>>> Listening on port 4000 <<<<<<<<
+> [  0.000156] (2:client@Fafard) Connected to Tremblay:4000.
+> [  0.000156] (2:client@Fafard) Messages registered
+> [  0.000156] (2:client@Fafard) >>>>>>>> Connected to server which is on Tremblay:4000 <<<<<<<<
+> [  0.020707] (2:client@Fafard) >>>>>>>> Message PING(1234) sent to Tremblay:4000 <<<<<<<<
+> [  0.020707] (1:server@Tremblay) >>>>>>>> Got message PING(1234) from Fafard:5000 <<<<<<<<
+> [  0.041259] (1:server@Tremblay) >>>>>>>> Answered with PONG(4321) <<<<<<<<
+> [  0.041259] (1:server@Tremblay) Done.
+> [  0.041259] (1:server@Tremblay) Exiting GRAS
+> [  0.041259] (2:client@Fafard) >>>>>>>> Got PONG(4321) from Tremblay:4000 <<<<<<<<
+> [  0.041259] (2:client@Fafard) Done.
+> [  0.041259] (2:client@Fafard) Exiting GRAS
 
old mode 100755 (executable)
new mode 100644 (file)
index adc927d..393e8f2
@@ -1,37 +1,38 @@
-$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml
-> [Jacquelin:master:(1) 0.000156] [pmm/INFO] Wait for peers for 2 sec
-> [Boivin:slave:(2) 0.000156] [pmm/INFO] Sensor 0 starting
-> [Jean_Yves:slave:(3) 0.000156] [pmm/INFO] Sensor 1 starting
-> [TeX:slave:(4) 0.000156] [pmm/INFO] Sensor 2 starting
-> [Geoff:slave:(5) 0.000156] [pmm/INFO] Sensor 3 starting
-> [Disney:slave:(6) 0.000156] [pmm/INFO] Sensor 4 starting
-> [iRMX:slave:(7) 0.000156] [pmm/INFO] Sensor 5 starting
-> [McGee:slave:(8) 0.000156] [pmm/INFO] Sensor 6 starting
-> [Gatien:slave:(9) 0.000156] [pmm/INFO] Sensor 7 starting
-> [Laroche:slave:(10) 0.000156] [pmm/INFO] Sensor 8 starting
-> [Jacquelin:master:(1) 2.416827] [pmm/INFO] Got only 2 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 4.476356] [pmm/INFO] Got only 3 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 6.476356] [pmm/INFO] Got only 5 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 9.355676] [pmm/INFO] Got only 6 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 12.524103] [pmm/INFO] Good. Got 9 pals
-> [Jacquelin:master:(1) 12.525507] [pmm/INFO] XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
-> [Boivin:slave:(2) 14.369272] [pmm/INFO] Receive my pos (0,0) and assignment
-> [Jean_Yves:slave:(3) 15.113445] [pmm/INFO] Receive my pos (0,1) and assignment
-> [TeX:slave:(4) 16.571623] [pmm/INFO] Receive my pos (0,2) and assignment
-> [Geoff:slave:(5) 16.576168] [pmm/INFO] Receive my pos (1,0) and assignment
-> [Disney:slave:(6) 18.043128] [pmm/INFO] Receive my pos (1,1) and assignment
-> [iRMX:slave:(7) 20.491553] [pmm/INFO] Receive my pos (1,2) and assignment
-> [McGee:slave:(8) 21.206195] [pmm/INFO] Receive my pos (2,0) and assignment
-> [Gatien:slave:(9) 22.231455] [pmm/INFO] Receive my pos (2,1) and assignment
-> [Laroche:slave:(10) 23.679910] [pmm/INFO] Receive my pos (2,2) and assignment
-> [Jacquelin:master:(1) 73.315380] [pmm/INFO] XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
-> [Boivin:slave:(2) 74.153996] [gras/INFO] Exiting GRAS
-> [Jean_Yves:slave:(3) 74.893654] [gras/INFO] Exiting GRAS
-> [TeX:slave:(4) 76.342765] [gras/INFO] Exiting GRAS
-> [Geoff:slave:(5) 76.347189] [gras/INFO] Exiting GRAS
-> [Disney:slave:(6) 77.805054] [gras/INFO] Exiting GRAS
-> [iRMX:slave:(7) 80.238265] [gras/INFO] Exiting GRAS
-> [McGee:slave:(8) 80.948556] [gras/INFO] Exiting GRAS
-> [Gatien:slave:(9) 81.967478] [gras/INFO] Exiting GRAS
-> [Jacquelin:master:(1) 83.407037] [gras/INFO] Exiting GRAS
-> [Laroche:slave:(10) 83.407037] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000156] (10:slave@Laroche) Sensor 8 starting
+> [  0.000156] (1:master@Jacquelin) Wait for peers for 2 sec
+> [  0.000156] (2:slave@Boivin) Sensor 0 starting
+> [  0.000156] (3:slave@Jean_Yves) Sensor 1 starting
+> [  0.000156] (4:slave@TeX) Sensor 2 starting
+> [  0.000156] (5:slave@Geoff) Sensor 3 starting
+> [  0.000156] (6:slave@Disney) Sensor 4 starting
+> [  0.000156] (7:slave@iRMX) Sensor 5 starting
+> [  0.000156] (8:slave@McGee) Sensor 6 starting
+> [  0.000156] (9:slave@Gatien) Sensor 7 starting
+> [  2.416827] (1:master@Jacquelin) Got only 2 pals (of 9). Wait 2 more seconds
+> [  4.476356] (1:master@Jacquelin) Got only 3 pals (of 9). Wait 2 more seconds
+> [  6.476356] (1:master@Jacquelin) Got only 5 pals (of 9). Wait 2 more seconds
+> [  9.355676] (1:master@Jacquelin) Got only 6 pals (of 9). Wait 2 more seconds
+> [ 12.524103] (1:master@Jacquelin) Good. Got 9 pals
+> [ 12.525507] (1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
+> [ 14.369272] (2:slave@Boivin) Receive my pos (0,0) and assignment
+> [ 15.113445] (3:slave@Jean_Yves) Receive my pos (0,1) and assignment
+> [ 16.571623] (4:slave@TeX) Receive my pos (0,2) and assignment
+> [ 16.576168] (5:slave@Geoff) Receive my pos (1,0) and assignment
+> [ 18.043128] (6:slave@Disney) Receive my pos (1,1) and assignment
+> [ 20.491553] (7:slave@iRMX) Receive my pos (1,2) and assignment
+> [ 21.206195] (8:slave@McGee) Receive my pos (2,0) and assignment
+> [ 22.231455] (9:slave@Gatien) Receive my pos (2,1) and assignment
+> [ 23.679910] (10:slave@Laroche) Receive my pos (2,2) and assignment
+> [ 73.315380] (1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
+> [ 74.153996] (2:slave@Boivin) Exiting GRAS
+> [ 74.893654] (3:slave@Jean_Yves) Exiting GRAS
+> [ 76.342765] (4:slave@TeX) Exiting GRAS
+> [ 76.347189] (5:slave@Geoff) Exiting GRAS
+> [ 77.805054] (6:slave@Disney) Exiting GRAS
+> [ 80.238265] (7:slave@iRMX) Exiting GRAS
+> [ 80.948556] (8:slave@McGee) Exiting GRAS
+> [ 81.967478] (9:slave@Gatien) Exiting GRAS
+> [ 83.407037] (1:master@Jacquelin) Exiting GRAS
+> [ 83.407037] (10:slave@Laroche) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index ffb117a..dedda62
@@ -1,39 +1,40 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml
-> [Jacquelin:master:(1) 0.000156] [pmm/INFO] Wait for peers for 2 sec
-> [Boivin:slave:(2) 0.000156] [pmm/INFO] Sensor 0 starting
-> [Jean_Yves:slave:(3) 0.000156] [pmm/INFO] Sensor 1 starting
-> [TeX:slave:(4) 0.000156] [pmm/INFO] Sensor 2 starting
-> [Geoff:slave:(5) 0.000156] [pmm/INFO] Sensor 3 starting
-> [Disney:slave:(6) 0.000156] [pmm/INFO] Sensor 4 starting
-> [iRMX:slave:(7) 0.000156] [pmm/INFO] Sensor 5 starting
-> [McGee:slave:(8) 0.000156] [pmm/INFO] Sensor 6 starting
-> [Gatien:slave:(9) 0.000156] [pmm/INFO] Sensor 7 starting
-> [Laroche:slave:(10) 0.000156] [pmm/INFO] Sensor 8 starting
-> [Jacquelin:master:(1) 2.416827] [pmm/INFO] Got only 2 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 4.476356] [pmm/INFO] Got only 3 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 6.476356] [pmm/INFO] Got only 5 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 9.355676] [pmm/INFO] Got only 6 pals (of 9). Wait 2 more seconds
-> [Jacquelin:master:(1) 12.524103] [pmm/INFO] Good. Got 9 pals
-> [Jacquelin:master:(1) 12.525507] [pmm/INFO] XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
-> [Boivin:slave:(2) 14.369401] [pmm/INFO] Receive my pos (0,0) and assignment
-> [Jean_Yves:slave:(3) 15.113688] [pmm/INFO] Receive my pos (0,1) and assignment
-> [TeX:slave:(4) 16.572089] [pmm/INFO] Receive my pos (0,2) and assignment
-> [Geoff:slave:(5) 16.576641] [pmm/INFO] Receive my pos (1,0) and assignment
-> [Disney:slave:(6) 18.043825] [pmm/INFO] Receive my pos (1,1) and assignment
-> [iRMX:slave:(7) 20.492624] [pmm/INFO] Receive my pos (1,2) and assignment
-> [McGee:slave:(8) 21.207375] [pmm/INFO] Receive my pos (2,0) and assignment
-> [Gatien:slave:(9) 22.232792] [pmm/INFO] Receive my pos (2,1) and assignment
-> [Laroche:slave:(10) 23.681469] [pmm/INFO] Receive my pos (2,2) and assignment
-> [Jacquelin:master:(1) 73.318369] [pmm/INFO] XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
-> [Boivin:slave:(2) 74.156986] [gras/INFO] Exiting GRAS
-> [Jean_Yves:slave:(3) 74.896643] [gras/INFO] Exiting GRAS
-> [TeX:slave:(4) 76.345754] [gras/INFO] Exiting GRAS
-> [Geoff:slave:(5) 76.350179] [gras/INFO] Exiting GRAS
-> [Disney:slave:(6) 77.808044] [gras/INFO] Exiting GRAS
-> [iRMX:slave:(7) 80.241254] [gras/INFO] Exiting GRAS
-> [McGee:slave:(8) 80.951545] [gras/INFO] Exiting GRAS
-> [Gatien:slave:(9) 81.970467] [gras/INFO] Exiting GRAS
-> [Jacquelin:master:(1) 83.410027] [gras/INFO] Exiting GRAS
-> [Laroche:slave:(10) 83.410027] [gras/INFO] Exiting GRAS
\ No newline at end of file
+! output sort
+$ $SG_TEST_EXENV ./pmm_simulator$EXEEXT ${srcdir:=.}/../../msg/msg_platform.xml ${srcdir:=.}/pmm.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000156] (1:master@Jacquelin) Wait for peers for 2 sec
+> [  0.000156] (2:slave@Boivin) Sensor 0 starting
+> [  0.000156] (3:slave@Jean_Yves) Sensor 1 starting
+> [  0.000156] (4:slave@TeX) Sensor 2 starting
+> [  0.000156] (5:slave@Geoff) Sensor 3 starting
+> [  0.000156] (6:slave@Disney) Sensor 4 starting
+> [  0.000156] (7:slave@iRMX) Sensor 5 starting
+> [  0.000156] (8:slave@McGee) Sensor 6 starting
+> [  0.000156] (9:slave@Gatien) Sensor 7 starting
+> [  0.000156] (10:slave@Laroche) Sensor 8 starting
+> [  2.416827] (1:master@Jacquelin) Got only 2 pals (of 9). Wait 2 more seconds
+> [  4.476356] (1:master@Jacquelin) Got only 3 pals (of 9). Wait 2 more seconds
+> [  6.476356] (1:master@Jacquelin) Got only 5 pals (of 9). Wait 2 more seconds
+> [  9.355676] (1:master@Jacquelin) Got only 6 pals (of 9). Wait 2 more seconds
+> [ 12.524103] (1:master@Jacquelin) Good. Got 9 pals
+> [ 12.525507] (1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX begin Multiplication
+> [ 14.369401] (2:slave@Boivin) Receive my pos (0,0) and assignment
+> [ 15.113688] (3:slave@Jean_Yves) Receive my pos (0,1) and assignment
+> [ 16.572089] (4:slave@TeX) Receive my pos (0,2) and assignment
+> [ 16.576641] (5:slave@Geoff) Receive my pos (1,0) and assignment
+> [ 18.043825] (6:slave@Disney) Receive my pos (1,1) and assignment
+> [ 20.492624] (7:slave@iRMX) Receive my pos (1,2) and assignment
+> [ 21.207375] (8:slave@McGee) Receive my pos (2,0) and assignment
+> [ 22.232792] (9:slave@Gatien) Receive my pos (2,1) and assignment
+> [ 23.681469] (10:slave@Laroche) Receive my pos (2,2) and assignment
+> [ 73.318369] (1:master@Jacquelin) XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations
+> [ 74.156986] (2:slave@Boivin) Exiting GRAS
+> [ 74.896643] (3:slave@Jean_Yves) Exiting GRAS
+> [ 76.345754] (4:slave@TeX) Exiting GRAS
+> [ 76.350179] (5:slave@Geoff) Exiting GRAS
+> [ 77.808044] (6:slave@Disney) Exiting GRAS
+> [ 80.241254] (7:slave@iRMX) Exiting GRAS
+> [ 80.951545] (8:slave@McGee) Exiting GRAS
+> [ 81.970467] (9:slave@Gatien) Exiting GRAS
+> [ 83.410027] (1:master@Jacquelin) Exiting GRAS
+> [ 83.410027] (10:slave@Laroche) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index c5102ed..ebf5a1a
@@ -1,22 +1,23 @@
 p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures)
 
-$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml
-> [host1:bob:(2) 0.000000] [test/INFO] == Dump all the properties of host1
-> [host1:bob:(2) 0.000000] [test/INFO]   Host property: 'SG_TEST_Hdd' has value: '180'
-> [host1:bob:(2) 0.000000] [test/INFO]   Host property: 'SG_TEST_mem' has value: '4'
-> [host1:bob:(2) 0.000000] [test/INFO] == Try to get a property that does not exist
-> [host1:bob:(2) 0.000000] [test/INFO] == Set a host property that alice will try to retrieve in SG (from bob->hello)
-> [host1:bob:(2) 0.000000] [test/INFO] == Dump all the properties of host1 again to check the addition
-> [host1:bob:(2) 0.000000] [test/INFO]   Host property: 'from bob' has value: 'hello'
-> [host1:bob:(2) 0.000000] [test/INFO]   Host property: 'SG_TEST_Hdd' has value: '180'
-> [host1:bob:(2) 0.000000] [test/INFO]   Host property: 'SG_TEST_mem' has value: '4'
-> [host1:alice:(1) 1.000000] [test/INFO] == Dump all the properties of current host
-> [host1:alice:(1) 1.000000] [test/INFO]   Host property: 'from bob' has value: 'hello'
-> [host1:alice:(1) 1.000000] [test/INFO]   Host property: 'SG_TEST_Hdd' has value: '180'
-> [host1:alice:(1) 1.000000] [test/INFO]   Host property: 'SG_TEST_mem' has value: '4'
-> [host1:alice:(1) 1.000000] [test/INFO] == Dump all the properties of alice
-> [host1:alice:(1) 1.000000] [test/INFO]   Process property: 'SG_TEST_blah' has value: 'blah'
-> [host1:alice:(1) 1.000000] [test/INFO] == Try to get a process property that does not exist
-> [host1:alice:(1) 1.000000] [test/INFO] == Trying to modify a process property
-> [host1:alice:(1) 1.000000] [gras/INFO] Exiting GRAS
-> [host1:bob:(2) 1.000000] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (2:bob@host1) == Dump all the properties of host1
+> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
+> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_mem' has value: '4'
+> [  0.000000] (2:bob@host1) == Try to get a property that does not exist
+> [  0.000000] (2:bob@host1) == Set a host property that alice will try to retrieve in SG (from bob->hello)
+> [  0.000000] (2:bob@host1) == Dump all the properties of host1 again to check the addition
+> [  0.000000] (2:bob@host1)   Host property: 'from bob' has value: 'hello'
+> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
+> [  0.000000] (2:bob@host1)   Host property: 'SG_TEST_mem' has value: '4'
+> [  1.000000] (1:alice@host1) == Dump all the properties of current host
+> [  1.000000] (1:alice@host1)   Host property: 'from bob' has value: 'hello'
+> [  1.000000] (1:alice@host1)   Host property: 'SG_TEST_Hdd' has value: '180'
+> [  1.000000] (1:alice@host1)   Host property: 'SG_TEST_mem' has value: '4'
+> [  1.000000] (1:alice@host1) == Dump all the properties of alice
+> [  1.000000] (1:alice@host1)   Process property: 'SG_TEST_blah' has value: 'blah'
+> [  1.000000] (1:alice@host1) == Try to get a process property that does not exist
+> [  1.000000] (1:alice@host1) == Trying to modify a process property
+> [  1.000000] (1:alice@host1) Exiting GRAS
+> [  1.000000] (2:bob@host1) Exiting GRAS
index da38cc5..b236540 100755 (executable)
@@ -5,9 +5,9 @@
 # Trying to get it right would prevent me to ever submit that damn paper.
 
 $ $SG_TEST_EXENV ./rpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/rpc.xml "--log=root.fmt:'[%h:%P:(%i)] [%c/%p] %m%n'"
-> [Tremblay:server:(1)] [Rpc/INFO] Launch server (port=4000)
-> [Ginette:forwarder:(2)] [Rpc/INFO] Launch forwarder (port=4000)
 > [Fafard:client:(3)] [Rpc/INFO] Launch client (server on Tremblay:4000)
+> [Ginette:forwarder:(2)] [Rpc/INFO] Launch forwarder (port=4000)
+> [Tremblay:server:(1)] [Rpc/INFO] Launch server (port=4000)
 > [Tremblay:server:(1)] [Rpc/INFO] Listening on port 4000
 > [Fafard:client:(3)] [Rpc/INFO] Connected to Tremblay:4000.
 > [Fafard:client:(3)] [Rpc/INFO] Connected to server which is on Tremblay:4000
index da38cc5..b236540 100755 (executable)
@@ -5,9 +5,9 @@
 # Trying to get it right would prevent me to ever submit that damn paper.
 
 $ $SG_TEST_EXENV ./rpc_simulator$EXEEXT ${srcdir:=.}/../../msg/small_platform.xml ${srcdir:=.}/rpc.xml "--log=root.fmt:'[%h:%P:(%i)] [%c/%p] %m%n'"
-> [Tremblay:server:(1)] [Rpc/INFO] Launch server (port=4000)
-> [Ginette:forwarder:(2)] [Rpc/INFO] Launch forwarder (port=4000)
 > [Fafard:client:(3)] [Rpc/INFO] Launch client (server on Tremblay:4000)
+> [Ginette:forwarder:(2)] [Rpc/INFO] Launch forwarder (port=4000)
+> [Tremblay:server:(1)] [Rpc/INFO] Launch server (port=4000)
 > [Tremblay:server:(1)] [Rpc/INFO] Listening on port 4000
 > [Fafard:client:(3)] [Rpc/INFO] Connected to Tremblay:4000.
 > [Fafard:client:(3)] [Rpc/INFO] Connected to server which is on Tremblay:4000
index 24fd093..6b389ba 100644 (file)
@@ -2,12 +2,13 @@
 
 # Later modify the commande and specify the platform and deployment path
 
-$ lua mult_matrix.lua
-> [Inmos:Sender:(1) 0.000000] [lua/INFO] Hello From Sender
-> [Inmos:Sender:(1) 0.000000] [lua/INFO] Argc=4 (should be 4)
-> [Inmos:Sender:(1) 0.000000] [lua/INFO] Sending matrix_task to Bellevue
-> [Bellevue:Receiver:(2) 0.000000] [lua/INFO] Hello From Receiver
-> [Bellevue:Receiver:(2) 0.000000] [lua/INFO] Receiving Task from Inmos
-> [Bellevue:Receiver:(2) 0.030276] [lua/INFO] Calcul is done ... Bye
-> [Inmos:Sender:(1) 0.030276] [lua/INFO] Got the Multiplication result ...Bye
-> [0.030276] [lua/INFO] Simulation's over.See you.
+! output sort
+$ lua mult_matrix.lua --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:Sender@Inmos) Hello From Sender
+> [  0.000000] (1:Sender@Inmos) Argc=4 (should be 4)
+> [  0.000000] (1:Sender@Inmos) Sending matrix_task to Bellevue
+> [  0.000000] (2:Receiver@Bellevue) Hello From Receiver
+> [  0.000000] (2:Receiver@Bellevue) Receiving Task from Inmos
+> [  0.030276] (0:@) Simulation's over.See you.
+> [  0.030276] (1:Sender@Inmos) Got the Multiplication result ...Bye
+> [  0.030276] (2:Receiver@Bellevue) Calcul is done ... Bye
index 63a1040..0e7e3f9 100644 (file)
@@ -251,27 +251,27 @@ static void barrier(xbt_dynar_t action)
     name = xbt_str_join(action, " ");
 
   if (mutex == NULL) {       // first arriving on the barrier
-    mutex = SIMIX_mutex_init();
-    cond = SIMIX_cond_init();
+    mutex = SIMIX_req_mutex_init();
+    cond = SIMIX_req_cond_init();
     processes_arrived_sofar=0;
   }
   DEBUG2("Entering barrier: %s (%d already there)", name,processes_arrived_sofar);
 
-  SIMIX_mutex_lock(mutex);
+  SIMIX_req_mutex_lock(mutex);
   if (++processes_arrived_sofar == communicator_size) {
-    SIMIX_cond_broadcast(cond);
-    SIMIX_mutex_unlock(mutex);
+    SIMIX_req_cond_broadcast(cond);
+    SIMIX_req_mutex_unlock(mutex);
   } else {
-    SIMIX_cond_wait(cond,mutex);
-    SIMIX_mutex_unlock(mutex);
+    SIMIX_req_cond_wait(cond,mutex);
+    SIMIX_req_mutex_unlock(mutex);
   }
 
   DEBUG1("Exiting barrier: %s", name);
 
   processes_arrived_sofar--;
   if (!processes_arrived_sofar) {
-    SIMIX_cond_destroy(cond);
-    SIMIX_mutex_destroy(mutex);
+    SIMIX_req_cond_destroy(cond);
+    SIMIX_req_mutex_destroy(mutex);
     mutex=NULL;
   }
 
index 1936080..632a2bf 100644 (file)
@@ -1,76 +1,81 @@
 # A little tesh file testing most MPI-related actions
 
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment_split.xml
-> [host0:p0:(1) 500.005200] p0 recv p1 500.005200
-> [host1:p1:(2) 500.005200] p1 send p0 1e10 500.005200
-> [host0:p0:(1) 500.005201] p0 compute 12 0.000001
-> [host1:p1:(2) 512.005200] p1 sleep 12 12.000000 
-> [::(0) 512.005200] Simulation time 512.005
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment_split.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [500.005200] (1:p0@host0) p0 recv p1 500.005200
+> [500.005200] (2:p1@host1) p1 send p0 1e10 500.005200
+> [500.005201] (1:p0@host0) p0 compute 12 0.000001
+> [512.005200] (0:@) Simulation time 512.005
+> [512.005200] (2:p1@host1) p1 sleep 12 12.000000 
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment.xml actions_allReduce.txt
-> [host0:p0:(1) 0.000000] p0 comm_size 3 0.000000
-> [host1:p1:(2) 100.015912] p1 allReduce 5e8 5e8 100.015912
-> [host2:p2:(3) 100.021112] p2 allReduce 5e8 5e8 100.021112
-> [host0:p0:(1) 100.021112] p0 allReduce 5e8 5e8 100.021112
-> [host1:p1:(2) 150.015912] p1 compute 5e8 50.000000
-> [host0:p0:(1) 150.021112] p0 compute 5e8 50.000000
-> [host2:p2:(3) 150.021112] p2 compute 5e8 50.000000
-> [::(0) 150.021112] Simulation time 150.021
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment.xml actions_allReduce.txt --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:p0@host0) p0 comm_size 3 0.000000
+> [100.015912] (2:p1@host1) p1 allReduce 5e8 5e8 100.015912
+> [100.021112] (1:p0@host0) p0 allReduce 5e8 5e8 100.021112
+> [100.021112] (3:p2@host2) p2 allReduce 5e8 5e8 100.021112
+> [150.015912] (2:p1@host1) p1 compute 5e8 50.000000
+> [150.021112] (0:@) Simulation time 150.021
+> [150.021112] (1:p0@host0) p0 compute 5e8 50.000000
+> [150.021112] (3:p2@host2) p2 compute 5e8 50.000000
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment.xml actions_barrier.txt
-> [host0:p0:(1) 0.000000] p0 comm_size 3 0.000000
-> [host1:p1:(2) 0.000000] p1 comm_size 3 0.000000
-> [host2:p2:(3) 0.000000] p2 comm_size 3 0.000000
-> [host0:p0:(1) 0.505200] p0 send p1 1E7 0.505200
-> [host1:p1:(2) 0.505200] p1 recv p0 0.505200
-> [host1:p1:(2) 0.905200] p1 compute 4E6 0.400000
-> [host2:p2:(3) 0.905200] p2 compute 4E6 0.400000
-> [host0:p0:(1) 0.955200] p0 compute 4.5E6 0.450000
-> [::(0) 0.955200] Simulation time 0.9552
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment.xml actions_barrier.txt --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:p0@host0) p0 comm_size 3 0.000000
+> [  0.000000] (2:p1@host1) p1 comm_size 3 0.000000
+> [  0.000000] (3:p2@host2) p2 comm_size 3 0.000000
+> [  0.505200] (1:p0@host0) p0 send p1 1E7 0.505200
+> [  0.505200] (2:p1@host1) p1 recv p0 0.505200
+> [  0.905200] (2:p1@host1) p1 compute 4E6 0.400000
+> [  0.905200] (3:p2@host2) p2 compute 4E6 0.400000
+> [  0.955200] (0:@) Simulation time 0.9552
+> [  0.955200] (1:p0@host0) p0 compute 4.5E6 0.450000
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment.xml actions_bcast.txt
-> [host0:p0:(1) 0.000000] p0 comm_size 3 0.000000
-> [host1:p1:(2) 25.010400] p1 bcast 5e8 25.010400
-> [host2:p2:(3) 25.015600] p2 bcast 5e8 25.015600
-> [host0:p0:(1) 25.015600] p0 bcast 5e8 25.015600
-> [host1:p1:(2) 45.010400] p1 compute 2e8 20.000000
-> [host0:p0:(1) 75.015600] p0 compute 5e8 50.000000
-> [host2:p2:(3) 75.015600] p2 compute 5e8 50.000000
-> [host1:p1:(2) 100.026000] p1 bcast 5e8 55.015600
-> [host2:p2:(3) 100.031200] p2 bcast 5e8 25.015600
-> [host0:p0:(1) 100.031200] p0 bcast 5e8 25.015600
-> [host1:p1:(2) 120.026000] p1 compute 2e8 20.000000
-> [host0:p0:(1) 150.031200] p0 compute 5e8 50.000000
-> [host2:p2:(3) 150.031200] p2 compute 5e8 50.000000
-> [host1:p1:(2) 175.036400] p1 reduce 5e8 5e8 55.010400
-> [host2:p2:(3) 175.036400] p2 reduce 5e8 5e8 25.005200
-> [host0:p0:(1) 225.036712] p0 reduce 5e8 5e8 75.005512
-> [::(0) 225.036712] Simulation time 225.037
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment.xml actions_bcast.txt --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:p0@host0) p0 comm_size 3 0.000000
+> [ 25.010400] (2:p1@host1) p1 bcast 5e8 25.010400
+> [ 25.015600] (1:p0@host0) p0 bcast 5e8 25.015600
+> [ 25.015600] (3:p2@host2) p2 bcast 5e8 25.015600
+> [ 45.010400] (2:p1@host1) p1 compute 2e8 20.000000
+> [ 75.015600] (1:p0@host0) p0 compute 5e8 50.000000
+> [ 75.015600] (3:p2@host2) p2 compute 5e8 50.000000
+> [100.026000] (2:p1@host1) p1 bcast 5e8 55.015600
+> [100.031200] (1:p0@host0) p0 bcast 5e8 25.015600
+> [100.031200] (3:p2@host2) p2 bcast 5e8 25.015600
+> [120.026000] (2:p1@host1) p1 compute 2e8 20.000000
+> [150.031200] (1:p0@host0) p0 compute 5e8 50.000000
+> [150.031200] (3:p2@host2) p2 compute 5e8 50.000000
+> [175.036400] (2:p1@host1) p1 reduce 5e8 5e8 55.010400
+> [175.036400] (3:p2@host2) p2 reduce 5e8 5e8 25.005200
+> [225.036712] (0:@) Simulation time 225.037
+> [225.036712] (1:p0@host0) p0 reduce 5e8 5e8 75.005512
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment.xml actions_reduce.txt
-> [host0:p0:(1) 0.000000] p0 comm_size 3 0.000000
-> [host1:p1:(2) 25.005200] p1 reduce 5e8 5e8 25.005200
-> [host2:p2:(3) 25.005200] p2 reduce 5e8 5e8 25.005200
-> [host1:p1:(2) 75.005200] p1 compute 5e8 50.000000
-> [host2:p2:(3) 75.005200] p2 compute 5e8 50.000000
-> [host0:p0:(1) 75.005512] p0 reduce 5e8 5e8 75.005512
-> [host0:p0:(1) 125.005512] p0 compute 5e8 50.000000
-> [::(0) 125.005512] Simulation time 125.006
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment.xml actions_reduce.txt --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:p0@host0) p0 comm_size 3 0.000000
+> [ 25.005200] (2:p1@host1) p1 reduce 5e8 5e8 25.005200
+> [ 25.005200] (3:p2@host2) p2 reduce 5e8 5e8 25.005200
+> [ 75.005200] (2:p1@host1) p1 compute 5e8 50.000000
+> [ 75.005200] (3:p2@host2) p2 compute 5e8 50.000000
+> [ 75.005512] (1:p0@host0) p0 reduce 5e8 5e8 75.005512
+> [125.005512] (0:@) Simulation time 125.006
+> [125.005512] (1:p0@host0) p0 compute 5e8 50.000000
 
-$ ./actions --log=actions.thres=verbose --log=root.fmt:[%h:%P:(%i)%e%r]%e%m%n homogeneous_3_hosts.xml deployment.xml actions_with_isend.txt
-> [host1:p1:(2) 0.000000] p1 Irecv p0 0.000000
-> [host2:p2:(3) 0.000000] p2 Irecv p1 0.000000
-> [host2:p2:(3) 50.000000] p2 compute 5e8 50.000000
-> [host0:p0:(1) 50.005200] p0 send p1 1e9 50.005200
-> [host1:p1:(2) 100.000000] p1 compute 1e9 100.000000
-> [host1:p1:(2) 100.000156] p1 wait 0.000156
-> [host0:p0:(1) 150.005200] p0 compute 1e9 100.000000
-> [host1:p1:(2) 150.005356] p1 send p2 1e9 50.005200
-> [host2:p2:(3) 150.005512] p2 wait 100.005512
-> [host2:p2:(3) 150.005512] p2 Isend p0 1e9 0.000000
-> [host2:p2:(3) 200.005512] p2 compute 5e8 50.000000
-> [host0:p0:(1) 200.010712] p0 recv p2 50.005512
-> [::(0) 200.010712] Simulation time 200.011
+! output sort
+$ ./actions --log=actions.thres=verbose homogeneous_3_hosts.xml deployment.xml actions_with_isend.txt --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (2:p1@host1) p1 Irecv p0 0.000000
+> [  0.000000] (3:p2@host2) p2 Irecv p1 0.000000
+> [ 50.000000] (3:p2@host2) p2 compute 5e8 50.000000
+> [ 50.005200] (1:p0@host0) p0 send p1 1e9 50.005200
+> [100.000000] (2:p1@host1) p1 compute 1e9 100.000000
+> [100.000156] (2:p1@host1) p1 wait 0.000156
+> [150.005200] (1:p0@host0) p0 compute 1e9 100.000000
+> [150.005356] (2:p1@host1) p1 send p2 1e9 50.005200
+> [150.005512] (3:p2@host2) p2 wait 100.005512
+> [150.005512] (3:p2@host2) p2 Isend p0 1e9 0.000000
+> [200.005512] (3:p2@host2) p2 compute 5e8 50.000000
+> [200.010712] (0:@) Simulation time 200.011
+> [200.010712] (1:p0@host0) p0 recv p2 50.005512
 
-          
\ No newline at end of file
index 8646717..5c75a0f 100644 (file)
 
 p Test1 MSG_comm_test() with Sleep_sender > Sleep_receiver
 
-$ ./peer small_platform.xml deployment_peer01.xml
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] sleep_start_time : 5.000000 , sleep_test_time : 0.100000
-> [Ruby:receiver:(2) 0.000000] [msg_test/INFO] sleep_start_time : 1.000000 , sleep_test_time : 0.100000
-> [Ruby:receiver:(2) 1.000000] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.000000] [msg_test/INFO] Send to receiver-0 Task_0
-> [Ruby:receiver:(2) 5.100000] [msg_test/INFO] Received "Task_0"
-> [Ruby:receiver:(2) 5.100000] [msg_test/INFO] Processing "Task_0"
-> [Tremblay:sender:(1) 5.100000] [msg_test/INFO] Send to receiver-0 Task_1
-> [Ruby:receiver:(2) 5.609710] [msg_test/INFO] "Task_0" done
-> [Ruby:receiver:(2) 5.609710] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.700000] [msg_test/INFO] Send to receiver-0 Task_2
-> [Ruby:receiver:(2) 5.709710] [msg_test/INFO] Received "Task_1"
-> [Ruby:receiver:(2) 5.709710] [msg_test/INFO] Processing "Task_1"
-> [Ruby:receiver:(2) 6.219420] [msg_test/INFO] "Task_1" done
-> [Ruby:receiver:(2) 6.219420] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.300000] [msg_test/INFO] Send to receiver-0 finalize
-> [Ruby:receiver:(2) 6.319420] [msg_test/INFO] Received "Task_2"
-> [Ruby:receiver:(2) 6.319420] [msg_test/INFO] Processing "Task_2"
-> [Ruby:receiver:(2) 6.829130] [msg_test/INFO] "Task_2" done
-> [Ruby:receiver:(2) 6.829130] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.900000] [msg_test/INFO] Goodbye now!
-> [Ruby:receiver:(2) 6.929130] [msg_test/INFO] Received "finalize"
-> [Ruby:receiver:(2) 6.929130] [msg_test/INFO] I'm done. See you!
-> [6.929130] [msg_test/INFO] Simulation time 6.92913
+! output sort
+$ ./peer small_platform.xml deployment_peer01.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
+> [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
+> [  1.000000] (2:receiver@Ruby) Wait to receive a task
+> [  5.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [  5.100000] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [  5.100000] (2:receiver@Ruby) Received "Task_0"
+> [  5.100000] (2:receiver@Ruby) Processing "Task_0"
+> [  5.609710] (2:receiver@Ruby) "Task_0" done
+> [  5.609710] (2:receiver@Ruby) Wait to receive a task
+> [  5.700000] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [  5.709710] (2:receiver@Ruby) Received "Task_1"
+> [  5.709710] (2:receiver@Ruby) Processing "Task_1"
+> [  6.219420] (2:receiver@Ruby) "Task_1" done
+> [  6.219420] (2:receiver@Ruby) Wait to receive a task
+> [  6.300000] (1:sender@Tremblay) Send to receiver-0 finalize
+> [  6.319420] (2:receiver@Ruby) Received "Task_2"
+> [  6.319420] (2:receiver@Ruby) Processing "Task_2"
+> [  6.829130] (2:receiver@Ruby) "Task_2" done
+> [  6.829130] (2:receiver@Ruby) Wait to receive a task
+> [  6.900000] (1:sender@Tremblay) Goodbye now!
+> [  6.929130] (0:@) Simulation time 6.92913
+> [  6.929130] (2:receiver@Ruby) Received "finalize"
+> [  6.929130] (2:receiver@Ruby) I'm done. See you!
 
 
 p Test2 MSG_comm_test() with Sleep_sender < Sleep_receiver
 
-$ ./peer small_platform.xml deployment_peer02.xml
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] sleep_start_time : 1.000000 , sleep_test_time : 0.100000
-> [Ruby:receiver:(2) 0.000000] [msg_test/INFO] sleep_start_time : 5.000000 , sleep_test_time : 0.100000
-> [Tremblay:sender:(1) 1.000000] [msg_test/INFO] Send to receiver-0 Task_0
-> [Ruby:receiver:(2) 5.000000] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.100000] [msg_test/INFO] Send to receiver-0 Task_1
-> [Ruby:receiver:(2) 5.100000] [msg_test/INFO] Received "Task_0"
-> [Ruby:receiver:(2) 5.100000] [msg_test/INFO] Processing "Task_0"
-> [Ruby:receiver:(2) 5.609710] [msg_test/INFO] "Task_0" done
-> [Ruby:receiver:(2) 5.609710] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.700000] [msg_test/INFO] Send to receiver-0 Task_2
-> [Ruby:receiver:(2) 5.709710] [msg_test/INFO] Received "Task_1"
-> [Ruby:receiver:(2) 5.709710] [msg_test/INFO] Processing "Task_1"
-> [Ruby:receiver:(2) 6.219420] [msg_test/INFO] "Task_1" done
-> [Ruby:receiver:(2) 6.219420] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.300000] [msg_test/INFO] Send to receiver-0 finalize
-> [Ruby:receiver:(2) 6.319420] [msg_test/INFO] Received "Task_2"
-> [Ruby:receiver:(2) 6.319420] [msg_test/INFO] Processing "Task_2"
-> [Ruby:receiver:(2) 6.829130] [msg_test/INFO] "Task_2" done
-> [Ruby:receiver:(2) 6.829130] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.900000] [msg_test/INFO] Goodbye now!
-> [Ruby:receiver:(2) 6.929130] [msg_test/INFO] Received "finalize"
-> [Ruby:receiver:(2) 6.929130] [msg_test/INFO] I'm done. See you!
-> [6.929130] [msg_test/INFO] Simulation time 6.92913
+! output sort
+$ ./peer small_platform.xml deployment_peer02.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
+> [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
+> [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [  5.000000] (2:receiver@Ruby) Wait to receive a task
+> [  5.100000] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [  5.100000] (2:receiver@Ruby) Received "Task_0"
+> [  5.100000] (2:receiver@Ruby) Processing "Task_0"
+> [  5.609710] (2:receiver@Ruby) "Task_0" done
+> [  5.609710] (2:receiver@Ruby) Wait to receive a task
+> [  5.700000] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [  5.709710] (2:receiver@Ruby) Received "Task_1"
+> [  5.709710] (2:receiver@Ruby) Processing "Task_1"
+> [  6.219420] (2:receiver@Ruby) "Task_1" done
+> [  6.219420] (2:receiver@Ruby) Wait to receive a task
+> [  6.300000] (1:sender@Tremblay) Send to receiver-0 finalize
+> [  6.319420] (2:receiver@Ruby) Received "Task_2"
+> [  6.319420] (2:receiver@Ruby) Processing "Task_2"
+> [  6.829130] (2:receiver@Ruby) "Task_2" done
+> [  6.829130] (2:receiver@Ruby) Wait to receive a task
+> [  6.900000] (1:sender@Tremblay) Goodbye now!
+> [  6.929130] (0:@) Simulation time 6.92913
+> [  6.929130] (2:receiver@Ruby) Received "finalize"
+> [  6.929130] (2:receiver@Ruby) I'm done. See you!
 
 
 p Test1 MSG_comm_wait() with Sleep_sender > Sleep_receiver
 
-$ ./peer small_platform.xml deployment_peer03.xml
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] sleep_start_time : 5.000000 , sleep_test_time : 0.000000
-> [Ruby:receiver:(2) 0.000000] [msg_test/INFO] sleep_start_time : 1.000000 , sleep_test_time : 0.000000
-> [Ruby:receiver:(2) 1.000000] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.000000] [msg_test/INFO] Send to receiver-0 Task_0
-> [Ruby:receiver:(2) 5.016560] [msg_test/INFO] Received "Task_0"
-> [Ruby:receiver:(2) 5.016560] [msg_test/INFO] Processing "Task_0"
-> [Tremblay:sender:(1) 5.016560] [msg_test/INFO] Send to receiver-0 Task_1
-> [Ruby:receiver:(2) 5.526270] [msg_test/INFO] "Task_0" done
-> [Ruby:receiver:(2) 5.526270] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.542830] [msg_test/INFO] Send to receiver-0 Task_2
-> [Ruby:receiver:(2) 5.542830] [msg_test/INFO] Received "Task_1"
-> [Ruby:receiver:(2) 5.542830] [msg_test/INFO] Processing "Task_1"
-> [Ruby:receiver:(2) 6.052540] [msg_test/INFO] "Task_1" done
-> [Ruby:receiver:(2) 6.052540] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.069100] [msg_test/INFO] Send to receiver-0 finalize
-> [Ruby:receiver:(2) 6.069100] [msg_test/INFO] Received "Task_2"
-> [Ruby:receiver:(2) 6.069100] [msg_test/INFO] Processing "Task_2"
-> [Ruby:receiver:(2) 6.578810] [msg_test/INFO] "Task_2" done
-> [Ruby:receiver:(2) 6.578810] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.580370] [msg_test/INFO] Goodbye now!
-> [Ruby:receiver:(2) 6.580370] [msg_test/INFO] Received "finalize"
-> [Ruby:receiver:(2) 6.580370] [msg_test/INFO] I'm done. See you!
-> [6.580370] [msg_test/INFO] Simulation time 6.58037
+! output sort
+$ ./peer small_platform.xml deployment_peer03.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
+> [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
+> [  1.000000] (2:receiver@Ruby) Wait to receive a task
+> [  5.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [  5.016560] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [  5.016560] (2:receiver@Ruby) Received "Task_0"
+> [  5.016560] (2:receiver@Ruby) Processing "Task_0"
+> [  5.526270] (2:receiver@Ruby) "Task_0" done
+> [  5.526270] (2:receiver@Ruby) Wait to receive a task
+> [  5.542830] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [  5.542830] (2:receiver@Ruby) Received "Task_1"
+> [  5.542830] (2:receiver@Ruby) Processing "Task_1"
+> [  6.052540] (2:receiver@Ruby) "Task_1" done
+> [  6.052540] (2:receiver@Ruby) Wait to receive a task
+> [  6.069100] (1:sender@Tremblay) Send to receiver-0 finalize
+> [  6.069100] (2:receiver@Ruby) Received "Task_2"
+> [  6.069100] (2:receiver@Ruby) Processing "Task_2"
+> [  6.578810] (2:receiver@Ruby) "Task_2" done
+> [  6.578810] (2:receiver@Ruby) Wait to receive a task
+> [  6.580370] (0:@) Simulation time 6.58037
+> [  6.580370] (1:sender@Tremblay) Goodbye now!
+> [  6.580370] (2:receiver@Ruby) Received "finalize"
+> [  6.580370] (2:receiver@Ruby) I'm done. See you!
 
 
 p Test2 MSG_comm_wait() with Sleep_sender < Sleep_receiver
 
-$ ./peer small_platform.xml deployment_peer04.xml
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] sleep_start_time : 1.000000 , sleep_test_time : 0.000000
-> [Ruby:receiver:(2) 0.000000] [msg_test/INFO] sleep_start_time : 5.000000 , sleep_test_time : 0.000000
-> [Tremblay:sender:(1) 1.000000] [msg_test/INFO] Send to receiver-0 Task_0
-> [Ruby:receiver:(2) 5.000000] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.016560] [msg_test/INFO] Send to receiver-0 Task_1
-> [Ruby:receiver:(2) 5.016560] [msg_test/INFO] Received "Task_0"
-> [Ruby:receiver:(2) 5.016560] [msg_test/INFO] Processing "Task_0"
-> [Ruby:receiver:(2) 5.526270] [msg_test/INFO] "Task_0" done
-> [Ruby:receiver:(2) 5.526270] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 5.542830] [msg_test/INFO] Send to receiver-0 Task_2
-> [Ruby:receiver:(2) 5.542830] [msg_test/INFO] Received "Task_1"
-> [Ruby:receiver:(2) 5.542830] [msg_test/INFO] Processing "Task_1"
-> [Ruby:receiver:(2) 6.052540] [msg_test/INFO] "Task_1" done
-> [Ruby:receiver:(2) 6.052540] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.069100] [msg_test/INFO] Send to receiver-0 finalize
-> [Ruby:receiver:(2) 6.069100] [msg_test/INFO] Received "Task_2"
-> [Ruby:receiver:(2) 6.069100] [msg_test/INFO] Processing "Task_2"
-> [Ruby:receiver:(2) 6.578810] [msg_test/INFO] "Task_2" done
-> [Ruby:receiver:(2) 6.578810] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 6.580370] [msg_test/INFO] Goodbye now!
-> [Ruby:receiver:(2) 6.580370] [msg_test/INFO] Received "finalize"
-> [Ruby:receiver:(2) 6.580370] [msg_test/INFO] I'm done. See you!
-> [6.580370] [msg_test/INFO] Simulation time 6.58037
+! output sort
+$ ./peer small_platform.xml deployment_peer04.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
+> [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
+> [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [  5.000000] (2:receiver@Ruby) Wait to receive a task
+> [  5.016560] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [  5.016560] (2:receiver@Ruby) Received "Task_0"
+> [  5.016560] (2:receiver@Ruby) Processing "Task_0"
+> [  5.526270] (2:receiver@Ruby) "Task_0" done
+> [  5.526270] (2:receiver@Ruby) Wait to receive a task
+> [  5.542830] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [  5.542830] (2:receiver@Ruby) Received "Task_1"
+> [  5.542830] (2:receiver@Ruby) Processing "Task_1"
+> [  6.052540] (2:receiver@Ruby) "Task_1" done
+> [  6.052540] (2:receiver@Ruby) Wait to receive a task
+> [  6.069100] (1:sender@Tremblay) Send to receiver-0 finalize
+> [  6.069100] (2:receiver@Ruby) Received "Task_2"
+> [  6.069100] (2:receiver@Ruby) Processing "Task_2"
+> [  6.578810] (2:receiver@Ruby) "Task_2" done
+> [  6.578810] (2:receiver@Ruby) Wait to receive a task
+> [  6.580370] (0:@) Simulation time 6.58037
+> [  6.580370] (1:sender@Tremblay) Goodbye now!
+> [  6.580370] (2:receiver@Ruby) Received "finalize"
+> [  6.580370] (2:receiver@Ruby) I'm done. See you!
 
 
 p Test1 MSG_comm_waitall() for sender 
 
-$ ./peer2 small_platform.xml deployment_peer.xml
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] Send to receiver-0 Task_0
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] Send to receiver-0 Task_1
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] Send to receiver-0 Task_2
-> [Tremblay:sender:(1) 0.000000] [msg_test/INFO] Send to receiver-0 finalize
-> [Ruby:receiver:(2) 10.000000] [msg_test/INFO] Wait to receive a task
-> [Ruby:receiver:(2) 10.016560] [msg_test/INFO] Received "Task_0"
-> [Ruby:receiver:(2) 10.016560] [msg_test/INFO] Processing "Task_0"
-> [Ruby:receiver:(2) 10.526270] [msg_test/INFO] "Task_0" done
-> [Ruby:receiver:(2) 10.526270] [msg_test/INFO] Wait to receive a task
-> [Ruby:receiver:(2) 10.542830] [msg_test/INFO] Received "Task_1"
-> [Ruby:receiver:(2) 10.542830] [msg_test/INFO] Processing "Task_1"
-> [Ruby:receiver:(2) 11.052540] [msg_test/INFO] "Task_1" done
-> [Ruby:receiver:(2) 11.052540] [msg_test/INFO] Wait to receive a task
-> [Ruby:receiver:(2) 11.069100] [msg_test/INFO] Received "Task_2"
-> [Ruby:receiver:(2) 11.069100] [msg_test/INFO] Processing "Task_2"
-> [Ruby:receiver:(2) 11.578810] [msg_test/INFO] "Task_2" done
-> [Ruby:receiver:(2) 11.578810] [msg_test/INFO] Wait to receive a task
-> [Tremblay:sender:(1) 11.580370] [msg_test/INFO] Goodbye now!
-> [Ruby:receiver:(2) 11.580370] [msg_test/INFO] Received "finalize"
-> [Ruby:receiver:(2) 11.580370] [msg_test/INFO] I'm done. See you!
-> [11.580370] [msg_test/INFO] Simulation time 11.5804
+! output sort
+$ ./peer2 small_platform.xml deployment_peer.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
+> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_1
+> [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2
+> [  0.000000] (1:sender@Tremblay) Send to receiver-0 finalize
+> [ 10.000000] (2:receiver@Ruby) Wait to receive a task
+> [ 10.016560] (2:receiver@Ruby) Received "Task_0"
+> [ 10.016560] (2:receiver@Ruby) Processing "Task_0"
+> [ 10.526270] (2:receiver@Ruby) "Task_0" done
+> [ 10.526270] (2:receiver@Ruby) Wait to receive a task
+> [ 10.542830] (2:receiver@Ruby) Received "Task_1"
+> [ 10.542830] (2:receiver@Ruby) Processing "Task_1"
+> [ 11.052540] (2:receiver@Ruby) "Task_1" done
+> [ 11.052540] (2:receiver@Ruby) Wait to receive a task
+> [ 11.069100] (2:receiver@Ruby) Received "Task_2"
+> [ 11.069100] (2:receiver@Ruby) Processing "Task_2"
+> [ 11.578810] (2:receiver@Ruby) "Task_2" done
+> [ 11.578810] (2:receiver@Ruby) Wait to receive a task
+> [ 11.580370] (0:@) Simulation time 11.5804
+> [ 11.580370] (1:sender@Tremblay) Goodbye now!
+> [ 11.580370] (2:receiver@Ruby) Received "finalize"
+> [ 11.580370] (2:receiver@Ruby) I'm done. See you!
 
 
index f2f2dc0..8506b60 100644 (file)
 
 p Testing a simple master/slave example application
 
-$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --trace
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "Jupiter"
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Sending "Task_1" to "Fafard"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Received "Task_0"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Processing "Task_0"
-> [Fafard:slave:(4) 0.384115] [msg_test/INFO] Received "Task_1"
-> [Fafard:slave:(4) 0.384115] [msg_test/INFO] Processing "Task_1"
-> [Tremblay:master:(1) 0.384115] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.384115] [msg_test/INFO] Sending "Task_2" to "Ginette"
-> [Ginette:slave:(5) 0.524575] [msg_test/INFO] Received "Task_2"
-> [Ginette:slave:(5) 0.524575] [msg_test/INFO] Processing "Task_2"
-> [Tremblay:master:(1) 0.524575] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.524575] [msg_test/INFO] Sending "Task_3" to "Bourassa"
-> [Bourassa:slave:(6) 0.740447] [msg_test/INFO] Received "Task_3"
-> [Bourassa:slave:(6) 0.740447] [msg_test/INFO] Processing "Task_3"
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Sending "Task_4" to "Tremblay"
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Hey ! It's me ! :)
-> [Tremblay:slave:(2) 0.742786] [msg_test/INFO] Received "Task_4"
-> [Tremblay:slave:(2) 0.742786] [msg_test/INFO] Processing "Task_4"
-> [Tremblay:master:(1) 0.742786] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.742786] [msg_test/INFO] Sending "Task_5" to "Jupiter"
-> [Jupiter:slave:(3) 0.821304] [msg_test/INFO] "Task_0" done
-> [Tremblay:master:(1) 0.987266] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.987266] [msg_test/INFO] Sending "Task_6" to "Fafard"
-> [Jupiter:slave:(3) 0.987266] [msg_test/INFO] Received "Task_5"
-> [Jupiter:slave:(3) 0.987266] [msg_test/INFO] Processing "Task_5"
-> [Fafard:slave:(4) 1.039457] [msg_test/INFO] "Task_1" done
-> [Tremblay:slave:(2) 1.252495] [msg_test/INFO] "Task_4" done
-> [Tremblay:master:(1) 1.257610] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.257610] [msg_test/INFO] Sending "Task_7" to "Ginette"
-> [Fafard:slave:(4) 1.257610] [msg_test/INFO] Received "Task_6"
-> [Fafard:slave:(4) 1.257610] [msg_test/INFO] Processing "Task_6"
-> [Ginette:slave:(5) 1.555672] [msg_test/INFO] "Task_2" done
-> [Jupiter:slave:(3) 1.642608] [msg_test/INFO] "Task_5" done
-> [Tremblay:master:(1) 1.696132] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.696132] [msg_test/INFO] Sending "Task_8" to "Bourassa"
-> [Ginette:slave:(5) 1.696132] [msg_test/INFO] Received "Task_7"
-> [Ginette:slave:(5) 1.696132] [msg_test/INFO] Processing "Task_7"
-> [Bourassa:slave:(6) 1.771545] [msg_test/INFO] "Task_3" done
-> [Fafard:slave:(4) 1.912953] [msg_test/INFO] "Task_6" done
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Sending "Task_9" to "Tremblay"
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 1.987417] [msg_test/INFO] Received "Task_8"
-> [Bourassa:slave:(6) 1.987417] [msg_test/INFO] Processing "Task_8"
-> [Tremblay:slave:(2) 1.989756] [msg_test/INFO] Received "Task_9"
-> [Tremblay:slave:(2) 1.989756] [msg_test/INFO] Processing "Task_9"
-> [Tremblay:master:(1) 1.989756] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.989756] [msg_test/INFO] Sending "Task_10" to "Jupiter"
-> [Jupiter:slave:(3) 2.155718] [msg_test/INFO] Received "Task_10"
-> [Jupiter:slave:(3) 2.155718] [msg_test/INFO] Processing "Task_10"
-> [Tremblay:master:(1) 2.155718] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.155718] [msg_test/INFO] Sending "Task_11" to "Fafard"
-> [Fafard:slave:(4) 2.373871] [msg_test/INFO] Received "Task_11"
-> [Fafard:slave:(4) 2.373871] [msg_test/INFO] Processing "Task_11"
-> [Tremblay:master:(1) 2.373871] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.373871] [msg_test/INFO] Sending "Task_12" to "Ginette"
-> [Tremblay:slave:(2) 2.499466] [msg_test/INFO] "Task_9" done
-> [Ginette:slave:(5) 2.727230] [msg_test/INFO] "Task_7" done
-> [Jupiter:slave:(3) 2.811060] [msg_test/INFO] "Task_10" done
-> [Tremblay:master:(1) 2.867690] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.867690] [msg_test/INFO] Sending "Task_13" to "Bourassa"
-> [Ginette:slave:(5) 2.867690] [msg_test/INFO] Received "Task_12"
-> [Ginette:slave:(5) 2.867690] [msg_test/INFO] Processing "Task_12"
-> [Bourassa:slave:(6) 3.018515] [msg_test/INFO] "Task_8" done
-> [Fafard:slave:(4) 3.029213] [msg_test/INFO] "Task_11" done
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Sending "Task_14" to "Tremblay"
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 3.234387] [msg_test/INFO] Received "Task_13"
-> [Bourassa:slave:(6) 3.234387] [msg_test/INFO] Processing "Task_13"
-> [Tremblay:slave:(2) 3.236726] [msg_test/INFO] Received "Task_14"
-> [Tremblay:slave:(2) 3.236726] [msg_test/INFO] Processing "Task_14"
-> [Tremblay:master:(1) 3.236726] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.236726] [msg_test/INFO] Sending "Task_15" to "Jupiter"
-> [Jupiter:slave:(3) 3.402688] [msg_test/INFO] Received "Task_15"
-> [Jupiter:slave:(3) 3.402688] [msg_test/INFO] Processing "Task_15"
-> [Tremblay:master:(1) 3.402688] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.402688] [msg_test/INFO] Sending "Task_16" to "Fafard"
-> [Fafard:slave:(4) 3.620841] [msg_test/INFO] Received "Task_16"
-> [Fafard:slave:(4) 3.620841] [msg_test/INFO] Processing "Task_16"
-> [Tremblay:master:(1) 3.620841] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.620841] [msg_test/INFO] Sending "Task_17" to "Ginette"
-> [Tremblay:slave:(2) 3.746436] [msg_test/INFO] "Task_14" done
-> [Ginette:slave:(5) 3.898788] [msg_test/INFO] "Task_12" done
-> [Tremblay:master:(1) 4.039247] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.039247] [msg_test/INFO] Sending "Task_18" to "Bourassa"
-> [Ginette:slave:(5) 4.039247] [msg_test/INFO] Received "Task_17"
-> [Ginette:slave:(5) 4.039247] [msg_test/INFO] Processing "Task_17"
-> [Jupiter:slave:(3) 4.058030] [msg_test/INFO] "Task_15" done
-> [Bourassa:slave:(6) 4.265485] [msg_test/INFO] "Task_13" done
-> [Fafard:slave:(4) 4.276183] [msg_test/INFO] "Task_16" done
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Sending "Task_19" to "Tremblay"
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 4.481357] [msg_test/INFO] Received "Task_18"
-> [Bourassa:slave:(6) 4.481357] [msg_test/INFO] Processing "Task_18"
-> [Tremblay:slave:(2) 4.483696] [msg_test/INFO] Received "Task_19"
-> [Tremblay:slave:(2) 4.483696] [msg_test/INFO] Processing "Task_19"
-> [Tremblay:master:(1) 4.483696] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.483696] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Jupiter:slave:(3) 4.498896] [msg_test/INFO] Received "finalize"
-> [Jupiter:slave:(3) 4.498896] [msg_test/INFO] I'm done. See you!
-> [Fafard:slave:(4) 4.519447] [msg_test/INFO] Received "finalize"
-> [Fafard:slave:(4) 4.519447] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 4.993406] [msg_test/INFO] "Task_19" done
-> [Ginette:slave:(5) 5.070345] [msg_test/INFO] "Task_17" done
-> [Ginette:slave:(5) 5.083577] [msg_test/INFO] Received "finalize"
-> [Ginette:slave:(5) 5.083577] [msg_test/INFO] I'm done. See you!
-> [Bourassa:slave:(6) 5.512455] [msg_test/INFO] "Task_18" done
-> [Bourassa:slave:(6) 5.532791] [msg_test/INFO] Received "finalize"
-> [Bourassa:slave:(6) 5.532791] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 5.532947] [msg_test/INFO] Received "finalize"
-> [Tremblay:slave:(2) 5.532947] [msg_test/INFO] I'm done. See you!
-> [Tremblay:master:(1) 5.532947] [msg_test/INFO] Goodbye now!
-> [5.532947] [msg_test/INFO] Simulation time 5.53295
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --trace --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:master@Tremblay) Got 5 slaves and 20 tasks to process
+> [  0.000000] (1:master@Tremblay) Sending "Task_0" to "Jupiter"
+> [  0.165962] (1:master@Tremblay) Sent
+> [  0.165962] (1:master@Tremblay) Sending "Task_1" to "Fafard"
+> [  0.165962] (3:slave@Jupiter) Received "Task_0"
+> [  0.165962] (3:slave@Jupiter) Processing "Task_0"
+> [  0.384115] (1:master@Tremblay) Sent
+> [  0.384115] (1:master@Tremblay) Sending "Task_2" to "Ginette"
+> [  0.384115] (4:slave@Fafard) Received "Task_1"
+> [  0.384115] (4:slave@Fafard) Processing "Task_1"
+> [  0.524575] (1:master@Tremblay) Sent
+> [  0.524575] (1:master@Tremblay) Sending "Task_3" to "Bourassa"
+> [  0.524575] (5:slave@Ginette) Received "Task_2"
+> [  0.524575] (5:slave@Ginette) Processing "Task_2"
+> [  0.740447] (1:master@Tremblay) Sent
+> [  0.740447] (1:master@Tremblay) Sending "Task_4" to "Tremblay"
+> [  0.740447] (1:master@Tremblay) Hey ! It's me ! :)
+> [  0.740447] (6:slave@Bourassa) Received "Task_3"
+> [  0.740447] (6:slave@Bourassa) Processing "Task_3"
+> [  0.742786] (1:master@Tremblay) Sent
+> [  0.742786] (1:master@Tremblay) Sending "Task_5" to "Jupiter"
+> [  0.742786] (2:slave@Tremblay) Received "Task_4"
+> [  0.742786] (2:slave@Tremblay) Processing "Task_4"
+> [  0.821304] (3:slave@Jupiter) "Task_0" done
+> [  0.987266] (1:master@Tremblay) Sent
+> [  0.987266] (1:master@Tremblay) Sending "Task_6" to "Fafard"
+> [  0.987266] (3:slave@Jupiter) Received "Task_5"
+> [  0.987266] (3:slave@Jupiter) Processing "Task_5"
+> [  1.039457] (4:slave@Fafard) "Task_1" done
+> [  1.252495] (2:slave@Tremblay) "Task_4" done
+> [  1.257610] (1:master@Tremblay) Sent
+> [  1.257610] (1:master@Tremblay) Sending "Task_7" to "Ginette"
+> [  1.257610] (4:slave@Fafard) Received "Task_6"
+> [  1.257610] (4:slave@Fafard) Processing "Task_6"
+> [  1.555672] (5:slave@Ginette) "Task_2" done
+> [  1.642608] (3:slave@Jupiter) "Task_5" done
+> [  1.696132] (1:master@Tremblay) Sent
+> [  1.696132] (1:master@Tremblay) Sending "Task_8" to "Bourassa"
+> [  1.696132] (5:slave@Ginette) Received "Task_7"
+> [  1.696132] (5:slave@Ginette) Processing "Task_7"
+> [  1.771545] (6:slave@Bourassa) "Task_3" done
+> [  1.912953] (4:slave@Fafard) "Task_6" done
+> [  1.987417] (1:master@Tremblay) Sent
+> [  1.987417] (1:master@Tremblay) Sending "Task_9" to "Tremblay"
+> [  1.987417] (1:master@Tremblay) Hey ! It's me ! :)
+> [  1.987417] (6:slave@Bourassa) Received "Task_8"
+> [  1.987417] (6:slave@Bourassa) Processing "Task_8"
+> [  1.989756] (1:master@Tremblay) Sent
+> [  1.989756] (1:master@Tremblay) Sending "Task_10" to "Jupiter"
+> [  1.989756] (2:slave@Tremblay) Received "Task_9"
+> [  1.989756] (2:slave@Tremblay) Processing "Task_9"
+> [  2.155718] (1:master@Tremblay) Sent
+> [  2.155718] (1:master@Tremblay) Sending "Task_11" to "Fafard"
+> [  2.155718] (3:slave@Jupiter) Received "Task_10"
+> [  2.155718] (3:slave@Jupiter) Processing "Task_10"
+> [  2.373871] (1:master@Tremblay) Sent
+> [  2.373871] (1:master@Tremblay) Sending "Task_12" to "Ginette"
+> [  2.373871] (4:slave@Fafard) Received "Task_11"
+> [  2.373871] (4:slave@Fafard) Processing "Task_11"
+> [  2.499466] (2:slave@Tremblay) "Task_9" done
+> [  2.727230] (5:slave@Ginette) "Task_7" done
+> [  2.811060] (3:slave@Jupiter) "Task_10" done
+> [  2.867690] (1:master@Tremblay) Sent
+> [  2.867690] (1:master@Tremblay) Sending "Task_13" to "Bourassa"
+> [  2.867690] (5:slave@Ginette) Received "Task_12"
+> [  2.867690] (5:slave@Ginette) Processing "Task_12"
+> [  3.018515] (6:slave@Bourassa) "Task_8" done
+> [  3.029213] (4:slave@Fafard) "Task_11" done
+> [  3.234387] (1:master@Tremblay) Sent
+> [  3.234387] (1:master@Tremblay) Sending "Task_14" to "Tremblay"
+> [  3.234387] (1:master@Tremblay) Hey ! It's me ! :)
+> [  3.234387] (6:slave@Bourassa) Received "Task_13"
+> [  3.234387] (6:slave@Bourassa) Processing "Task_13"
+> [  3.236726] (1:master@Tremblay) Sent
+> [  3.236726] (1:master@Tremblay) Sending "Task_15" to "Jupiter"
+> [  3.236726] (2:slave@Tremblay) Received "Task_14"
+> [  3.236726] (2:slave@Tremblay) Processing "Task_14"
+> [  3.402688] (1:master@Tremblay) Sent
+> [  3.402688] (1:master@Tremblay) Sending "Task_16" to "Fafard"
+> [  3.402688] (3:slave@Jupiter) Received "Task_15"
+> [  3.402688] (3:slave@Jupiter) Processing "Task_15"
+> [  3.620841] (1:master@Tremblay) Sent
+> [  3.620841] (1:master@Tremblay) Sending "Task_17" to "Ginette"
+> [  3.620841] (4:slave@Fafard) Received "Task_16"
+> [  3.620841] (4:slave@Fafard) Processing "Task_16"
+> [  3.746436] (2:slave@Tremblay) "Task_14" done
+> [  3.898788] (5:slave@Ginette) "Task_12" done
+> [  4.039247] (1:master@Tremblay) Sent
+> [  4.039247] (1:master@Tremblay) Sending "Task_18" to "Bourassa"
+> [  4.039247] (5:slave@Ginette) Received "Task_17"
+> [  4.039247] (5:slave@Ginette) Processing "Task_17"
+> [  4.058030] (3:slave@Jupiter) "Task_15" done
+> [  4.265485] (6:slave@Bourassa) "Task_13" done
+> [  4.276183] (4:slave@Fafard) "Task_16" done
+> [  4.481357] (1:master@Tremblay) Sent
+> [  4.481357] (1:master@Tremblay) Sending "Task_19" to "Tremblay"
+> [  4.481357] (1:master@Tremblay) Hey ! It's me ! :)
+> [  4.481357] (6:slave@Bourassa) Received "Task_18"
+> [  4.481357] (6:slave@Bourassa) Processing "Task_18"
+> [  4.483696] (1:master@Tremblay) Sent
+> [  4.483696] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [  4.483696] (2:slave@Tremblay) Received "Task_19"
+> [  4.483696] (2:slave@Tremblay) Processing "Task_19"
+> [  4.498896] (3:slave@Jupiter) Received "finalize"
+> [  4.498896] (3:slave@Jupiter) I'm done. See you!
+> [  4.519447] (4:slave@Fafard) Received "finalize"
+> [  4.519447] (4:slave@Fafard) I'm done. See you!
+> [  4.993406] (2:slave@Tremblay) "Task_19" done
+> [  5.070345] (5:slave@Ginette) "Task_17" done
+> [  5.083577] (5:slave@Ginette) Received "finalize"
+> [  5.083577] (5:slave@Ginette) I'm done. See you!
+> [  5.512455] (6:slave@Bourassa) "Task_18" done
+> [  5.532791] (6:slave@Bourassa) Received "finalize"
+> [  5.532791] (6:slave@Bourassa) I'm done. See you!
+> [  5.532947] (0:@) Simulation time 5.53295
+> [  5.532947] (1:master@Tremblay) Goodbye now!
+> [  5.532947] (2:slave@Tremblay) Received "finalize"
+> [  5.532947] (2:slave@Tremblay) I'm done. See you!
index 5dd5019..3e870c9 100644 (file)
 #! ./tesh
 p Testing the bypassing of the flexml parser
 
-$ $SG_TEST_EXENV masterslave/masterslave_bypass --log=no_loc 
-> [0.000000] [surf_parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
-> [host A:master:(1) 0.000000] [msg_test/INFO] Got 1 slave(s) :
-> [host A:master:(1) 0.000000] [msg_test/INFO]          host B
-> [host A:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_0"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_1"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_2"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_3"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_4"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_5"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_6"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_7"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_8"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_9"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_10"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_11"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_12"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_13"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_14"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_15"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_16"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_17"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_18"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_19"
-> [host A:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "host B"
-> [host B:slave:(2) 0.000000] [msg_test/INFO] I'm a slave
-> [host A:master:(1) 4.080000] [msg_test/INFO] Send completed
-> [host A:master:(1) 4.080000] [msg_test/INFO] Sending "Task_1" to "host B"
-> [host B:slave:(2) 4.080000] [msg_test/INFO] Received "Task_0" 
-> [host B:slave:(2) 4.080000] [msg_test/INFO] Processing "Task_0" 
-> [host B:slave:(2) 4.130000] [msg_test/INFO] "Task_0" done 
-> [host A:master:(1) 8.210000] [msg_test/INFO] Send completed
-> [host A:master:(1) 8.210000] [msg_test/INFO] Sending "Task_2" to "host B"
-> [host B:slave:(2) 8.210000] [msg_test/INFO] Received "Task_1" 
-> [host B:slave:(2) 8.210000] [msg_test/INFO] Processing "Task_1" 
-> [host B:slave:(2) 8.260000] [msg_test/INFO] "Task_1" done 
-> [host A:master:(1) 12.340000] [msg_test/INFO] Send completed
-> [host A:master:(1) 12.340000] [msg_test/INFO] Sending "Task_3" to "host B"
-> [host B:slave:(2) 12.340000] [msg_test/INFO] Received "Task_2" 
-> [host B:slave:(2) 12.340000] [msg_test/INFO] Processing "Task_2" 
-> [host B:slave:(2) 12.390000] [msg_test/INFO] "Task_2" done 
-> [host A:master:(1) 16.470000] [msg_test/INFO] Send completed
-> [host A:master:(1) 16.470000] [msg_test/INFO] Sending "Task_4" to "host B"
-> [host B:slave:(2) 16.470000] [msg_test/INFO] Received "Task_3" 
-> [host B:slave:(2) 16.470000] [msg_test/INFO] Processing "Task_3" 
-> [host B:slave:(2) 16.520000] [msg_test/INFO] "Task_3" done 
-> [host A:master:(1) 20.600000] [msg_test/INFO] Send completed
-> [host A:master:(1) 20.600000] [msg_test/INFO] Sending "Task_5" to "host B"
-> [host B:slave:(2) 20.600000] [msg_test/INFO] Received "Task_4" 
-> [host B:slave:(2) 20.600000] [msg_test/INFO] Processing "Task_4" 
-> [host B:slave:(2) 20.650000] [msg_test/INFO] "Task_4" done 
-> [host A:master:(1) 24.730000] [msg_test/INFO] Send completed
-> [host A:master:(1) 24.730000] [msg_test/INFO] Sending "Task_6" to "host B"
-> [host B:slave:(2) 24.730000] [msg_test/INFO] Received "Task_5" 
-> [host B:slave:(2) 24.730000] [msg_test/INFO] Processing "Task_5" 
-> [host B:slave:(2) 24.780000] [msg_test/INFO] "Task_5" done 
-> [host A:master:(1) 28.860000] [msg_test/INFO] Send completed
-> [host A:master:(1) 28.860000] [msg_test/INFO] Sending "Task_7" to "host B"
-> [host B:slave:(2) 28.860000] [msg_test/INFO] Received "Task_6" 
-> [host B:slave:(2) 28.860000] [msg_test/INFO] Processing "Task_6" 
-> [host B:slave:(2) 28.910000] [msg_test/INFO] "Task_6" done 
-> [host A:master:(1) 32.990000] [msg_test/INFO] Send completed
-> [host A:master:(1) 32.990000] [msg_test/INFO] Sending "Task_8" to "host B"
-> [host B:slave:(2) 32.990000] [msg_test/INFO] Received "Task_7" 
-> [host B:slave:(2) 32.990000] [msg_test/INFO] Processing "Task_7" 
-> [host B:slave:(2) 33.040000] [msg_test/INFO] "Task_7" done 
-> [host A:master:(1) 37.120000] [msg_test/INFO] Send completed
-> [host A:master:(1) 37.120000] [msg_test/INFO] Sending "Task_9" to "host B"
-> [host B:slave:(2) 37.120000] [msg_test/INFO] Received "Task_8" 
-> [host B:slave:(2) 37.120000] [msg_test/INFO] Processing "Task_8" 
-> [host B:slave:(2) 37.170000] [msg_test/INFO] "Task_8" done 
-> [host A:master:(1) 41.250000] [msg_test/INFO] Send completed
-> [host A:master:(1) 41.250000] [msg_test/INFO] Sending "Task_10" to "host B"
-> [host B:slave:(2) 41.250000] [msg_test/INFO] Received "Task_9" 
-> [host B:slave:(2) 41.250000] [msg_test/INFO] Processing "Task_9" 
-> [host B:slave:(2) 41.300000] [msg_test/INFO] "Task_9" done 
-> [host A:master:(1) 45.380000] [msg_test/INFO] Send completed
-> [host A:master:(1) 45.380000] [msg_test/INFO] Sending "Task_11" to "host B"
-> [host B:slave:(2) 45.380000] [msg_test/INFO] Received "Task_10" 
-> [host B:slave:(2) 45.380000] [msg_test/INFO] Processing "Task_10" 
-> [host B:slave:(2) 45.430000] [msg_test/INFO] "Task_10" done 
-> [host A:master:(1) 49.510000] [msg_test/INFO] Send completed
-> [host A:master:(1) 49.510000] [msg_test/INFO] Sending "Task_12" to "host B"
-> [host B:slave:(2) 49.510000] [msg_test/INFO] Received "Task_11" 
-> [host B:slave:(2) 49.510000] [msg_test/INFO] Processing "Task_11" 
-> [host B:slave:(2) 49.560000] [msg_test/INFO] "Task_11" done 
-> [host A:master:(1) 53.640000] [msg_test/INFO] Send completed
-> [host A:master:(1) 53.640000] [msg_test/INFO] Sending "Task_13" to "host B"
-> [host B:slave:(2) 53.640000] [msg_test/INFO] Received "Task_12" 
-> [host B:slave:(2) 53.640000] [msg_test/INFO] Processing "Task_12" 
-> [host B:slave:(2) 53.690000] [msg_test/INFO] "Task_12" done 
-> [host A:master:(1) 57.770000] [msg_test/INFO] Send completed
-> [host A:master:(1) 57.770000] [msg_test/INFO] Sending "Task_14" to "host B"
-> [host B:slave:(2) 57.770000] [msg_test/INFO] Received "Task_13" 
-> [host B:slave:(2) 57.770000] [msg_test/INFO] Processing "Task_13" 
-> [host B:slave:(2) 57.820000] [msg_test/INFO] "Task_13" done 
-> [host A:master:(1) 61.900000] [msg_test/INFO] Send completed
-> [host A:master:(1) 61.900000] [msg_test/INFO] Sending "Task_15" to "host B"
-> [host B:slave:(2) 61.900000] [msg_test/INFO] Received "Task_14" 
-> [host B:slave:(2) 61.900000] [msg_test/INFO] Processing "Task_14" 
-> [host B:slave:(2) 61.950000] [msg_test/INFO] "Task_14" done 
-> [host A:master:(1) 66.030000] [msg_test/INFO] Send completed
-> [host A:master:(1) 66.030000] [msg_test/INFO] Sending "Task_16" to "host B"
-> [host B:slave:(2) 66.030000] [msg_test/INFO] Received "Task_15" 
-> [host B:slave:(2) 66.030000] [msg_test/INFO] Processing "Task_15" 
-> [host B:slave:(2) 66.080000] [msg_test/INFO] "Task_15" done 
-> [host A:master:(1) 70.160000] [msg_test/INFO] Send completed
-> [host A:master:(1) 70.160000] [msg_test/INFO] Sending "Task_17" to "host B"
-> [host B:slave:(2) 70.160000] [msg_test/INFO] Received "Task_16" 
-> [host B:slave:(2) 70.160000] [msg_test/INFO] Processing "Task_16" 
-> [host B:slave:(2) 70.210000] [msg_test/INFO] "Task_16" done 
-> [host A:master:(1) 74.290000] [msg_test/INFO] Send completed
-> [host A:master:(1) 74.290000] [msg_test/INFO] Sending "Task_18" to "host B"
-> [host B:slave:(2) 74.290000] [msg_test/INFO] Received "Task_17" 
-> [host B:slave:(2) 74.290000] [msg_test/INFO] Processing "Task_17" 
-> [host B:slave:(2) 74.340000] [msg_test/INFO] "Task_17" done 
-> [host A:master:(1) 78.420000] [msg_test/INFO] Send completed
-> [host A:master:(1) 78.420000] [msg_test/INFO] Sending "Task_19" to "host B"
-> [host B:slave:(2) 78.420000] [msg_test/INFO] Received "Task_18" 
-> [host B:slave:(2) 78.420000] [msg_test/INFO] Processing "Task_18" 
-> [host B:slave:(2) 78.470000] [msg_test/INFO] "Task_18" done 
-> [host A:master:(1) 82.550000] [msg_test/INFO] Send completed
-> [host A:master:(1) 82.550000] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [host B:slave:(2) 82.550000] [msg_test/INFO] Received "Task_19" 
-> [host B:slave:(2) 82.550000] [msg_test/INFO] Processing "Task_19" 
-> [host B:slave:(2) 82.600000] [msg_test/INFO] "Task_19" done 
-> [host A:master:(1) 84.680000] [msg_test/INFO] Goodbye now!
-> [host B:slave:(2) 84.680000] [msg_test/INFO] Received "finalize" 
-> [host B:slave:(2) 84.680000] [msg_test/INFO] I'm done. See you!
-> [84.680000] [msg_test/INFO] Simulation time 84.68
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_bypass --log=no_loc  --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
+> [  0.000000] (1:master@host A) Got 1 slave(s) :
+> [  0.000000] (1:master@host A)        host B
+> [  0.000000] (1:master@host A) Got 20 task to process :
+> [  0.000000] (1:master@host A)       "Task_0"
+> [  0.000000] (1:master@host A)       "Task_1"
+> [  0.000000] (1:master@host A)       "Task_2"
+> [  0.000000] (1:master@host A)       "Task_3"
+> [  0.000000] (1:master@host A)       "Task_4"
+> [  0.000000] (1:master@host A)       "Task_5"
+> [  0.000000] (1:master@host A)       "Task_6"
+> [  0.000000] (1:master@host A)       "Task_7"
+> [  0.000000] (1:master@host A)       "Task_8"
+> [  0.000000] (1:master@host A)       "Task_9"
+> [  0.000000] (1:master@host A)       "Task_10"
+> [  0.000000] (1:master@host A)       "Task_11"
+> [  0.000000] (1:master@host A)       "Task_12"
+> [  0.000000] (1:master@host A)       "Task_13"
+> [  0.000000] (1:master@host A)       "Task_14"
+> [  0.000000] (1:master@host A)       "Task_15"
+> [  0.000000] (1:master@host A)       "Task_16"
+> [  0.000000] (1:master@host A)       "Task_17"
+> [  0.000000] (1:master@host A)       "Task_18"
+> [  0.000000] (1:master@host A)       "Task_19"
+> [  0.000000] (1:master@host A) Sending "Task_0" to "host B"
+> [  0.000000] (2:slave@host B) I'm a slave
+> [  4.080000] (1:master@host A) Send completed
+> [  4.080000] (1:master@host A) Sending "Task_1" to "host B"
+> [  4.080000] (2:slave@host B) Received "Task_0" 
+> [  4.080000] (2:slave@host B) Processing "Task_0" 
+> [  4.130000] (2:slave@host B) "Task_0" done 
+> [  8.210000] (1:master@host A) Send completed
+> [  8.210000] (1:master@host A) Sending "Task_2" to "host B"
+> [  8.210000] (2:slave@host B) Received "Task_1" 
+> [  8.210000] (2:slave@host B) Processing "Task_1" 
+> [  8.260000] (2:slave@host B) "Task_1" done 
+> [ 12.340000] (1:master@host A) Send completed
+> [ 12.340000] (1:master@host A) Sending "Task_3" to "host B"
+> [ 12.340000] (2:slave@host B) Received "Task_2" 
+> [ 12.340000] (2:slave@host B) Processing "Task_2" 
+> [ 12.390000] (2:slave@host B) "Task_2" done 
+> [ 16.470000] (1:master@host A) Send completed
+> [ 16.470000] (1:master@host A) Sending "Task_4" to "host B"
+> [ 16.470000] (2:slave@host B) Received "Task_3" 
+> [ 16.470000] (2:slave@host B) Processing "Task_3" 
+> [ 16.520000] (2:slave@host B) "Task_3" done 
+> [ 20.600000] (1:master@host A) Send completed
+> [ 20.600000] (1:master@host A) Sending "Task_5" to "host B"
+> [ 20.600000] (2:slave@host B) Received "Task_4" 
+> [ 20.600000] (2:slave@host B) Processing "Task_4" 
+> [ 20.650000] (2:slave@host B) "Task_4" done 
+> [ 24.730000] (1:master@host A) Send completed
+> [ 24.730000] (1:master@host A) Sending "Task_6" to "host B"
+> [ 24.730000] (2:slave@host B) Received "Task_5" 
+> [ 24.730000] (2:slave@host B) Processing "Task_5" 
+> [ 24.780000] (2:slave@host B) "Task_5" done 
+> [ 28.860000] (1:master@host A) Send completed
+> [ 28.860000] (1:master@host A) Sending "Task_7" to "host B"
+> [ 28.860000] (2:slave@host B) Received "Task_6" 
+> [ 28.860000] (2:slave@host B) Processing "Task_6" 
+> [ 28.910000] (2:slave@host B) "Task_6" done 
+> [ 32.990000] (1:master@host A) Send completed
+> [ 32.990000] (1:master@host A) Sending "Task_8" to "host B"
+> [ 32.990000] (2:slave@host B) Received "Task_7" 
+> [ 32.990000] (2:slave@host B) Processing "Task_7" 
+> [ 33.040000] (2:slave@host B) "Task_7" done 
+> [ 37.120000] (1:master@host A) Send completed
+> [ 37.120000] (1:master@host A) Sending "Task_9" to "host B"
+> [ 37.120000] (2:slave@host B) Received "Task_8" 
+> [ 37.120000] (2:slave@host B) Processing "Task_8" 
+> [ 37.170000] (2:slave@host B) "Task_8" done 
+> [ 41.250000] (1:master@host A) Send completed
+> [ 41.250000] (1:master@host A) Sending "Task_10" to "host B"
+> [ 41.250000] (2:slave@host B) Received "Task_9" 
+> [ 41.250000] (2:slave@host B) Processing "Task_9" 
+> [ 41.300000] (2:slave@host B) "Task_9" done 
+> [ 45.380000] (1:master@host A) Send completed
+> [ 45.380000] (1:master@host A) Sending "Task_11" to "host B"
+> [ 45.380000] (2:slave@host B) Received "Task_10" 
+> [ 45.380000] (2:slave@host B) Processing "Task_10" 
+> [ 45.430000] (2:slave@host B) "Task_10" done 
+> [ 49.510000] (1:master@host A) Send completed
+> [ 49.510000] (1:master@host A) Sending "Task_12" to "host B"
+> [ 49.510000] (2:slave@host B) Received "Task_11" 
+> [ 49.510000] (2:slave@host B) Processing "Task_11" 
+> [ 49.560000] (2:slave@host B) "Task_11" done 
+> [ 53.640000] (1:master@host A) Send completed
+> [ 53.640000] (1:master@host A) Sending "Task_13" to "host B"
+> [ 53.640000] (2:slave@host B) Received "Task_12" 
+> [ 53.640000] (2:slave@host B) Processing "Task_12" 
+> [ 53.690000] (2:slave@host B) "Task_12" done 
+> [ 57.770000] (1:master@host A) Send completed
+> [ 57.770000] (1:master@host A) Sending "Task_14" to "host B"
+> [ 57.770000] (2:slave@host B) Received "Task_13" 
+> [ 57.770000] (2:slave@host B) Processing "Task_13" 
+> [ 57.820000] (2:slave@host B) "Task_13" done 
+> [ 61.900000] (1:master@host A) Send completed
+> [ 61.900000] (1:master@host A) Sending "Task_15" to "host B"
+> [ 61.900000] (2:slave@host B) Received "Task_14" 
+> [ 61.900000] (2:slave@host B) Processing "Task_14" 
+> [ 61.950000] (2:slave@host B) "Task_14" done 
+> [ 66.030000] (1:master@host A) Send completed
+> [ 66.030000] (1:master@host A) Sending "Task_16" to "host B"
+> [ 66.030000] (2:slave@host B) Received "Task_15" 
+> [ 66.030000] (2:slave@host B) Processing "Task_15" 
+> [ 66.080000] (2:slave@host B) "Task_15" done 
+> [ 70.160000] (1:master@host A) Send completed
+> [ 70.160000] (1:master@host A) Sending "Task_17" to "host B"
+> [ 70.160000] (2:slave@host B) Received "Task_16" 
+> [ 70.160000] (2:slave@host B) Processing "Task_16" 
+> [ 70.210000] (2:slave@host B) "Task_16" done 
+> [ 74.290000] (1:master@host A) Send completed
+> [ 74.290000] (1:master@host A) Sending "Task_18" to "host B"
+> [ 74.290000] (2:slave@host B) Received "Task_17" 
+> [ 74.290000] (2:slave@host B) Processing "Task_17" 
+> [ 74.340000] (2:slave@host B) "Task_17" done 
+> [ 78.420000] (1:master@host A) Send completed
+> [ 78.420000] (1:master@host A) Sending "Task_19" to "host B"
+> [ 78.420000] (2:slave@host B) Received "Task_18" 
+> [ 78.420000] (2:slave@host B) Processing "Task_18" 
+> [ 78.470000] (2:slave@host B) "Task_18" done 
+> [ 82.550000] (1:master@host A) Send completed
+> [ 82.550000] (1:master@host A) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 82.550000] (2:slave@host B) Received "Task_19" 
+> [ 82.550000] (2:slave@host B) Processing "Task_19" 
+> [ 82.600000] (2:slave@host B) "Task_19" done 
+> [ 84.680000] (0:@) Simulation time 84.68
+> [ 84.680000] (1:master@host A) Goodbye now!
+> [ 84.680000] (2:slave@host B) Received "finalize" 
+> [ 84.680000] (2:slave@host B) I'm done. See you!
index fbd8ab2..2ab90f6 100644 (file)
@@ -1,95 +1,96 @@
 #! ./tesh
 
-$ $SG_TEST_EXENV ./masterslave_console platform_script.lua --log=surf_parse.thres:critical
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 4 slaves and 20 tasks to process
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 221.119476] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-1"
-> [Bourassa:slave:(5) 221.119476] [msg_test/INFO] Received "Task_0"
-> [Bourassa:slave:(5) 221.119476] [msg_test/INFO] Processing "Task_0"
-> [Jupiter:slave:(2) 230.754144] [msg_test/INFO] Received "Task_1"
-> [Jupiter:slave:(2) 230.754144] [msg_test/INFO] Processing "Task_1"
-> [Tremblay:master:(1) 230.754144] [msg_test/INFO] Sending "Task_2" (of 20) to mailbox "slave-2"
-> [Bourassa:slave:(5) 232.461553] [msg_test/INFO] "Task_0" done
-> [Jupiter:slave:(2) 237.962910] [msg_test/INFO] "Task_1" done
-> [Fafard:slave:(3) 403.819753] [msg_test/INFO] Received "Task_2"
-> [Fafard:slave:(3) 403.819753] [msg_test/INFO] Processing "Task_2"
-> [Tremblay:master:(1) 403.819753] [msg_test/INFO] Sending "Task_3" (of 20) to mailbox "slave-3"
-> [Fafard:slave:(3) 411.028519] [msg_test/INFO] "Task_2" done
-> [Ginette:slave:(4) 519.166957] [msg_test/INFO] Received "Task_3"
-> [Ginette:slave:(4) 519.166957] [msg_test/INFO] Processing "Task_3"
-> [Tremblay:master:(1) 519.166957] [msg_test/INFO] Sending "Task_4" (of 20) to mailbox "slave-0"
-> [Ginette:slave:(4) 530.509034] [msg_test/INFO] "Task_3" done
-> [Bourassa:slave:(5) 740.286433] [msg_test/INFO] Received "Task_4"
-> [Bourassa:slave:(5) 740.286433] [msg_test/INFO] Processing "Task_4"
-> [Tremblay:master:(1) 740.286433] [msg_test/INFO] Sending "Task_5" (of 20) to mailbox "slave-1"
-> [Jupiter:slave:(2) 749.921101] [msg_test/INFO] Received "Task_5"
-> [Jupiter:slave:(2) 749.921101] [msg_test/INFO] Processing "Task_5"
-> [Tremblay:master:(1) 749.921101] [msg_test/INFO] Sending "Task_6" (of 20) to mailbox "slave-2"
-> [Bourassa:slave:(5) 751.628510] [msg_test/INFO] "Task_4" done
-> [Jupiter:slave:(2) 757.129867] [msg_test/INFO] "Task_5" done
-> [Fafard:slave:(3) 922.986710] [msg_test/INFO] Received "Task_6"
-> [Fafard:slave:(3) 922.986710] [msg_test/INFO] Processing "Task_6"
-> [Tremblay:master:(1) 922.986710] [msg_test/INFO] Sending "Task_7" (of 20) to mailbox "slave-3"
-> [Fafard:slave:(3) 930.195476] [msg_test/INFO] "Task_6" done
-> [Ginette:slave:(4) 1038.333914] [msg_test/INFO] Received "Task_7"
-> [Ginette:slave:(4) 1038.333914] [msg_test/INFO] Processing "Task_7"
-> [Tremblay:master:(1) 1038.333914] [msg_test/INFO] Sending "Task_8" (of 20) to mailbox "slave-0"
-> [Ginette:slave:(4) 1049.675991] [msg_test/INFO] "Task_7" done
-> [Bourassa:slave:(5) 1259.453390] [msg_test/INFO] Received "Task_8"
-> [Bourassa:slave:(5) 1259.453390] [msg_test/INFO] Processing "Task_8"
-> [Tremblay:master:(1) 1259.453390] [msg_test/INFO] Sending "Task_9" (of 20) to mailbox "slave-1"
-> [Jupiter:slave:(2) 1269.088058] [msg_test/INFO] Received "Task_9"
-> [Jupiter:slave:(2) 1269.088058] [msg_test/INFO] Processing "Task_9"
-> [Tremblay:master:(1) 1269.088058] [msg_test/INFO] Sending "Task_10" (of 20) to mailbox "slave-2"
-> [Bourassa:slave:(5) 1270.795467] [msg_test/INFO] "Task_8" done
-> [Jupiter:slave:(2) 1276.296824] [msg_test/INFO] "Task_9" done
-> [Fafard:slave:(3) 1442.153667] [msg_test/INFO] Received "Task_10"
-> [Fafard:slave:(3) 1442.153667] [msg_test/INFO] Processing "Task_10"
-> [Tremblay:master:(1) 1442.153667] [msg_test/INFO] Sending "Task_11" (of 20) to mailbox "slave-3"
-> [Fafard:slave:(3) 1449.362433] [msg_test/INFO] "Task_10" done
-> [Ginette:slave:(4) 1557.500871] [msg_test/INFO] Received "Task_11"
-> [Ginette:slave:(4) 1557.500871] [msg_test/INFO] Processing "Task_11"
-> [Tremblay:master:(1) 1557.500871] [msg_test/INFO] Sending "Task_12" (of 20) to mailbox "slave-0"
-> [Ginette:slave:(4) 1568.842948] [msg_test/INFO] "Task_11" done
-> [Bourassa:slave:(5) 1778.620347] [msg_test/INFO] Received "Task_12"
-> [Bourassa:slave:(5) 1778.620347] [msg_test/INFO] Processing "Task_12"
-> [Tremblay:master:(1) 1778.620347] [msg_test/INFO] Sending "Task_13" (of 20) to mailbox "slave-1"
-> [Jupiter:slave:(2) 1788.255015] [msg_test/INFO] Received "Task_13"
-> [Jupiter:slave:(2) 1788.255015] [msg_test/INFO] Processing "Task_13"
-> [Tremblay:master:(1) 1788.255015] [msg_test/INFO] Sending "Task_14" (of 20) to mailbox "slave-2"
-> [Bourassa:slave:(5) 1789.962424] [msg_test/INFO] "Task_12" done
-> [Jupiter:slave:(2) 1795.463781] [msg_test/INFO] "Task_13" done
-> [Fafard:slave:(3) 1961.320624] [msg_test/INFO] Received "Task_14"
-> [Fafard:slave:(3) 1961.320624] [msg_test/INFO] Processing "Task_14"
-> [Tremblay:master:(1) 1961.320624] [msg_test/INFO] Sending "Task_15" (of 20) to mailbox "slave-3"
-> [Fafard:slave:(3) 1968.529390] [msg_test/INFO] "Task_14" done
-> [Ginette:slave:(4) 2076.667828] [msg_test/INFO] Received "Task_15"
-> [Ginette:slave:(4) 2076.667828] [msg_test/INFO] Processing "Task_15"
-> [Tremblay:master:(1) 2076.667828] [msg_test/INFO] Sending "Task_16" (of 20) to mailbox "slave-0"
-> [Ginette:slave:(4) 2088.009905] [msg_test/INFO] "Task_15" done
-> [Bourassa:slave:(5) 2297.787304] [msg_test/INFO] Received "Task_16"
-> [Bourassa:slave:(5) 2297.787304] [msg_test/INFO] Processing "Task_16"
-> [Tremblay:master:(1) 2297.787304] [msg_test/INFO] Sending "Task_17" (of 20) to mailbox "slave-1"
-> [Jupiter:slave:(2) 2307.421972] [msg_test/INFO] Received "Task_17"
-> [Jupiter:slave:(2) 2307.421972] [msg_test/INFO] Processing "Task_17"
-> [Tremblay:master:(1) 2307.421972] [msg_test/INFO] Sending "Task_18" (of 20) to mailbox "slave-2"
-> [Bourassa:slave:(5) 2309.129381] [msg_test/INFO] "Task_16" done
-> [Jupiter:slave:(2) 2314.630738] [msg_test/INFO] "Task_17" done
-> [Fafard:slave:(3) 2480.487581] [msg_test/INFO] Received "Task_18"
-> [Fafard:slave:(3) 2480.487581] [msg_test/INFO] Processing "Task_18"
-> [Tremblay:master:(1) 2480.487581] [msg_test/INFO] Sending "Task_19" (of 20) to mailbox "slave-3"
-> [Fafard:slave:(3) 2487.696347] [msg_test/INFO] "Task_18" done
-> [Ginette:slave:(4) 2595.834785] [msg_test/INFO] Received "Task_19"
-> [Ginette:slave:(4) 2595.834785] [msg_test/INFO] Processing "Task_19"
-> [Tremblay:master:(1) 2595.834785] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Ginette:slave:(4) 2607.176862] [msg_test/INFO] "Task_19" done
-> [Bourassa:slave:(5) 2616.664880] [msg_test/INFO] Received "finalize"
-> [Bourassa:slave:(5) 2616.664880] [msg_test/INFO] I'm done. See you!
-> [Jupiter:slave:(2) 2617.572494] [msg_test/INFO] Received "finalize"
-> [Jupiter:slave:(2) 2617.572494] [msg_test/INFO] I'm done. See you!
-> [Fafard:slave:(3) 2633.875776] [msg_test/INFO] Received "finalize"
-> [Fafard:slave:(3) 2633.875776] [msg_test/INFO] I'm done. See you!
-> [Ginette:slave:(4) 2644.741817] [msg_test/INFO] Received "finalize"
-> [Ginette:slave:(4) 2644.741817] [msg_test/INFO] I'm done. See you!
-> [Tremblay:master:(1) 2644.741817] [msg_test/INFO] Goodbye now!
-> [2644.741817] [msg_test/INFO] Simulation time 2644.74
+! output sort
+$ $SG_TEST_EXENV masterslave_console platform_script.lua --log=surf_parse.thres:critical --log=root.fmt:[%11.6r]%e(%i:%P@%h)%e%m%n
+> [   0.000000] (1:master@Tremblay) Got 4 slaves and 20 tasks to process
+> [   0.000000] (1:master@Tremblay) Sending "Task_0" (of 20) to mailbox "slave-0"
+> [ 221.119476] (1:master@Tremblay) Sending "Task_1" (of 20) to mailbox "slave-1"
+> [ 221.119476] (5:slave@Bourassa) Received "Task_0"
+> [ 221.119476] (5:slave@Bourassa) Processing "Task_0"
+> [ 230.754144] (1:master@Tremblay) Sending "Task_2" (of 20) to mailbox "slave-2"
+> [ 230.754144] (2:slave@Jupiter) Received "Task_1"
+> [ 230.754144] (2:slave@Jupiter) Processing "Task_1"
+> [ 232.461553] (5:slave@Bourassa) "Task_0" done
+> [ 237.962910] (2:slave@Jupiter) "Task_1" done
+> [ 403.819753] (1:master@Tremblay) Sending "Task_3" (of 20) to mailbox "slave-3"
+> [ 403.819753] (3:slave@Fafard) Received "Task_2"
+> [ 403.819753] (3:slave@Fafard) Processing "Task_2"
+> [ 411.028519] (3:slave@Fafard) "Task_2" done
+> [ 519.166957] (1:master@Tremblay) Sending "Task_4" (of 20) to mailbox "slave-0"
+> [ 519.166957] (4:slave@Ginette) Received "Task_3"
+> [ 519.166957] (4:slave@Ginette) Processing "Task_3"
+> [ 530.509034] (4:slave@Ginette) "Task_3" done
+> [ 740.286433] (1:master@Tremblay) Sending "Task_5" (of 20) to mailbox "slave-1"
+> [ 740.286433] (5:slave@Bourassa) Received "Task_4"
+> [ 740.286433] (5:slave@Bourassa) Processing "Task_4"
+> [ 749.921101] (1:master@Tremblay) Sending "Task_6" (of 20) to mailbox "slave-2"
+> [ 749.921101] (2:slave@Jupiter) Received "Task_5"
+> [ 749.921101] (2:slave@Jupiter) Processing "Task_5"
+> [ 751.628510] (5:slave@Bourassa) "Task_4" done
+> [ 757.129867] (2:slave@Jupiter) "Task_5" done
+> [ 922.986710] (1:master@Tremblay) Sending "Task_7" (of 20) to mailbox "slave-3"
+> [ 922.986710] (3:slave@Fafard) Received "Task_6"
+> [ 922.986710] (3:slave@Fafard) Processing "Task_6"
+> [ 930.195476] (3:slave@Fafard) "Task_6" done
+> [1038.333914] (1:master@Tremblay) Sending "Task_8" (of 20) to mailbox "slave-0"
+> [1038.333914] (4:slave@Ginette) Received "Task_7"
+> [1038.333914] (4:slave@Ginette) Processing "Task_7"
+> [1049.675991] (4:slave@Ginette) "Task_7" done
+> [1259.453390] (1:master@Tremblay) Sending "Task_9" (of 20) to mailbox "slave-1"
+> [1259.453390] (5:slave@Bourassa) Received "Task_8"
+> [1259.453390] (5:slave@Bourassa) Processing "Task_8"
+> [1269.088058] (1:master@Tremblay) Sending "Task_10" (of 20) to mailbox "slave-2"
+> [1269.088058] (2:slave@Jupiter) Received "Task_9"
+> [1269.088058] (2:slave@Jupiter) Processing "Task_9"
+> [1270.795467] (5:slave@Bourassa) "Task_8" done
+> [1276.296824] (2:slave@Jupiter) "Task_9" done
+> [1442.153667] (1:master@Tremblay) Sending "Task_11" (of 20) to mailbox "slave-3"
+> [1442.153667] (3:slave@Fafard) Received "Task_10"
+> [1442.153667] (3:slave@Fafard) Processing "Task_10"
+> [1449.362433] (3:slave@Fafard) "Task_10" done
+> [1557.500871] (1:master@Tremblay) Sending "Task_12" (of 20) to mailbox "slave-0"
+> [1557.500871] (4:slave@Ginette) Received "Task_11"
+> [1557.500871] (4:slave@Ginette) Processing "Task_11"
+> [1568.842948] (4:slave@Ginette) "Task_11" done
+> [1778.620347] (1:master@Tremblay) Sending "Task_13" (of 20) to mailbox "slave-1"
+> [1778.620347] (5:slave@Bourassa) Received "Task_12"
+> [1778.620347] (5:slave@Bourassa) Processing "Task_12"
+> [1788.255015] (1:master@Tremblay) Sending "Task_14" (of 20) to mailbox "slave-2"
+> [1788.255015] (2:slave@Jupiter) Received "Task_13"
+> [1788.255015] (2:slave@Jupiter) Processing "Task_13"
+> [1789.962424] (5:slave@Bourassa) "Task_12" done
+> [1795.463781] (2:slave@Jupiter) "Task_13" done
+> [1961.320624] (1:master@Tremblay) Sending "Task_15" (of 20) to mailbox "slave-3"
+> [1961.320624] (3:slave@Fafard) Received "Task_14"
+> [1961.320624] (3:slave@Fafard) Processing "Task_14"
+> [1968.529390] (3:slave@Fafard) "Task_14" done
+> [2076.667828] (1:master@Tremblay) Sending "Task_16" (of 20) to mailbox "slave-0"
+> [2076.667828] (4:slave@Ginette) Received "Task_15"
+> [2076.667828] (4:slave@Ginette) Processing "Task_15"
+> [2088.009905] (4:slave@Ginette) "Task_15" done
+> [2297.787304] (1:master@Tremblay) Sending "Task_17" (of 20) to mailbox "slave-1"
+> [2297.787304] (5:slave@Bourassa) Received "Task_16"
+> [2297.787304] (5:slave@Bourassa) Processing "Task_16"
+> [2307.421972] (1:master@Tremblay) Sending "Task_18" (of 20) to mailbox "slave-2"
+> [2307.421972] (2:slave@Jupiter) Received "Task_17"
+> [2307.421972] (2:slave@Jupiter) Processing "Task_17"
+> [2309.129381] (5:slave@Bourassa) "Task_16" done
+> [2314.630738] (2:slave@Jupiter) "Task_17" done
+> [2480.487581] (1:master@Tremblay) Sending "Task_19" (of 20) to mailbox "slave-3"
+> [2480.487581] (3:slave@Fafard) Received "Task_18"
+> [2480.487581] (3:slave@Fafard) Processing "Task_18"
+> [2487.696347] (3:slave@Fafard) "Task_18" done
+> [2595.834785] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [2595.834785] (4:slave@Ginette) Received "Task_19"
+> [2595.834785] (4:slave@Ginette) Processing "Task_19"
+> [2607.176862] (4:slave@Ginette) "Task_19" done
+> [2616.664880] (5:slave@Bourassa) Received "finalize"
+> [2616.664880] (5:slave@Bourassa) I'm done. See you!
+> [2617.572494] (2:slave@Jupiter) Received "finalize"
+> [2617.572494] (2:slave@Jupiter) I'm done. See you!
+> [2633.875776] (3:slave@Fafard) Received "finalize"
+> [2633.875776] (3:slave@Fafard) I'm done. See you!
+> [2644.741817] (0:@) Simulation time 2644.74
+> [2644.741817] (1:master@Tremblay) Goodbye now!
+> [2644.741817] (4:slave@Ginette) Received "finalize"
+> [2644.741817] (4:slave@Ginette) I'm done. See you!
index f11de06..be85695 100644 (file)
 
 p Testing a simple master/slave example application
 
-$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "Jupiter"
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Sending "Task_1" to "Fafard"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Received "Task_0"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Processing "Task_0"
-> [Fafard:slave:(4) 0.384115] [msg_test/INFO] Received "Task_1"
-> [Fafard:slave:(4) 0.384115] [msg_test/INFO] Processing "Task_1"
-> [Tremblay:master:(1) 0.384115] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.384115] [msg_test/INFO] Sending "Task_2" to "Ginette"
-> [Ginette:slave:(5) 0.524575] [msg_test/INFO] Received "Task_2"
-> [Ginette:slave:(5) 0.524575] [msg_test/INFO] Processing "Task_2"
-> [Tremblay:master:(1) 0.524575] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.524575] [msg_test/INFO] Sending "Task_3" to "Bourassa"
-> [Bourassa:slave:(6) 0.740447] [msg_test/INFO] Received "Task_3"
-> [Bourassa:slave:(6) 0.740447] [msg_test/INFO] Processing "Task_3"
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Sending "Task_4" to "Tremblay"
-> [Tremblay:master:(1) 0.740447] [msg_test/INFO] Hey ! It's me ! :)
-> [Tremblay:slave:(2) 0.742786] [msg_test/INFO] Received "Task_4"
-> [Tremblay:slave:(2) 0.742786] [msg_test/INFO] Processing "Task_4"
-> [Tremblay:master:(1) 0.742786] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.742786] [msg_test/INFO] Sending "Task_5" to "Jupiter"
-> [Jupiter:slave:(3) 0.821304] [msg_test/INFO] "Task_0" done
-> [Tremblay:master:(1) 0.987266] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 0.987266] [msg_test/INFO] Sending "Task_6" to "Fafard"
-> [Jupiter:slave:(3) 0.987266] [msg_test/INFO] Received "Task_5"
-> [Jupiter:slave:(3) 0.987266] [msg_test/INFO] Processing "Task_5"
-> [Fafard:slave:(4) 1.039457] [msg_test/INFO] "Task_1" done
-> [Tremblay:slave:(2) 1.252495] [msg_test/INFO] "Task_4" done
-> [Tremblay:master:(1) 1.257610] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.257610] [msg_test/INFO] Sending "Task_7" to "Ginette"
-> [Fafard:slave:(4) 1.257610] [msg_test/INFO] Received "Task_6"
-> [Fafard:slave:(4) 1.257610] [msg_test/INFO] Processing "Task_6"
-> [Ginette:slave:(5) 1.555672] [msg_test/INFO] "Task_2" done
-> [Jupiter:slave:(3) 1.642608] [msg_test/INFO] "Task_5" done
-> [Tremblay:master:(1) 1.696132] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.696132] [msg_test/INFO] Sending "Task_8" to "Bourassa"
-> [Ginette:slave:(5) 1.696132] [msg_test/INFO] Received "Task_7"
-> [Ginette:slave:(5) 1.696132] [msg_test/INFO] Processing "Task_7"
-> [Bourassa:slave:(6) 1.771545] [msg_test/INFO] "Task_3" done
-> [Fafard:slave:(4) 1.912953] [msg_test/INFO] "Task_6" done
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Sending "Task_9" to "Tremblay"
-> [Tremblay:master:(1) 1.987417] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 1.987417] [msg_test/INFO] Received "Task_8"
-> [Bourassa:slave:(6) 1.987417] [msg_test/INFO] Processing "Task_8"
-> [Tremblay:slave:(2) 1.989756] [msg_test/INFO] Received "Task_9"
-> [Tremblay:slave:(2) 1.989756] [msg_test/INFO] Processing "Task_9"
-> [Tremblay:master:(1) 1.989756] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 1.989756] [msg_test/INFO] Sending "Task_10" to "Jupiter"
-> [Jupiter:slave:(3) 2.155718] [msg_test/INFO] Received "Task_10"
-> [Jupiter:slave:(3) 2.155718] [msg_test/INFO] Processing "Task_10"
-> [Tremblay:master:(1) 2.155718] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.155718] [msg_test/INFO] Sending "Task_11" to "Fafard"
-> [Fafard:slave:(4) 2.373871] [msg_test/INFO] Received "Task_11"
-> [Fafard:slave:(4) 2.373871] [msg_test/INFO] Processing "Task_11"
-> [Tremblay:master:(1) 2.373871] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.373871] [msg_test/INFO] Sending "Task_12" to "Ginette"
-> [Tremblay:slave:(2) 2.499466] [msg_test/INFO] "Task_9" done
-> [Ginette:slave:(5) 2.727230] [msg_test/INFO] "Task_7" done
-> [Jupiter:slave:(3) 2.811060] [msg_test/INFO] "Task_10" done
-> [Tremblay:master:(1) 2.867690] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 2.867690] [msg_test/INFO] Sending "Task_13" to "Bourassa"
-> [Ginette:slave:(5) 2.867690] [msg_test/INFO] Received "Task_12"
-> [Ginette:slave:(5) 2.867690] [msg_test/INFO] Processing "Task_12"
-> [Bourassa:slave:(6) 3.018515] [msg_test/INFO] "Task_8" done
-> [Fafard:slave:(4) 3.029213] [msg_test/INFO] "Task_11" done
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Sending "Task_14" to "Tremblay"
-> [Tremblay:master:(1) 3.234387] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 3.234387] [msg_test/INFO] Received "Task_13"
-> [Bourassa:slave:(6) 3.234387] [msg_test/INFO] Processing "Task_13"
-> [Tremblay:slave:(2) 3.236726] [msg_test/INFO] Received "Task_14"
-> [Tremblay:slave:(2) 3.236726] [msg_test/INFO] Processing "Task_14"
-> [Tremblay:master:(1) 3.236726] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.236726] [msg_test/INFO] Sending "Task_15" to "Jupiter"
-> [Jupiter:slave:(3) 3.402688] [msg_test/INFO] Received "Task_15"
-> [Jupiter:slave:(3) 3.402688] [msg_test/INFO] Processing "Task_15"
-> [Tremblay:master:(1) 3.402688] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.402688] [msg_test/INFO] Sending "Task_16" to "Fafard"
-> [Fafard:slave:(4) 3.620841] [msg_test/INFO] Received "Task_16"
-> [Fafard:slave:(4) 3.620841] [msg_test/INFO] Processing "Task_16"
-> [Tremblay:master:(1) 3.620841] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 3.620841] [msg_test/INFO] Sending "Task_17" to "Ginette"
-> [Tremblay:slave:(2) 3.746436] [msg_test/INFO] "Task_14" done
-> [Ginette:slave:(5) 3.898788] [msg_test/INFO] "Task_12" done
-> [Tremblay:master:(1) 4.039247] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.039247] [msg_test/INFO] Sending "Task_18" to "Bourassa"
-> [Ginette:slave:(5) 4.039247] [msg_test/INFO] Received "Task_17"
-> [Ginette:slave:(5) 4.039247] [msg_test/INFO] Processing "Task_17"
-> [Jupiter:slave:(3) 4.058030] [msg_test/INFO] "Task_15" done
-> [Bourassa:slave:(6) 4.265485] [msg_test/INFO] "Task_13" done
-> [Fafard:slave:(4) 4.276183] [msg_test/INFO] "Task_16" done
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Sending "Task_19" to "Tremblay"
-> [Tremblay:master:(1) 4.481357] [msg_test/INFO] Hey ! It's me ! :)
-> [Bourassa:slave:(6) 4.481357] [msg_test/INFO] Received "Task_18"
-> [Bourassa:slave:(6) 4.481357] [msg_test/INFO] Processing "Task_18"
-> [Tremblay:slave:(2) 4.483696] [msg_test/INFO] Received "Task_19"
-> [Tremblay:slave:(2) 4.483696] [msg_test/INFO] Processing "Task_19"
-> [Tremblay:master:(1) 4.483696] [msg_test/INFO] Sent
-> [Tremblay:master:(1) 4.483696] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Jupiter:slave:(3) 4.498896] [msg_test/INFO] Received "finalize"
-> [Jupiter:slave:(3) 4.498896] [msg_test/INFO] I'm done. See you!
-> [Fafard:slave:(4) 4.519447] [msg_test/INFO] Received "finalize"
-> [Fafard:slave:(4) 4.519447] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 4.993406] [msg_test/INFO] "Task_19" done
-> [Ginette:slave:(5) 5.070345] [msg_test/INFO] "Task_17" done
-> [Ginette:slave:(5) 5.083577] [msg_test/INFO] Received "finalize"
-> [Ginette:slave:(5) 5.083577] [msg_test/INFO] I'm done. See you!
-> [Bourassa:slave:(6) 5.512455] [msg_test/INFO] "Task_18" done
-> [Bourassa:slave:(6) 5.532791] [msg_test/INFO] Received "finalize"
-> [Bourassa:slave:(6) 5.532791] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 5.532947] [msg_test/INFO] Received "finalize"
-> [Tremblay:slave:(2) 5.532947] [msg_test/INFO] I'm done. See you!
-> [Tremblay:master:(1) 5.532947] [msg_test/INFO] Goodbye now!
-> [5.532947] [msg_test/INFO] Simulation time 5.53295
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [  0.000000] (1:master@Tremblay) Got 5 slaves and 20 tasks to process
+> [  0.000000] (1:master@Tremblay) Sending "Task_0" to "Jupiter"
+> [  0.165962] (1:master@Tremblay) Sent
+> [  0.165962] (1:master@Tremblay) Sending "Task_1" to "Fafard"
+> [  0.165962] (3:slave@Jupiter) Received "Task_0"
+> [  0.165962] (3:slave@Jupiter) Processing "Task_0"
+> [  0.384115] (1:master@Tremblay) Sent
+> [  0.384115] (1:master@Tremblay) Sending "Task_2" to "Ginette"
+> [  0.384115] (4:slave@Fafard) Received "Task_1"
+> [  0.384115] (4:slave@Fafard) Processing "Task_1"
+> [  0.524575] (1:master@Tremblay) Sent
+> [  0.524575] (1:master@Tremblay) Sending "Task_3" to "Bourassa"
+> [  0.524575] (5:slave@Ginette) Received "Task_2"
+> [  0.524575] (5:slave@Ginette) Processing "Task_2"
+> [  0.740447] (1:master@Tremblay) Sent
+> [  0.740447] (1:master@Tremblay) Sending "Task_4" to "Tremblay"
+> [  0.740447] (1:master@Tremblay) Hey ! It's me ! :)
+> [  0.740447] (6:slave@Bourassa) Received "Task_3"
+> [  0.740447] (6:slave@Bourassa) Processing "Task_3"
+> [  0.742786] (1:master@Tremblay) Sent
+> [  0.742786] (1:master@Tremblay) Sending "Task_5" to "Jupiter"
+> [  0.742786] (2:slave@Tremblay) Received "Task_4"
+> [  0.742786] (2:slave@Tremblay) Processing "Task_4"
+> [  0.821304] (3:slave@Jupiter) "Task_0" done
+> [  0.987266] (1:master@Tremblay) Sent
+> [  0.987266] (1:master@Tremblay) Sending "Task_6" to "Fafard"
+> [  0.987266] (3:slave@Jupiter) Received "Task_5"
+> [  0.987266] (3:slave@Jupiter) Processing "Task_5"
+> [  1.039457] (4:slave@Fafard) "Task_1" done
+> [  1.252495] (2:slave@Tremblay) "Task_4" done
+> [  1.257610] (1:master@Tremblay) Sent
+> [  1.257610] (1:master@Tremblay) Sending "Task_7" to "Ginette"
+> [  1.257610] (4:slave@Fafard) Received "Task_6"
+> [  1.257610] (4:slave@Fafard) Processing "Task_6"
+> [  1.555672] (5:slave@Ginette) "Task_2" done
+> [  1.642608] (3:slave@Jupiter) "Task_5" done
+> [  1.696132] (1:master@Tremblay) Sent
+> [  1.696132] (1:master@Tremblay) Sending "Task_8" to "Bourassa"
+> [  1.696132] (5:slave@Ginette) Received "Task_7"
+> [  1.696132] (5:slave@Ginette) Processing "Task_7"
+> [  1.771545] (6:slave@Bourassa) "Task_3" done
+> [  1.912953] (4:slave@Fafard) "Task_6" done
+> [  1.987417] (1:master@Tremblay) Sent
+> [  1.987417] (1:master@Tremblay) Sending "Task_9" to "Tremblay"
+> [  1.987417] (1:master@Tremblay) Hey ! It's me ! :)
+> [  1.987417] (6:slave@Bourassa) Received "Task_8"
+> [  1.987417] (6:slave@Bourassa) Processing "Task_8"
+> [  1.989756] (1:master@Tremblay) Sent
+> [  1.989756] (1:master@Tremblay) Sending "Task_10" to "Jupiter"
+> [  1.989756] (2:slave@Tremblay) Received "Task_9"
+> [  1.989756] (2:slave@Tremblay) Processing "Task_9"
+> [  2.155718] (1:master@Tremblay) Sent
+> [  2.155718] (1:master@Tremblay) Sending "Task_11" to "Fafard"
+> [  2.155718] (3:slave@Jupiter) Received "Task_10"
+> [  2.155718] (3:slave@Jupiter) Processing "Task_10"
+> [  2.373871] (1:master@Tremblay) Sent
+> [  2.373871] (1:master@Tremblay) Sending "Task_12" to "Ginette"
+> [  2.373871] (4:slave@Fafard) Received "Task_11"
+> [  2.373871] (4:slave@Fafard) Processing "Task_11"
+> [  2.499466] (2:slave@Tremblay) "Task_9" done
+> [  2.727230] (5:slave@Ginette) "Task_7" done
+> [  2.811060] (3:slave@Jupiter) "Task_10" done
+> [  2.867690] (1:master@Tremblay) Sent
+> [  2.867690] (1:master@Tremblay) Sending "Task_13" to "Bourassa"
+> [  2.867690] (5:slave@Ginette) Received "Task_12"
+> [  2.867690] (5:slave@Ginette) Processing "Task_12"
+> [  3.018515] (6:slave@Bourassa) "Task_8" done
+> [  3.029213] (4:slave@Fafard) "Task_11" done
+> [  3.234387] (1:master@Tremblay) Sent
+> [  3.234387] (1:master@Tremblay) Sending "Task_14" to "Tremblay"
+> [  3.234387] (1:master@Tremblay) Hey ! It's me ! :)
+> [  3.234387] (6:slave@Bourassa) Received "Task_13"
+> [  3.234387] (6:slave@Bourassa) Processing "Task_13"
+> [  3.236726] (1:master@Tremblay) Sent
+> [  3.236726] (1:master@Tremblay) Sending "Task_15" to "Jupiter"
+> [  3.236726] (2:slave@Tremblay) Received "Task_14"
+> [  3.236726] (2:slave@Tremblay) Processing "Task_14"
+> [  3.402688] (1:master@Tremblay) Sent
+> [  3.402688] (1:master@Tremblay) Sending "Task_16" to "Fafard"
+> [  3.402688] (3:slave@Jupiter) Received "Task_15"
+> [  3.402688] (3:slave@Jupiter) Processing "Task_15"
+> [  3.620841] (1:master@Tremblay) Sent
+> [  3.620841] (1:master@Tremblay) Sending "Task_17" to "Ginette"
+> [  3.620841] (4:slave@Fafard) Received "Task_16"
+> [  3.620841] (4:slave@Fafard) Processing "Task_16"
+> [  3.746436] (2:slave@Tremblay) "Task_14" done
+> [  3.898788] (5:slave@Ginette) "Task_12" done
+> [  4.039247] (1:master@Tremblay) Sent
+> [  4.039247] (1:master@Tremblay) Sending "Task_18" to "Bourassa"
+> [  4.039247] (5:slave@Ginette) Received "Task_17"
+> [  4.039247] (5:slave@Ginette) Processing "Task_17"
+> [  4.058030] (3:slave@Jupiter) "Task_15" done
+> [  4.265485] (6:slave@Bourassa) "Task_13" done
+> [  4.276183] (4:slave@Fafard) "Task_16" done
+> [  4.481357] (1:master@Tremblay) Sent
+> [  4.481357] (1:master@Tremblay) Sending "Task_19" to "Tremblay"
+> [  4.481357] (1:master@Tremblay) Hey ! It's me ! :)
+> [  4.481357] (6:slave@Bourassa) Received "Task_18"
+> [  4.481357] (6:slave@Bourassa) Processing "Task_18"
+> [  4.483696] (1:master@Tremblay) Sent
+> [  4.483696] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [  4.483696] (2:slave@Tremblay) Received "Task_19"
+> [  4.483696] (2:slave@Tremblay) Processing "Task_19"
+> [  4.498896] (3:slave@Jupiter) Received "finalize"
+> [  4.498896] (3:slave@Jupiter) I'm done. See you!
+> [  4.519447] (4:slave@Fafard) Received "finalize"
+> [  4.519447] (4:slave@Fafard) I'm done. See you!
+> [  4.993406] (2:slave@Tremblay) "Task_19" done
+> [  5.070345] (5:slave@Ginette) "Task_17" done
+> [  5.083577] (5:slave@Ginette) Received "finalize"
+> [  5.083577] (5:slave@Ginette) I'm done. See you!
+> [  5.512455] (6:slave@Bourassa) "Task_18" done
+> [  5.532791] (6:slave@Bourassa) Received "finalize"
+> [  5.532791] (6:slave@Bourassa) I'm done. See you!
+> [  5.532947] (0:@) Simulation time 5.53295
+> [  5.532947] (1:master@Tremblay) Goodbye now!
+> [  5.532947] (2:slave@Tremblay) Received "finalize"
+> [  5.532947] (2:slave@Tremblay) I'm done. See you!
 
 p Testing a master/slave example application with a forwarder module
 
-$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave_forwarder.xml --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Jacquelin:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process
-> [Jacquelin:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "iRMX"
-> [Jacquelin:master:(1) 4.772530] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 4.772530] [msg_test/INFO] Sending "Task_1" to "Casavant"
-> [iRMX:slave:(4) 4.772530] [msg_test/INFO] Received "Task_0"
-> [iRMX:slave:(4) 4.772530] [msg_test/INFO] Processing "Task_0"
-> [iRMX:slave:(4) 4.845345] [msg_test/INFO] "Task_0" done
-> [Casavant:forwarder:(3) 6.900351] [msg_test/INFO] Received "Task_1"
-> [Casavant:forwarder:(3) 6.900351] [msg_test/INFO] Sending "Task_1" to "Robert"
-> [Jacquelin:master:(1) 6.900351] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 6.900351] [msg_test/INFO] Sending "Task_2" to "Bousquet"
-> [Bousquet:slave:(5) 8.491392] [msg_test/INFO] Received "Task_2"
-> [Bousquet:slave:(5) 8.491392] [msg_test/INFO] Processing "Task_2"
-> [Jacquelin:master:(1) 8.491392] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 8.491392] [msg_test/INFO] Sending "Task_3" to "Soucy"
-> [Bousquet:slave:(5) 8.607896] [msg_test/INFO] "Task_2" done
-> [Robert:slave:(10) 9.260549] [msg_test/INFO] Received "Task_1"
-> [Robert:slave:(10) 9.260549] [msg_test/INFO] Processing "Task_1"
-> [Robert:slave:(10) 9.296956] [msg_test/INFO] "Task_1" done
-> [Soucy:slave:(6) 10.755127] [msg_test/INFO] Received "Task_3"
-> [Soucy:slave:(6) 10.755127] [msg_test/INFO] Processing "Task_3"
-> [Jacquelin:master:(1) 10.755127] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 10.755127] [msg_test/INFO] Sending "Task_4" to "Jackson"
-> [Soucy:slave:(6) 10.791535] [msg_test/INFO] "Task_3" done
-> [Jackson:forwarder:(2) 12.090242] [msg_test/INFO] Received "Task_4"
-> [Jackson:forwarder:(2) 12.090242] [msg_test/INFO] Sending "Task_4" to "Kuenning"
-> [Jacquelin:master:(1) 12.090242] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 12.090242] [msg_test/INFO] Sending "Task_5" to "iRMX"
-> [Kuenning:slave:(7) 12.173866] [msg_test/INFO] Received "Task_4"
-> [Kuenning:slave:(7) 12.173866] [msg_test/INFO] Processing "Task_4"
-> [Kuenning:slave:(7) 12.232118] [msg_test/INFO] "Task_4" done
-> [iRMX:slave:(4) 16.862772] [msg_test/INFO] Received "Task_5"
-> [iRMX:slave:(4) 16.862772] [msg_test/INFO] Processing "Task_5"
-> [Jacquelin:master:(1) 16.862772] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 16.862772] [msg_test/INFO] Sending "Task_6" to "Casavant"
-> [iRMX:slave:(4) 16.935587] [msg_test/INFO] "Task_5" done
-> [Casavant:forwarder:(3) 18.990593] [msg_test/INFO] Received "Task_6"
-> [Casavant:forwarder:(3) 18.990593] [msg_test/INFO] Sending "Task_6" to "Sirois"
-> [Jacquelin:master:(1) 18.990593] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 18.990593] [msg_test/INFO] Sending "Task_7" to "Bousquet"
-> [Sirois:slave:(11) 19.793293] [msg_test/INFO] Received "Task_6"
-> [Sirois:slave:(11) 19.793293] [msg_test/INFO] Processing "Task_6"
-> [Sirois:slave:(11) 19.836983] [msg_test/INFO] "Task_6" done
-> [Bousquet:slave:(5) 20.581634] [msg_test/INFO] Received "Task_7"
-> [Bousquet:slave:(5) 20.581634] [msg_test/INFO] Processing "Task_7"
-> [Jacquelin:master:(1) 20.581634] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 20.581634] [msg_test/INFO] Sending "Task_8" to "Soucy"
-> [Bousquet:slave:(5) 20.698138] [msg_test/INFO] "Task_7" done
-> [Soucy:slave:(6) 22.845369] [msg_test/INFO] Received "Task_8"
-> [Soucy:slave:(6) 22.845369] [msg_test/INFO] Processing "Task_8"
-> [Jacquelin:master:(1) 22.845369] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 22.845369] [msg_test/INFO] Sending "Task_9" to "Jackson"
-> [Soucy:slave:(6) 22.881777] [msg_test/INFO] "Task_8" done
-> [Jackson:forwarder:(2) 24.180485] [msg_test/INFO] Received "Task_9"
-> [Jackson:forwarder:(2) 24.180485] [msg_test/INFO] Sending "Task_9" to "Browne"
-> [Jacquelin:master:(1) 24.180485] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 24.180485] [msg_test/INFO] Sending "Task_10" to "iRMX"
-> [Browne:slave:(8) 27.009931] [msg_test/INFO] Received "Task_9"
-> [Browne:slave:(8) 27.009931] [msg_test/INFO] Processing "Task_9"
-> [Browne:slave:(8) 27.046339] [msg_test/INFO] "Task_9" done
-> [iRMX:slave:(4) 28.953014] [msg_test/INFO] Received "Task_10"
-> [iRMX:slave:(4) 28.953014] [msg_test/INFO] Processing "Task_10"
-> [Jacquelin:master:(1) 28.953014] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 28.953014] [msg_test/INFO] Sending "Task_11" to "Casavant"
-> [iRMX:slave:(4) 29.025830] [msg_test/INFO] "Task_10" done
-> [Casavant:forwarder:(3) 31.080835] [msg_test/INFO] Received "Task_11"
-> [Casavant:forwarder:(3) 31.080835] [msg_test/INFO] Sending "Task_11" to "Monique"
-> [Jacquelin:master:(1) 31.080835] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 31.080835] [msg_test/INFO] Sending "Task_12" to "Bousquet"
-> [Monique:slave:(12) 32.472434] [msg_test/INFO] Received "Task_11"
-> [Monique:slave:(12) 32.472434] [msg_test/INFO] Processing "Task_11"
-> [Monique:slave:(12) 32.516124] [msg_test/INFO] "Task_11" done
-> [Bousquet:slave:(5) 32.671876] [msg_test/INFO] Received "Task_12"
-> [Bousquet:slave:(5) 32.671876] [msg_test/INFO] Processing "Task_12"
-> [Jacquelin:master:(1) 32.671876] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 32.671876] [msg_test/INFO] Sending "Task_13" to "Soucy"
-> [Bousquet:slave:(5) 32.788380] [msg_test/INFO] "Task_12" done
-> [Soucy:slave:(6) 34.935611] [msg_test/INFO] Received "Task_13"
-> [Soucy:slave:(6) 34.935611] [msg_test/INFO] Processing "Task_13"
-> [Jacquelin:master:(1) 34.935611] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 34.935611] [msg_test/INFO] Sending "Task_14" to "Jackson"
-> [Soucy:slave:(6) 34.972019] [msg_test/INFO] "Task_13" done
-> [Jackson:forwarder:(2) 36.270727] [msg_test/INFO] Received "Task_14"
-> [Jackson:forwarder:(2) 36.270727] [msg_test/INFO] Sending "Task_14" to "Stephen"
-> [Jacquelin:master:(1) 36.270727] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 36.270727] [msg_test/INFO] Sending "Task_15" to "iRMX"
-> [Stephen:slave:(9) 40.508273] [msg_test/INFO] Received "Task_14"
-> [Stephen:slave:(9) 40.508273] [msg_test/INFO] Processing "Task_14"
-> [Stephen:slave:(9) 40.581088] [msg_test/INFO] "Task_14" done
-> [iRMX:slave:(4) 41.043257] [msg_test/INFO] Received "Task_15"
-> [iRMX:slave:(4) 41.043257] [msg_test/INFO] Processing "Task_15"
-> [Jacquelin:master:(1) 41.043257] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 41.043257] [msg_test/INFO] Sending "Task_16" to "Casavant"
-> [iRMX:slave:(4) 41.116072] [msg_test/INFO] "Task_15" done
-> [Casavant:forwarder:(3) 43.171078] [msg_test/INFO] Received "Task_16"
-> [Casavant:forwarder:(3) 43.171078] [msg_test/INFO] Sending "Task_16" to "Robert"
-> [Jacquelin:master:(1) 43.171078] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 43.171078] [msg_test/INFO] Sending "Task_17" to "Bousquet"
-> [Bousquet:slave:(5) 44.762118] [msg_test/INFO] Received "Task_17"
-> [Bousquet:slave:(5) 44.762118] [msg_test/INFO] Processing "Task_17"
-> [Jacquelin:master:(1) 44.762118] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 44.762118] [msg_test/INFO] Sending "Task_18" to "Soucy"
-> [Bousquet:slave:(5) 44.878622] [msg_test/INFO] "Task_17" done
-> [Robert:slave:(10) 45.531275] [msg_test/INFO] Received "Task_16"
-> [Robert:slave:(10) 45.531275] [msg_test/INFO] Processing "Task_16"
-> [Robert:slave:(10) 45.567683] [msg_test/INFO] "Task_16" done
-> [Soucy:slave:(6) 47.025854] [msg_test/INFO] Received "Task_18"
-> [Soucy:slave:(6) 47.025854] [msg_test/INFO] Processing "Task_18"
-> [Jacquelin:master:(1) 47.025854] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 47.025854] [msg_test/INFO] Sending "Task_19" to "Jackson"
-> [Soucy:slave:(6) 47.062262] [msg_test/INFO] "Task_18" done
-> [Jackson:forwarder:(2) 48.360969] [msg_test/INFO] Received "Task_19"
-> [Jackson:forwarder:(2) 48.360969] [msg_test/INFO] Sending "Task_19" to "Kuenning"
-> [Jacquelin:master:(1) 48.360969] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 48.360969] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Kuenning:slave:(7) 48.444592] [msg_test/INFO] Received "Task_19"
-> [Kuenning:slave:(7) 48.444592] [msg_test/INFO] Processing "Task_19"
-> [Kuenning:slave:(7) 48.502845] [msg_test/INFO] "Task_19" done
-> [iRMX:slave:(4) 50.794024] [msg_test/INFO] Received "finalize"
-> [iRMX:slave:(4) 50.794024] [msg_test/INFO] I'm done. See you!
-> [Casavant:forwarder:(3) 51.878795] [msg_test/INFO] Received "finalize"
-> [Casavant:forwarder:(3) 51.878795] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Bousquet:slave:(5) 52.689914] [msg_test/INFO] Received "finalize"
-> [Bousquet:slave:(5) 52.689914] [msg_test/INFO] I'm done. See you!
-> [Robert:slave:(10) 53.082033] [msg_test/INFO] Received "finalize"
-> [Robert:slave:(10) 53.082033] [msg_test/INFO] I'm done. See you!
-> [Sirois:slave:(11) 53.491253] [msg_test/INFO] Received "finalize"
-> [Sirois:slave:(11) 53.491253] [msg_test/INFO] I'm done. See you!
-> [Soucy:slave:(6) 53.843975] [msg_test/INFO] Received "finalize"
-> [Soucy:slave:(6) 53.843975] [msg_test/INFO] I'm done. See you!
-> [Monique:slave:(12) 54.200695] [msg_test/INFO] Received "finalize"
-> [Monique:slave:(12) 54.200695] [msg_test/INFO] I'm done. See you!
-> [Casavant:forwarder:(3) 54.200695] [msg_test/INFO] I'm done. See you!
-> [Jackson:forwarder:(2) 54.524622] [msg_test/INFO] Received "finalize"
-> [Jackson:forwarder:(2) 54.524622] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Jacquelin:master:(1) 54.524622] [msg_test/INFO] Goodbye now!
-> [Kuenning:slave:(7) 54.529294] [msg_test/INFO] Received "finalize"
-> [Kuenning:slave:(7) 54.529294] [msg_test/INFO] I'm done. See you!
-> [Browne:slave:(8) 55.971757] [msg_test/INFO] Received "finalize"
-> [Browne:slave:(8) 55.971757] [msg_test/INFO] I'm done. See you!
-> [Stephen:slave:(9) 58.132075] [msg_test/INFO] Received "finalize"
-> [Stephen:slave:(9) 58.132075] [msg_test/INFO] I'm done. See you!
-> [Jackson:forwarder:(2) 58.132075] [msg_test/INFO] I'm done. See you!
-> [58.132075] [msg_test/INFO] Simulation time 58.1321
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave_forwarder.xml --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [  0.000000] (1:master@Jacquelin) Got 5 slaves and 20 tasks to process
+> [  0.000000] (1:master@Jacquelin) Sending "Task_0" to "iRMX"
+> [  4.772530] (1:master@Jacquelin) Sent
+> [  4.772530] (1:master@Jacquelin) Sending "Task_1" to "Casavant"
+> [  4.772530] (4:slave@iRMX) Received "Task_0"
+> [  4.772530] (4:slave@iRMX) Processing "Task_0"
+> [  4.845345] (4:slave@iRMX) "Task_0" done
+> [  6.900351] (1:master@Jacquelin) Sent
+> [  6.900351] (1:master@Jacquelin) Sending "Task_2" to "Bousquet"
+> [  6.900351] (3:forwarder@Casavant) Received "Task_1"
+> [  6.900351] (3:forwarder@Casavant) Sending "Task_1" to "Robert"
+> [  8.491392] (1:master@Jacquelin) Sent
+> [  8.491392] (1:master@Jacquelin) Sending "Task_3" to "Soucy"
+> [  8.491392] (5:slave@Bousquet) Received "Task_2"
+> [  8.491392] (5:slave@Bousquet) Processing "Task_2"
+> [  8.607896] (5:slave@Bousquet) "Task_2" done
+> [  9.260549] (10:slave@Robert) Received "Task_1"
+> [  9.260549] (10:slave@Robert) Processing "Task_1"
+> [  9.296956] (10:slave@Robert) "Task_1" done
+> [ 10.755127] (1:master@Jacquelin) Sent
+> [ 10.755127] (1:master@Jacquelin) Sending "Task_4" to "Jackson"
+> [ 10.755127] (6:slave@Soucy) Received "Task_3"
+> [ 10.755127] (6:slave@Soucy) Processing "Task_3"
+> [ 10.791535] (6:slave@Soucy) "Task_3" done
+> [ 12.090242] (1:master@Jacquelin) Sent
+> [ 12.090242] (1:master@Jacquelin) Sending "Task_5" to "iRMX"
+> [ 12.090242] (2:forwarder@Jackson) Received "Task_4"
+> [ 12.090242] (2:forwarder@Jackson) Sending "Task_4" to "Kuenning"
+> [ 12.173866] (7:slave@Kuenning) Received "Task_4"
+> [ 12.173866] (7:slave@Kuenning) Processing "Task_4"
+> [ 12.232118] (7:slave@Kuenning) "Task_4" done
+> [ 16.862772] (1:master@Jacquelin) Sent
+> [ 16.862772] (1:master@Jacquelin) Sending "Task_6" to "Casavant"
+> [ 16.862772] (4:slave@iRMX) Received "Task_5"
+> [ 16.862772] (4:slave@iRMX) Processing "Task_5"
+> [ 16.935587] (4:slave@iRMX) "Task_5" done
+> [ 18.990593] (1:master@Jacquelin) Sent
+> [ 18.990593] (1:master@Jacquelin) Sending "Task_7" to "Bousquet"
+> [ 18.990593] (3:forwarder@Casavant) Received "Task_6"
+> [ 18.990593] (3:forwarder@Casavant) Sending "Task_6" to "Sirois"
+> [ 19.793293] (11:slave@Sirois) Received "Task_6"
+> [ 19.793293] (11:slave@Sirois) Processing "Task_6"
+> [ 19.836983] (11:slave@Sirois) "Task_6" done
+> [ 20.581634] (1:master@Jacquelin) Sent
+> [ 20.581634] (1:master@Jacquelin) Sending "Task_8" to "Soucy"
+> [ 20.581634] (5:slave@Bousquet) Received "Task_7"
+> [ 20.581634] (5:slave@Bousquet) Processing "Task_7"
+> [ 20.698138] (5:slave@Bousquet) "Task_7" done
+> [ 22.845369] (1:master@Jacquelin) Sent
+> [ 22.845369] (1:master@Jacquelin) Sending "Task_9" to "Jackson"
+> [ 22.845369] (6:slave@Soucy) Received "Task_8"
+> [ 22.845369] (6:slave@Soucy) Processing "Task_8"
+> [ 22.881777] (6:slave@Soucy) "Task_8" done
+> [ 24.180485] (1:master@Jacquelin) Sent
+> [ 24.180485] (1:master@Jacquelin) Sending "Task_10" to "iRMX"
+> [ 24.180485] (2:forwarder@Jackson) Received "Task_9"
+> [ 24.180485] (2:forwarder@Jackson) Sending "Task_9" to "Browne"
+> [ 27.009931] (8:slave@Browne) Received "Task_9"
+> [ 27.009931] (8:slave@Browne) Processing "Task_9"
+> [ 27.046339] (8:slave@Browne) "Task_9" done
+> [ 28.953014] (1:master@Jacquelin) Sent
+> [ 28.953014] (1:master@Jacquelin) Sending "Task_11" to "Casavant"
+> [ 28.953014] (4:slave@iRMX) Received "Task_10"
+> [ 28.953014] (4:slave@iRMX) Processing "Task_10"
+> [ 29.025830] (4:slave@iRMX) "Task_10" done
+> [ 31.080835] (1:master@Jacquelin) Sent
+> [ 31.080835] (1:master@Jacquelin) Sending "Task_12" to "Bousquet"
+> [ 31.080835] (3:forwarder@Casavant) Received "Task_11"
+> [ 31.080835] (3:forwarder@Casavant) Sending "Task_11" to "Monique"
+> [ 32.472434] (12:slave@Monique) Received "Task_11"
+> [ 32.472434] (12:slave@Monique) Processing "Task_11"
+> [ 32.516124] (12:slave@Monique) "Task_11" done
+> [ 32.671876] (1:master@Jacquelin) Sent
+> [ 32.671876] (1:master@Jacquelin) Sending "Task_13" to "Soucy"
+> [ 32.671876] (5:slave@Bousquet) Received "Task_12"
+> [ 32.671876] (5:slave@Bousquet) Processing "Task_12"
+> [ 32.788380] (5:slave@Bousquet) "Task_12" done
+> [ 34.935611] (1:master@Jacquelin) Sent
+> [ 34.935611] (1:master@Jacquelin) Sending "Task_14" to "Jackson"
+> [ 34.935611] (6:slave@Soucy) Received "Task_13"
+> [ 34.935611] (6:slave@Soucy) Processing "Task_13"
+> [ 34.972019] (6:slave@Soucy) "Task_13" done
+> [ 36.270727] (1:master@Jacquelin) Sent
+> [ 36.270727] (1:master@Jacquelin) Sending "Task_15" to "iRMX"
+> [ 36.270727] (2:forwarder@Jackson) Received "Task_14"
+> [ 36.270727] (2:forwarder@Jackson) Sending "Task_14" to "Stephen"
+> [ 40.508273] (9:slave@Stephen) Received "Task_14"
+> [ 40.508273] (9:slave@Stephen) Processing "Task_14"
+> [ 40.581088] (9:slave@Stephen) "Task_14" done
+> [ 41.043257] (1:master@Jacquelin) Sent
+> [ 41.043257] (1:master@Jacquelin) Sending "Task_16" to "Casavant"
+> [ 41.043257] (4:slave@iRMX) Received "Task_15"
+> [ 41.043257] (4:slave@iRMX) Processing "Task_15"
+> [ 41.116072] (4:slave@iRMX) "Task_15" done
+> [ 43.171078] (1:master@Jacquelin) Sent
+> [ 43.171078] (1:master@Jacquelin) Sending "Task_17" to "Bousquet"
+> [ 43.171078] (3:forwarder@Casavant) Received "Task_16"
+> [ 43.171078] (3:forwarder@Casavant) Sending "Task_16" to "Robert"
+> [ 44.762118] (1:master@Jacquelin) Sent
+> [ 44.762118] (1:master@Jacquelin) Sending "Task_18" to "Soucy"
+> [ 44.762118] (5:slave@Bousquet) Received "Task_17"
+> [ 44.762118] (5:slave@Bousquet) Processing "Task_17"
+> [ 44.878622] (5:slave@Bousquet) "Task_17" done
+> [ 45.531275] (10:slave@Robert) Received "Task_16"
+> [ 45.531275] (10:slave@Robert) Processing "Task_16"
+> [ 45.567683] (10:slave@Robert) "Task_16" done
+> [ 47.025854] (1:master@Jacquelin) Sent
+> [ 47.025854] (1:master@Jacquelin) Sending "Task_19" to "Jackson"
+> [ 47.025854] (6:slave@Soucy) Received "Task_18"
+> [ 47.025854] (6:slave@Soucy) Processing "Task_18"
+> [ 47.062262] (6:slave@Soucy) "Task_18" done
+> [ 48.360969] (1:master@Jacquelin) Sent
+> [ 48.360969] (1:master@Jacquelin) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 48.360969] (2:forwarder@Jackson) Received "Task_19"
+> [ 48.360969] (2:forwarder@Jackson) Sending "Task_19" to "Kuenning"
+> [ 48.444592] (7:slave@Kuenning) Received "Task_19"
+> [ 48.444592] (7:slave@Kuenning) Processing "Task_19"
+> [ 48.502845] (7:slave@Kuenning) "Task_19" done
+> [ 50.794024] (4:slave@iRMX) Received "finalize"
+> [ 50.794024] (4:slave@iRMX) I'm done. See you!
+> [ 51.878795] (3:forwarder@Casavant) Received "finalize"
+> [ 51.878795] (3:forwarder@Casavant) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 52.689914] (5:slave@Bousquet) Received "finalize"
+> [ 52.689914] (5:slave@Bousquet) I'm done. See you!
+> [ 53.082033] (10:slave@Robert) Received "finalize"
+> [ 53.082033] (10:slave@Robert) I'm done. See you!
+> [ 53.491253] (11:slave@Sirois) Received "finalize"
+> [ 53.491253] (11:slave@Sirois) I'm done. See you!
+> [ 53.843975] (6:slave@Soucy) Received "finalize"
+> [ 53.843975] (6:slave@Soucy) I'm done. See you!
+> [ 54.200695] (12:slave@Monique) Received "finalize"
+> [ 54.200695] (12:slave@Monique) I'm done. See you!
+> [ 54.200695] (3:forwarder@Casavant) I'm done. See you!
+> [ 54.524622] (1:master@Jacquelin) Goodbye now!
+> [ 54.524622] (2:forwarder@Jackson) Received "finalize"
+> [ 54.524622] (2:forwarder@Jackson) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 54.529294] (7:slave@Kuenning) Received "finalize"
+> [ 54.529294] (7:slave@Kuenning) I'm done. See you!
+> [ 55.971757] (8:slave@Browne) Received "finalize"
+> [ 55.971757] (8:slave@Browne) I'm done. See you!
+> [ 58.132075] (0:@) Simulation time 58.1321
+> [ 58.132075] (2:forwarder@Jackson) I'm done. See you!
+> [ 58.132075] (9:slave@Stephen) Received "finalize"
+> [ 58.132075] (9:slave@Stephen) I'm done. See you!
 
 p Testing a simple master/slave example application handling failures
 
-$ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${srcdir:=.}/small_platform_with_failures.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=path:${srcdir} --cfg=cpu/model:CpuTI
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [0.000000] [simix_process/WARNING] Cannot launch process 'slave' on failed host 'Fafard'
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slave(s) :
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Jupiter
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Fafard
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Ginette
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Bourassa
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Tremblay
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Send completed
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Received "Task"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Communication time : "0.165962"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Processing "Task"
-> [Jupiter:slave:(3) 0.821304] [msg_test/INFO] "Task" done
-> [Jupiter:slave:(3) 1.100000] [msg_test/INFO] Gloups. The cpu on which I'm running just turned off!. See you!
-> [Tremblay:master:(1) 10.165962] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.306421] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.522294] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.524632] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 11.034342] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 11.337519] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 11.553392] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 20.524632] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 30.524632] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 30.524632] [msg_test/INFO] Mmh. Something went wrong. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 30.524632] [msg_test/INFO] Mmh. Something went wrong with 'Ginette'. Nevermind. Let's keep going!
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 30.740505] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 30.742843] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 31.252553] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 31.771603] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 40.742843] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 50.742843] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 50.883303] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 51.099175] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 51.101514] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 51.611224] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 51.914401] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 52.130273] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 61.101514] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 71.101514] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.241973] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.457846] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.460184] [msg_test/INFO] Send completed
-> [Tremblay:master:(1) 71.460184] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:slave:(2) 71.969894] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 72.273071] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 72.460184] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Bourassa:slave:(5) 72.488944] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 73.460184] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 73.473416] [msg_test/INFO] Received "finalize"
-> [Ginette:slave:(4) 73.473416] [msg_test/INFO] I'm done. See you!
-> [Bourassa:slave:(5) 73.493752] [msg_test/INFO] Received "finalize"
-> [Bourassa:slave:(5) 73.493752] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 73.493908] [msg_test/INFO] Received "finalize"
-> [Tremblay:slave:(2) 73.493908] [msg_test/INFO] I'm done. See you!
-> [Tremblay:master:(1) 73.493908] [msg_test/INFO] Goodbye now!
-> [73.493908] [msg_test/INFO] Simulation time 73.4939
+! output sort
+$ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${srcdir:=.}/small_platform_with_failures.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=path:${srcdir} --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [  0.000000] (0:@) Cannot launch process 'slave' on failed host 'Fafard'
+> [  0.000000] (1:master@Tremblay) Got 5 slave(s) :
+> [  0.000000] (1:master@Tremblay) Jupiter
+> [  0.000000] (1:master@Tremblay) Fafard
+> [  0.000000] (1:master@Tremblay) Ginette
+> [  0.000000] (1:master@Tremblay) Bourassa
+> [  0.000000] (1:master@Tremblay) Tremblay
+> [  0.000000] (1:master@Tremblay) Got 20 task to process :
+> [  0.165962] (1:master@Tremblay) Send completed
+> [  0.165962] (3:slave@Jupiter) Received "Task"
+> [  0.165962] (3:slave@Jupiter) Communication time : "0.165962"
+> [  0.165962] (3:slave@Jupiter) Processing "Task"
+> [  0.821304] (3:slave@Jupiter) "Task" done
+> [  1.100000] (3:slave@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
+> [ 10.165962] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 10.306421] (1:master@Tremblay) Send completed
+> [ 10.306421] (4:slave@Ginette) Received "Task"
+> [ 10.306421] (4:slave@Ginette) Communication time : "0.140460"
+> [ 10.306421] (4:slave@Ginette) Processing "Task"
+> [ 10.522294] (1:master@Tremblay) Send completed
+> [ 10.522294] (5:slave@Bourassa) Received "Task"
+> [ 10.522294] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 10.522294] (5:slave@Bourassa) Processing "Task"
+> [ 10.524632] (1:master@Tremblay) Send completed
+> [ 10.524632] (2:slave@Tremblay) Received "Task"
+> [ 10.524632] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 10.524632] (2:slave@Tremblay) Processing "Task"
+> [ 11.034342] (2:slave@Tremblay) "Task" done
+> [ 11.337519] (4:slave@Ginette) "Task" done
+> [ 11.553392] (5:slave@Bourassa) "Task" done
+> [ 20.524632] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 30.524632] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 30.524632] (1:master@Tremblay) Mmh. Something went wrong with 'Ginette'. Nevermind. Let's keep going!
+> [ 30.524632] (4:slave@Ginette) Mmh. Something went wrong. Nevermind. Let's keep going!
+> [ 30.740505] (1:master@Tremblay) Send completed
+> [ 30.740505] (5:slave@Bourassa) Received "Task"
+> [ 30.740505] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 30.740505] (5:slave@Bourassa) Processing "Task"
+> [ 30.742843] (1:master@Tremblay) Send completed
+> [ 30.742843] (2:slave@Tremblay) Received "Task"
+> [ 30.742843] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 30.742843] (2:slave@Tremblay) Processing "Task"
+> [ 31.252553] (2:slave@Tremblay) "Task" done
+> [ 31.771603] (5:slave@Bourassa) "Task" done
+> [ 40.742843] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 50.742843] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 50.883303] (1:master@Tremblay) Send completed
+> [ 50.883303] (4:slave@Ginette) Received "Task"
+> [ 50.883303] (4:slave@Ginette) Communication time : "0.140460"
+> [ 50.883303] (4:slave@Ginette) Processing "Task"
+> [ 51.099175] (1:master@Tremblay) Send completed
+> [ 51.099175] (5:slave@Bourassa) Received "Task"
+> [ 51.099175] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 51.099175] (5:slave@Bourassa) Processing "Task"
+> [ 51.101514] (1:master@Tremblay) Send completed
+> [ 51.101514] (2:slave@Tremblay) Received "Task"
+> [ 51.101514] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 51.101514] (2:slave@Tremblay) Processing "Task"
+> [ 51.611224] (2:slave@Tremblay) "Task" done
+> [ 51.914401] (4:slave@Ginette) "Task" done
+> [ 52.130273] (5:slave@Bourassa) "Task" done
+> [ 61.101514] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 71.101514] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 71.241973] (1:master@Tremblay) Send completed
+> [ 71.241973] (4:slave@Ginette) Received "Task"
+> [ 71.241973] (4:slave@Ginette) Communication time : "0.140460"
+> [ 71.241973] (4:slave@Ginette) Processing "Task"
+> [ 71.457846] (1:master@Tremblay) Send completed
+> [ 71.457846] (5:slave@Bourassa) Received "Task"
+> [ 71.457846] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 71.457846] (5:slave@Bourassa) Processing "Task"
+> [ 71.460184] (1:master@Tremblay) Send completed
+> [ 71.460184] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 71.460184] (2:slave@Tremblay) Received "Task"
+> [ 71.460184] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 71.460184] (2:slave@Tremblay) Processing "Task"
+> [ 71.969894] (2:slave@Tremblay) "Task" done
+> [ 72.273071] (4:slave@Ginette) "Task" done
+> [ 72.460184] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 72.488944] (5:slave@Bourassa) "Task" done
+> [ 73.460184] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 73.473416] (4:slave@Ginette) Received "finalize"
+> [ 73.473416] (4:slave@Ginette) I'm done. See you!
+> [ 73.493752] (5:slave@Bourassa) Received "finalize"
+> [ 73.493752] (5:slave@Bourassa) I'm done. See you!
+> [ 73.493908] (0:@) Simulation time 73.4939
+> [ 73.493908] (1:master@Tremblay) Goodbye now!
+> [ 73.493908] (2:slave@Tremblay) Received "finalize"
+> [ 73.493908] (2:slave@Tremblay) I'm done. See you!
 
 p Testing the bypassing of the flexml parser
 
-$ $SG_TEST_EXENV masterslave/masterslave_bypass --log=no_loc --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [0.000000] [surf_parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
-> [host A:master:(1) 0.000000] [msg_test/INFO] Got 1 slave(s) :
-> [host A:master:(1) 0.000000] [msg_test/INFO]          host B
-> [host A:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_0"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_1"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_2"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_3"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_4"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_5"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_6"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_7"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_8"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_9"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_10"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_11"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_12"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_13"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_14"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_15"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_16"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_17"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_18"
-> [host A:master:(1) 0.000000] [msg_test/INFO]         "Task_19"
-> [host A:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "host B"
-> [host B:slave:(2) 0.000000] [msg_test/INFO] I'm a slave
-> [host A:master:(1) 4.080000] [msg_test/INFO] Send completed
-> [host A:master:(1) 4.080000] [msg_test/INFO] Sending "Task_1" to "host B"
-> [host B:slave:(2) 4.080000] [msg_test/INFO] Received "Task_0" 
-> [host B:slave:(2) 4.080000] [msg_test/INFO] Processing "Task_0" 
-> [host B:slave:(2) 4.130000] [msg_test/INFO] "Task_0" done 
-> [host A:master:(1) 8.210000] [msg_test/INFO] Send completed
-> [host A:master:(1) 8.210000] [msg_test/INFO] Sending "Task_2" to "host B"
-> [host B:slave:(2) 8.210000] [msg_test/INFO] Received "Task_1" 
-> [host B:slave:(2) 8.210000] [msg_test/INFO] Processing "Task_1" 
-> [host B:slave:(2) 8.260000] [msg_test/INFO] "Task_1" done 
-> [host A:master:(1) 12.340000] [msg_test/INFO] Send completed
-> [host A:master:(1) 12.340000] [msg_test/INFO] Sending "Task_3" to "host B"
-> [host B:slave:(2) 12.340000] [msg_test/INFO] Received "Task_2" 
-> [host B:slave:(2) 12.340000] [msg_test/INFO] Processing "Task_2" 
-> [host B:slave:(2) 12.390000] [msg_test/INFO] "Task_2" done 
-> [host A:master:(1) 16.470000] [msg_test/INFO] Send completed
-> [host A:master:(1) 16.470000] [msg_test/INFO] Sending "Task_4" to "host B"
-> [host B:slave:(2) 16.470000] [msg_test/INFO] Received "Task_3" 
-> [host B:slave:(2) 16.470000] [msg_test/INFO] Processing "Task_3" 
-> [host B:slave:(2) 16.520000] [msg_test/INFO] "Task_3" done 
-> [host A:master:(1) 20.600000] [msg_test/INFO] Send completed
-> [host A:master:(1) 20.600000] [msg_test/INFO] Sending "Task_5" to "host B"
-> [host B:slave:(2) 20.600000] [msg_test/INFO] Received "Task_4" 
-> [host B:slave:(2) 20.600000] [msg_test/INFO] Processing "Task_4" 
-> [host B:slave:(2) 20.650000] [msg_test/INFO] "Task_4" done 
-> [host A:master:(1) 24.730000] [msg_test/INFO] Send completed
-> [host A:master:(1) 24.730000] [msg_test/INFO] Sending "Task_6" to "host B"
-> [host B:slave:(2) 24.730000] [msg_test/INFO] Received "Task_5" 
-> [host B:slave:(2) 24.730000] [msg_test/INFO] Processing "Task_5" 
-> [host B:slave:(2) 24.780000] [msg_test/INFO] "Task_5" done 
-> [host A:master:(1) 28.860000] [msg_test/INFO] Send completed
-> [host A:master:(1) 28.860000] [msg_test/INFO] Sending "Task_7" to "host B"
-> [host B:slave:(2) 28.860000] [msg_test/INFO] Received "Task_6" 
-> [host B:slave:(2) 28.860000] [msg_test/INFO] Processing "Task_6" 
-> [host B:slave:(2) 28.910000] [msg_test/INFO] "Task_6" done 
-> [host A:master:(1) 32.990000] [msg_test/INFO] Send completed
-> [host A:master:(1) 32.990000] [msg_test/INFO] Sending "Task_8" to "host B"
-> [host B:slave:(2) 32.990000] [msg_test/INFO] Received "Task_7" 
-> [host B:slave:(2) 32.990000] [msg_test/INFO] Processing "Task_7" 
-> [host B:slave:(2) 33.040000] [msg_test/INFO] "Task_7" done 
-> [host A:master:(1) 37.120000] [msg_test/INFO] Send completed
-> [host A:master:(1) 37.120000] [msg_test/INFO] Sending "Task_9" to "host B"
-> [host B:slave:(2) 37.120000] [msg_test/INFO] Received "Task_8" 
-> [host B:slave:(2) 37.120000] [msg_test/INFO] Processing "Task_8" 
-> [host B:slave:(2) 37.170000] [msg_test/INFO] "Task_8" done 
-> [host A:master:(1) 41.250000] [msg_test/INFO] Send completed
-> [host A:master:(1) 41.250000] [msg_test/INFO] Sending "Task_10" to "host B"
-> [host B:slave:(2) 41.250000] [msg_test/INFO] Received "Task_9" 
-> [host B:slave:(2) 41.250000] [msg_test/INFO] Processing "Task_9" 
-> [host B:slave:(2) 41.300000] [msg_test/INFO] "Task_9" done 
-> [host A:master:(1) 45.380000] [msg_test/INFO] Send completed
-> [host A:master:(1) 45.380000] [msg_test/INFO] Sending "Task_11" to "host B"
-> [host B:slave:(2) 45.380000] [msg_test/INFO] Received "Task_10" 
-> [host B:slave:(2) 45.380000] [msg_test/INFO] Processing "Task_10" 
-> [host B:slave:(2) 45.430000] [msg_test/INFO] "Task_10" done 
-> [host A:master:(1) 49.510000] [msg_test/INFO] Send completed
-> [host A:master:(1) 49.510000] [msg_test/INFO] Sending "Task_12" to "host B"
-> [host B:slave:(2) 49.510000] [msg_test/INFO] Received "Task_11" 
-> [host B:slave:(2) 49.510000] [msg_test/INFO] Processing "Task_11" 
-> [host B:slave:(2) 49.560000] [msg_test/INFO] "Task_11" done 
-> [host A:master:(1) 53.640000] [msg_test/INFO] Send completed
-> [host A:master:(1) 53.640000] [msg_test/INFO] Sending "Task_13" to "host B"
-> [host B:slave:(2) 53.640000] [msg_test/INFO] Received "Task_12" 
-> [host B:slave:(2) 53.640000] [msg_test/INFO] Processing "Task_12" 
-> [host B:slave:(2) 53.690000] [msg_test/INFO] "Task_12" done 
-> [host A:master:(1) 57.770000] [msg_test/INFO] Send completed
-> [host A:master:(1) 57.770000] [msg_test/INFO] Sending "Task_14" to "host B"
-> [host B:slave:(2) 57.770000] [msg_test/INFO] Received "Task_13" 
-> [host B:slave:(2) 57.770000] [msg_test/INFO] Processing "Task_13" 
-> [host B:slave:(2) 57.820000] [msg_test/INFO] "Task_13" done 
-> [host A:master:(1) 61.900000] [msg_test/INFO] Send completed
-> [host A:master:(1) 61.900000] [msg_test/INFO] Sending "Task_15" to "host B"
-> [host B:slave:(2) 61.900000] [msg_test/INFO] Received "Task_14" 
-> [host B:slave:(2) 61.900000] [msg_test/INFO] Processing "Task_14" 
-> [host B:slave:(2) 61.950000] [msg_test/INFO] "Task_14" done 
-> [host A:master:(1) 66.030000] [msg_test/INFO] Send completed
-> [host A:master:(1) 66.030000] [msg_test/INFO] Sending "Task_16" to "host B"
-> [host B:slave:(2) 66.030000] [msg_test/INFO] Received "Task_15" 
-> [host B:slave:(2) 66.030000] [msg_test/INFO] Processing "Task_15" 
-> [host B:slave:(2) 66.080000] [msg_test/INFO] "Task_15" done 
-> [host A:master:(1) 70.160000] [msg_test/INFO] Send completed
-> [host A:master:(1) 70.160000] [msg_test/INFO] Sending "Task_17" to "host B"
-> [host B:slave:(2) 70.160000] [msg_test/INFO] Received "Task_16" 
-> [host B:slave:(2) 70.160000] [msg_test/INFO] Processing "Task_16" 
-> [host B:slave:(2) 70.210000] [msg_test/INFO] "Task_16" done 
-> [host A:master:(1) 74.290000] [msg_test/INFO] Send completed
-> [host A:master:(1) 74.290000] [msg_test/INFO] Sending "Task_18" to "host B"
-> [host B:slave:(2) 74.290000] [msg_test/INFO] Received "Task_17" 
-> [host B:slave:(2) 74.290000] [msg_test/INFO] Processing "Task_17" 
-> [host B:slave:(2) 74.340000] [msg_test/INFO] "Task_17" done 
-> [host A:master:(1) 78.420000] [msg_test/INFO] Send completed
-> [host A:master:(1) 78.420000] [msg_test/INFO] Sending "Task_19" to "host B"
-> [host B:slave:(2) 78.420000] [msg_test/INFO] Received "Task_18" 
-> [host B:slave:(2) 78.420000] [msg_test/INFO] Processing "Task_18" 
-> [host B:slave:(2) 78.470000] [msg_test/INFO] "Task_18" done 
-> [host A:master:(1) 82.550000] [msg_test/INFO] Send completed
-> [host A:master:(1) 82.550000] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [host B:slave:(2) 82.550000] [msg_test/INFO] Received "Task_19" 
-> [host B:slave:(2) 82.550000] [msg_test/INFO] Processing "Task_19" 
-> [host B:slave:(2) 82.600000] [msg_test/INFO] "Task_19" done 
-> [host A:master:(1) 84.680000] [msg_test/INFO] Goodbye now!
-> [host B:slave:(2) 84.680000] [msg_test/INFO] Received "finalize" 
-> [host B:slave:(2) 84.680000] [msg_test/INFO] I'm done. See you!
-> [84.680000] [msg_test/INFO] Simulation time 84.68
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_bypass --log=no_loc --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [  0.000000] (0:@) Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
+> [  0.000000] (1:master@host A) Got 1 slave(s) :
+> [  0.000000] (1:master@host A)        host B
+> [  0.000000] (1:master@host A) Got 20 task to process :
+> [  0.000000] (1:master@host A)       "Task_0"
+> [  0.000000] (1:master@host A)       "Task_1"
+> [  0.000000] (1:master@host A)       "Task_2"
+> [  0.000000] (1:master@host A)       "Task_3"
+> [  0.000000] (1:master@host A)       "Task_4"
+> [  0.000000] (1:master@host A)       "Task_5"
+> [  0.000000] (1:master@host A)       "Task_6"
+> [  0.000000] (1:master@host A)       "Task_7"
+> [  0.000000] (1:master@host A)       "Task_8"
+> [  0.000000] (1:master@host A)       "Task_9"
+> [  0.000000] (1:master@host A)       "Task_10"
+> [  0.000000] (1:master@host A)       "Task_11"
+> [  0.000000] (1:master@host A)       "Task_12"
+> [  0.000000] (1:master@host A)       "Task_13"
+> [  0.000000] (1:master@host A)       "Task_14"
+> [  0.000000] (1:master@host A)       "Task_15"
+> [  0.000000] (1:master@host A)       "Task_16"
+> [  0.000000] (1:master@host A)       "Task_17"
+> [  0.000000] (1:master@host A)       "Task_18"
+> [  0.000000] (1:master@host A)       "Task_19"
+> [  0.000000] (1:master@host A) Sending "Task_0" to "host B"
+> [  0.000000] (2:slave@host B) I'm a slave
+> [  4.080000] (1:master@host A) Send completed
+> [  4.080000] (1:master@host A) Sending "Task_1" to "host B"
+> [  4.080000] (2:slave@host B) Received "Task_0" 
+> [  4.080000] (2:slave@host B) Processing "Task_0" 
+> [  4.130000] (2:slave@host B) "Task_0" done 
+> [  8.210000] (1:master@host A) Send completed
+> [  8.210000] (1:master@host A) Sending "Task_2" to "host B"
+> [  8.210000] (2:slave@host B) Received "Task_1" 
+> [  8.210000] (2:slave@host B) Processing "Task_1" 
+> [  8.260000] (2:slave@host B) "Task_1" done 
+> [ 12.340000] (1:master@host A) Send completed
+> [ 12.340000] (1:master@host A) Sending "Task_3" to "host B"
+> [ 12.340000] (2:slave@host B) Received "Task_2" 
+> [ 12.340000] (2:slave@host B) Processing "Task_2" 
+> [ 12.390000] (2:slave@host B) "Task_2" done 
+> [ 16.470000] (1:master@host A) Send completed
+> [ 16.470000] (1:master@host A) Sending "Task_4" to "host B"
+> [ 16.470000] (2:slave@host B) Received "Task_3" 
+> [ 16.470000] (2:slave@host B) Processing "Task_3" 
+> [ 16.520000] (2:slave@host B) "Task_3" done 
+> [ 20.600000] (1:master@host A) Send completed
+> [ 20.600000] (1:master@host A) Sending "Task_5" to "host B"
+> [ 20.600000] (2:slave@host B) Received "Task_4" 
+> [ 20.600000] (2:slave@host B) Processing "Task_4" 
+> [ 20.650000] (2:slave@host B) "Task_4" done 
+> [ 24.730000] (1:master@host A) Send completed
+> [ 24.730000] (1:master@host A) Sending "Task_6" to "host B"
+> [ 24.730000] (2:slave@host B) Received "Task_5" 
+> [ 24.730000] (2:slave@host B) Processing "Task_5" 
+> [ 24.780000] (2:slave@host B) "Task_5" done 
+> [ 28.860000] (1:master@host A) Send completed
+> [ 28.860000] (1:master@host A) Sending "Task_7" to "host B"
+> [ 28.860000] (2:slave@host B) Received "Task_6" 
+> [ 28.860000] (2:slave@host B) Processing "Task_6" 
+> [ 28.910000] (2:slave@host B) "Task_6" done 
+> [ 32.990000] (1:master@host A) Send completed
+> [ 32.990000] (1:master@host A) Sending "Task_8" to "host B"
+> [ 32.990000] (2:slave@host B) Received "Task_7" 
+> [ 32.990000] (2:slave@host B) Processing "Task_7" 
+> [ 33.040000] (2:slave@host B) "Task_7" done 
+> [ 37.120000] (1:master@host A) Send completed
+> [ 37.120000] (1:master@host A) Sending "Task_9" to "host B"
+> [ 37.120000] (2:slave@host B) Received "Task_8" 
+> [ 37.120000] (2:slave@host B) Processing "Task_8" 
+> [ 37.170000] (2:slave@host B) "Task_8" done 
+> [ 41.250000] (1:master@host A) Send completed
+> [ 41.250000] (1:master@host A) Sending "Task_10" to "host B"
+> [ 41.250000] (2:slave@host B) Received "Task_9" 
+> [ 41.250000] (2:slave@host B) Processing "Task_9" 
+> [ 41.300000] (2:slave@host B) "Task_9" done 
+> [ 45.380000] (1:master@host A) Send completed
+> [ 45.380000] (1:master@host A) Sending "Task_11" to "host B"
+> [ 45.380000] (2:slave@host B) Received "Task_10" 
+> [ 45.380000] (2:slave@host B) Processing "Task_10" 
+> [ 45.430000] (2:slave@host B) "Task_10" done 
+> [ 49.510000] (1:master@host A) Send completed
+> [ 49.510000] (1:master@host A) Sending "Task_12" to "host B"
+> [ 49.510000] (2:slave@host B) Received "Task_11" 
+> [ 49.510000] (2:slave@host B) Processing "Task_11" 
+> [ 49.560000] (2:slave@host B) "Task_11" done 
+> [ 53.640000] (1:master@host A) Send completed
+> [ 53.640000] (1:master@host A) Sending "Task_13" to "host B"
+> [ 53.640000] (2:slave@host B) Received "Task_12" 
+> [ 53.640000] (2:slave@host B) Processing "Task_12" 
+> [ 53.690000] (2:slave@host B) "Task_12" done 
+> [ 57.770000] (1:master@host A) Send completed
+> [ 57.770000] (1:master@host A) Sending "Task_14" to "host B"
+> [ 57.770000] (2:slave@host B) Received "Task_13" 
+> [ 57.770000] (2:slave@host B) Processing "Task_13" 
+> [ 57.820000] (2:slave@host B) "Task_13" done 
+> [ 61.900000] (1:master@host A) Send completed
+> [ 61.900000] (1:master@host A) Sending "Task_15" to "host B"
+> [ 61.900000] (2:slave@host B) Received "Task_14" 
+> [ 61.900000] (2:slave@host B) Processing "Task_14" 
+> [ 61.950000] (2:slave@host B) "Task_14" done 
+> [ 66.030000] (1:master@host A) Send completed
+> [ 66.030000] (1:master@host A) Sending "Task_16" to "host B"
+> [ 66.030000] (2:slave@host B) Received "Task_15" 
+> [ 66.030000] (2:slave@host B) Processing "Task_15" 
+> [ 66.080000] (2:slave@host B) "Task_15" done 
+> [ 70.160000] (1:master@host A) Send completed
+> [ 70.160000] (1:master@host A) Sending "Task_17" to "host B"
+> [ 70.160000] (2:slave@host B) Received "Task_16" 
+> [ 70.160000] (2:slave@host B) Processing "Task_16" 
+> [ 70.210000] (2:slave@host B) "Task_16" done 
+> [ 74.290000] (1:master@host A) Send completed
+> [ 74.290000] (1:master@host A) Sending "Task_18" to "host B"
+> [ 74.290000] (2:slave@host B) Received "Task_17" 
+> [ 74.290000] (2:slave@host B) Processing "Task_17" 
+> [ 74.340000] (2:slave@host B) "Task_17" done 
+> [ 78.420000] (1:master@host A) Send completed
+> [ 78.420000] (1:master@host A) Sending "Task_19" to "host B"
+> [ 78.420000] (2:slave@host B) Received "Task_18" 
+> [ 78.420000] (2:slave@host B) Processing "Task_18" 
+> [ 78.470000] (2:slave@host B) "Task_18" done 
+> [ 82.550000] (1:master@host A) Send completed
+> [ 82.550000] (1:master@host A) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 82.550000] (2:slave@host B) Received "Task_19" 
+> [ 82.550000] (2:slave@host B) Processing "Task_19" 
+> [ 82.600000] (2:slave@host B) "Task_19" done 
+> [ 84.680000] (0:@) Simulation time 84.68
+> [ 84.680000] (1:master@host A) Goodbye now!
+> [ 84.680000] (2:slave@host B) Received "finalize" 
+> [ 84.680000] (2:slave@host B) I'm done. See you!
index c72f58b..d5b87d7 100644 (file)
@@ -2,93 +2,94 @@
 
 p Testing a simple master/slave example application handling failures
 
-$ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${srcdir:=.}/small_platform_with_failures.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=path:${srcdir}
-> [0.000000] [simix_process/WARNING] Cannot launch process 'slave' on failed host 'Fafard'
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slave(s) :
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Jupiter
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Fafard
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Ginette
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Bourassa
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Tremblay
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :
-> [Tremblay:master:(1) 0.165962] [msg_test/INFO] Send completed
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Received "Task"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Communication time : "0.165962"
-> [Jupiter:slave:(3) 0.165962] [msg_test/INFO] Processing "Task"
-> [Jupiter:slave:(3) 0.821304] [msg_test/INFO] "Task" done
-> [Jupiter:slave:(3) 1.100000] [msg_test/INFO] Gloups. The cpu on which I'm running just turned off!. See you!
-> [Tremblay:master:(1) 10.165962] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 10.306421] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.306421] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 10.522294] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.522294] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 10.524632] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 10.524632] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 11.034342] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 11.337519] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 11.553392] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 20.524632] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 30.524632] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 30.524632] [msg_test/INFO] Mmh. Something went wrong. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 30.524632] [msg_test/INFO] Mmh. Something went wrong with 'Ginette'. Nevermind. Let's keep going!
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 30.740505] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 30.740505] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 30.742843] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 30.742843] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 31.252553] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 31.771603] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 40.742843] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 50.742843] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 50.883303] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 50.883303] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 51.099175] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 51.099175] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 51.101514] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 51.101514] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 51.611224] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 51.914401] [msg_test/INFO] "Task" done
-> [Bourassa:slave:(5) 52.130273] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 61.101514] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Tremblay:master:(1) 71.101514] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Received "Task"
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Communication time : "0.140460"
-> [Ginette:slave:(4) 71.241973] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.241973] [msg_test/INFO] Send completed
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Received "Task"
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Communication time : "0.215872"
-> [Bourassa:slave:(5) 71.457846] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.457846] [msg_test/INFO] Send completed
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Received "Task"
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Communication time : "0.002339"
-> [Tremblay:slave:(2) 71.460184] [msg_test/INFO] Processing "Task"
-> [Tremblay:master:(1) 71.460184] [msg_test/INFO] Send completed
-> [Tremblay:master:(1) 71.460184] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:slave:(2) 71.969894] [msg_test/INFO] "Task" done
-> [Ginette:slave:(4) 72.273071] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 72.460184] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
-> [Bourassa:slave:(5) 72.488944] [msg_test/INFO] "Task" done
-> [Tremblay:master:(1) 73.460184] [msg_test/INFO] Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
-> [Ginette:slave:(4) 73.473416] [msg_test/INFO] Received "finalize"
-> [Ginette:slave:(4) 73.473416] [msg_test/INFO] I'm done. See you!
-> [Bourassa:slave:(5) 73.493752] [msg_test/INFO] Received "finalize"
-> [Bourassa:slave:(5) 73.493752] [msg_test/INFO] I'm done. See you!
-> [Tremblay:slave:(2) 73.493908] [msg_test/INFO] Received "finalize"
-> [Tremblay:slave:(2) 73.493908] [msg_test/INFO] I'm done. See you!
-> [Tremblay:master:(1) 73.493908] [msg_test/INFO] Goodbye now!
-> [73.493908] [msg_test/INFO] Simulation time 73.4939
+! output sort
+$ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${srcdir:=.}/small_platform_with_failures.xml ${srcdir:=.}/masterslave/deployment_masterslave.xml --cfg=path:${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Cannot launch process 'slave' on failed host 'Fafard'
+> [  0.000000] (1:master@Tremblay) Got 5 slave(s) :
+> [  0.000000] (1:master@Tremblay) Jupiter
+> [  0.000000] (1:master@Tremblay) Fafard
+> [  0.000000] (1:master@Tremblay) Ginette
+> [  0.000000] (1:master@Tremblay) Bourassa
+> [  0.000000] (1:master@Tremblay) Tremblay
+> [  0.000000] (1:master@Tremblay) Got 20 task to process :
+> [  0.165962] (1:master@Tremblay) Send completed
+> [  0.165962] (3:slave@Jupiter) Received "Task"
+> [  0.165962] (3:slave@Jupiter) Communication time : "0.165962"
+> [  0.165962] (3:slave@Jupiter) Processing "Task"
+> [  0.821304] (3:slave@Jupiter) "Task" done
+> [  1.100000] (3:slave@Jupiter) Gloups. The cpu on which I'm running just turned off!. See you!
+> [ 10.165962] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 10.306421] (1:master@Tremblay) Send completed
+> [ 10.306421] (4:slave@Ginette) Received "Task"
+> [ 10.306421] (4:slave@Ginette) Communication time : "0.140460"
+> [ 10.306421] (4:slave@Ginette) Processing "Task"
+> [ 10.522294] (1:master@Tremblay) Send completed
+> [ 10.522294] (5:slave@Bourassa) Received "Task"
+> [ 10.522294] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 10.522294] (5:slave@Bourassa) Processing "Task"
+> [ 10.524632] (1:master@Tremblay) Send completed
+> [ 10.524632] (2:slave@Tremblay) Received "Task"
+> [ 10.524632] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 10.524632] (2:slave@Tremblay) Processing "Task"
+> [ 11.034342] (2:slave@Tremblay) "Task" done
+> [ 11.337519] (4:slave@Ginette) "Task" done
+> [ 11.553392] (5:slave@Bourassa) "Task" done
+> [ 20.524632] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 30.524632] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 30.524632] (1:master@Tremblay) Mmh. Something went wrong with 'Ginette'. Nevermind. Let's keep going!
+> [ 30.524632] (4:slave@Ginette) Mmh. Something went wrong. Nevermind. Let's keep going!
+> [ 30.740505] (1:master@Tremblay) Send completed
+> [ 30.740505] (5:slave@Bourassa) Received "Task"
+> [ 30.740505] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 30.740505] (5:slave@Bourassa) Processing "Task"
+> [ 30.742843] (1:master@Tremblay) Send completed
+> [ 30.742843] (2:slave@Tremblay) Received "Task"
+> [ 30.742843] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 30.742843] (2:slave@Tremblay) Processing "Task"
+> [ 31.252553] (2:slave@Tremblay) "Task" done
+> [ 31.771603] (5:slave@Bourassa) "Task" done
+> [ 40.742843] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 50.742843] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 50.883303] (1:master@Tremblay) Send completed
+> [ 50.883303] (4:slave@Ginette) Received "Task"
+> [ 50.883303] (4:slave@Ginette) Communication time : "0.140460"
+> [ 50.883303] (4:slave@Ginette) Processing "Task"
+> [ 51.099175] (1:master@Tremblay) Send completed
+> [ 51.099175] (5:slave@Bourassa) Received "Task"
+> [ 51.099175] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 51.099175] (5:slave@Bourassa) Processing "Task"
+> [ 51.101514] (1:master@Tremblay) Send completed
+> [ 51.101514] (2:slave@Tremblay) Received "Task"
+> [ 51.101514] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 51.101514] (2:slave@Tremblay) Processing "Task"
+> [ 51.611224] (2:slave@Tremblay) "Task" done
+> [ 51.914401] (4:slave@Ginette) "Task" done
+> [ 52.130273] (5:slave@Bourassa) "Task" done
+> [ 61.101514] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 71.101514] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 71.241973] (1:master@Tremblay) Send completed
+> [ 71.241973] (4:slave@Ginette) Received "Task"
+> [ 71.241973] (4:slave@Ginette) Communication time : "0.140460"
+> [ 71.241973] (4:slave@Ginette) Processing "Task"
+> [ 71.457846] (1:master@Tremblay) Send completed
+> [ 71.457846] (5:slave@Bourassa) Received "Task"
+> [ 71.457846] (5:slave@Bourassa) Communication time : "0.215872"
+> [ 71.457846] (5:slave@Bourassa) Processing "Task"
+> [ 71.460184] (1:master@Tremblay) Send completed
+> [ 71.460184] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 71.460184] (2:slave@Tremblay) Received "Task"
+> [ 71.460184] (2:slave@Tremblay) Communication time : "0.002339"
+> [ 71.460184] (2:slave@Tremblay) Processing "Task"
+> [ 71.969894] (2:slave@Tremblay) "Task" done
+> [ 72.273071] (4:slave@Ginette) "Task" done
+> [ 72.460184] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Jupiter'. Nevermind. Let's keep going!
+> [ 72.488944] (5:slave@Bourassa) "Task" done
+> [ 73.460184] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
+> [ 73.473416] (4:slave@Ginette) Received "finalize"
+> [ 73.473416] (4:slave@Ginette) I'm done. See you!
+> [ 73.493752] (5:slave@Bourassa) Received "finalize"
+> [ 73.493752] (5:slave@Bourassa) I'm done. See you!
+> [ 73.493908] (0:@) Simulation time 73.4939
+> [ 73.493908] (1:master@Tremblay) Goodbye now!
+> [ 73.493908] (2:slave@Tremblay) Received "finalize"
+> [ 73.493908] (2:slave@Tremblay) I'm done. See you!
index 82e2702..dac111d 100644 (file)
 
 p Testing a master/slave example application with a forwarder module
 
-$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave_forwarder.xml 
-> [Jacquelin:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process
-> [Jacquelin:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" to "iRMX"
-> [Jacquelin:master:(1) 4.772530] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 4.772530] [msg_test/INFO] Sending "Task_1" to "Casavant"
-> [iRMX:slave:(4) 4.772530] [msg_test/INFO] Received "Task_0"
-> [iRMX:slave:(4) 4.772530] [msg_test/INFO] Processing "Task_0"
-> [iRMX:slave:(4) 4.845345] [msg_test/INFO] "Task_0" done
-> [Casavant:forwarder:(3) 6.900351] [msg_test/INFO] Received "Task_1"
-> [Casavant:forwarder:(3) 6.900351] [msg_test/INFO] Sending "Task_1" to "Robert"
-> [Jacquelin:master:(1) 6.900351] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 6.900351] [msg_test/INFO] Sending "Task_2" to "Bousquet"
-> [Bousquet:slave:(5) 8.491392] [msg_test/INFO] Received "Task_2"
-> [Bousquet:slave:(5) 8.491392] [msg_test/INFO] Processing "Task_2"
-> [Jacquelin:master:(1) 8.491392] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 8.491392] [msg_test/INFO] Sending "Task_3" to "Soucy"
-> [Bousquet:slave:(5) 8.607896] [msg_test/INFO] "Task_2" done
-> [Robert:slave:(10) 9.260549] [msg_test/INFO] Received "Task_1"
-> [Robert:slave:(10) 9.260549] [msg_test/INFO] Processing "Task_1"
-> [Robert:slave:(10) 9.296956] [msg_test/INFO] "Task_1" done
-> [Soucy:slave:(6) 10.755127] [msg_test/INFO] Received "Task_3"
-> [Soucy:slave:(6) 10.755127] [msg_test/INFO] Processing "Task_3"
-> [Jacquelin:master:(1) 10.755127] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 10.755127] [msg_test/INFO] Sending "Task_4" to "Jackson"
-> [Soucy:slave:(6) 10.791535] [msg_test/INFO] "Task_3" done
-> [Jackson:forwarder:(2) 12.090242] [msg_test/INFO] Received "Task_4"
-> [Jackson:forwarder:(2) 12.090242] [msg_test/INFO] Sending "Task_4" to "Kuenning"
-> [Jacquelin:master:(1) 12.090242] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 12.090242] [msg_test/INFO] Sending "Task_5" to "iRMX"
-> [Kuenning:slave:(7) 12.173866] [msg_test/INFO] Received "Task_4"
-> [Kuenning:slave:(7) 12.173866] [msg_test/INFO] Processing "Task_4"
-> [Kuenning:slave:(7) 12.232118] [msg_test/INFO] "Task_4" done
-> [iRMX:slave:(4) 16.862772] [msg_test/INFO] Received "Task_5"
-> [iRMX:slave:(4) 16.862772] [msg_test/INFO] Processing "Task_5"
-> [Jacquelin:master:(1) 16.862772] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 16.862772] [msg_test/INFO] Sending "Task_6" to "Casavant"
-> [iRMX:slave:(4) 16.935587] [msg_test/INFO] "Task_5" done
-> [Casavant:forwarder:(3) 18.990593] [msg_test/INFO] Received "Task_6"
-> [Casavant:forwarder:(3) 18.990593] [msg_test/INFO] Sending "Task_6" to "Sirois"
-> [Jacquelin:master:(1) 18.990593] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 18.990593] [msg_test/INFO] Sending "Task_7" to "Bousquet"
-> [Sirois:slave:(11) 19.793293] [msg_test/INFO] Received "Task_6"
-> [Sirois:slave:(11) 19.793293] [msg_test/INFO] Processing "Task_6"
-> [Sirois:slave:(11) 19.836983] [msg_test/INFO] "Task_6" done
-> [Bousquet:slave:(5) 20.581634] [msg_test/INFO] Received "Task_7"
-> [Bousquet:slave:(5) 20.581634] [msg_test/INFO] Processing "Task_7"
-> [Jacquelin:master:(1) 20.581634] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 20.581634] [msg_test/INFO] Sending "Task_8" to "Soucy"
-> [Bousquet:slave:(5) 20.698138] [msg_test/INFO] "Task_7" done
-> [Soucy:slave:(6) 22.845369] [msg_test/INFO] Received "Task_8"
-> [Soucy:slave:(6) 22.845369] [msg_test/INFO] Processing "Task_8"
-> [Jacquelin:master:(1) 22.845369] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 22.845369] [msg_test/INFO] Sending "Task_9" to "Jackson"
-> [Soucy:slave:(6) 22.881777] [msg_test/INFO] "Task_8" done
-> [Jackson:forwarder:(2) 24.180485] [msg_test/INFO] Received "Task_9"
-> [Jackson:forwarder:(2) 24.180485] [msg_test/INFO] Sending "Task_9" to "Browne"
-> [Jacquelin:master:(1) 24.180485] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 24.180485] [msg_test/INFO] Sending "Task_10" to "iRMX"
-> [Browne:slave:(8) 27.009931] [msg_test/INFO] Received "Task_9"
-> [Browne:slave:(8) 27.009931] [msg_test/INFO] Processing "Task_9"
-> [Browne:slave:(8) 27.046339] [msg_test/INFO] "Task_9" done
-> [iRMX:slave:(4) 28.953014] [msg_test/INFO] Received "Task_10"
-> [iRMX:slave:(4) 28.953014] [msg_test/INFO] Processing "Task_10"
-> [Jacquelin:master:(1) 28.953014] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 28.953014] [msg_test/INFO] Sending "Task_11" to "Casavant"
-> [iRMX:slave:(4) 29.025830] [msg_test/INFO] "Task_10" done
-> [Casavant:forwarder:(3) 31.080835] [msg_test/INFO] Received "Task_11"
-> [Casavant:forwarder:(3) 31.080835] [msg_test/INFO] Sending "Task_11" to "Monique"
-> [Jacquelin:master:(1) 31.080835] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 31.080835] [msg_test/INFO] Sending "Task_12" to "Bousquet"
-> [Monique:slave:(12) 32.472434] [msg_test/INFO] Received "Task_11"
-> [Monique:slave:(12) 32.472434] [msg_test/INFO] Processing "Task_11"
-> [Monique:slave:(12) 32.516124] [msg_test/INFO] "Task_11" done
-> [Bousquet:slave:(5) 32.671876] [msg_test/INFO] Received "Task_12"
-> [Bousquet:slave:(5) 32.671876] [msg_test/INFO] Processing "Task_12"
-> [Jacquelin:master:(1) 32.671876] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 32.671876] [msg_test/INFO] Sending "Task_13" to "Soucy"
-> [Bousquet:slave:(5) 32.788380] [msg_test/INFO] "Task_12" done
-> [Soucy:slave:(6) 34.935611] [msg_test/INFO] Received "Task_13"
-> [Soucy:slave:(6) 34.935611] [msg_test/INFO] Processing "Task_13"
-> [Jacquelin:master:(1) 34.935611] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 34.935611] [msg_test/INFO] Sending "Task_14" to "Jackson"
-> [Soucy:slave:(6) 34.972019] [msg_test/INFO] "Task_13" done
-> [Jackson:forwarder:(2) 36.270727] [msg_test/INFO] Received "Task_14"
-> [Jackson:forwarder:(2) 36.270727] [msg_test/INFO] Sending "Task_14" to "Stephen"
-> [Jacquelin:master:(1) 36.270727] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 36.270727] [msg_test/INFO] Sending "Task_15" to "iRMX"
-> [Stephen:slave:(9) 40.508273] [msg_test/INFO] Received "Task_14"
-> [Stephen:slave:(9) 40.508273] [msg_test/INFO] Processing "Task_14"
-> [Stephen:slave:(9) 40.581088] [msg_test/INFO] "Task_14" done
-> [iRMX:slave:(4) 41.043257] [msg_test/INFO] Received "Task_15"
-> [iRMX:slave:(4) 41.043257] [msg_test/INFO] Processing "Task_15"
-> [Jacquelin:master:(1) 41.043257] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 41.043257] [msg_test/INFO] Sending "Task_16" to "Casavant"
-> [iRMX:slave:(4) 41.116072] [msg_test/INFO] "Task_15" done
-> [Casavant:forwarder:(3) 43.171078] [msg_test/INFO] Received "Task_16"
-> [Casavant:forwarder:(3) 43.171078] [msg_test/INFO] Sending "Task_16" to "Robert"
-> [Jacquelin:master:(1) 43.171078] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 43.171078] [msg_test/INFO] Sending "Task_17" to "Bousquet"
-> [Bousquet:slave:(5) 44.762118] [msg_test/INFO] Received "Task_17"
-> [Bousquet:slave:(5) 44.762118] [msg_test/INFO] Processing "Task_17"
-> [Jacquelin:master:(1) 44.762118] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 44.762118] [msg_test/INFO] Sending "Task_18" to "Soucy"
-> [Bousquet:slave:(5) 44.878622] [msg_test/INFO] "Task_17" done
-> [Robert:slave:(10) 45.531275] [msg_test/INFO] Received "Task_16"
-> [Robert:slave:(10) 45.531275] [msg_test/INFO] Processing "Task_16"
-> [Robert:slave:(10) 45.567683] [msg_test/INFO] "Task_16" done
-> [Soucy:slave:(6) 47.025854] [msg_test/INFO] Received "Task_18"
-> [Soucy:slave:(6) 47.025854] [msg_test/INFO] Processing "Task_18"
-> [Jacquelin:master:(1) 47.025854] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 47.025854] [msg_test/INFO] Sending "Task_19" to "Jackson"
-> [Soucy:slave:(6) 47.062262] [msg_test/INFO] "Task_18" done
-> [Jackson:forwarder:(2) 48.360969] [msg_test/INFO] Received "Task_19"
-> [Jackson:forwarder:(2) 48.360969] [msg_test/INFO] Sending "Task_19" to "Kuenning"
-> [Jacquelin:master:(1) 48.360969] [msg_test/INFO] Sent
-> [Jacquelin:master:(1) 48.360969] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Kuenning:slave:(7) 48.444592] [msg_test/INFO] Received "Task_19"
-> [Kuenning:slave:(7) 48.444592] [msg_test/INFO] Processing "Task_19"
-> [Kuenning:slave:(7) 48.502845] [msg_test/INFO] "Task_19" done
-> [iRMX:slave:(4) 50.794024] [msg_test/INFO] Received "finalize"
-> [iRMX:slave:(4) 50.794024] [msg_test/INFO] I'm done. See you!
-> [Casavant:forwarder:(3) 51.878795] [msg_test/INFO] Received "finalize"
-> [Casavant:forwarder:(3) 51.878795] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Bousquet:slave:(5) 52.689914] [msg_test/INFO] Received "finalize"
-> [Bousquet:slave:(5) 52.689914] [msg_test/INFO] I'm done. See you!
-> [Robert:slave:(10) 53.082033] [msg_test/INFO] Received "finalize"
-> [Robert:slave:(10) 53.082033] [msg_test/INFO] I'm done. See you!
-> [Sirois:slave:(11) 53.491253] [msg_test/INFO] Received "finalize"
-> [Sirois:slave:(11) 53.491253] [msg_test/INFO] I'm done. See you!
-> [Soucy:slave:(6) 53.843975] [msg_test/INFO] Received "finalize"
-> [Soucy:slave:(6) 53.843975] [msg_test/INFO] I'm done. See you!
-> [Monique:slave:(12) 54.200695] [msg_test/INFO] Received "finalize"
-> [Monique:slave:(12) 54.200695] [msg_test/INFO] I'm done. See you!
-> [Casavant:forwarder:(3) 54.200695] [msg_test/INFO] I'm done. See you!
-> [Jackson:forwarder:(2) 54.524622] [msg_test/INFO] Received "finalize"
-> [Jackson:forwarder:(2) 54.524622] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Jacquelin:master:(1) 54.524622] [msg_test/INFO] Goodbye now!
-> [Kuenning:slave:(7) 54.529294] [msg_test/INFO] Received "finalize"
-> [Kuenning:slave:(7) 54.529294] [msg_test/INFO] I'm done. See you!
-> [Browne:slave:(8) 55.971757] [msg_test/INFO] Received "finalize"
-> [Browne:slave:(8) 55.971757] [msg_test/INFO] I'm done. See you!
-> [Stephen:slave:(9) 58.132075] [msg_test/INFO] Received "finalize"
-> [Stephen:slave:(9) 58.132075] [msg_test/INFO] I'm done. See you!
-> [Jackson:forwarder:(2) 58.132075] [msg_test/INFO] I'm done. See you!
-> [58.132075] [msg_test/INFO] Simulation time 58.1321
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_forwarder$EXEEXT ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/masterslave/deployment_masterslave_forwarder.xml  --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:master@Jacquelin) Got 5 slaves and 20 tasks to process
+> [  0.000000] (1:master@Jacquelin) Sending "Task_0" to "iRMX"
+> [  4.772530] (1:master@Jacquelin) Sent
+> [  4.772530] (1:master@Jacquelin) Sending "Task_1" to "Casavant"
+> [  4.772530] (4:slave@iRMX) Received "Task_0"
+> [  4.772530] (4:slave@iRMX) Processing "Task_0"
+> [  4.845345] (4:slave@iRMX) "Task_0" done
+> [  6.900351] (1:master@Jacquelin) Sent
+> [  6.900351] (1:master@Jacquelin) Sending "Task_2" to "Bousquet"
+> [  6.900351] (3:forwarder@Casavant) Received "Task_1"
+> [  6.900351] (3:forwarder@Casavant) Sending "Task_1" to "Robert"
+> [  8.491392] (1:master@Jacquelin) Sent
+> [  8.491392] (1:master@Jacquelin) Sending "Task_3" to "Soucy"
+> [  8.491392] (5:slave@Bousquet) Received "Task_2"
+> [  8.491392] (5:slave@Bousquet) Processing "Task_2"
+> [  8.607896] (5:slave@Bousquet) "Task_2" done
+> [  9.260549] (10:slave@Robert) Received "Task_1"
+> [  9.260549] (10:slave@Robert) Processing "Task_1"
+> [  9.296956] (10:slave@Robert) "Task_1" done
+> [ 10.755127] (1:master@Jacquelin) Sent
+> [ 10.755127] (1:master@Jacquelin) Sending "Task_4" to "Jackson"
+> [ 10.755127] (6:slave@Soucy) Received "Task_3"
+> [ 10.755127] (6:slave@Soucy) Processing "Task_3"
+> [ 10.791535] (6:slave@Soucy) "Task_3" done
+> [ 12.090242] (1:master@Jacquelin) Sent
+> [ 12.090242] (1:master@Jacquelin) Sending "Task_5" to "iRMX"
+> [ 12.090242] (2:forwarder@Jackson) Received "Task_4"
+> [ 12.090242] (2:forwarder@Jackson) Sending "Task_4" to "Kuenning"
+> [ 12.173866] (7:slave@Kuenning) Received "Task_4"
+> [ 12.173866] (7:slave@Kuenning) Processing "Task_4"
+> [ 12.232118] (7:slave@Kuenning) "Task_4" done
+> [ 16.862772] (1:master@Jacquelin) Sent
+> [ 16.862772] (1:master@Jacquelin) Sending "Task_6" to "Casavant"
+> [ 16.862772] (4:slave@iRMX) Received "Task_5"
+> [ 16.862772] (4:slave@iRMX) Processing "Task_5"
+> [ 16.935587] (4:slave@iRMX) "Task_5" done
+> [ 18.990593] (1:master@Jacquelin) Sent
+> [ 18.990593] (1:master@Jacquelin) Sending "Task_7" to "Bousquet"
+> [ 18.990593] (3:forwarder@Casavant) Received "Task_6"
+> [ 18.990593] (3:forwarder@Casavant) Sending "Task_6" to "Sirois"
+> [ 19.793293] (11:slave@Sirois) Received "Task_6"
+> [ 19.793293] (11:slave@Sirois) Processing "Task_6"
+> [ 19.836983] (11:slave@Sirois) "Task_6" done
+> [ 20.581634] (1:master@Jacquelin) Sent
+> [ 20.581634] (1:master@Jacquelin) Sending "Task_8" to "Soucy"
+> [ 20.581634] (5:slave@Bousquet) Received "Task_7"
+> [ 20.581634] (5:slave@Bousquet) Processing "Task_7"
+> [ 20.698138] (5:slave@Bousquet) "Task_7" done
+> [ 22.845369] (1:master@Jacquelin) Sent
+> [ 22.845369] (1:master@Jacquelin) Sending "Task_9" to "Jackson"
+> [ 22.845369] (6:slave@Soucy) Received "Task_8"
+> [ 22.845369] (6:slave@Soucy) Processing "Task_8"
+> [ 22.881777] (6:slave@Soucy) "Task_8" done
+> [ 24.180485] (1:master@Jacquelin) Sent
+> [ 24.180485] (1:master@Jacquelin) Sending "Task_10" to "iRMX"
+> [ 24.180485] (2:forwarder@Jackson) Received "Task_9"
+> [ 24.180485] (2:forwarder@Jackson) Sending "Task_9" to "Browne"
+> [ 27.009931] (8:slave@Browne) Received "Task_9"
+> [ 27.009931] (8:slave@Browne) Processing "Task_9"
+> [ 27.046339] (8:slave@Browne) "Task_9" done
+> [ 28.953014] (1:master@Jacquelin) Sent
+> [ 28.953014] (1:master@Jacquelin) Sending "Task_11" to "Casavant"
+> [ 28.953014] (4:slave@iRMX) Received "Task_10"
+> [ 28.953014] (4:slave@iRMX) Processing "Task_10"
+> [ 29.025830] (4:slave@iRMX) "Task_10" done
+> [ 31.080835] (1:master@Jacquelin) Sent
+> [ 31.080835] (1:master@Jacquelin) Sending "Task_12" to "Bousquet"
+> [ 31.080835] (3:forwarder@Casavant) Received "Task_11"
+> [ 31.080835] (3:forwarder@Casavant) Sending "Task_11" to "Monique"
+> [ 32.472434] (12:slave@Monique) Received "Task_11"
+> [ 32.472434] (12:slave@Monique) Processing "Task_11"
+> [ 32.516124] (12:slave@Monique) "Task_11" done
+> [ 32.671876] (1:master@Jacquelin) Sent
+> [ 32.671876] (1:master@Jacquelin) Sending "Task_13" to "Soucy"
+> [ 32.671876] (5:slave@Bousquet) Received "Task_12"
+> [ 32.671876] (5:slave@Bousquet) Processing "Task_12"
+> [ 32.788380] (5:slave@Bousquet) "Task_12" done
+> [ 34.935611] (1:master@Jacquelin) Sent
+> [ 34.935611] (1:master@Jacquelin) Sending "Task_14" to "Jackson"
+> [ 34.935611] (6:slave@Soucy) Received "Task_13"
+> [ 34.935611] (6:slave@Soucy) Processing "Task_13"
+> [ 34.972019] (6:slave@Soucy) "Task_13" done
+> [ 36.270727] (1:master@Jacquelin) Sent
+> [ 36.270727] (1:master@Jacquelin) Sending "Task_15" to "iRMX"
+> [ 36.270727] (2:forwarder@Jackson) Received "Task_14"
+> [ 36.270727] (2:forwarder@Jackson) Sending "Task_14" to "Stephen"
+> [ 40.508273] (9:slave@Stephen) Received "Task_14"
+> [ 40.508273] (9:slave@Stephen) Processing "Task_14"
+> [ 40.581088] (9:slave@Stephen) "Task_14" done
+> [ 41.043257] (1:master@Jacquelin) Sent
+> [ 41.043257] (1:master@Jacquelin) Sending "Task_16" to "Casavant"
+> [ 41.043257] (4:slave@iRMX) Received "Task_15"
+> [ 41.043257] (4:slave@iRMX) Processing "Task_15"
+> [ 41.116072] (4:slave@iRMX) "Task_15" done
+> [ 43.171078] (1:master@Jacquelin) Sent
+> [ 43.171078] (1:master@Jacquelin) Sending "Task_17" to "Bousquet"
+> [ 43.171078] (3:forwarder@Casavant) Received "Task_16"
+> [ 43.171078] (3:forwarder@Casavant) Sending "Task_16" to "Robert"
+> [ 44.762118] (1:master@Jacquelin) Sent
+> [ 44.762118] (1:master@Jacquelin) Sending "Task_18" to "Soucy"
+> [ 44.762118] (5:slave@Bousquet) Received "Task_17"
+> [ 44.762118] (5:slave@Bousquet) Processing "Task_17"
+> [ 44.878622] (5:slave@Bousquet) "Task_17" done
+> [ 45.531275] (10:slave@Robert) Received "Task_16"
+> [ 45.531275] (10:slave@Robert) Processing "Task_16"
+> [ 45.567683] (10:slave@Robert) "Task_16" done
+> [ 47.025854] (1:master@Jacquelin) Sent
+> [ 47.025854] (1:master@Jacquelin) Sending "Task_19" to "Jackson"
+> [ 47.025854] (6:slave@Soucy) Received "Task_18"
+> [ 47.025854] (6:slave@Soucy) Processing "Task_18"
+> [ 47.062262] (6:slave@Soucy) "Task_18" done
+> [ 48.360969] (1:master@Jacquelin) Sent
+> [ 48.360969] (1:master@Jacquelin) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 48.360969] (2:forwarder@Jackson) Received "Task_19"
+> [ 48.360969] (2:forwarder@Jackson) Sending "Task_19" to "Kuenning"
+> [ 48.444592] (7:slave@Kuenning) Received "Task_19"
+> [ 48.444592] (7:slave@Kuenning) Processing "Task_19"
+> [ 48.502845] (7:slave@Kuenning) "Task_19" done
+> [ 50.794024] (4:slave@iRMX) Received "finalize"
+> [ 50.794024] (4:slave@iRMX) I'm done. See you!
+> [ 51.878795] (3:forwarder@Casavant) Received "finalize"
+> [ 51.878795] (3:forwarder@Casavant) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 52.689914] (5:slave@Bousquet) Received "finalize"
+> [ 52.689914] (5:slave@Bousquet) I'm done. See you!
+> [ 53.082033] (10:slave@Robert) Received "finalize"
+> [ 53.082033] (10:slave@Robert) I'm done. See you!
+> [ 53.491253] (11:slave@Sirois) Received "finalize"
+> [ 53.491253] (11:slave@Sirois) I'm done. See you!
+> [ 53.843975] (6:slave@Soucy) Received "finalize"
+> [ 53.843975] (6:slave@Soucy) I'm done. See you!
+> [ 54.200695] (12:slave@Monique) Received "finalize"
+> [ 54.200695] (12:slave@Monique) I'm done. See you!
+> [ 54.200695] (3:forwarder@Casavant) I'm done. See you!
+> [ 54.524622] (1:master@Jacquelin) Goodbye now!
+> [ 54.524622] (2:forwarder@Jackson) Received "finalize"
+> [ 54.524622] (2:forwarder@Jackson) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [ 54.529294] (7:slave@Kuenning) Received "finalize"
+> [ 54.529294] (7:slave@Kuenning) I'm done. See you!
+> [ 55.971757] (8:slave@Browne) Received "finalize"
+> [ 55.971757] (8:slave@Browne) I'm done. See you!
+> [ 58.132075] (0:@) Simulation time 58.1321
+> [ 58.132075] (2:forwarder@Jackson) I'm done. See you!
+> [ 58.132075] (9:slave@Stephen) Received "finalize"
+> [ 58.132075] (9:slave@Stephen) I'm done. See you!
index 32138b6..2906429 100644 (file)
@@ -2,32 +2,33 @@
 
 p Testing a simple master/slave example application (mailbox version)
 
-$ $SG_TEST_EXENV masterslave/masterslave_mailbox$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/masterslave/deployment_masterslave_mailbox.xml --trace
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 0.002339] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-1"
-> [Tremblay:master:(1) 0.168300] [msg_test/INFO] Sending "Task_2" (of 20) to mailbox "slave-2"
-> [Tremblay:master:(1) 0.386454] [msg_test/INFO] Sending "Task_3" (of 20) to mailbox "slave-3"
-> [Tremblay:master:(1) 0.526913] [msg_test/INFO] Sending "Task_4" (of 20) to mailbox "slave-4"
-> [Tremblay:master:(1) 0.742786] [msg_test/INFO] Sending "Task_5" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 0.745124] [msg_test/INFO] Sending "Task_6" (of 20) to mailbox "slave-1"
-> [Tremblay:master:(1) 0.989605] [msg_test/INFO] Sending "Task_7" (of 20) to mailbox "slave-2"
-> [Tremblay:master:(1) 1.259949] [msg_test/INFO] Sending "Task_8" (of 20) to mailbox "slave-3"
-> [Tremblay:master:(1) 1.698471] [msg_test/INFO] Sending "Task_9" (of 20) to mailbox "slave-4"
-> [Tremblay:master:(1) 1.989756] [msg_test/INFO] Sending "Task_10" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 1.992094] [msg_test/INFO] Sending "Task_11" (of 20) to mailbox "slave-1"
-> [Tremblay:master:(1) 2.158056] [msg_test/INFO] Sending "Task_12" (of 20) to mailbox "slave-2"
-> [Tremblay:master:(1) 2.376209] [msg_test/INFO] Sending "Task_13" (of 20) to mailbox "slave-3"
-> [Tremblay:master:(1) 2.870028] [msg_test/INFO] Sending "Task_14" (of 20) to mailbox "slave-4"
-> [Tremblay:master:(1) 3.236726] [msg_test/INFO] Sending "Task_15" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 3.239065] [msg_test/INFO] Sending "Task_16" (of 20) to mailbox "slave-1"
-> [Tremblay:master:(1) 3.405026] [msg_test/INFO] Sending "Task_17" (of 20) to mailbox "slave-2"
-> [Tremblay:master:(1) 3.623180] [msg_test/INFO] Sending "Task_18" (of 20) to mailbox "slave-3"
-> [Tremblay:master:(1) 4.041586] [msg_test/INFO] Sending "Task_19" (of 20) to mailbox "slave-4"
-> [Tremblay:master:(1) 4.483696] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:slave:(2) 4.483852] [msg_test/INFO] I'm done. See you!
-> [Jupiter:slave:(3) 4.499052] [msg_test/INFO] I'm done. See you!
-> [Fafard:slave:(4) 4.519603] [msg_test/INFO] I'm done. See you!
-> [Ginette:slave:(5) 5.085915] [msg_test/INFO] I'm done. See you!
-> [Bourassa:slave:(6) 5.535130] [msg_test/INFO] I'm done. See you!
-> [5.535130] [msg_test/INFO] Simulation time 5.53513
+! output sort
+$ $SG_TEST_EXENV masterslave/masterslave_mailbox$EXEEXT ${srcdir:=.}/small_platform_with_routers.xml ${srcdir:=.}/masterslave/deployment_masterslave_mailbox.xml --trace --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:master@Tremblay) Got 5 slaves and 20 tasks to process
+> [  0.000000] (1:master@Tremblay) Sending "Task_0" (of 20) to mailbox "slave-0"
+> [  0.002339] (1:master@Tremblay) Sending "Task_1" (of 20) to mailbox "slave-1"
+> [  0.168300] (1:master@Tremblay) Sending "Task_2" (of 20) to mailbox "slave-2"
+> [  0.386454] (1:master@Tremblay) Sending "Task_3" (of 20) to mailbox "slave-3"
+> [  0.526913] (1:master@Tremblay) Sending "Task_4" (of 20) to mailbox "slave-4"
+> [  0.742786] (1:master@Tremblay) Sending "Task_5" (of 20) to mailbox "slave-0"
+> [  0.745124] (1:master@Tremblay) Sending "Task_6" (of 20) to mailbox "slave-1"
+> [  0.989605] (1:master@Tremblay) Sending "Task_7" (of 20) to mailbox "slave-2"
+> [  1.259949] (1:master@Tremblay) Sending "Task_8" (of 20) to mailbox "slave-3"
+> [  1.698471] (1:master@Tremblay) Sending "Task_9" (of 20) to mailbox "slave-4"
+> [  1.989756] (1:master@Tremblay) Sending "Task_10" (of 20) to mailbox "slave-0"
+> [  1.992094] (1:master@Tremblay) Sending "Task_11" (of 20) to mailbox "slave-1"
+> [  2.158056] (1:master@Tremblay) Sending "Task_12" (of 20) to mailbox "slave-2"
+> [  2.376209] (1:master@Tremblay) Sending "Task_13" (of 20) to mailbox "slave-3"
+> [  2.870028] (1:master@Tremblay) Sending "Task_14" (of 20) to mailbox "slave-4"
+> [  3.236726] (1:master@Tremblay) Sending "Task_15" (of 20) to mailbox "slave-0"
+> [  3.239065] (1:master@Tremblay) Sending "Task_16" (of 20) to mailbox "slave-1"
+> [  3.405026] (1:master@Tremblay) Sending "Task_17" (of 20) to mailbox "slave-2"
+> [  3.623180] (1:master@Tremblay) Sending "Task_18" (of 20) to mailbox "slave-3"
+> [  4.041586] (1:master@Tremblay) Sending "Task_19" (of 20) to mailbox "slave-4"
+> [  4.483696] (1:master@Tremblay) All tasks have been dispatched. Let's tell everybody the computation is over.
+> [  4.483852] (2:slave@Tremblay) I'm done. See you!
+> [  4.499052] (3:slave@Jupiter) I'm done. See you!
+> [  4.519603] (4:slave@Fafard) I'm done. See you!
+> [  5.085915] (5:slave@Ginette) I'm done. See you!
+> [  5.535130] (0:@) Simulation time 5.53513
+> [  5.535130] (6:slave@Bourassa) I'm done. See you!
index b83efd7..10ef4ce 100644 (file)
@@ -58,6 +58,10 @@ int main(int argc, char *argv[])
 
   MSG_main();
 
+  INFO0("MSG_main finished");
+  
+  MSG_clean();
+
   return 0;
 
 }
index d5b681b..6ed1f1b 100644 (file)
@@ -2,9 +2,10 @@
 
 p Testing the migration feature of MSG
 
-$ $SG_TEST_EXENV migration/migration ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/migration/migration.deploy 
-> [Jacquelin:emigrant:(1) 0.000000] [msg_test/INFO] I'll look for a new job on another machine where the grass is greener.
-> [Boivin:emigrant:(1) 0.000000] [msg_test/INFO] Yeah, found something to do
-> [Boivin:emigrant:(1) 3.000000] [msg_test/INFO] Moving back home after work
-> [Boivin:emigrant:(1) 7.000000] [msg_test/INFO] Uh, nothing to do here. Stopping now
-> [7.000000] [msg_test/INFO] Simulation time 7
+! output sort
+$ $SG_TEST_EXENV migration/migration ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/migration/migration.deploy  --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:emigrant@Jacquelin) I'll look for a new job on another machine where the grass is greener.
+> [  0.000000] (1:emigrant@Boivin) Yeah, found something to do
+> [  3.000000] (1:emigrant@Boivin) Moving back home after work
+> [  7.000000] (0:@) Simulation time 7
+> [  7.000000] (1:emigrant@Boivin) Uh, nothing to do here. Stopping now
index 6bd609d..fd26898 100644 (file)
@@ -2,15 +2,17 @@
 
 p Testing a simple master/slave example application
 
-$ $SG_TEST_EXENV parallel_task/parallel_task$EXEEXT ${srcdir:=.}/small_platform.xml
-> [0.000000] [xbt_cfg/INFO] type in variable = 2
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [Ginette:test:(1) 0.009378] [msg_test/INFO] Goodbye now!
-> [0.009378] [msg_test/INFO] Simulation time 0.00937836
+! output sort
+$ $SG_TEST_EXENV parallel_task/parallel_task$EXEEXT ${srcdir:=.}/small_platform.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) type in variable = 2
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  0.009378] (0:@) Simulation time 0.00937836
+> [  0.009378] (1:test@Ginette) Goodbye now!
 
-$ $SG_TEST_EXENV parallel_task/test_ptask$EXEEXT ${srcdir:=.}/parallel_task/test_ptask_platform.xml ${srcdir:=.}/parallel_task/test_ptask_deployment.xml
-> [0.000000] [xbt_cfg/INFO] type in variable = 2
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [Ginette:execute:(1) 1.000300] [msg_test/INFO] execution_time=1.0003 
-> [Ginette:redistribute:(2) 6.000900] [msg_test/INFO] redistribution_time=6.0009 
-> [6.000900] [msg_test/INFO] Simulation time 6.0009
+! output sort
+$ $SG_TEST_EXENV parallel_task/test_ptask$EXEEXT ${srcdir:=.}/parallel_task/test_ptask_platform.xml ${srcdir:=.}/parallel_task/test_ptask_deployment.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) type in variable = 2
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  1.000300] (1:execute@Ginette) execution_time=1.0003 
+> [  6.000900] (0:@) Simulation time 6.0009
+> [  6.000900] (2:redistribute@Ginette) redistribution_time=6.0009 
index 54f4edf..0d79753 100644 (file)
@@ -2,9 +2,10 @@
 
 p Testing a simple master/slave example application
 
-$ $SG_TEST_EXENV priority/priority$EXEEXT ${srcdir:=.}/small_platform.xml  ${srcdir:=.}/priority/deployment_priority.xml
-> [Fafard:test:(1) 0.000000] [msg_test/INFO] Hello! Running a task of size 7.6296e+07 with priority 1
-> [Fafard:test:(2) 0.000000] [msg_test/INFO] Hello! Running a task of size 7.6296e+07 with priority 2
-> [Fafard:test:(2) 1.500000] [msg_test/INFO] Goodbye now!
-> [Fafard:test:(1) 2.000000] [msg_test/INFO] Goodbye now!
-> [2.000000] [msg_test/INFO] Simulation time 2
+! output sort
+$ $SG_TEST_EXENV priority/priority$EXEEXT ${srcdir:=.}/small_platform.xml  ${srcdir:=.}/priority/deployment_priority.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 1
+> [  0.000000] (2:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 2
+> [  1.500000] (2:test@Fafard) Goodbye now!
+> [  2.000000] (0:@) Simulation time 2
+> [  2.000000] (1:test@Fafard) Goodbye now!
index 07f9070..472d8f9 100644 (file)
@@ -2,15 +2,16 @@
 
 p Testing a MSG application with properties in the XML for Hosts, Links and Processes
 
-$ $SG_TEST_EXENV properties/msg_prop$EXEEXT ${srcdir:=.}/../platforms/prop.xml ${srcdir:=.}/properties/deployment_properties.xml 
-> [host1:alice:(1) 0.000000] [test/INFO] == Print the properties of the host
-> [host1:alice:(1) 0.000000] [test/INFO]   Host property: 'SG_TEST_Hdd' -> '180'
-> [host1:alice:(1) 0.000000] [test/INFO]   Host property: 'SG_TEST_mem' -> '4'
-> [host1:alice:(1) 0.000000] [test/INFO] == Try to get a host property that does not exist
-> [host1:alice:(1) 0.000000] [test/INFO] == Try to get a host property that does exist
-> [host1:alice:(1) 0.000000] [test/INFO]    Property: SG_TEST_Hdd old value: 180
-> [host1:alice:(1) 0.000000] [test/INFO] == Trying to modify a host property
-> [host1:alice:(1) 0.000000] [test/INFO]    Property: SG_TEST_Hdd old value: 250
-> [host1:bob:(2) 0.000000] [test/INFO] == Print the properties of the process
-> [host1:bob:(2) 0.000000] [test/INFO]    Process property: SomeProp -> SomeValue
-> [host1:bob:(2) 0.000000] [test/INFO] == Try to get a process property that does not exist
+! output sort
+$ $SG_TEST_EXENV properties/msg_prop$EXEEXT ${srcdir:=.}/../platforms/prop.xml ${srcdir:=.}/properties/deployment_properties.xml  --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:alice@host1) == Print the properties of the host
+> [  0.000000] (1:alice@host1)   Host property: 'SG_TEST_Hdd' -> '180'
+> [  0.000000] (1:alice@host1)   Host property: 'SG_TEST_mem' -> '4'
+> [  0.000000] (1:alice@host1) == Try to get a host property that does not exist
+> [  0.000000] (1:alice@host1) == Try to get a host property that does exist
+> [  0.000000] (1:alice@host1)    Property: SG_TEST_Hdd old value: 180
+> [  0.000000] (1:alice@host1) == Trying to modify a host property
+> [  0.000000] (1:alice@host1)    Property: SG_TEST_Hdd old value: 250
+> [  0.000000] (2:bob@host1) == Print the properties of the process
+> [  0.000000] (2:bob@host1)    Process property: SomeProp -> SomeValue
+> [  0.000000] (2:bob@host1) == Try to get a process property that does not exist
index 478e23a..77ee06e 100644 (file)
@@ -2,22 +2,23 @@
 
 p Testing the surf network maxmin fairness model
 
-$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml --cfg=workstation/model:CLM03 --cfg=cpu/model:Cas01 --cfg=network/model:CM02
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'CLM03'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [msg_test/INFO] test_all
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] sender
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] host = Bellevue
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] task_la->data = 0.000000e+00
-> [Bellevue:receiver:(2) 0.000000] [msg_test/INFO] receiver
-> [Inmos:sender:(1) 0.100100] [msg_test/INFO] task_bw->data = 1.001000e-01
-> [Bellevue:receiver:(2) 0.100100] [msg_test/INFO] Task received : latency task
-> [Bellevue:receiver:(2) 0.100100] [msg_test/INFO] Communic. time 1.001000e-01
-> [Bellevue:receiver:(2) 0.100100] [msg_test/INFO] --- la 0.100100 ----
-> [Bellevue:receiver:(2) 10000.200100] [msg_test/INFO] Task received : bandwidth task
-> [Bellevue:receiver:(2) 10000.200100] [msg_test/INFO] Communic. time 1.000010e+04
-> [Bellevue:receiver:(2) 10000.200100] [msg_test/INFO] --- bw 99999.000010 ----
-> [10000.200100] [msg_test/INFO] Total simulation time: 1.000020e+04
+! output sort
+$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml --cfg=workstation/model:CLM03 --cfg=cpu/model:Cas01 --cfg=network/model:CM02 --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'CLM03'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) test_all
+> [  0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [  0.000000] (1:sender@Inmos) sender
+> [  0.000000] (1:sender@Inmos) host = Bellevue
+> [  0.000000] (1:sender@Inmos) task_la->data = 0.000000e+00
+> [  0.000000] (2:receiver@Bellevue) receiver
+> [  0.100100] (1:sender@Inmos) task_bw->data = 1.001000e-01
+> [  0.100100] (2:receiver@Bellevue) Task received : latency task
+> [  0.100100] (2:receiver@Bellevue) Communic. time 1.001000e-01
+> [  0.100100] (2:receiver@Bellevue) --- la 0.100100 ----
+> [10000.200100] (0:@) Total simulation time: 1.000020e+04
+> [10000.200100] (2:receiver@Bellevue) Task received : bandwidth task
+> [10000.200100] (2:receiver@Bellevue) Communic. time 1.000010e+04
+> [10000.200100] (2:receiver@Bellevue) --- bw 99999.000010 ----
 
index f01be06..296f8a0 100644 (file)
@@ -3,20 +3,21 @@
 p Testing the surf network Reno fairness model using lagrangian approach
 
 
-$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml "--cfg=workstation/model:compound cpu/model:Cas01 network/model:Reno" --log=surf_lagrange.thres=critical
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'Reno'
-> [0.000000] [msg_test/INFO] test_all
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] sender
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] host = Bellevue
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] task_la->data = 0.000000e+00
-> [Bellevue:receiver:(2) 0.000000] [msg_test/INFO] receiver
-> [Inmos:sender:(1) 1.040100] [msg_test/INFO] task_bw->data = 1.040100e+00
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] Task received : latency task
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] Communic. time 1.040100e+00
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] --- la 1.040100 ----
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] Task received : bandwidth task
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] Communic. time 1.000104e+04
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] --- bw 99989.601081 ----
-> [10002.080100] [msg_test/INFO] Total simulation time: 1.000208e+04
+! output sort
+$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml "--cfg=workstation/model:compound cpu/model:Cas01 network/model:Reno" --log=surf_lagrange.thres=critical --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'Reno'
+> [  0.000000] (0:@) test_all
+> [  0.000000] (1:sender@Inmos) sender
+> [  0.000000] (1:sender@Inmos) host = Bellevue
+> [  0.000000] (1:sender@Inmos) task_la->data = 0.000000e+00
+> [  0.000000] (2:receiver@Bellevue) receiver
+> [  1.040100] (1:sender@Inmos) task_bw->data = 1.040100e+00
+> [  1.040100] (2:receiver@Bellevue) Task received : latency task
+> [  1.040100] (2:receiver@Bellevue) Communic. time 1.040100e+00
+> [  1.040100] (2:receiver@Bellevue) --- la 1.040100 ----
+> [10002.080100] (0:@) Total simulation time: 1.000208e+04
+> [10002.080100] (2:receiver@Bellevue) Task received : bandwidth task
+> [10002.080100] (2:receiver@Bellevue) Communic. time 1.000104e+04
+> [10002.080100] (2:receiver@Bellevue) --- bw 99989.601081 ----
index 0f5a584..32229e4 100644 (file)
@@ -2,20 +2,21 @@
 
 p Testing the surf network Vegas fairness model using lagrangian approach
 
-$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml "--cfg=workstation/model:compound cpu/model:Cas01 network/model:Vegas"
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'Vegas'
-> [0.000000] [msg_test/INFO] test_all
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] sender
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] host = Bellevue
-> [Inmos:sender:(1) 0.000000] [msg_test/INFO] task_la->data = 0.000000e+00
-> [Bellevue:receiver:(2) 0.000000] [msg_test/INFO] receiver
-> [Inmos:sender:(1) 1.040100] [msg_test/INFO] task_bw->data = 1.040100e+00
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] Task received : latency task
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] Communic. time 1.040100e+00
-> [Bellevue:receiver:(2) 1.040100] [msg_test/INFO] --- la 1.040100 ----
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] Task received : bandwidth task
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] Communic. time 1.000104e+04
-> [Bellevue:receiver:(2) 10002.080100] [msg_test/INFO] --- bw 99989.601081 ----
-> [10002.080100] [msg_test/INFO] Total simulation time: 1.000208e+04
+! output sort
+$ $SG_TEST_EXENV sendrecv/sendrecv$EXEEXT ${srcdir:=.}/sendrecv/platform_sendrecv.xml ${srcdir:=.}/sendrecv/deployment_sendrecv.xml "--cfg=workstation/model:compound cpu/model:Cas01 network/model:Vegas" --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'Vegas'
+> [  0.000000] (0:@) test_all
+> [  0.000000] (1:sender@Inmos) sender
+> [  0.000000] (1:sender@Inmos) host = Bellevue
+> [  0.000000] (1:sender@Inmos) task_la->data = 0.000000e+00
+> [  0.000000] (2:receiver@Bellevue) receiver
+> [  1.040100] (1:sender@Inmos) task_bw->data = 1.040100e+00
+> [  1.040100] (2:receiver@Bellevue) Task received : latency task
+> [  1.040100] (2:receiver@Bellevue) Communic. time 1.040100e+00
+> [  1.040100] (2:receiver@Bellevue) --- la 1.040100 ----
+> [10002.080100] (0:@) Total simulation time: 1.000208e+04
+> [10002.080100] (2:receiver@Bellevue) Task received : bandwidth task
+> [10002.080100] (2:receiver@Bellevue) Communic. time 1.000104e+04
+> [10002.080100] (2:receiver@Bellevue) --- bw 99989.601081 ----
index ccac46f..51d26f6 100644 (file)
@@ -2,12 +2,13 @@
 
 p Testing the suspend/resume feature of MSG
 
-$ $SG_TEST_EXENV suspend/suspend ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/suspend/deployment_suspend.xml 
-> [Jacquelin:dream_master:(1) 0.000000] [msg_test/INFO] Let's create a lazy guy.
-> [Jacquelin:dream_master:(1) 0.000000] [msg_test/INFO] Let's wait a little bit...
-> [Jacquelin:Lazy:(2) 0.000000] [msg_test/INFO] Nobody's watching me ? Let's go to sleep.
-> [Jacquelin:dream_master:(1) 10.000000] [msg_test/INFO] Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!
-> [Jacquelin:dream_master:(1) 10.000000] [msg_test/INFO] OK, goodbye now.
-> [Jacquelin:Lazy:(2) 10.000000] [msg_test/INFO] Uuuh ? Did somebody call me ?
-> [Jacquelin:Lazy:(2) 10.000000] [msg_test/INFO] Mmmh, goodbye now.
-> [10.000000] [msg_test/INFO] Simulation time 10
+! output sort
+$ $SG_TEST_EXENV suspend/suspend ${srcdir:=.}/msg_platform.xml ${srcdir:=.}/suspend/deployment_suspend.xml  --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:dream_master@Jacquelin) Let's create a lazy guy.
+> [  0.000000] (1:dream_master@Jacquelin) Let's wait a little bit...
+> [  0.000000] (2:Lazy@Jacquelin) Nobody's watching me ? Let's go to sleep.
+> [ 10.000000] (0:@) Simulation time 10
+> [ 10.000000] (1:dream_master@Jacquelin) Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!
+> [ 10.000000] (1:dream_master@Jacquelin) OK, goodbye now.
+> [ 10.000000] (2:Lazy@Jacquelin) Uuuh ? Did somebody call me ?
+> [ 10.000000] (2:Lazy@Jacquelin) Mmmh, goodbye now.
index 3d14f38..cb31bf4 100644 (file)
 
 p Testing trace integration using file.trace and test1.xml, a < max(time), b < max(time)
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test1.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 40.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test1.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 10.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (1:test_trace@CPU1) Task size: 400.000000
+> [ 10.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [ 40.000000] (1:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test2.xml, a < max(time), max(time) < b < 2 max(time) 
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test2.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task size: 850.000000
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 85.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test2.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 10.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (1:test_trace@CPU1) Task size: 850.000000
+> [ 10.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [ 85.000000] (1:test_trace@CPU1) Test finished
 
 
 p Testing trace integration using file.trace and test3.xml, a < max(time), b > 2 max(time) 
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test3.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task size: 1980.000000
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 178.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test3.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 10.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (1:test_trace@CPU1) Task size: 1980.000000
+> [ 10.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [178.000000] (1:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test4.xml, max(time) < a < 2max(time), max(time) < b < 2max(time)
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test4.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 110.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test4.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 80.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 80.000000] (1:test_trace@CPU1) Task size: 400.000000
+> [ 80.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [110.000000] (1:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test5.xml, max(time) < a < 2max(time), 2max(time) < b < 3max(time)
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test5.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 90.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 90.000000] [test_trace_integration/INFO] Task size: 850.000000
-> [CPU1:test_trace:(1) 90.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 162.500000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test5.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 90.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 90.000000] (1:test_trace@CPU1) Task size: 850.000000
+> [ 90.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [162.500000] (1:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test6.xml, max(time) < a < 2max(time), b > 3max(time)
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test6.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Task size: 1980.000000
-> [CPU1:test_trace:(1) 80.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 248.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test6.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 80.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 80.000000] (1:test_trace@CPU1) Task size: 1980.000000
+> [ 80.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [248.000000] (1:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test7.xml, two process with same priority
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test7.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task prio: 1.500000
-> [CPU1:test_trace:(2) 20.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(2) 20.000000] [test_trace_integration/INFO] Task size: 300.000000
-> [CPU1:test_trace:(2) 20.000000] [test_trace_integration/INFO] Task prio: 1.500000
-> [CPU1:test_trace:(1) 70.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(2) 70.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test7.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 10.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (1:test_trace@CPU1) Task size: 400.000000
+> [ 10.000000] (1:test_trace@CPU1) Task prio: 1.500000
+> [ 20.000000] (2:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 20.000000] (2:test_trace@CPU1) Task size: 300.000000
+> [ 20.000000] (2:test_trace@CPU1) Task prio: 1.500000
+> [ 70.000000] (1:test_trace@CPU1) Test finished
+> [ 70.000000] (2:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test8.xml, two process with different priority
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test8.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(1) 10.000000] [test_trace_integration/INFO] Task prio: 2.500000
-> [CPU1:test_trace:(2) 10.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(2) 10.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(2) 10.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 56.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(2) 80.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test8.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [ 10.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (1:test_trace@CPU1) Task size: 400.000000
+> [ 10.000000] (1:test_trace@CPU1) Task prio: 2.500000
+> [ 10.000000] (2:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 10.000000] (2:test_trace@CPU1) Task size: 400.000000
+> [ 10.000000] (2:test_trace@CPU1) Task prio: 1.000000
+> [ 56.000000] (1:test_trace@CPU1) Test finished
+> [ 80.000000] (2:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test9.xml, three process with same priority
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test9.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task size: 400.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(3) 30.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(3) 30.000000] [test_trace_integration/INFO] Task size: 2000.000000
-> [CPU1:test_trace:(3) 30.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(1) 90.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(2) 90.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(3) 240.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test9.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (1:test_trace@CPU1) Task size: 400.000000
+> [  0.000000] (1:test_trace@CPU1) Task prio: 1.000000
+> [  0.000000] (2:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (2:test_trace@CPU1) Task size: 400.000000
+> [  0.000000] (2:test_trace@CPU1) Task prio: 1.000000
+> [ 30.000000] (3:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 30.000000] (3:test_trace@CPU1) Task size: 2000.000000
+> [ 30.000000] (3:test_trace@CPU1) Task prio: 1.000000
+> [ 90.000000] (1:test_trace@CPU1) Test finished
+> [ 90.000000] (2:test_trace@CPU1) Test finished
+> [240.000000] (3:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test10.xml, three process with different priority
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test10.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task size: 420.000000
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task prio: 2.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task size: 310.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Task size: 990.000000
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Task prio: 9.000000
-> [CPU1:test_trace:(1) 62.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(2) 152.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(3) 152.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test10.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (1:test_trace@CPU1) Task size: 420.000000
+> [  0.000000] (1:test_trace@CPU1) Task prio: 2.000000
+> [  0.000000] (2:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (2:test_trace@CPU1) Task size: 310.000000
+> [  0.000000] (2:test_trace@CPU1) Task prio: 1.000000
+> [ 50.000000] (3:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 50.000000] (3:test_trace@CPU1) Task size: 990.000000
+> [ 50.000000] (3:test_trace@CPU1) Task prio: 9.000000
+> [ 62.000000] (1:test_trace@CPU1) Test finished
+> [152.000000] (2:test_trace@CPU1) Test finished
+> [152.000000] (3:test_trace@CPU1) Test finished
 
 p Testing trace integration using file.trace and test11.xml, three process with different priority. Changed timestep to 0.1.
 
-$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test11.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI'
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task size: 420.000000
-> [CPU1:test_trace:(1) 0.000000] [test_trace_integration/INFO] Task prio: 2.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task size: 310.000000
-> [CPU1:test_trace:(2) 0.000000] [test_trace_integration/INFO] Task prio: 1.000000
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Testing the trace integration cpu model: CpuTI
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Task size: 990.000000
-> [CPU1:test_trace:(3) 50.000000] [test_trace_integration/INFO] Task prio: 9.000000
-> [CPU1:test_trace:(1) 62.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(2) 152.000000] [test_trace_integration/INFO] Test finished
-> [CPU1:test_trace:(3) 152.000000] [test_trace_integration/INFO] Test finished
+! output sort
+$ $SG_TEST_EXENV trace/test_trace_integration$EXEEXT ${srcdir:=.}/trace/test11.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/model:CpuTI --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound'
+> [  0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI'
+> [  0.000000] (1:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (1:test_trace@CPU1) Task size: 420.000000
+> [  0.000000] (1:test_trace@CPU1) Task prio: 2.000000
+> [  0.000000] (2:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [  0.000000] (2:test_trace@CPU1) Task size: 310.000000
+> [  0.000000] (2:test_trace@CPU1) Task prio: 1.000000
+> [ 50.000000] (3:test_trace@CPU1) Testing the trace integration cpu model: CpuTI
+> [ 50.000000] (3:test_trace@CPU1) Task size: 990.000000
+> [ 50.000000] (3:test_trace@CPU1) Task prio: 9.000000
+> [ 62.000000] (1:test_trace@CPU1) Test finished
+> [152.000000] (2:test_trace@CPU1) Test finished
+> [152.000000] (3:test_trace@CPU1) Test finished
index 494661e..84d956d 100644 (file)
@@ -65,7 +65,7 @@ typedef struct m_task *m_task_t;
 */
 #define MSG_TASK_UNINITIALIZED NULL
 
-typedef struct s_smx_comm *msg_comm_t;
+typedef struct s_smx_action *msg_comm_t;
 /** @} */
 
 
@@ -105,7 +105,7 @@ typedef int m_channel_t;
 
 /* ******************************** Mailbox ************************************ */
 
-typedef struct s_msg_mailbox *msg_mailbox_t;
+typedef struct s_smx_rvpoint *msg_mailbox_t;
 /** @brief Mailbox datatype
     @ingroup m_datatypes_management_details @{ */
 
index 1d07841..f83be03 100644 (file)
@@ -155,9 +155,6 @@ XBT_PUBLIC(void) MSG_task_set_priority(m_task_t task, double priority);
 XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel);
 XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel);
 XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host);
-XBT_PUBLIC(MSG_error_t) MSG_channel_select_from(m_channel_t channel,
-                                                double max_duration,
-                                                int *PID);
 XBT_PUBLIC(MSG_error_t) MSG_process_sleep(double nb_sec);
 XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
 
@@ -196,9 +193,6 @@ XBT_PUBLIC(int) MSG_task_listen(const char *alias);
 XBT_PUBLIC(int) MSG_task_listen_from_host(const char *alias,
                                           m_host_t host);
 
-XBT_PUBLIC(MSG_error_t)
-    MSG_alias_select_from(const char *alias, double timeout, int *PID);
-
 XBT_PUBLIC(MSG_error_t)
     MSG_task_send_with_timeout(m_task_t task, const char *alias,
                            double timeout);
index a1ff0f6..b38a3e6 100644 (file)
@@ -88,7 +88,8 @@ XBT_PUBLIC(void) xbt_dynar_dump(xbt_dynar_t dynar);
 XBT_PUBLIC(void) xbt_dynar_get_cpy(const xbt_dynar_t dynar,
                                    const unsigned long idx,
                                    void *const dst);
-
+XBT_INLINE void *xbt_dynar_set_at_ptr(const xbt_dynar_t dynar,
+                                      const unsigned long idx);
 XBT_PUBLIC(void) xbt_dynar_set(xbt_dynar_t dynar, const int idx,
                                const void *src);
 XBT_PUBLIC(void) xbt_dynar_replace(xbt_dynar_t dynar,
index 1f7e538..50a4ef7 100644 (file)
@@ -259,6 +259,7 @@ typedef enum {
   system_error,   /**< a syscall did fail */
   network_error,  /**< error while sending/receiving data */
   timeout_error,  /**< not quick enough, dude */
+  cancel_error,   /**< an action was canceled */
   thread_error,    /**< error while [un]locking */
   host_error,                            /**< host failed */
   tracing_error   /**< error during the simulation tracing */
@@ -289,50 +290,53 @@ typedef struct {
   void *bt[XBT_BACKTRACE_SIZE];
 } xbt_ex_t;
 
-/* declare the context type (private) */
+/* declare the running context type
+ * (that's where we get the process name for the logs and the exception storage)
+ *  -- do not mess with it --
+ */
 typedef struct {
   __ex_mctx_t *ctx_mctx;        /* permanent machine context of enclosing try/catch */
   volatile int ctx_caught;      /* temporary flag whether exception was caught */
-  volatile xbt_ex_t ctx_ex;     /* temporary exception storage */
-} ex_ctx_t;
+  volatile xbt_ex_t exception;  /* temporary exception storage */
+} xbt_running_ctx_t;
 
 /* the static and dynamic initializers for a context structure */
-#define XBT_CTX_INITIALIZER \
+#define XBT_RUNNING_CTX_INITIALIZER \
     { NULL, 0, { /* content */ NULL, unknown_error, 0, \
                  /* throw point*/ 0,NULL, NULL,0, NULL, 0, NULL,\
                  /* backtrace */ 0,NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL} } }
-#define XBT_CTX_INITIALIZE(ctx) \
+#define XBT_RUNNING_CTX_INITIALIZE(ctx) \
     do { \
         (ctx)->ctx_mctx          = NULL; \
         (ctx)->ctx_caught        = 0;    \
-        (ctx)->ctx_ex.msg        = NULL; \
-        (ctx)->ctx_ex.category   = 0;    \
-        (ctx)->ctx_ex.value      = 0;    \
-        (ctx)->ctx_ex.remote     = 0;    \
-        (ctx)->ctx_ex.host       = NULL; \
-        (ctx)->ctx_ex.procname   = NULL; \
-        (ctx)->ctx_ex.pid        = 0;    \
-        (ctx)->ctx_ex.file       = NULL; \
-        (ctx)->ctx_ex.line       = 0;    \
-        (ctx)->ctx_ex.func       = NULL; \
-        (ctx)->ctx_ex.bt[0]      = NULL; \
-        (ctx)->ctx_ex.bt[1]      = NULL; \
-        (ctx)->ctx_ex.bt[2]      = NULL; \
-        (ctx)->ctx_ex.bt[3]      = NULL; \
-        (ctx)->ctx_ex.bt[4]      = NULL; \
-        (ctx)->ctx_ex.bt[5]      = NULL; \
-        (ctx)->ctx_ex.bt[6]      = NULL; \
-        (ctx)->ctx_ex.bt[7]      = NULL; \
-        (ctx)->ctx_ex.bt[8]      = NULL; \
-        (ctx)->ctx_ex.bt[9]      = NULL; \
-        (ctx)->ctx_ex.used       = 0; \
-        (ctx)->ctx_ex.bt_strings = NULL; \
+        (ctx)->exception.msg        = NULL; \
+        (ctx)->exception.category   = 0;    \
+        (ctx)->exception.value      = 0;    \
+        (ctx)->exception.remote     = 0;    \
+        (ctx)->exception.host       = NULL; \
+        (ctx)->exception.procname   = NULL; \
+        (ctx)->exception.pid        = 0;    \
+        (ctx)->exception.file       = NULL; \
+        (ctx)->exception.line       = 0;    \
+        (ctx)->exception.func       = NULL; \
+        (ctx)->exception.bt[0]      = NULL; \
+        (ctx)->exception.bt[1]      = NULL; \
+        (ctx)->exception.bt[2]      = NULL; \
+        (ctx)->exception.bt[3]      = NULL; \
+        (ctx)->exception.bt[4]      = NULL; \
+        (ctx)->exception.bt[5]      = NULL; \
+        (ctx)->exception.bt[6]      = NULL; \
+        (ctx)->exception.bt[7]      = NULL; \
+        (ctx)->exception.bt[8]      = NULL; \
+        (ctx)->exception.bt[9]      = NULL; \
+        (ctx)->exception.used       = 0; \
+        (ctx)->exception.bt_strings = NULL; \
     } while (0)
 
 /* the exception context */
-typedef ex_ctx_t *(*ex_ctx_cb_t) (void);
-XBT_PUBLIC_DATA(ex_ctx_cb_t) __xbt_ex_ctx;
-extern ex_ctx_t *__xbt_ex_ctx_default(void);
+typedef xbt_running_ctx_t *(*xbt_running_ctx_fetcher_t) (void);
+XBT_PUBLIC_DATA(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch;
+extern xbt_running_ctx_t *__xbt_ex_ctx_default(void);
 
 /* the termination handler */
 typedef void (*ex_term_cb_t) (xbt_ex_t *);
@@ -344,7 +348,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e);
  */
 #define TRY \
     { \
-        ex_ctx_t *__xbt_ex_ctx_ptr = __xbt_ex_ctx(); \
+        xbt_running_ctx_t *__xbt_ex_ctx_ptr = __xbt_running_ctx_fetch(); \
         int __ex_cleanup = 0; \
         __ex_mctx_t *__ex_mctx_en; \
         __ex_mctx_t __ex_mctx_me; \
@@ -393,18 +397,18 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e);
         } \
         __xbt_ex_ctx_ptr->ctx_mctx = __ex_mctx_en; \
     } \
-    if (   !(__xbt_ex_ctx()->ctx_caught) \
-        || ((e) = XBT_EX_T_CPLUSPLUSCAST __xbt_ex_ctx()->ctx_ex, MAYDAY_CATCH(e) 0)) { \
+    if (   !(__xbt_running_ctx_fetch()->ctx_caught) \
+        || ((e) = XBT_EX_T_CPLUSPLUSCAST __xbt_running_ctx_fetch()->exception, MAYDAY_CATCH(e) 0)) { \
     } \
     else
 
-#define DO_THROW(e) \
-     /* deal with the exception */                                             \
-     if (__xbt_ex_ctx()->ctx_mctx == NULL)                                     \
-       __xbt_ex_terminate((xbt_ex_t *)&(e)); /* not catched */\
-     else                                                                      \
-       __ex_mctx_restore(__xbt_ex_ctx()->ctx_mctx); /* catched somewhere */    \
-     abort()                    /* nope, stupid GCC, we won't survive a THROW (this won't be reached) */
+#define DO_THROW(running_ctx) \
+     /* deal with the exception */                                                     \
+     if (running_ctx->ctx_mctx == NULL)                                                \
+       __xbt_ex_terminate((xbt_ex_t*)&(running_ctx->exception)); /* not catched */     \
+     else                                                                              \
+       __ex_mctx_restore(running_ctx->ctx_mctx); /* catched somewhere */               \
+     abort()  /* nope, stupid GCC, we won't survive a THROW (this won't be reached) */
 
 /** @brief Helper macro for THROWS0-6
  *  @hideinitializer
@@ -425,24 +429,23 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e);
  */
 
 #define _THROW(c,v,m) \
-  do { /* change this sequence into one block */                          \
-     ex_ctx_t *_throw_ctx = __xbt_ex_ctx();                               \
-     /* build the exception */                                            \
-     _throw_ctx->ctx_ex.msg      = (m);                                   \
-     _throw_ctx->ctx_ex.category = (xbt_errcat_t)(c);                     \
-     _throw_ctx->ctx_ex.value    = (v);                                   \
-     _throw_ctx->ctx_ex.remote   = 0;                                     \
-     _throw_ctx->ctx_ex.host     = (char*)NULL;                           \
-     _throw_ctx->ctx_ex.procname = (char*)xbt_procname();                 \
-     _throw_ctx->ctx_ex.pid      = (*xbt_getpid)();                       \
-     _throw_ctx->ctx_ex.file     = (char*)__FILE__;                       \
-     _throw_ctx->ctx_ex.line     = __LINE__;                              \
-     _throw_ctx->ctx_ex.func     = (char*)_XBT_FUNCTION;                  \
-     _throw_ctx->ctx_ex.bt_strings = NULL;                                \
-     xbt_backtrace_current( (xbt_ex_t *) &(_throw_ctx->ctx_ex) );         \
-     DO_THROW(_throw_ctx->ctx_ex);                                        \
+  do { /* change this sequence into one block */                             \
+     xbt_running_ctx_t *_throw_ctx = __xbt_running_ctx_fetch();              \
+     /* build the exception */                                               \
+     _throw_ctx->exception.msg      = (m);                                   \
+     _throw_ctx->exception.category = (xbt_errcat_t)(c);                     \
+     _throw_ctx->exception.value    = (v);                                   \
+     _throw_ctx->exception.remote   = 0;                                     \
+     _throw_ctx->exception.host     = (char*)NULL;                           \
+     _throw_ctx->exception.procname = (char*)xbt_procname();                 \
+     _throw_ctx->exception.pid      = (*xbt_getpid)();                       \
+     _throw_ctx->exception.file     = (char*)__FILE__;                       \
+     _throw_ctx->exception.line     = __LINE__;                              \
+     _throw_ctx->exception.func     = (char*)_XBT_FUNCTION;                  \
+     _throw_ctx->exception.bt_strings = NULL;                                \
+     xbt_backtrace_current( (xbt_ex_t *) &(_throw_ctx->exception) );         \
+     DO_THROW(_throw_ctx);                                                   \
   } while (0)
-/*     __xbt_ex_ctx()->ctx_ex.used     = backtrace((void**)__xbt_ex_ctx()->ctx_ex.bt,XBT_BACKTRACE_SIZE); */
 
 /** @brief Builds and throws an exception with a string taking no arguments
     @hideinitializer */
@@ -483,10 +486,11 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e);
  */
 #define RETHROW \
   do { \
-   if (__xbt_ex_ctx()->ctx_mctx == NULL) \
-     __xbt_ex_terminate((xbt_ex_t *)&(__xbt_ex_ctx()->ctx_ex)); \
+   xbt_running_ctx_t *ctx = __xbt_running_ctx_fetch(); \
+   if (ctx->ctx_mctx == NULL) \
+     __xbt_ex_terminate((xbt_ex_t*)&(ctx->exception)); \
    else \
-     __ex_mctx_restore(__xbt_ex_ctx()->ctx_mctx); \
+     __ex_mctx_restore(ctx->ctx_mctx); \
    abort();\
   } while(0)
 
@@ -494,8 +498,8 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e);
 #ifndef DOXYGEN_SKIP
 #define _XBT_PRE_RETHROW \
   do {                                                               \
-    char *_xbt_ex_internal_msg = __xbt_ex_ctx()->ctx_ex.msg;         \
-    __xbt_ex_ctx()->ctx_ex.msg = bprintf(
+    char *_xbt_ex_internal_msg = __xbt_running_ctx_fetch()->exception.msg;         \
+    __xbt_running_ctx_fetch()->exception.msg = bprintf(
 #define _XBT_POST_RETHROW \
  _xbt_ex_internal_msg); \
     free(_xbt_ex_internal_msg);                                      \
diff --git a/include/xbt/threadpool.h b/include/xbt/threadpool.h
new file mode 100644 (file)
index 0000000..e941c9e
--- /dev/null
@@ -0,0 +1,46 @@
+/* A thread pool.                                          */
+
+/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _XBT_THREADPOOL_H
+#define _XBT_THREADPOOL_H
+
+#include "xbt/misc.h"           /* SG_BEGIN_DECL */
+#include "xbt/function_types.h"
+
+SG_BEGIN_DECL()
+
+/** @addtogroup XBT_threadpool
+  * @brief Pool of threads.
+  *
+  * Jobs can be queued and the dispacher process can wait for the completion
+  * of all jobs.
+  * The call to "queue job" is non-blocking except the maximum amount of
+  * queued jobs is reached. In that case, it will block until a job is taken
+  * by a worker
+  * @{
+  */
+  /** \brief Queue data type (opaque type) */
+
+typedef struct s_xbt_tpool *xbt_tpool_t;
+
+XBT_PUBLIC(xbt_tpool_t) xbt_tpool_new(unsigned int num_workers,
+                                      unsigned int max_jobs);
+
+XBT_PUBLIC(void) xbt_tpool_queue_job(xbt_tpool_t tpool, 
+                                     void_f_pvoid_t fun, 
+                                     void* fun_arg);
+
+XBT_PUBLIC(void) xbt_tpool_wait_all(xbt_tpool_t tpool);
+
+XBT_PUBLIC(void) xbt_tpool_destroy(xbt_tpool_t tpool);
+
+/** @} */
+
+SG_END_DECL()
+
+#endif
\ No newline at end of file
index 7682f08..96b2747 100644 (file)
@@ -558,11 +558,17 @@ static int create_environment(lua_State * L)
   const char *file = luaL_checkstring(L, 1);
   DEBUG1("Loading environment file %s", file);
   MSG_create_environment(file);
-  smx_host_t *hosts = SIMIX_host_get_table();
-  int i;
-  for (i = 0; i < SIMIX_host_get_number(); i++) {
-    DEBUG1("We have an host %s", SIMIX_host_get_name(hosts[i]));
+
+/*
+  xbt_dict_t hosts = SIMIX_host_get_dict();
+  smx_host_t host;
+  xbt_dict_cursor_t c;
+  const char *name;
+
+  xbt_dict_foreach(hosts, c, name, host) {
+    DEBUG1("We have an host %s", SIMIX_host_get_name(host));
   }
+*/
 
   return 0;
 }
index 61dc2fd..c2f794a 100644 (file)
@@ -189,23 +189,23 @@ void gras_msg_rpc_async_wait(gras_msg_cb_ctx_t ctx, void *answer)
     xbt_ex_t e;
     memcpy(&e, received.payl, received.payl_size);
     free(received.payl);
-    VERB3("Raise a remote exception cat:%d comming from %s (%s)",
+    VERB3("Raise a remote exception cat:%d coming from %s (%s)",
           e.category, e.host, e.msg);
-    __xbt_ex_ctx()->ctx_ex.msg = e.msg;
-    __xbt_ex_ctx()->ctx_ex.category = e.category;
-    __xbt_ex_ctx()->ctx_ex.value = e.value;
-    __xbt_ex_ctx()->ctx_ex.remote = 1;
-    __xbt_ex_ctx()->ctx_ex.host = e.host;
-    __xbt_ex_ctx()->ctx_ex.procname = e.procname;
-    __xbt_ex_ctx()->ctx_ex.pid = e.pid;
-    __xbt_ex_ctx()->ctx_ex.file = e.file;
-    __xbt_ex_ctx()->ctx_ex.line = e.line;
-    __xbt_ex_ctx()->ctx_ex.func = e.func;
-    __xbt_ex_ctx()->ctx_ex.used = e.used;
-    __xbt_ex_ctx()->ctx_ex.bt_strings = e.bt_strings;
-    memset(&__xbt_ex_ctx()->ctx_ex.bt, 0,
-           sizeof(__xbt_ex_ctx()->ctx_ex.bt));
-    DO_THROW(__xbt_ex_ctx()->ctx_ex);
+    __xbt_running_ctx_fetch()->exception.msg = e.msg;
+    __xbt_running_ctx_fetch()->exception.category = e.category;
+    __xbt_running_ctx_fetch()->exception.value = e.value;
+    __xbt_running_ctx_fetch()->exception.remote = 1;
+    __xbt_running_ctx_fetch()->exception.host = e.host;
+    __xbt_running_ctx_fetch()->exception.procname = e.procname;
+    __xbt_running_ctx_fetch()->exception.pid = e.pid;
+    __xbt_running_ctx_fetch()->exception.file = e.file;
+    __xbt_running_ctx_fetch()->exception.line = e.line;
+    __xbt_running_ctx_fetch()->exception.func = e.func;
+    __xbt_running_ctx_fetch()->exception.used = e.used;
+    __xbt_running_ctx_fetch()->exception.bt_strings = e.bt_strings;
+    memset(&__xbt_running_ctx_fetch()->exception.bt, 0,
+           sizeof(__xbt_running_ctx_fetch()->exception.bt));
+    DO_THROW(__xbt_running_ctx_fetch());
   }
   memcpy(answer, received.payl, received.payl_size);
   free(received.payl);
index a45a728..1f586f3 100644 (file)
@@ -41,11 +41,17 @@ int gras_socket_im_the_server(gras_socket_t sock) {
   smx_process_t server_listener_process=NULL;
   smx_process_t client_listener_process = NULL;
 
+  VERB4("Am I the server of socket %p (client = %p, server = %p) ? process self: %p", sock, sock_data->client, sock_data->server, SIMIX_process_self());
 
-  if (sock_data->server == SIMIX_process_self())
+  if (sock_data->server == SIMIX_process_self()) {
+    VERB0("I am the server");
     return 1;
-  if (sock_data->client == SIMIX_process_self())
+  }
+  if (sock_data->client == SIMIX_process_self()) {
+    VERB0("I am the client");
     return 0;
+  }
+  VERB0("I am neither the client nor the server, probably a listener");
 
   /* neither the client nor the server. Check their respective listeners */
   pd = ((gras_procdata_t*)SIMIX_process_get_data(sock_data->server));
@@ -53,8 +59,10 @@ int gras_socket_im_the_server(gras_socket_t sock) {
   if (l) {
     listener_thread = ((fake_gras_msg_listener_t)l)->listener;
     server_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
-    if (server_listener_process == SIMIX_process_self())
+    if (server_listener_process == SIMIX_process_self()) {
+      VERB0("I am the listener of the server");
       return 1;
+    }
   }
 
   if (sock_data->client) {
@@ -63,8 +71,10 @@ int gras_socket_im_the_server(gras_socket_t sock) {
     if (l) {
       listener_thread = ((fake_gras_msg_listener_t)l)->listener;
       client_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
-      if (client_listener_process == SIMIX_process_self())
+      if (client_listener_process == SIMIX_process_self()) {
+       VERB0("I am the listener of the client");
         return 0;
+      }
     }
   }
   /* THAT'S BAD! I should be either client or server of the sockets I get messages on!! */
@@ -90,10 +100,10 @@ gras_msg_t gras_msg_recv_any(void)
       (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
   gras_msg_t msg;
   /* Build a dynar of all communications I could get something from */
-  xbt_dynar_t comms = xbt_dynar_new(sizeof(smx_comm_t), NULL);
+  xbt_dynar_t comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
   unsigned int cursor = 0;
   int got = 0;
-  smx_comm_t comm = NULL;
+  smx_action_t comm = NULL;
   gras_socket_t sock = NULL;
   gras_trp_sg_sock_data_t sock_data;
   xbt_dynar_foreach(trp_proc->sockets, cursor, sock) {
@@ -142,8 +152,8 @@ gras_msg_t gras_msg_recv_any(void)
                 sock);
     /* End of paranoia */
 
-    VERB4("Consider receiving messages from on comm_recv %p (%s) rdv:%p (other rdv:%p)",
-          sock_data->comm_recv, sock_data->comm_recv->type == comm_send? "send":"recv",
+    VERB3("Consider receiving messages from on comm_recv %p rdv:%p (other rdv:%p)",
+          sock_data->comm_recv,
           gras_socket_im_the_server(sock)?
               sock_data->rdv_server : sock_data->rdv_client,
           gras_socket_im_the_server(sock)?
@@ -152,16 +162,16 @@ gras_msg_t gras_msg_recv_any(void)
   }
   VERB1("Wait on %ld 'sockets'", xbt_dynar_length(comms));
   /* Wait for the end of any of these communications */
-  got = SIMIX_network_waitany(comms);
+  got = SIMIX_req_comm_waitany(comms);
 
   /* retrieve the message sent in that communication */
   xbt_dynar_get_cpy(comms, got, &(comm));
-  msg = SIMIX_communication_get_data(comm);
+  msg = SIMIX_req_comm_get_data(comm);
   sock = xbt_dynar_get_as(trp_proc->sockets, got, gras_socket_t);
   sock_data = (gras_trp_sg_sock_data_t) sock->data;
   VERB3("Got something. Communication %p's over rdv_server=%p, rdv_client=%p",
       comm,sock_data->rdv_server,sock_data->rdv_client);
-  SIMIX_communication_destroy(comm);
+  SIMIX_req_comm_destroy(comm);
 
   /* Reinstall a waiting communication on that rdv */
 /*  xbt_dynar_foreach(trp_proc->sockets,cursor,sock) {
@@ -171,7 +181,7 @@ gras_msg_t gras_msg_recv_any(void)
   }
   */
   sock_data->comm_recv =
-      SIMIX_network_irecv(gras_socket_im_the_server(sock) ?
+      SIMIX_req_comm_irecv(gras_socket_im_the_server(sock) ?
                           sock_data->rdv_server : sock_data->rdv_client,
                           NULL, 0);
 
@@ -187,7 +197,7 @@ void gras_msg_send_ext(gras_socket_t sock,
   int whole_payload_size = 0;   /* msg->payload_size is used to memcpy the payload.
                                    This is used to report the load onto the simulator. It also counts the size of pointed stuff */
   gras_msg_t msg;               /* message to send */
-  smx_comm_t comm;
+  smx_action_t comm;
   gras_trp_sg_sock_data_t sock_data = (gras_trp_sg_sock_data_t) sock->data;
 
   smx_rdv_t target_rdv =
@@ -231,8 +241,8 @@ void gras_msg_send_ext(gras_socket_t sock,
                                                 payload, msg->payl);
   }
 
-  SIMIX_network_send(target_rdv, whole_payload_size, -1, -1, &msg,
-                     sizeof(void *), &comm, msg);
+  comm = SIMIX_req_comm_isend(target_rdv, whole_payload_size, -1, &msg, sizeof(void *), msg);
+  SIMIX_req_comm_wait(comm, -1);
 
   VERB0("Message sent (and received)");
 
index d6b3aac..e65d53d 100644 (file)
@@ -37,7 +37,7 @@ typedef struct {
     
   smx_rdv_t rdv_server; /* The rendez-vous point to use */
   smx_rdv_t rdv_client; /* The rendez-vous point to use */
-  smx_comm_t comm_recv; /* The comm of irecv on receiver side */
+  smx_action_t comm_recv; /* The comm of irecv on receiver side */
 } s_gras_trp_sg_sock_data_t,*gras_trp_sg_sock_data_t;
 
 In GRAS, there is a listener process, in charge of pumping everything
index 6079f08..9056dd1 100644 (file)
@@ -41,8 +41,8 @@ gras_socket_t gras_trp_select(double timeout)
   unsigned int cursor;
 
   DEBUG3("select on %s@%s with timeout=%f",
-         SIMIX_process_get_name(SIMIX_process_self()),
-         SIMIX_host_get_name(SIMIX_host_self()), timeout);
+         SIMIX_process_self_get_name(),
+         SIMIX_host_self_get_name(), timeout);
   if (timeout >= 0) {
     xbt_queue_shift_timed(pd->msg_selectable_sockets,
                           &active_socket, timeout);
@@ -70,7 +70,7 @@ gras_socket_t gras_trp_select(double timeout)
 
     if ((sock_data->to_socket == active_socket) &&
         (sock_data->to_host ==
-         SIMIX_process_get_host(active_socket_data->from_process))) {
+         SIMIX_req_process_get_host(active_socket_data->from_process))) {
       xbt_dynar_cursor_unlock(pd->sockets);
       return sock_iter;
     }
@@ -107,21 +107,21 @@ gras_socket_t gras_trp_select(double timeout)
   sockdata->to_socket = active_socket;
   /*update the peer to_socket  variable */
   active_socket_data->to_socket = res;
-  sockdata->cond = SIMIX_cond_init();
-  sockdata->mutex = SIMIX_mutex_init();
+  sockdata->cond = SIMIX_req_cond_init();
+  sockdata->mutex = SIMIX_req_mutex_init();
 
   sockdata->to_host =
-      SIMIX_process_get_host(active_socket_data->from_process);
+      SIMIX_req_process_get_host(active_socket_data->from_process);
 
   res->data = sockdata;
-  res->peer_name = strdup(SIMIX_host_get_name(sockdata->to_host));
+  res->peer_name = strdup(SIMIX_req_host_get_name(sockdata->to_host));
 
   gras_trp_buf_init_sock(res);
 
   DEBUG4("Create socket to process:%s(Port %d) from process: %s(Port %d)",
-         SIMIX_process_get_name(sockdata->from_process),
+         SIMIX_req_process_get_name(sockdata->from_process),
          res->peer_port,
-         SIMIX_process_get_name(sockdata->to_process), res->port);
+         SIMIX_req_process_get_name(sockdata->to_process), res->port);
 
   return res;
 }
index 5f419a5..af76cb1 100644 (file)
@@ -87,12 +87,13 @@ static int gras_trp_sg_peer_port(gras_socket_t s) {
   else
     return sockdata->server_port;
 }
+
 static const char* gras_trp_sg_peer_name(gras_socket_t s) {
   gras_trp_sg_sock_data_t sockdata = s->data;
   if (gras_socket_im_the_server(s))
-    return SIMIX_host_get_name(SIMIX_process_get_host(sockdata->client));
+    return SIMIX_host_get_name(SIMIX_req_process_get_host(sockdata->client));
   else {
-    return SIMIX_host_get_name(SIMIX_process_get_host(sockdata->server));
+    return SIMIX_host_get_name(SIMIX_req_process_get_host(sockdata->server));
   }
 }
 static const char* gras_trp_sg_peer_proc(gras_socket_t s) {
@@ -138,11 +139,11 @@ void gras_trp_sg_socket_client(gras_trp_plugin_t self,
   gras_sg_portrec_t pr;
 
   /* make sure this socket will reach someone */
-  if (!(peer = SIMIX_host_get_by_name(host)))
+  if (!(peer = SIMIX_req_host_get_by_name(host)))
     THROW1(mismatch_error, 0,
            "Can't connect to %s: no such host.\n", host);
 
-  if (!(hd = (gras_hostdata_t *) SIMIX_host_get_data(peer)))
+  if (!(hd = (gras_hostdata_t *) SIMIX_req_host_get_data(peer)))
     THROW1(mismatch_error, 0,
            "can't connect to %s: no process on this host",
            host);
@@ -178,15 +179,15 @@ void gras_trp_sg_socket_client(gras_trp_plugin_t self,
 
   /* initialize synchronization stuff on the socket */
   data->rdv_server = pr->rdv;
-  data->rdv_client = SIMIX_rdv_create(NULL);
-  data->comm_recv = SIMIX_network_irecv(data->rdv_client, NULL, 0);
+  data->rdv_client = SIMIX_req_rdv_create(NULL);
+  data->comm_recv = SIMIX_req_comm_irecv(data->rdv_client, NULL, 0);
 
   /* connect that simulation data to the socket */
   sock->data = data;
   sock->incoming = 1;
 
   DEBUG8("%s (PID %d) connects in %s mode to %s:%d (rdv_ser:%p, rdv_cli:%p, comm:%p)",
-         SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid(),
+         SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
          sock->meas ? "meas" : "regular", host, port,
          data->rdv_server,data->rdv_client,data->comm_recv);
 }
@@ -195,7 +196,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self, int port, gras_socket_t s
 {
 
   gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_get_data(SIMIX_host_self());
+      (gras_hostdata_t *) SIMIX_host_self_get_data();
   gras_sg_portrec_t pr;
   gras_trp_sg_sock_data_t data;
 
@@ -209,15 +210,15 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self, int port, gras_socket_t s
   if (pr)
     THROW2(mismatch_error, 0,
            "can't listen on address %s:%d: port already in use.",
-           SIMIX_host_get_name(SIMIX_host_self()), port);
+           SIMIX_host_self_get_name(), port);
 
   /* This port is free, let's take it */
   pr = xbt_new(s_gras_sg_portrec_t, 1);
   pr->port = port;
   pr->meas = sock->meas;
   pr->server = SIMIX_process_self();
-  pr->rdv = SIMIX_rdv_create(NULL);
   xbt_dynar_push(hd->ports, &pr);
+  pr->rdv = SIMIX_req_rdv_create(NULL);
 
   /* Create the socket */
   data = xbt_new0(s_gras_trp_sg_sock_data_t, 1);
@@ -226,14 +227,14 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self, int port, gras_socket_t s
   data->client = NULL;
   data->rdv_server = pr->rdv;
   data->rdv_client = NULL;
-  data->comm_recv = SIMIX_network_irecv(pr->rdv, NULL, 0);
+  data->comm_recv = SIMIX_req_comm_irecv(pr->rdv, NULL, 0);
 
   sock->data = data;
 
   VERB10
       ("'%s' (%d) ears on %s:%d%s (%p; data:%p); Here rdv: %p; Remote rdv: %p; Comm %p",
-       SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid(),
-       SIMIX_host_get_name(SIMIX_host_self()), port,
+       SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
+       SIMIX_host_self_get_name(), port,
        sock->meas ? " (mode meas)" : "", sock, data,
        (data->server ==
         SIMIX_process_self())? data->rdv_server : data->rdv_client,
@@ -246,7 +247,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self, int port, gras_socket_t s
 void gras_trp_sg_socket_close(gras_socket_t sock)
 {
   gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_get_data(SIMIX_host_self());
+      (gras_hostdata_t *) SIMIX_host_self_get_data();
   unsigned int cpt;
   gras_sg_portrec_t pr;
 
@@ -316,7 +317,7 @@ void gras_trp_sg_chunk_send_raw(gras_socket_t sock,
     smx_process_t remote_dude =
         (sock_data->server ==
          SIMIX_process_self())? (sock_data->client) : (sock_data->server);
-    smx_host_t remote_host = SIMIX_process_get_host(remote_dude);
+    smx_host_t remote_host = SIMIX_req_process_get_host(remote_dude);
   }
   */
   //SIMIX_network_send(sock_data->rdv,size,1,-1,NULL,0,NULL,NULL);
@@ -330,7 +331,7 @@ int gras_trp_sg_chunk_recv(gras_socket_t sock,
   //gras_trp_sg_sock_data_t *sock_data =
   //    (gras_trp_sg_sock_data_t *) sock->data;
 
-  //SIMIX_network_recv(sock_data->rdv,-1,NULL,0,NULL);
+  //SIMIX_req_comm_recv(sock_data->rdv,-1,NULL,0,NULL);
   THROW_UNIMPLEMENTED;
 #ifdef KILLME
   gras_trp_sg_sock_data_t *remote_sock_data;
@@ -356,18 +357,18 @@ int gras_trp_sg_chunk_recv(gras_socket_t sock,
   sock_data = (gras_trp_sg_sock_data_t *) sock->data;
 
   /* ok, I'm here, you can continue the communication */
-  SIMIX_cond_signal(remote_sock_data->cond);
+  SIMIX_req_cond_signal(remote_sock_data->cond);
 
-  SIMIX_mutex_lock(remote_sock_data->mutex);
+  SIMIX_req_mutex_lock(remote_sock_data->mutex);
   /* wait for communication end */
-  SIMIX_cond_wait(remote_sock_data->cond, remote_sock_data->mutex);
+  SIMIX_req_cond_wait(remote_sock_data->cond, remote_sock_data->mutex);
 
   if (msg_got->payl_size != size)
     THROW5(mismatch_error, 0,
            "Got %d bytes when %ld where expected (in %s->%s:%d)",
            msg_got->payl_size, size,
-           SIMIX_host_get_name(sock_data->to_host),
-           SIMIX_host_get_name(SIMIX_host_self()), sock->peer_port);
+           SIMIX_req_host_get_name(sock_data->to_host),
+           SIMIX_host_self_get_name(), sock->peer_port);
 
   if (data)
     memcpy(data, msg_got->payl, size);
@@ -376,7 +377,7 @@ int gras_trp_sg_chunk_recv(gras_socket_t sock,
     xbt_free(msg_got->payl);
 
   xbt_free(msg_got);
-  SIMIX_mutex_unlock(remote_sock_data->mutex);
+  SIMIX_req_mutex_unlock(remote_sock_data->mutex);
 #endif
   return 0;
 }
index 33d37c0..20d26ed 100644 (file)
@@ -116,7 +116,7 @@ void gras_agent_spawn(const char *name,
   args->argc=argc;
   args->argv=argv;
   args->code=code;
-  xbt_os_thread_create(name,spawner_wrapper,args);
+  xbt_os_thread_create(name,spawner_wrapper,args, NULL);
 }
 
 /* **************************************************************************
index 9269b0e..cf15311 100644 (file)
 
 const char *gras_os_myname(void)
 {
-  smx_host_t host;
-  smx_process_t process = SIMIX_process_self();
-
-  /*HACK: maestro used not have a simix process, now it does so 
-     SIMIX_process_self will return something different to NULL. This breaks
-     the old xbt_log logic that assumed that NULL was equivalent to maestro,
-     thus when printing it searches for maestro host name (which doesn't exists)
-     and breaks the logging.
-     As a hack we check for maestro by looking to the assigned host, if it is
-     NULL then we are sure is maestro
-   */
-  if (process != NULL && (host = SIMIX_host_self()) != NULL)
-    return SIMIX_host_get_name(host);
-
-  return "";
+  return SIMIX_host_self_get_name();
 }
index 4734db0..62be7c2 100644 (file)
@@ -20,26 +20,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_virtu_emul, gras_virtu,
 /*** CPU burning */
 void gras_cpu_burn(double flops)
 {
-  smx_action_t act;
-  smx_cond_t cond;
-  smx_mutex_t mutex;
+  smx_action_t execution;
 
-  if (flops > 0) {
-    cond = SIMIX_cond_init();
-    mutex = SIMIX_mutex_init();
-
-    SIMIX_mutex_lock(mutex);
-    act = SIMIX_action_execute(SIMIX_host_self(), "task", flops);
-
-    SIMIX_register_action_to_condition(act, cond);
-    SIMIX_cond_wait(cond, mutex);
-    SIMIX_unregister_action_to_condition(act, cond);
-
-    SIMIX_action_destroy(act);
-    SIMIX_mutex_unlock(mutex);
-
-    SIMIX_cond_destroy(cond);
-    SIMIX_mutex_destroy(mutex);
+  if (flops > 0){
+    execution = SIMIX_req_host_execute("task", SIMIX_host_self(), flops);
+    SIMIX_req_host_execution_wait(execution);
   }
 }
 
index 2e2ed98..d16c067 100644 (file)
@@ -27,8 +27,8 @@ void gras_agent_spawn(const char *name,
                       xbt_dict_t properties)
 {
 
-  SIMIX_process_create(name, code, NULL,
-                       gras_os_myname(), argc, argv, properties);
+  SIMIX_req_process_create(name, code, NULL,
+                           gras_os_myname(), argc, argv, properties);
 }
 
 /* **************************************************************************
@@ -38,27 +38,26 @@ void gras_agent_spawn(const char *name,
 void gras_process_init()
 {
   gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_get_data(SIMIX_host_self());
+      (gras_hostdata_t *) SIMIX_host_self_get_data();
   gras_procdata_t *pd = xbt_new0(gras_procdata_t, 1);
   gras_trp_procdata_t trp_pd;
-
-  SIMIX_process_set_data(SIMIX_process_self(), (void *) pd);
-
-
-  gras_procdata_init();
+  long int pid = PID++; /* make sure the first process gets the first id */
 
   if (!hd) {
-    /* First process on this host */
+    /* First process on this host (FIXME: does not work if the SIMIX user contexts are truly parallel) */
     hd = xbt_new(gras_hostdata_t, 1);
     hd->refcount = 1;
     hd->ports = xbt_dynar_new(sizeof(gras_sg_portrec_t), NULL);
-    SIMIX_host_set_data(SIMIX_host_self(), (void *) hd);
+    SIMIX_host_self_set_data((void *) hd);
   } else {
     hd->refcount++;
   }
 
+  SIMIX_process_self_set_data((void *) pd);
+  gras_procdata_init();
+
   trp_pd = (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
-  pd->pid = PID++;
+  pd->pid = pid;
 
   if (SIMIX_process_self() != NULL) {
     pd->ppid = gras_os_getpid();
@@ -70,8 +69,8 @@ void gras_process_init()
   trp_pd->meas_selectable_sockets =
       xbt_queue_new(0, sizeof(gras_socket_t));
 
-  VERB2("Creating process '%s' (%d)",
-        SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid());
+  VERB2("Creating process '%s' (%d)", SIMIX_process_self_get_name(),
+      gras_os_getpid());
 }
 
 void gras_process_exit()
@@ -81,9 +80,9 @@ void gras_process_exit()
   gras_socket_t sock_iter;
   unsigned int cursor;
   gras_hostdata_t *hd =
-      (gras_hostdata_t *) SIMIX_host_get_data(SIMIX_host_self());
+      (gras_hostdata_t *) SIMIX_host_self_get_data();
   gras_procdata_t *pd =
-      (gras_procdata_t *) SIMIX_process_get_data(SIMIX_process_self());
+      (gras_procdata_t *) SIMIX_req_process_get_data(SIMIX_process_self());
 
   gras_msg_procdata_t msg_pd =
       (gras_msg_procdata_t) gras_libdata_by_name("gras_msg");
@@ -98,7 +97,7 @@ void gras_process_exit()
   xbt_assert0(hd, "Run gras_process_init (ie, gras_init)!!");
 
   VERB2("GRAS: Finalizing process '%s' (%d)",
-        SIMIX_process_get_name(SIMIX_process_self()), gras_os_getpid());
+        SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid());
 
   if (xbt_dynar_length(msg_pd->msg_queue)) {
     unsigned int cpt;
@@ -137,7 +136,7 @@ void gras_process_exit()
 gras_procdata_t *gras_procdata_get(void)
 {
   gras_procdata_t *pd =
-      (gras_procdata_t *) SIMIX_process_get_data(SIMIX_process_self());
+      (gras_procdata_t *) SIMIX_req_process_get_data(SIMIX_process_self());
 
   xbt_assert0(pd, "Run gras_process_init! (ie, gras_init)");
 
@@ -146,12 +145,12 @@ gras_procdata_t *gras_procdata_get(void)
 
 void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p)
 {
-  gras_procdata_t *pd = (gras_procdata_t *) SIMIX_process_get_data(p);
+  gras_procdata_t *pd = (gras_procdata_t *) SIMIX_req_process_get_data(p);
 
   xbt_assert2(pd,
               "process '%s' on '%s' didn't run gras_process_init! (ie, gras_init)",
-              SIMIX_process_get_name(p),
-              SIMIX_host_get_name(SIMIX_process_get_host(p)));
+              SIMIX_req_process_get_name(p),
+              SIMIX_req_host_get_name(SIMIX_req_process_get_host(p)));
 
   return gras_libdata_by_name_from_procdata(name, pd);
 }
@@ -159,9 +158,8 @@ void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p)
 /** @brief retrieve the value of a given process property (or NULL if not defined) */
 const char *gras_process_property_value(const char *name)
 {
-  return xbt_dict_get_or_null(
-               SIMIX_process_get_properties(SIMIX_process_self()), 
-                                            name);
+  return xbt_dict_get_or_null(SIMIX_req_process_get_properties
+                             (SIMIX_process_self()), name);
 }
 
 /** @brief retrieve the process properties dictionnary
@@ -169,40 +167,20 @@ const char *gras_process_property_value(const char *name)
  */
 xbt_dict_t gras_process_properties(void)
 {
-  return SIMIX_process_get_properties(SIMIX_process_self());
+  return SIMIX_req_process_get_properties(SIMIX_process_self());
 }
 
 /* **************************************************************************
  * OS virtualization function
  * **************************************************************************/
 
-const char *xbt_procname(void)
-{
-  smx_process_t process = SIMIX_process_self();
-  /*FIXME: maestro used not have a simix process, now it does so 
-     SIMIX_process_self will return something different to NULL. This breaks
-     the old xbt_log logic that assumed that NULL was equivalent to maestro,
-     thus when printing it searches for maestro host name (which doesn't exists)
-     and breaks the logging.
-     As a hack we check for maestro by looking to the assigned host, if it is
-     NULL then we are sure is maestro
-   */
-  if (process != NULL && SIMIX_process_get_host(process))
-    return SIMIX_process_get_name(process);
-
-  return "";
-}
 
 int gras_os_getpid(void)
 {
   gras_procdata_t *data;
-  smx_process_t process = SIMIX_process_self();
-
-  if (process != NULL) {
-    data = (gras_procdata_t *) SIMIX_process_get_data(process);
-    if (data != NULL)
-      return data->pid;
-  }
+  data = (gras_procdata_t *) SIMIX_process_self_get_data();
+  if (data != NULL)
+    return data->pid;
 
   return 0;
 }
@@ -211,8 +189,8 @@ int gras_os_getpid(void)
 const char *gras_os_host_property_value(const char *name)
 {
   return
-      xbt_dict_get_or_null(SIMIX_host_get_properties
-                           (SIMIX_process_get_host(SIMIX_process_self())),
+      xbt_dict_get_or_null(SIMIX_req_host_get_properties
+                           (SIMIX_req_process_get_host(SIMIX_process_self())),
                            name);
 }
 
@@ -222,7 +200,7 @@ const char *gras_os_host_property_value(const char *name)
 xbt_dict_t gras_os_host_properties(void)
 {
   return
-      SIMIX_host_get_properties(SIMIX_process_get_host
+      SIMIX_req_host_get_properties(SIMIX_req_process_get_host
                                 (SIMIX_process_self()));
 }
 
@@ -260,9 +238,7 @@ void gras_main()
   /* Clean IO before the run */
   fflush(stdout);
   fflush(stderr);
-  SIMIX_init();
-
-  while (SIMIX_solve(NULL, NULL) != -1.0);
+  SIMIX_run();
 
   return;
 }
index 1ff489f..70f7c10 100644 (file)
@@ -36,7 +36,7 @@ typedef struct {
 
   smx_rdv_t rdv_server;         /* The rendez-vous point to use */
   smx_rdv_t rdv_client;         /* The rendez-vous point to use */
-  smx_comm_t comm_recv;         /* The comm of irecv on receiver side */
+  smx_action_t comm_recv;         /* The comm of irecv on receiver side */
 
   int server_port;
   int client_port;
index 9e826f7..dedb373 100644 (file)
@@ -70,7 +70,7 @@ XBT_LOG_EXTERNAL_CATEGORY(gras_virtu_process);
 
 void gras_init(int *argc, char **argv)
 {
-
+  int first = 0;
   gras_procdata_t *pd;
   gras_msg_procdata_t msg_pd;
   VERB0("Initialize GRAS");
@@ -83,6 +83,7 @@ void gras_init(int *argc, char **argv)
    *    - declare process specific data we need (without creating them)
    */
   if (gras_running_process == 0) {
+    first = 1;
     /* Connect our log channels: that must be done manually under windows */
     XBT_LOG_CONNECT(gras_ddt, gras);
     XBT_LOG_CONNECT(gras_ddt_cbps, gras_ddt);
@@ -110,6 +111,7 @@ void gras_init(int *argc, char **argv)
     gras_trp_register();
     gras_msg_register();
   }
+  gras_running_process++;
 
   /*
    * Initialize the process specific stuff
@@ -119,7 +121,7 @@ void gras_init(int *argc, char **argv)
   /*
    * Initialize the global stuff if it's not the first process created
    */
-  if (gras_running_process++ == 0) {
+  if (first) {
     gras_emul_init();
     gras_msg_init();
     gras_trp_init();
index 1d9f521..bdc16bd 100644 (file)
 SG_BEGIN_DECL()
 
 /********************************* Global *************************************/
-XBT_PUBLIC(void) MC_init(int);
-XBT_PUBLIC(void) MC_exit(int);
+XBT_PUBLIC(void) MC_init(void);
+XBT_PUBLIC(void) MC_exit(void);
 XBT_PUBLIC(void) MC_assert(int);
-XBT_PUBLIC(void) MC_modelcheck(int);
+XBT_PUBLIC(void) MC_modelcheck(void);
 XBT_PUBLIC(int) MC_random(int, int);
 
-/******************************* Transitions **********************************/
-XBT_PUBLIC(void) MC_trans_intercept_isend(smx_rdv_t);
-XBT_PUBLIC(void) MC_trans_intercept_irecv(smx_rdv_t);
-XBT_PUBLIC(void) MC_trans_intercept_wait(smx_comm_t);
-XBT_PUBLIC(void) MC_trans_intercept_test(smx_comm_t);
-XBT_PUBLIC(void) MC_trans_intercept_waitany(xbt_dynar_t);
-XBT_PUBLIC(void) MC_trans_intercept_random(int, int);
-
 /********************************* Memory *************************************/
 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
 XBT_PUBLIC(void) MC_memory_exit(void);
index 4d5b8d6..be146fe 100644 (file)
 SG_BEGIN_DECL()
 
 typedef struct s_xbt_context *xbt_context_t;
+typedef void (*void_pfn_smxprocess_t) (smx_process_t);
+
 
 XBT_PUBLIC(xbt_context_t) xbt_context_new(const char *name,
                                           xbt_main_func_t code,
                                           void_f_pvoid_t startup_func,
                                           void *startup_arg,
-                                          void_f_pvoid_t cleanup_func,
-                                          void *cleanup_arg, int argc,
-                                          char *argv[]);
+                                          void_pfn_smxprocess_t cleanup_func,
+                                          smx_process_t process,
+                                          int argc, char *argv[]);
 
 XBT_PUBLIC(void) xbt_context_kill(xbt_context_t context);
 
index fde4f6f..1064d27 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_DATATYPE_H
-#define SIMIX_DATATYPE_H
+#ifndef _SIMIX_DATATYPES_H
+#define _SIMIX_DATATYPES_H
 #include "xbt/misc.h"
 #include "xbt/swag.h"
 #include "xbt/fifo.h"
@@ -27,32 +27,34 @@ SG_BEGIN_DECL()
     \see m_host_management
   @{ */
 typedef struct s_smx_host *smx_host_t;
+typedef enum {
+  SIMIX_WAITING,
+  SIMIX_READY,
+  SIMIX_RUNNING,
+  SIMIX_DONE,
+  SIMIX_CANCELED,
+  SIMIX_FAILED,
+  SIMIX_SRC_HOST_FAILURE,
+  SIMIX_DST_HOST_FAILURE,
+  SIMIX_SRC_TIMEOUT,
+  SIMIX_DST_TIMEOUT,
+  SIMIX_LINK_FAILURE,
+} e_smx_state_t;
 /** @} */
 
 
-/* ******************************** Syncro ************************************ */
-typedef struct s_smx_mutex {
-  xbt_swag_t sleeping;          /* list of sleeping process */
-  int refcount;
-} s_smx_mutex_t;
-typedef s_smx_mutex_t *smx_mutex_t;
+typedef struct s_smx_timer* smx_timer_t;
 
-typedef struct s_smx_cond {
-  xbt_swag_t sleeping;          /* list of sleeping process */
-  smx_mutex_t mutex;
-  xbt_fifo_t actions;           /* list of actions */
-} s_smx_cond_t;
-typedef s_smx_cond_t *smx_cond_t;
 
-typedef struct s_smx_sem {
-  xbt_fifo_t sleeping;          /* list of sleeping process */
-  int capacity;
-  xbt_fifo_t actions;           /* list of actions */
-} s_smx_sem_t;
-typedef s_smx_sem_t *smx_sem_t;
+/* ******************************** Synchro ************************************ */
+typedef struct s_smx_mutex *smx_mutex_t;
+typedef struct s_smx_cond *smx_cond_t;
+typedef struct s_smx_sem *smx_sem_t;
 
 /********************************** Action *************************************/
-typedef struct s_smx_action *smx_action_t;
+typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
+
+
 
 /* ****************************** Process *********************************** */
 /** @brief Agent datatype  
@@ -67,13 +69,25 @@ typedef struct s_smx_process *smx_process_t;
 
 typedef struct s_smx_context *smx_context_t;
 
+/* User create and kill process, the function must accept the folling parameters:
+ * const char *name: a name for the object. It is for user-level information and can be NULL
+ * xbt_main_func_t code: is a function describing the behavior of the agent
+ * void *data: data a pointer to any data one may want to attach to the new object.
+ * smx_host_t host: the location where the new agent is executed
+ * int argc, char **argv: parameters passed to code
+ *
+ * */
+typedef void *(*smx_creation_func_t) ( /*name */ const char *,
+                                      /*code */ xbt_main_func_t,
+                                      /*userdata */ void *,
+                                      /*hostname */ char *,
+                                      /* argc */ int,
+                                      /* argv */ char **,
+                                      /* props */ xbt_dict_t);
+
+
 /******************************* Networking ***********************************/
 typedef struct s_smx_rvpoint *smx_rdv_t;
-typedef struct s_smx_comm *smx_comm_t;
-typedef enum { comm_send,
-  comm_recv
-} smx_comm_type_t;
-
 
 
 SG_END_DECL()
index 25fc374..a35d716 100644 (file)
 
 SG_BEGIN_DECL()
 
-
-/************************** Global ******************************************/
+/********************************** Global ************************************/
+/* Initialization and exit */
 XBT_PUBLIC(void) SIMIX_global_init(int *argc, char **argv);
 XBT_PUBLIC(void) SIMIX_clean(void);
-XBT_PUBLIC(void) SIMIX_function_register(const char *name,
-                                         xbt_main_func_t code);
-XBT_PUBLIC(void) SIMIX_function_register_default(xbt_main_func_t code);
-XBT_PUBLIC(xbt_main_func_t) SIMIX_get_registered_function(const char
-                                                          *name);
-
-XBT_PUBLIC(void) SIMIX_launch_application(const char *file);
 
-/*
- *  Deployment (Bypass the parser)
- */
-XBT_PUBLIC(void) SIMIX_process_set_function(const char *process_host,
-                                            const char *process_function,
-                                            xbt_dynar_t arguments,
-                                            double process_start_time,
-                                            double process_kill_time);
+/* Process creation/destruction callbacks */
+typedef void (*void_pfn_smxprocess_t) (smx_process_t);
 
+XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function);
+XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function);
+XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t function);
 
-XBT_PUBLIC(double) SIMIX_get_clock(void);
-XBT_PUBLIC(void) SIMIX_init(void);
-XBT_PUBLIC(double) SIMIX_solve(xbt_fifo_t actions_done,
-                               xbt_fifo_t actions_failed);
+/* Simulation execution */
+XBT_PUBLIC(void) SIMIX_run(void);    
 
-/* Timer functions */
+/* Timer functions FIXME: should these be public? */
 XBT_PUBLIC(void) SIMIX_timer_set(double date, void *function, void *arg);
-XBT_PUBLIC(int) SIMIX_timer_get(void **function, void **arg);
-
-/* only for tests */
-XBT_PUBLIC(void) __SIMIX_main(void);
-
-/* User create and kill process, the function must accept the folling parameters:
- * const char *name: a name for the object. It is for user-level information and can be NULL
- * xbt_main_func_t code: is a function describing the behavior of the agent
- * void *data: data a pointer to any data one may want to attach to the new object.
- * smx_host_t host: the location where the new agent is executed
- * int argc, char **argv: parameters passed to code
- *
- * */
-typedef void *(*smx_creation_func_t) ( /*name */ const char *,
-                                      /*code */ xbt_main_func_t,
-                                      /*userdata */ void *,
-                                      /*hostname */ char *,
-                                      /* argc */ int,
-                                      /* argv */ char **,
-                                      /* props */ xbt_dict_t);
-XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t
-                                                        function);
-XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t
-                                                      function);
-XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_f_pvoid_t
-                                                         function);
-
-/************************** Host handling ***********************************/
-
-XBT_PUBLIC(void) SIMIX_host_set_data(smx_host_t host, void *data);
-XBT_PUBLIC(void *) SIMIX_host_get_data(smx_host_t host);
-
-XBT_PUBLIC(const char *) SIMIX_host_get_name(smx_host_t host);
-XBT_PUBLIC(void) SIMIX_process_set_name(smx_process_t process, char *name);
-XBT_PUBLIC(smx_host_t) SIMIX_host_self(void);
-XBT_PUBLIC(double) SIMIX_host_get_speed(smx_host_t host);
-XBT_PUBLIC(double) SIMIX_host_get_available_speed(smx_host_t host);
+XBT_PUBLIC(double) SIMIX_timer_next(void);
 
-XBT_PUBLIC(int) SIMIX_host_get_number(void);
-XBT_PUBLIC(smx_host_t *) SIMIX_host_get_table(void);
-XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_dict(void);
+XBT_PUBLIC(void) SIMIX_display_process_status(void);
 
+/******************************* Environment **********************************/
 XBT_PUBLIC(void) SIMIX_create_environment(const char *file);
-XBT_INLINE XBT_PUBLIC(smx_host_t) SIMIX_host_get_by_name(const char *name);
 
-XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_properties(smx_host_t host);
+/******************************** Deployment **********************************/
 
-/* Two possible states, 1 - CPU ON and 0 CPU OFF */
-XBT_PUBLIC(int) SIMIX_host_get_state(smx_host_t host);
+XBT_PUBLIC(void) SIMIX_function_register(const char *name, xbt_main_func_t code);
+XBT_PUBLIC(void) SIMIX_function_register_default(xbt_main_func_t code);
+XBT_PUBLIC(xbt_main_func_t) SIMIX_get_registered_function(const char *name);
+XBT_PUBLIC(void) SIMIX_launch_application(const char *file);
+XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host,
+                                            const char *process_function,
+                                            xbt_dynar_t arguments,
+                                            double process_start_time,
+                                            double process_kill_time);
+
+/*********************************** Host *************************************/
+XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_dict(void);
+XBT_PUBLIC(smx_host_t) SIMIX_host_get_by_name(const char *name);
+XBT_PUBLIC(smx_host_t) SIMIX_host_self(void);
+XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
+XBT_PUBLIC(const char*) SIMIX_host_get_name(smx_host_t host); /* FIXME: make private: only the name of SIMIX_host_self() should be public without request */
+XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
+XBT_PUBLIC(void*) SIMIX_host_self_get_data(void);
 
-/************************** Process handling *********************************/
+/********************************* Process ************************************/
+XBT_PUBLIC(void) SIMIX_process_cleanup(smx_process_t arg);
+XBT_PUBLIC(int) SIMIX_process_count(void);
+XBT_PUBLIC(smx_process_t) SIMIX_process_self(void);
+XBT_PUBLIC(const char*) SIMIX_process_self_get_name(void);
+XBT_PUBLIC(void) SIMIX_process_self_set_data(void *data);
+XBT_PUBLIC(void*) SIMIX_process_self_get_data(void);
 XBT_PUBLIC(smx_process_t) SIMIX_process_create(const char *name,
+                                               xbt_main_func_t code,
+                                                                      void *data,
+                                                                      const char *hostname,
+                                                                      int argc, char **argv,
+                                                                      xbt_dict_t properties);
+
+/****************************** Communication *********************************/
+XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_action_t, size_t));
+XBT_PUBLIC(void) SIMIX_comm_copy_pointer_callback(smx_action_t comm, size_t buff_size);
+XBT_PUBLIC(void) SIMIX_comm_copy_buffer_callback(smx_action_t comm, size_t buff_size);
+
+/******************************************************************************/
+/*                        SIMIX Smurf Proxy Functions                         */
+/******************************************************************************/
+/* These functions issue request through the Smurf proxy.                     */
+/* They cannot be called from maestro's context, and they are thread safe.    */
+/******************************************************************************/
+
+XBT_PUBLIC(double) SIMIX_get_clock(void);
+
+/******************************* Host Requests ********************************/
+/* FIXME: use handlers and keep smx_host_t hidden from higher levels */
+XBT_PUBLIC(xbt_dict_t) SIMIX_req_host_get_dict(void);
+XBT_INLINE XBT_PUBLIC(smx_host_t) SIMIX_req_host_get_by_name(const char *name);
+XBT_PUBLIC(const char *) SIMIX_req_host_get_name(smx_host_t host);
+XBT_PUBLIC(xbt_dict_t) SIMIX_req_host_get_properties(smx_host_t host);
+XBT_PUBLIC(double) SIMIX_req_host_get_speed(smx_host_t host);
+XBT_PUBLIC(double) SIMIX_req_host_get_available_speed(smx_host_t host);
+/* Two possible states, 1 - CPU ON and 0 CPU OFF */
+XBT_PUBLIC(int) SIMIX_req_host_get_state(smx_host_t host);
+XBT_PUBLIC(void *) SIMIX_req_host_get_data(smx_host_t host);
+
+XBT_PUBLIC(void) SIMIX_req_host_set_data(smx_host_t host, void *data);
+
+XBT_PUBLIC(smx_action_t) SIMIX_req_host_execute(const char *name, smx_host_t host,
+                                            double computation_amount);
+XBT_PUBLIC(smx_action_t) SIMIX_req_host_parallel_execute(const char *name,
+                                                     int host_nb,
+                                                     smx_host_t *host_list,
+                                                     double *computation_amount,
+                                                     double *communication_amount,
+                                                     double amount,
+                                                     double rate);
+XBT_PUBLIC(void) SIMIX_req_host_execution_destroy(smx_action_t execution);
+XBT_PUBLIC(void) SIMIX_req_host_execution_cancel(smx_action_t execution);
+XBT_PUBLIC(double) SIMIX_req_host_execution_get_remains(smx_action_t execution);
+XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_get_state(smx_action_t execution);
+XBT_PUBLIC(void) SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority);
+XBT_PUBLIC(void) SIMIX_req_host_execution_wait(smx_action_t execution);
+
+
+/**************************** Process Requests ********************************/
+/* Constructor and Destructor */
+XBT_PUBLIC(smx_process_t) SIMIX_req_process_create(const char *name,
                                                xbt_main_func_t code,
                                                void *data,
                                                const char *hostname,
                                                int argc, char **argv,
                                                xbt_dict_t properties);
 
-XBT_PUBLIC(void) SIMIX_process_kill(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_cleanup(void *arg);
-XBT_PUBLIC(void) SIMIX_process_killall(void);
-XBT_PUBLIC(void) SIMIX_process_change_host(smx_process_t process,
-                                           char *source, char *dest);
-
-//above layer
-XBT_PUBLIC(void *) SIMIX_process_get_data(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_set_data(smx_process_t process, void *data);
-
-XBT_INLINE XBT_PUBLIC(smx_host_t) SIMIX_process_get_host(smx_process_t
-                                                         process);
-XBT_PUBLIC(const char *) SIMIX_process_get_name(smx_process_t process);
-XBT_INLINE XBT_PUBLIC(smx_process_t) SIMIX_process_self(void);
-
-XBT_PUBLIC(void) SIMIX_process_yield(void);
-XBT_PUBLIC(void) SIMIX_process_suspend(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_resume(smx_process_t process);
-XBT_PUBLIC(int) SIMIX_process_is_suspended(smx_process_t process);
-XBT_PUBLIC(int) SIMIX_process_is_blocked(smx_process_t process);
-
-/*property handlers*/
-XBT_PUBLIC(xbt_dict_t) SIMIX_process_get_properties(smx_process_t host);
-XBT_PUBLIC(int) SIMIX_process_count(void);
+XBT_PUBLIC(void) SIMIX_req_process_kill(smx_process_t process);
+
+/* Process handling */
+XBT_PUBLIC(void) SIMIX_req_process_cleanup(void *arg); /* FIXME: This function shouldn't be called from outside SIMIX */
+XBT_PUBLIC(void) SIMIX_req_process_change_host(smx_process_t process,
+                                           const char *source, const char *dest);
+XBT_PUBLIC(void) SIMIX_req_process_suspend(smx_process_t process);
+XBT_PUBLIC(void) SIMIX_req_process_resume(smx_process_t process);
+
+/* Getters and Setters */
+XBT_PUBLIC(int) SIMIX_req_process_count(void);
+XBT_PUBLIC(void *) SIMIX_req_process_get_data(smx_process_t process);
+XBT_PUBLIC(void) SIMIX_req_process_set_data(smx_process_t process, void *data);
+XBT_INLINE XBT_PUBLIC(smx_host_t) SIMIX_req_process_get_host(smx_process_t process);
+XBT_PUBLIC(const char *) SIMIX_req_process_get_name(smx_process_t process);
+XBT_PUBLIC(int) SIMIX_req_process_is_suspended(smx_process_t process);
+XBT_PUBLIC(xbt_dict_t) SIMIX_req_process_get_properties(smx_process_t host);
+
+/* Sleep control */
+XBT_PUBLIC(e_smx_state_t) SIMIX_req_process_sleep(double duration);
+
+/************************** Comunication Requests *****************************/
+/***** Rendez-vous points *****/
+XBT_PUBLIC(smx_rdv_t) SIMIX_req_rdv_create(const char *name);
+XBT_PUBLIC(void) SIMIX_req_rdv_destroy(smx_rdv_t rvp);
+XBT_PUBLIC(smx_rdv_t) SIMIX_req_rdv_get_by_name(const char *name);
+XBT_PUBLIC(int) SIMIX_req_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host);
+XBT_PUBLIC(smx_action_t) SIMIX_req_rdv_get_head(smx_rdv_t rdv);
+
+/***** Communication Requests *****/
+
+/* Constructors and Destructor */
+XBT_PUBLIC(smx_action_t) SIMIX_req_comm_isend(smx_rdv_t rdv, double task_size,
+                                           double rate, void *src_buff,
+                                           size_t src_buff_size,
+                                           void *data);
+
+XBT_PUBLIC(smx_action_t) SIMIX_req_comm_irecv(smx_rdv_t rdv, void *dst_buff,
+                                           size_t * dst_buff_size);
+
+XBT_PUBLIC(void) SIMIX_req_comm_destroy(smx_action_t comm);
+
+/* Communication handling */
+XBT_INLINE XBT_PUBLIC(void) SIMIX_req_comm_cancel(smx_action_t comm);
+
+/* FIXME: waitany is going to be a vararg function, and should take a timeout */
+XBT_PUBLIC(unsigned int) SIMIX_req_comm_waitany(xbt_dynar_t comms);
+XBT_PUBLIC(void) SIMIX_req_comm_wait(smx_action_t comm, double timeout);
+XBT_PUBLIC(int) SIMIX_req_comm_test(smx_action_t comm);
+
+/* Getters and setters */
+XBT_PUBLIC(double) SIMIX_req_comm_get_remains(smx_action_t comm);
+XBT_PUBLIC(e_smx_state_t) SIMIX_req_comm_get_state(smx_action_t comm);
+XBT_PUBLIC(void *) SIMIX_req_comm_get_data(smx_action_t comm);
+XBT_PUBLIC(void *) SIMIX_req_comm_get_src_buff(smx_action_t comm);
+XBT_PUBLIC(void *) SIMIX_req_comm_get_dst_buff(smx_action_t comm);
+XBT_PUBLIC(size_t) SIMIX_req_comm_get_src_buff_size(smx_action_t comm);
+XBT_PUBLIC(size_t) SIMIX_req_comm_get_dst_buff_size(smx_action_t comm);
+XBT_PUBLIC(smx_process_t) SIMIX_req_comm_get_src_proc(smx_action_t comm);
+XBT_PUBLIC(smx_process_t) SIMIX_req_comm_get_dst_proc(smx_action_t comm);
+XBT_PUBLIC(void) SIMIX_req_comm_set_copy_data_callback(void (*callback)(smx_action_t,size_t));
+XBT_PUBLIC(void) SIMIX_req_comm_copy_pointer_callback(smx_action_t comm, size_t buff_size);
+XBT_PUBLIC(void) SIMIX_req_comm_copy_buffer_callback(smx_action_t comm, size_t buff_size);
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+XBT_PUBLIC(int) SIMIX_req_comm_is_latency_bounded(smx_action_t comm);
+#endif
 
 /************************** Synchro handling **********************************/
 
-/******Mutex******/
-XBT_PUBLIC(smx_mutex_t) SIMIX_mutex_init(void);
-XBT_PUBLIC(void) SIMIX_mutex_lock(smx_mutex_t mutex);
-XBT_PUBLIC(int) SIMIX_mutex_trylock(smx_mutex_t mutex);
-XBT_PUBLIC(void) SIMIX_mutex_unlock(smx_mutex_t mutex);
-XBT_PUBLIC(void) SIMIX_mutex_destroy(smx_mutex_t mutex);
-
-/*****Conditional*****/
-XBT_PUBLIC(smx_cond_t) SIMIX_cond_init(void);
-XBT_PUBLIC(void) SIMIX_cond_signal(smx_cond_t cond);
-XBT_PUBLIC(void) SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
-XBT_PUBLIC(void) SIMIX_cond_wait_timeout(smx_cond_t cond,
+XBT_PUBLIC(smx_mutex_t) SIMIX_req_mutex_init(void);
+XBT_PUBLIC(void) SIMIX_req_mutex_destroy(smx_mutex_t mutex);
+XBT_PUBLIC(void) SIMIX_req_mutex_lock(smx_mutex_t mutex);
+XBT_PUBLIC(int) SIMIX_req_mutex_trylock(smx_mutex_t mutex);
+XBT_PUBLIC(void) SIMIX_req_mutex_unlock(smx_mutex_t mutex);
+
+XBT_PUBLIC(smx_cond_t) SIMIX_req_cond_init(void);
+XBT_PUBLIC(void) SIMIX_req_cond_destroy(smx_cond_t cond);
+XBT_PUBLIC(void) SIMIX_req_cond_signal(smx_cond_t cond);
+XBT_PUBLIC(void) SIMIX_req_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
+XBT_PUBLIC(void) SIMIX_req_cond_wait_timeout(smx_cond_t cond,
                                          smx_mutex_t mutex,
                                          double max_duration);
-XBT_PUBLIC(void) SIMIX_cond_broadcast(smx_cond_t cond);
-XBT_PUBLIC(void) SIMIX_cond_destroy(smx_cond_t cond);
-XBT_PUBLIC(xbt_fifo_t) SIMIX_cond_get_actions(smx_cond_t cond);
-XBT_PUBLIC(void) SIMIX_cond_display_info(smx_cond_t cond);
-
-/*****Semaphores*******/
-
-
-XBT_PUBLIC(smx_sem_t) SIMIX_sem_init(int capacity);
-XBT_PUBLIC(void) SIMIX_sem_destroy(smx_sem_t sem);
-XBT_PUBLIC(void) SIMIX_sem_release(smx_sem_t sem);
-XBT_PUBLIC(void) SIMIX_sem_release_forever(smx_sem_t sem);
-XBT_PUBLIC(int) SIMIX_sem_would_block(smx_sem_t sem);
-XBT_PUBLIC(void) SIMIX_sem_block_onto(smx_sem_t sem);
-XBT_PUBLIC(void) SIMIX_sem_acquire(smx_sem_t sem);
-XBT_PUBLIC(void) SIMIX_sem_acquire_timeout(smx_sem_t sem,
+XBT_PUBLIC(void) SIMIX_req_cond_broadcast(smx_cond_t cond);
+
+XBT_PUBLIC(smx_sem_t) SIMIX_req_sem_init(int capacity);
+XBT_PUBLIC(void) SIMIX_req_sem_destroy(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_req_sem_release(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_req_sem_release_forever(smx_sem_t sem);
+XBT_PUBLIC(int) SIMIX_req_sem_would_block(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_req_sem_block_onto(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_req_sem_acquire(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_req_sem_acquire_timeout(smx_sem_t sem,
                                            double max_duration);
-XBT_PUBLIC(unsigned int) SIMIX_sem_acquire_any(xbt_dynar_t sems);
-XBT_PUBLIC(int) SIMIX_sem_get_capacity(smx_sem_t sem);
-
-
-/************************** Action handling ************************************/
-XBT_PUBLIC(smx_action_t) SIMIX_action_communicate(smx_host_t sender,
-                                                  smx_host_t receiver,
-                                                  const char *name,
-                                                  double size,
-                                                  double rate);
-XBT_PUBLIC(smx_action_t) SIMIX_action_execute(smx_host_t host,
-                                              const char *name,
-                                              double amount);
-XBT_PUBLIC(smx_action_t) SIMIX_action_sleep(smx_host_t host,
-                                            double amount);
-XBT_PUBLIC(void) SIMIX_action_cancel(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_action_set_priority(smx_action_t action,
-                                           double priority);
-XBT_PUBLIC(void) SIMIX_action_resume(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_action_suspend(smx_action_t action);
-XBT_PUBLIC(int) SIMIX_action_destroy(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_action_use(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_action_release(smx_action_t action);
-
-XBT_PUBLIC(void) SIMIX_register_action_to_condition(smx_action_t action,
-                                                    smx_cond_t cond);
-XBT_PUBLIC(void) SIMIX_unregister_action_to_condition(smx_action_t action,
-                                                      smx_cond_t cond);
-XBT_PUBLIC(void) SIMIX_register_action_to_semaphore(smx_action_t action,
-                                                    smx_sem_t sem);
-XBT_INLINE XBT_PUBLIC(void)
-SIMIX_unregister_action_to_semaphore(smx_action_t action, smx_sem_t sem);
-
-
-XBT_PUBLIC(double) SIMIX_action_get_remains(smx_action_t action);
-#ifdef HAVE_LATENCY_BOUND_TRACKING
-XBT_PUBLIC(int) SIMIX_action_is_latency_bounded(smx_action_t action);
-#endif
-
-XBT_PUBLIC(e_surf_action_state_t) SIMIX_action_get_state(smx_action_t
-                                                         action);
-
-XBT_PUBLIC(smx_action_t) SIMIX_action_parallel_execute(char *name,
-                                                       int host_nb,
-                                                       smx_host_t *
-                                                       host_list, double
-                                                       *computation_amount, double
-                                                       *communication_amount,
-                                                       double amount,
-                                                       double rate);
-
-XBT_PUBLIC(char *) SIMIX_action_get_name(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_action_set_name(smx_action_t action, char *name);
-XBT_PUBLIC(void) SIMIX_action_signal_all(smx_action_t action);
-XBT_PUBLIC(void) SIMIX_display_process_status(void);
-/************************** Comunication Handling *****************************/
-
-/* Public */
-/*****Rendez-vous points*****/
-XBT_PUBLIC(smx_rdv_t) SIMIX_rdv_create(const char *name);
-XBT_PUBLIC(void) SIMIX_rdv_destroy(smx_rdv_t rvp);
-XBT_PUBLIC(int) SIMIX_rdv_get_count_waiting_comm(smx_rdv_t rdv,
-                                                 smx_host_t host);
-XBT_PUBLIC(smx_comm_t) SIMIX_rdv_get_head(smx_rdv_t rdv);
-XBT_PUBLIC(smx_comm_t) SIMIX_rdv_get_request(smx_rdv_t rdv,
-                                             smx_comm_type_t type);
-XBT_PUBLIC(void) SIMIX_rdv_set_data(smx_rdv_t rdv, void *data);
-XBT_PUBLIC(void *) SIMIX_rdv_get_data(smx_rdv_t rdv);
-
-/*****Communication Requests*****/
-XBT_INLINE XBT_PUBLIC(void) SIMIX_communication_cancel(smx_comm_t comm);
-XBT_PUBLIC(void) SIMIX_communication_destroy(smx_comm_t comm);
-XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm);
-#ifdef HAVE_LATENCY_BOUND_TRACKING
-XBT_PUBLIC(int) SIMIX_communication_is_latency_bounded(smx_comm_t comm);
-#endif
-XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm);
-
-XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm);
-XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm);
-XBT_PUBLIC(size_t) SIMIX_communication_get_src_buf_size(smx_comm_t comm);
-XBT_PUBLIC(size_t) SIMIX_communication_get_dst_buf_size(smx_comm_t comm);
-
-/*****Networking*****/
-XBT_PUBLIC(void) SIMIX_network_set_copy_data_callback(void (*callback)
-                                                       (smx_comm_t,
-                                                        size_t));
-XBT_PUBLIC(void) SIMIX_network_copy_pointer_callback(smx_comm_t comm,
-                                                     size_t buff_size);
-XBT_PUBLIC(void) SIMIX_network_copy_buffer_callback(smx_comm_t comm,
-                                                    size_t buff_size);
-XBT_PUBLIC(void) SIMIX_network_send(smx_rdv_t rdv, double task_size,
-                                    double rate, double timeout,
-                                    void *src_buff, size_t src_buff_size,
-                                    smx_comm_t * comm, void *data);
-XBT_PUBLIC(void) SIMIX_network_recv(smx_rdv_t rdv, double timeout,
-                                    void *dst_buff, size_t * dst_buff_size,
-                                    smx_comm_t * comm);
-XBT_PUBLIC(smx_comm_t) SIMIX_network_isend(smx_rdv_t rdv, double task_size,
-                                           double rate, void *src_buff,
-                                           size_t src_buff_size,
-                                           void *data);
-XBT_PUBLIC(smx_comm_t) SIMIX_network_irecv(smx_rdv_t rdv, void *dst_buff,
-                                           size_t * dst_buff_size);
-XBT_PUBLIC(unsigned int) SIMIX_network_waitany(xbt_dynar_t comms);
-XBT_INLINE XBT_PUBLIC(void) SIMIX_network_wait(smx_comm_t comm,
-                                               double timeout);
-XBT_PUBLIC(int) SIMIX_network_test(smx_comm_t comm);
+XBT_PUBLIC(unsigned int) SIMIX_req_sem_acquire_any(xbt_dynar_t sems);
+XBT_PUBLIC(int) SIMIX_req_sem_get_capacity(smx_sem_t sem);
 
 SG_END_DECL()
 #endif                          /* _SIMIX_SIMIX_H */
index 277069f..275b481 100644 (file)
@@ -144,16 +144,6 @@ XBT_PUBLIC_DATA(routing_global_t) global_routing;
  */
 typedef struct surf_model_private *surf_model_private_t;
 
-     /** \brief Timer model extension public
-      * \ingroup SURF_model
-      *
-      * Additionnal functions specific to the timer model
-      */
-typedef struct surf_timer_model_extension_public {
-  void (*set) (double date, void *function, void *arg);
-  int (*get) (void **function, void **arg);
-} s_surf_model_extension_timer_t;
-
      /* Cpu model */
 
      /** \brief CPU model extension public
@@ -292,7 +282,6 @@ typedef struct surf_model {
 
 
   union extension {
-    s_surf_model_extension_timer_t timer;
     s_surf_model_extension_cpu_t cpu;
     s_surf_model_extension_network_t network;
     s_surf_model_extension_workstation_t workstation;
@@ -335,16 +324,6 @@ typedef struct surf_resource_lmm {
 /**************************************/
 
 
-/** \brief The timer model
- *  \ingroup SURF_models
- */
-XBT_PUBLIC_DATA(surf_model_t) surf_timer_model;
-
-/** \brief Initializes the timer model
- *  \ingroup SURF_models
- */
-XBT_PUBLIC(void) surf_timer_model_init(const char *filename);
-
 /** \brief The CPU model
  *  \ingroup SURF_models
  */
@@ -607,11 +586,11 @@ XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
  *
  *  This function has to be called to initialize the common
  *  structures.  Then you will have to create the environment by
- *  calling surf_timer_model_init() and
+ *  calling 
  *  e.g. surf_workstation_model_init_CLM03() or
  *  surf_workstation_model_init_KCCFLN05().
  *
- *  \see surf_timer_model_init(), surf_workstation_model_init_CLM03(),
+ *  \see surf_workstation_model_init_CLM03(),
  *  surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
  */
 XBT_PUBLIC(void) surf_init(int *argc, char **argv);     /* initialize common structures */
@@ -640,6 +619,7 @@ XBT_PUBLIC(void) surf_presolve(void);
 
 /** \brief Performs a part of the simulation
  *  \ingroup SURF_simulation
+ *  \param max_date Maximum date to update the simulation to, or -1
  *  \return the elapsed time, or -1.0 if no event could be executed
  *
  *  This function execute all possible events, update the action states
@@ -648,7 +628,7 @@ XBT_PUBLIC(void) surf_presolve(void);
  *  are not executed immediately but only when you call surf_solve.
  *  Note that the returned elapsed time can be zero.
  */
-XBT_PUBLIC(double) surf_solve(void);
+XBT_PUBLIC(double) surf_solve(double max_date);
 
 /** \brief Return the current time
  *  \ingroup SURF_simulation
index 122d238..c88e733 100644 (file)
@@ -36,11 +36,15 @@ XBT_PUBLIC(int) xbt_os_thread_atfork(void (*prepare)(void),
 XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name,
                                                  pvoid_f_pvoid_t
                                                  start_routine,
-                                                 void *param);
+                                                 void *param,
+                                                 void *data);
 XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode);
+XBT_PUBLIC(void) xbt_os_thread_detach(xbt_os_thread_t thread);
 XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void);
 XBT_PUBLIC(const char *) xbt_os_thread_self_name(void);
 XBT_PUBLIC(const char *) xbt_os_thread_name(xbt_os_thread_t);
+XBT_PUBLIC(void) xbt_os_thread_set_extra_data(void *data);
+XBT_PUBLIC(void *) xbt_os_thread_get_extra_data(void);
   /* xbt_os_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
 XBT_PUBLIC(void) xbt_os_thread_join(xbt_os_thread_t thread,
                                     void **thread_return);
index e02385f..07d8cc1 100644 (file)
@@ -79,7 +79,7 @@ void TRACE_smpi_init(int rank)
   TRACE_smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   if (TRACE_smpi_is_grouped()){
     pajeCreateContainer(SIMIX_get_clock(), str, "MPI_PROCESS",
-                      SIMIX_host_get_name(SIMIX_host_self()), str);
+                      SIMIX_host_self_get_name(), str);
   }else{
     pajeCreateContainer(SIMIX_get_clock(), str, "MPI_PROCESS",
                       "platform", str);
index 51be389..6924284 100644 (file)
@@ -10,7 +10,7 @@
 
 static long long int counter = 0;       /* to uniquely identify simix actions */
 
-void TRACE_smx_action_execute(smx_action_t act)
+void TRACE_smx_host_execute(smx_action_t act)
 {
   char *category = NULL;
   if (!IS_TRACING)
index de1ec3a..d416f72 100644 (file)
@@ -1,23 +1,74 @@
 #include "private.h"
 
+static mc_mem_region_t MC_region_new(void *start_addr, size_t size);
+static void MC_region_restore(mc_mem_region_t reg);
+static void MC_region_destroy(mc_mem_region_t reg);
+
+static void MC_snapshot_add_region(mc_snapshot_t snapshot, void *start_addr, size_t size);
+
+static mc_mem_region_t MC_region_new(void *start_addr, size_t size)
+{
+  mc_mem_region_t new_reg = xbt_new0(s_mc_mem_region_t, 1);
+  new_reg->start_addr = start_addr;
+  new_reg->size = size;
+  new_reg->data = xbt_malloc0(size);
+  memcpy(new_reg->data, start_addr, size);
+  return new_reg;
+}
+
+static void MC_region_restore(mc_mem_region_t reg)
+{
+  /*FIXME: check if start_addr is still mapped, if it is not, then map it
+    before copying the data */
+  memcpy(reg->start_addr, reg->data, reg->size);
+}
+
+static void MC_region_destroy(mc_mem_region_t reg)
+{
+  xbt_free(reg->data);
+  xbt_free(reg);
+}
+
+static void MC_snapshot_add_region(mc_snapshot_t snapshot, void *start_addr, size_t size)
+{
+  mc_mem_region_t new_reg = MC_region_new(start_addr, size);
+  snapshot->regions = xbt_realloc(snapshot->regions, (snapshot->num_reg + 1) * sizeof(mc_mem_region_t));
+  snapshot->regions[snapshot->num_reg] = new_reg;
+  snapshot->num_reg++;
+  return;
+} 
+
 void MC_take_snapshot(mc_snapshot_t snapshot)
 {
-/* Save the heap! */
-  snapshot->heap_size = MC_save_heap(&(snapshot->heap));
+  unsigned int i;
+  s_map_region reg;
+  memory_map_t maps = get_memory_map();
 
-/* Save data and bss that */
-  snapshot->data_size = MC_save_dataseg(&(snapshot->data));
+  /* Save all the writable mapped pages except the  and the stack */
+  for (i = 0; i < maps->mapsize; i++) {
+    reg = maps->regions[i];
+    if((reg.prot & PROT_WRITE)
+       && (reg.pathname == NULL
+           || (strncmp(reg.pathname, "/dev/zero", 9)
+               && strncmp(reg.pathname, "[stack]", 7)))){
+      MC_snapshot_add_region(snapshot, reg.start_addr,
+                             (char*)reg.end_addr - (char*)reg.start_addr);
+    }
+  }
 }
 
 void MC_restore_snapshot(mc_snapshot_t snapshot)
 {
-  MC_restore_heap(snapshot->heap, snapshot->heap_size);
-  MC_restore_dataseg(snapshot->data, snapshot->data_size);
+  unsigned int i;
+  for(i=0; i < snapshot->num_reg; i++)
+    MC_region_restore(snapshot->regions[i]);
 }
 
 void MC_free_snapshot(mc_snapshot_t snapshot)
 {
-  xbt_free(snapshot->heap);
-  xbt_free(snapshot->data);
+  unsigned int i;
+  for(i=0; i < snapshot->num_reg; i++)
+    MC_region_destroy(snapshot->regions[i]);
+
   xbt_free(snapshot);
 }
diff --git a/src/mc/mc_dfs.c b/src/mc/mc_dfs.c
deleted file mode 100644 (file)
index a3dec04..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#include "private.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dfs, mc,
-                                "Logging specific to MC DFS exploration");
-
-
-void MC_dfs_init()
-{
-  mc_transition_t trans = NULL;
-  mc_state_t initial_state = NULL;
-  xbt_setset_cursor_t cursor = NULL;
-
-  MC_SET_RAW_MEM;
-  initial_state = MC_state_new();
-  /* Add the state data structure for the initial state */
-  xbt_fifo_unshift(mc_stack, initial_state);
-  MC_UNSET_RAW_MEM;
-
-  DEBUG0("**************************************************");
-  DEBUG0("Initial state");
-
-  /* Schedule all the processes to detect the transitions from the initial state */
-  MC_schedule_enabled_processes();
-
-  MC_SET_RAW_MEM;
-  xbt_setset_add(initial_state->enabled_transitions,
-                 initial_state->transitions);
-  xbt_setset_foreach(initial_state->enabled_transitions, cursor, trans) {
-    if (trans->type == mc_wait
-        && (trans->wait.comm->src_proc == NULL
-            || trans->wait.comm->dst_proc == NULL)) {
-      xbt_setset_set_remove(initial_state->enabled_transitions, trans);
-    }
-  }
-
-  /* Fill the interleave set of the initial state with all enabled transitions */
-  xbt_setset_add(initial_state->interleave,
-                 initial_state->enabled_transitions);
-
-  /* Update Statistics */
-  mc_stats->state_size +=
-      xbt_setset_set_size(initial_state->enabled_transitions);
-
-  MC_UNSET_RAW_MEM;
-}
-
-/**
- *     \brief Perform the model-checking operation using a depth-first search exploration
- *
- *     It performs the model-checking operation by executing all possible scheduling of the communication actions
- *     \return The time spent to execute the simulation or -1 if the simulation ended
- */
-void MC_dfs(void)
-{
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  mc_state_t next_state = NULL;
-  xbt_setset_cursor_t cursor = NULL;
-
-  while (xbt_fifo_size(mc_stack) > 0) {
-    DEBUG0("**************************************************");
-
-    /* FIXME: Think about what happens if there are no transitions but there are
-       some actions on the models. (ex. all the processes do a sleep(0) in a round). */
-
-    /* Get current state */
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-
-    /* If there are transitions to execute and the maximun depth has not been reached 
-       then perform one step of the exploration algorithm */
-    if (xbt_setset_set_size(current_state->interleave) > 0
-        && xbt_fifo_size(mc_stack) < MAX_DEPTH) {
-
-      DEBUG3("Exploration detph=%d (state=%p)(%d transitions)",
-             xbt_fifo_size(mc_stack), current_state,
-             xbt_setset_set_size(current_state->interleave));
-
-      /* Update statistics */
-      mc_stats->visited_states++;
-      mc_stats->executed_transitions++;
-
-      /* Choose a transition to execute from the interleave set of the current state,
-         and create the data structures for the new expanded state in the exploration
-         stack. */
-      MC_SET_RAW_MEM;
-      trans = xbt_setset_set_extract(current_state->interleave);
-
-      /* Define it as the executed transition of this state */
-      current_state->executed_transition = trans;
-
-      next_state = MC_state_new();
-      xbt_fifo_unshift(mc_stack, next_state);
-      MC_UNSET_RAW_MEM;
-
-      DEBUG1("Executing transition %s", trans->name);
-      SIMIX_process_schedule(trans->process);
-
-      /* Do all surf's related black magic tricks to keep all working */
-      MC_execute_surf_actions();
-
-      /* Schedule every process that got enabled due to the executed transition */
-      MC_schedule_enabled_processes();
-
-      /* Calculate the enabled transitions set of the next state:
-         -add the transition sets of the current state and the next state 
-         -remove the executed transition from that set
-         -remove all the transitions that are disabled (mc_wait only)
-         -use the resulting set as the enabled transitions of the next state */
-      MC_SET_RAW_MEM;
-      xbt_setset_add(next_state->transitions, current_state->transitions);
-      xbt_setset_set_remove(next_state->transitions, trans);
-      xbt_setset_add(next_state->enabled_transitions,
-                     next_state->transitions);
-      xbt_setset_foreach(next_state->enabled_transitions, cursor, trans) {
-        if (trans->type == mc_wait
-            && (trans->wait.comm->src_proc == NULL
-                || trans->wait.comm->dst_proc == NULL)) {
-          xbt_setset_set_remove(next_state->enabled_transitions, trans);
-        }
-      }
-
-      /* Fill the interleave set of the new state with all enabled transitions */
-      xbt_setset_add(next_state->interleave,
-                     next_state->enabled_transitions);
-      MC_UNSET_RAW_MEM;
-
-      /* Update Statistics */
-      mc_stats->state_size +=
-          xbt_setset_set_size(next_state->enabled_transitions);
-
-      /* Let's loop again */
-
-      /* The interleave set is empty or the maximum depth is reached, let's back-track */
-    } else {
-      DEBUG0("There are no more actions to run");
-
-      MC_SET_RAW_MEM;
-      xbt_fifo_shift(mc_stack);
-      MC_state_delete(current_state);
-
-      /* Go backwards in the stack until we find a state with transitions in the interleave set */
-      while (xbt_fifo_size(mc_stack) > 0
-             && (current_state = (mc_state_t) xbt_fifo_shift(mc_stack))) {
-        if (xbt_setset_set_size(current_state->interleave) == 0) {
-          MC_state_delete(current_state);
-        } else {
-          xbt_fifo_unshift(mc_stack, current_state);
-          DEBUG1("Back-tracking to depth %d", xbt_fifo_size(mc_stack));
-          MC_replay(mc_stack);
-          MC_UNSET_RAW_MEM;
-          /* Let's loop again */
-          break;
-        }
-      }
-    }
-  }
-  MC_UNSET_RAW_MEM;
-  /* We are done, show the statistics and return */
-  MC_print_statistics(mc_stats);
-}
index 93e7d07..02c1d05 100644 (file)
@@ -15,44 +15,33 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dpor, mc,
 void MC_dpor_init()
 {
   mc_state_t initial_state = NULL;
-  mc_transition_t trans, trans_tmp = NULL;
-  xbt_setset_cursor_t cursor = NULL;
-
+  smx_process_t process;
+  
   /* Create the initial state and push it into the exploration stack */
   MC_SET_RAW_MEM;
   initial_state = MC_state_new();
   xbt_fifo_unshift(mc_stack, initial_state);
   MC_UNSET_RAW_MEM;
 
-  /* Schedule all the processes to detect the transitions of the initial state */
   DEBUG0("**************************************************");
   DEBUG0("Initial state");
 
-  while (xbt_swag_size(simix_global->process_to_run)) {
-    MC_schedule_enabled_processes();
-    MC_execute_surf_actions();
-  }
+  /* Wait for requests (schedules processes) */
+  MC_wait_for_requests();
 
   MC_SET_RAW_MEM;
-  MC_trans_compute_enabled(initial_state->enabled_transitions,
-                           initial_state->transitions);
-
-  /* Fill the interleave set of the initial state with an enabled process */
-  trans = xbt_setset_set_choose(initial_state->enabled_transitions);
-  if (trans) {
-    DEBUG1("Choosing process %s for next interleave",
-           trans->process->name);
-    xbt_setset_foreach(initial_state->enabled_transitions, cursor,
-                       trans_tmp) {
-      if (trans_tmp->process == trans->process)
-        xbt_setset_set_insert(initial_state->interleave, trans_tmp);
+  /* Get an enabled process and insert it in the interleave set of the initial state */
+  xbt_swag_foreach(process, simix_global->process_list){
+    if(SIMIX_process_is_enabled(process)){
+      xbt_setset_set_insert(initial_state->interleave, process);
+      break;
     }
   }
   MC_UNSET_RAW_MEM;
-
-  /* Update Statistics */
+    
+  /* FIXME: Update Statistics 
   mc_stats->state_size +=
-      xbt_setset_set_size(initial_state->enabled_transitions);
+      xbt_setset_set_size(initial_state->enabled_transitions); */
 }
 
 
@@ -62,176 +51,134 @@ void MC_dpor_init()
  */
 void MC_dpor(void)
 {
-  mc_transition_t trans, trans_tmp = NULL;
-  mc_state_t next_state = NULL;
-  xbt_setset_cursor_t cursor = NULL;
+  char *req_str;
+  smx_req_t req = NULL;
+  mc_state_t state = NULL, prev_state = NULL, next_state = NULL;
+  smx_process_t process = NULL;
+  xbt_fifo_item_t item = NULL;
 
   while (xbt_fifo_size(mc_stack) > 0) {
 
     DEBUG0("**************************************************");
 
-    /* FIXME: Think about what happen if there are no transitions but there are
-       some actions on the models. (ex. all the processes do a sleep(0) in a round). */
-
     /* Get current state */
-    mc_current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
+    state = (mc_state_t) 
+      xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
 
-    /* If there are transitions to execute and the maximun depth has not been reached 
+    /* If there are processes to interleave and the maximun depth has not been reached 
        then perform one step of the exploration algorithm */
-    if (xbt_setset_set_size(mc_current_state->interleave) > 0
+    if (xbt_setset_set_size(state->interleave) > 0
         && xbt_fifo_size(mc_stack) < MAX_DEPTH) {
 
-      DEBUG4("Exploration detph=%d (state=%p)(%d interleave) (%d enabled)",
-             xbt_fifo_size(mc_stack), mc_current_state,
-             xbt_setset_set_size(mc_current_state->interleave),
-             xbt_setset_set_size(mc_current_state->enabled_transitions));
+      DEBUG3("Exploration detph=%d (state=%p)(%d interleave)",
+             xbt_fifo_size(mc_stack), state,
+             xbt_setset_set_size(state->interleave));
 
       /* Update statistics */
       mc_stats->visited_states++;
       mc_stats->executed_transitions++;
 
-      /* Choose a transition to execute from the interleave set of the current
-         state, and create the data structures for the new expanded state in the
-         exploration stack. */
       MC_SET_RAW_MEM;
-      trans = xbt_setset_set_extract(mc_current_state->interleave);
-
-      /* Add the transition in the done set of the current state */
-      xbt_setset_set_insert(mc_current_state->done, trans);
-
-      next_state = MC_state_new();
-      xbt_fifo_unshift(mc_stack, next_state);
-
-      /* Set it as the executed transition of the current state */
-      mc_current_state->executed_transition = trans;
+      /* Choose a request to execute from the the current state */
+      req = MC_state_get_request(state);
       MC_UNSET_RAW_MEM;
 
-      /* Execute the selected transition by scheduling it's associated process.
-         Then schedule every process that got ready to run due to the execution
-         of the transition */
-      DEBUG1("Executing transition %s", trans->name);
-      SIMIX_process_schedule(trans->process);
-      MC_execute_surf_actions();
+      if(req){    
+        /* Answer the request */
+        /* Debug information */
+        if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
+          req_str = MC_request_to_string(req); 
+          DEBUG1("Execute: %s", req_str);
+          xbt_free(req_str);
+        }
 
-      while (xbt_swag_size(simix_global->process_to_run)) {
-        MC_schedule_enabled_processes();
-        MC_execute_surf_actions();
-      }
+        SIMIX_request_pre(req);
 
-      /* Calculate the enabled transitions set of the next state */
-      MC_SET_RAW_MEM;
+        MC_state_set_executed_request(state, req);
+        
+        /* Wait for requests (schedules processes) */
+        MC_wait_for_requests();
 
-      xbt_setset_foreach(mc_current_state->transitions, cursor, trans_tmp) {
-        if (trans_tmp->process != trans->process) {
-          xbt_setset_set_insert(next_state->transitions, trans_tmp);
-        }
-      }
+        /* Create the new expanded state */
+        MC_SET_RAW_MEM;
+        next_state = MC_state_new();
+        xbt_fifo_unshift(mc_stack, next_state);
+        
 
-      MC_trans_compute_enabled(next_state->enabled_transitions,
-                               next_state->transitions);
-
-      /* Choose one transition to interleave from the enabled transition set */
-      trans = xbt_setset_set_choose(next_state->enabled_transitions);
-      if (trans) {
-        DEBUG1("Choosing process %s for next interleave",
-               trans->process->name);
-        xbt_setset_foreach(next_state->enabled_transitions, cursor,
-                           trans_tmp) {
-          if (trans_tmp->process == trans->process)
-            xbt_setset_set_insert(next_state->interleave, trans_tmp);
+        /* Get an enabled process and insert it in the interleave set of the next state */
+        xbt_swag_foreach(process, simix_global->process_list){
+          if(SIMIX_process_is_enabled(process)){
+            xbt_setset_set_insert(next_state->interleave, process);
+            break;
+          }
         }
+        MC_UNSET_RAW_MEM;
+        
+        /* FIXME: Update Statistics
+        mc_stats->state_size +=
+            xbt_setset_set_size(next_state->enabled_transitions);*/
       }
-      MC_UNSET_RAW_MEM;
-
-      /* Update Statistics */
-      mc_stats->state_size +=
-          xbt_setset_set_size(next_state->enabled_transitions);
-
       /* Let's loop again */
 
       /* The interleave set is empty or the maximum depth is reached, let's back-track */
     } else {
-      DEBUG0("There are no more transitions to interleave.");
-
+      DEBUG0("There are no more processes to interleave.");
 
       /* Check for deadlocks */
-      xbt_setset_substract(mc_current_state->transitions,
-                           mc_current_state->done);
-      if (xbt_setset_set_size(mc_current_state->transitions) > 0) {
-        INFO0("**************************");
-        INFO0("*** DEAD-LOCK DETECTED ***");
-        INFO0("**************************");
-        INFO0("Locked transitions:");
-        xbt_setset_foreach(mc_current_state->transitions, cursor, trans) {
-          INFO3("%s [src=%p, dst=%p]", trans->name,
-                trans->wait.comm->src_proc, trans->wait.comm->dst_proc);
+      xbt_swag_foreach(process, simix_global->process_list){
+        if(process->request && !SIMIX_request_isEnabled(process->request)){
+          *mc_exp_ctl = MC_DEADLOCK;
+          return;
         }
-
-        INFO0("Counter-example execution trace:");
-        MC_dump_stack(mc_stack);
-
-        MC_print_statistics(mc_stats);
-        xbt_abort();
-      }
-
-      mc_transition_t q = NULL;
-      xbt_fifo_item_t item = NULL;
-      mc_state_t state = NULL;
+      }  
 
       /*
-         INFO0("*********************************");
-         MC_show_stack(mc_stack); */
+      INFO0("*********************************");
+      MC_show_stack(mc_stack); */
 
       /* Trash the current state, no longer needed */
       MC_SET_RAW_MEM;
       xbt_fifo_shift(mc_stack);
-      MC_state_delete(mc_current_state);
+      MC_state_delete(state);
 
       /* Traverse the stack backwards until a state with a non empty interleave
          set is found, deleting all the states that have it empty in the way.
-         For each deleted state, check if the transition that has generated it 
-         (from it's predecesor state), depends on any other previous transition 
+         For each deleted state, check if the request that has generated it 
+         (from it's predecesor state), depends on any other previous request 
          executed before it. If it does then add it to the interleave set of the
-         state that executed that previous transition. */
-      while ((mc_current_state = xbt_fifo_shift(mc_stack)) != NULL) {
-        q = mc_current_state->executed_transition;
-        xbt_fifo_foreach(mc_stack, item, state, mc_state_t) {
-          if (MC_transition_depend(q, state->executed_transition)) {
-            xbt_setset_foreach(state->enabled_transitions, cursor, trans) {
-              if ((trans->process == q->process)
-                  && !xbt_setset_set_belongs(state->done, trans)) {
-                DEBUG3("%s depend with %s at %p", q->name,
-                       state->executed_transition->name, state);
-
-                xbt_setset_foreach(state->enabled_transitions, cursor,
-                                   trans) {
-                  if (trans->process == q->process)
-                    xbt_setset_set_insert(state->interleave, trans);
-                }
-                /* FIXME: hack to make it work */
-                trans = q;
-                break;
-              }
+         state that executed that previous request. */
+      while ((state = xbt_fifo_shift(mc_stack)) != NULL) {
+        req = MC_state_get_executed_request(state);
+        xbt_fifo_foreach(mc_stack, item, prev_state, mc_state_t) {
+          if(MC_request_depend(req, MC_state_get_executed_request(prev_state))){
+            if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
+              DEBUG0("Dependent Transitions:");
+              req_str = MC_request_to_string(MC_state_get_executed_request(prev_state));
+              DEBUG1("%s", req_str);
+              xbt_free(req_str);
+              req_str = MC_request_to_string(req);
+              DEBUG1("%s", req_str);
+              xbt_free(req_str);              
             }
-            if (trans)
-              break;
+            xbt_setset_set_insert(prev_state->interleave, req->issuer);
+            break;
           }
         }
-        if (xbt_setset_set_size(mc_current_state->interleave) > 0) {
+        if (xbt_setset_set_size(state->interleave) > 0) {
           /* We found a back-tracking point, let's loop */
-          xbt_fifo_unshift(mc_stack, mc_current_state);
+          xbt_fifo_unshift(mc_stack, state);
           DEBUG1("Back-tracking to depth %d", xbt_fifo_size(mc_stack));
-          MC_replay(mc_stack);
+          *mc_exp_ctl = MC_EXPLORE;
           MC_UNSET_RAW_MEM;
+          return;
           break;
         } else {
-          MC_state_delete(mc_current_state);
+          MC_state_delete(state);
         }
       }
     }
   }
-  DEBUG0("We are done");
-  /* We are done, show the statistics and return */
-  MC_print_statistics(mc_stats);
-}
+  MC_UNSET_RAW_MEM;
+  *mc_exp_ctl = MC_STOP;
+  return;
+}
\ No newline at end of file
index 9cd6c7f..c4b4b15 100644 (file)
@@ -1,8 +1,13 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
 #include "../surf/surf_private.h"
 #include "../simix/private.h"
 #include "xbt/fifo.h"
 #include "private.h"
 
+
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc,
                                 "Logging specific to MC (global)");
 
@@ -17,8 +22,10 @@ char mc_replay_mode = FALSE;
 /**
  *  \brief Initialize the model-checker data structures
  */
-void MC_init(int method)
+void MC_init(void)
 {
+  smx_process_t process;
+  
   /* Check if MC is already initialized */
   if (initial_snapshot)
     return;
@@ -37,74 +44,94 @@ void MC_init(int method)
   /* Create the container for the sets */
   mc_setset = xbt_setset_new(20);
 
-  switch (method) {
-  case 0:
-    MC_dfs_init();
-    break;
-  case 1:
-    MC_dpor_init();
-    break;
-  default:
-    break;
+  /* Add the existing processes to mc's setset so they have an ID designated */
+  xbt_swag_foreach(process, simix_global->process_list){
+    xbt_setset_elm_add(mc_setset, process);
   }
+  
+  /* Initialize the control variable */
+  mc_exp_ctl = xbt_new0(e_mc_exp_ctl_t, 1);
+  *mc_exp_ctl = MC_EXPLORE;
+  
+  MC_UNSET_RAW_MEM;
+  
+
 
   /* Save the initial state */
-  MC_SET_RAW_MEM;
-  initial_snapshot = xbt_new(s_mc_snapshot_t, 1);
+/*  MC_SET_RAW_MEM;
+  initial_snapshot = xbt_new0(s_mc_snapshot_t, 1);
   MC_take_snapshot(initial_snapshot);
-  MC_UNSET_RAW_MEM;
+  MC_UNSET_RAW_MEM;*/
 }
 
-void MC_modelcheck(int method)
+void MC_modelcheck(void)
 {
-
-  MC_init(method);
-
-  switch (method) {
-  case 0:
-    MC_dfs();
-    break;
-  case 1:
-    MC_dpor();
-    break;
-  default:
-    break;
-  }
-
-  MC_exit(method);
+  int status;
+  pid_t pid;
+
+  /* Compute initial state */
+  MC_init();
+  
+  /* Fork an mc's slave exploration process and wait for it. */
+  /* The forked process will explore a trace until:
+       - a back-tracking point is found (it sets mc_expl_ctl to MC_explore)
+       - there are no more states to explore (it sets mc_expl_ctl to MC_STOP)
+       - a property is invalid (or dead-lock)
+   */
+  while(*mc_exp_ctl == MC_EXPLORE){
+    if((pid = fork())){
+      waitpid(pid, &status, 0);
+      mmalloc_detach(raw_heap);
+      raw_heap = mmalloc_attach(raw_heap_fd, (char*)(std_heap) + STD_HEAP_SIZE + getpagesize());
+
+    if (WIFSIGNALED(status)) {
+      INFO1("killed by signal %d\n", WTERMSIG(status));
+      break;
+    }else if (WIFSTOPPED(status)) {
+      INFO1("stopped by signal %d\n", WSTOPSIG(status));
+      break;
+    }else if (WIFCONTINUED(status)) {
+      INFO0("continued\n");
+      break;
+    }
+     
+    if(*mc_exp_ctl == MC_DEADLOCK){
+      INFO0("**************************");
+      INFO0("*** DEAD-LOCK DETECTED ***");
+      INFO0("**************************");
+      MC_dump_stack(mc_stack);
+      MC_print_statistics(mc_stats);
+      break;
+    }
+      
+    }else{
+      /* if mc_stack is empty then create first state, otherwise replay */
+      if(xbt_fifo_size(mc_stack) == 0)
+        MC_dpor_init();
+      else
+        MC_replay(mc_stack);
+
+      MC_dpor();
+      MC_memory_exit();
+      break;
+    }
+  }    
+  
+  /* If we are the mc's master process then exit */
+  if(pid)
+    MC_exit();
 }
 
-void MC_exit(int method)
+void MC_exit(void)
 {
-  mc_state_t state;
-
-  switch (method) {
-  case 0:
-    //MC_dfs_exit();
-    break;
-  case 1:
-    //MC_dpor_exit();
-    break;
-  default:
-    break;
-  }
-
-  /* Destroy MC data structures (in RAW memory) */
-  MC_SET_RAW_MEM;
-  xbt_free(mc_stats);
-
-  while ((state = (mc_state_t) xbt_fifo_pop(mc_stack)) != NULL)
-    MC_state_delete(state);
-
-  xbt_fifo_free(mc_stack);
-  xbt_setset_destroy(mc_setset);
-  MC_UNSET_RAW_MEM;
+  mmalloc_detach(raw_heap);
+  shm_unlink("raw_heap");
 }
 
 int MC_random(int min, int max)
 {
-  MC_trans_intercept_random(min, max);
-  return mc_current_state->executed_transition->random.value;
+  /*FIXME: return mc_current_state->executed_transition->random.value;*/
+  return 0;
 }
 
 /**
@@ -114,40 +141,46 @@ int MC_random(int min, int max)
 */
 void MC_replay(xbt_fifo_t stack)
 {
+  char *req_str;
+  smx_req_t req = NULL, saved_req = NULL;
   xbt_fifo_item_t item;
-  mc_transition_t trans;
+  mc_state_t state;
 
   DEBUG0("**** Begin Replay ****");
 
   /* Restore the initial state */
-  MC_restore_snapshot(initial_snapshot);
+  /*MC_restore_snapshot(initial_snapshot);*/
 
-  mc_replay_mode = TRUE;
-
-  MC_UNSET_RAW_MEM;
+  MC_wait_for_requests();
 
   /* Traverse the stack from the initial state and re-execute the transitions */
   for (item = xbt_fifo_get_last_item(stack);
        item != xbt_fifo_get_first_item(stack);
        item = xbt_fifo_get_prev_item(item)) {
 
-    mc_current_state = (mc_state_t) xbt_fifo_get_item_content(item);
-    trans = mc_current_state->executed_transition;
-
+    state = (mc_state_t) xbt_fifo_get_item_content(item);
+    saved_req = MC_state_get_executed_request(state);
+   
+    if(saved_req){
+      /* because we got a copy of the executed request, we have to fetch the  
+         real one, pointed by the request field of the issuer process */
+      req = saved_req->issuer->request;
+
+      /* Debug information */
+      if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+        req_str = MC_request_to_string(req); 
+        DEBUG1("Replay: %s", req_str);
+        xbt_free(req_str);
+      }
+    }
+         
+    SIMIX_request_pre(req);
+    MC_wait_for_requests();
+         
     /* Update statistics */
     mc_stats->visited_states++;
     mc_stats->executed_transitions++;
-
-    DEBUG1("Executing transition %s", trans->name);
-    SIMIX_process_schedule(trans->process);
-
-    /* Do all surf's related black magic tricks to keep all working */
-    MC_execute_surf_actions();
-
-    /* Schedule every process that got enabled due to the executed transition */
-    MC_schedule_enabled_processes();
   }
-  mc_replay_mode = FALSE;
   DEBUG0("**** End Replay ****");
 }
 
@@ -171,125 +204,44 @@ void MC_dump_stack(xbt_fifo_t stack)
 void MC_show_stack(xbt_fifo_t stack)
 {
   mc_state_t state;
-  mc_transition_t trans;
   xbt_fifo_item_t item;
-
+  smx_req_t req;
+  char *req_str = NULL;
+  
   for (item = xbt_fifo_get_last_item(stack);
        (item ? (state = (mc_state_t) (xbt_fifo_get_item_content(item)))
         : (NULL)); item = xbt_fifo_get_prev_item(item)) {
-    trans = state->executed_transition;
-    if (trans) {
-      INFO1("%s", trans->name);
+    req = MC_state_get_executed_request(state);
+    if(req){
+      req_str = MC_request_to_string(req); 
+      INFO1("%s", req_str);
+      xbt_free(req_str);
     }
   }
 }
 
 /**
  * \brief Schedules all the process that are ready to run
- *        As a side effect it performs some clean-up required by SIMIX 
  */
-void MC_schedule_enabled_processes(void)
+void MC_wait_for_requests(void)
 {
-  smx_process_t process;
-
-  //SIMIX_process_empty_trash();
-
-  /* Schedule every process that is ready to run due to an finished action */
-  while ((process = xbt_swag_extract(simix_global->process_to_run))) {
-    DEBUG2("Scheduling %s on %s", process->name, process->smx_host->name);
-    SIMIX_process_schedule(process);
-  }
-}
-
-/******************************** States **************************************/
-
-/**
- * \brief Creates a state data structure used by the exploration algorithm
- */
-mc_state_t MC_state_new(void)
-{
-  mc_state_t state = NULL;
-
-  state = xbt_new0(s_mc_state_t, 1);
-  state->created_transitions = xbt_setset_new_set(mc_setset);
-  state->transitions = xbt_setset_new_set(mc_setset);
-  state->enabled_transitions = xbt_setset_new_set(mc_setset);
-  state->interleave = xbt_setset_new_set(mc_setset);
-  state->done = xbt_setset_new_set(mc_setset);
-  state->executed_transition = NULL;
-
-  mc_stats->expanded_states++;
-
-  return state;
-}
-
-/**
- * \brief Deletes a state data structure
- * \param trans The state to be deleted
- */
-void MC_state_delete(mc_state_t state)
-{
-  xbt_setset_cursor_t cursor;
-  mc_transition_t trans;
-
-  xbt_setset_foreach(state->created_transitions, cursor, trans) {
-    xbt_setset_elm_remove(mc_setset, trans);
-    MC_transition_delete(trans);
-  }
-
-  xbt_setset_destroy_set(state->created_transitions);
-  xbt_setset_destroy_set(state->transitions);
-  xbt_setset_destroy_set(state->enabled_transitions);
-  xbt_setset_destroy_set(state->interleave);
-  xbt_setset_destroy_set(state->done);
-
-  xbt_free(state);
-}
-
-/************************** SURF Emulation ************************************/
-
-/* Dirty hack, we manipulate surf's clock to simplify the integration of the
-   model-checker */
-extern double NOW;
-
-/**
- * \brief Executes all the actions at every model
- */
-void MC_execute_surf_actions(void)
-{
-  unsigned int iter;
-  surf_action_t action = NULL;
-  surf_model_t model = NULL;
-  smx_action_t smx_action = NULL;
-
-  /* Execute all the actions in every model */
-  xbt_dynar_foreach(model_list, iter, model) {
-    while ((action = xbt_swag_extract(model->states.running_action_set))) {
-      /* FIXME: timeouts are not calculated correctly */
-      if (NOW >= action->max_duration) {
-        surf_action_state_set(action, SURF_ACTION_DONE);
-        smx_action = action->data;
-        DEBUG5
-            ("Resource [%s] (%d): Executing RUNNING action \"%s\" (%p) MaxDuration %lf",
-             model->name, xbt_swag_size(model->states.running_action_set),
-             smx_action->name, smx_action, action->max_duration);
-
-        if (smx_action)
-          SIMIX_action_signal_all(smx_action);
+  char *req_str = NULL;
+  smx_req_t req = NULL;
+
+  do {
+    SIMIX_context_runall(simix_global->process_to_run);
+    while((req = SIMIX_request_pop())){
+      if(!SIMIX_request_isVisible(req))
+        SIMIX_request_pre(req);
+      else if(req->call == REQ_COMM_WAITANY)
+        THROW_UNIMPLEMENTED;
+      else if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+        req_str = MC_request_to_string(req);
+        DEBUG1("Got: %s", req_str);
+        xbt_free(req_str);
       }
     }
-    /*FIXME: check if this is always empty or not */
-    while ((action = xbt_swag_extract(model->states.failed_action_set))) {
-      smx_action = action->data;
-      DEBUG4("Resource [%s] (%d): Executing FAILED action \"%s\" (%p)",
-             model->name, xbt_swag_size(model->states.running_action_set),
-             smx_action->name, smx_action);
-      if (smx_action)
-        SIMIX_action_signal_all(smx_action);
-    }
-  }
-  /* That's it, now go one step deeper into the model-checking process! */
-  NOW += 0.5;                   /* FIXME: Check time increases */
+  } while (xbt_swag_size(simix_global->process_to_run));
 }
 
 /****************************** Statistics ************************************/
@@ -308,7 +260,7 @@ void MC_print_statistics(mc_stats_t stats)
 /************************* Assertion Checking *********************************/
 void MC_assert(int prop)
 {
-  if (!prop) {
+  if (_surf_do_model_check && !prop) {
     INFO0("**************************");
     INFO0("*** PROPERTY NOT VALID ***");
     INFO0("**************************");
@@ -318,3 +270,17 @@ void MC_assert(int prop)
     xbt_abort();
   }
 }
+
+void MC_show_deadlock(smx_req_t req)
+{
+  char *req_str = NULL;
+  INFO0("**************************");
+  INFO0("*** DEAD-LOCK DETECTED ***");
+  INFO0("**************************");
+  INFO0("Locked request:");
+  req_str = MC_request_to_string(req);
+  INFO1("%s", req_str);
+  xbt_free(req_str);
+  INFO0("Counter-example execution trace:");
+  MC_dump_stack(mc_stack);
+}
\ No newline at end of file
index 7b191a9..769f948 100644 (file)
@@ -1,15 +1,11 @@
-#include <stdlib.h>
-#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include "mc/mc.h"
-#include "xbt/sysdep.h"
 #include "private.h"
 #include "xbt/log.h"
-#include <unistd.h>
 #define _GNU_SOURCE
 
-extern char *basename(__const char *__filename);
 
-#define STD_HEAP_SIZE   20480000        /* Maximum size of the system's heap */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
                                 "Logging specific to MC (memory)");
@@ -18,70 +14,18 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
 void *std_heap = NULL;          /* memory erased each time the MC stuff rollbacks to the beginning. Almost everything goes here */
 void *raw_heap = NULL;          /* memory persistent over the MC rollbacks. Only MC stuff should go there */
 
-/* Pointers to the beginning and end of the .data and .bss segment of libsimgrid */
-/* They are initialized once at memory_init */
-void *libsimgrid_data_addr_start = NULL;
-size_t libsimgrid_data_size = 0;
-
 /* Initialize the model-checker memory subsystem */
-/* It creates the heap regions and set the default one */
+/* It creates the two heap regions: std_heap and raw_heap */
 void MC_memory_init()
 {
 /* Create the first region HEAP_OFFSET bytes after the heap break address */
   std_heap = mmalloc_get_default_md();
   xbt_assert(std_heap != NULL);
 
-/* Create the second region a page after the first one ends */
-  raw_heap =
-      mmalloc_attach(-1,
-                     (char *) (std_heap) + STD_HEAP_SIZE + getpagesize());
+/* Create the second region a page after the first one ends + safety gap */
+  raw_heap_fd = shm_open("raw_heap", O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+  raw_heap = mmalloc_attach(raw_heap_fd, (char*)(std_heap) + STD_HEAP_SIZE + getpagesize());
   xbt_assert(raw_heap != NULL);
-
-  MC_SET_RAW_MEM;
-
-/* Get the start address and size of libsimgrid's data segment */
-/* CAVEAT: Here we are assuming that get_memory_map() */
-/* returns an array with the maps sorted from lower addresses to higher ones.  */
-  int i;
-  char *libname, *tmp;
-
-  /* Get memory map */
-  memory_map_t maps;
-  maps = get_memory_map();
-
-  for (i = 0; i < maps->mapsize; i++) {
-
-    if (maps->regions[i].inode != 0) {
-
-      tmp = xbt_strdup(maps->regions[i].pathname);
-      libname = basename(tmp);
-
-#if 0
-      if (maps->regions[i].perms & MAP_WRITE && maps->regions[i].pathname[0] != '\0' && /* do not take anonymous segments: what are they? */
-          strcmp("[heap]", maps->regions[i].pathname) &&        /* do not take standard heap: mmalloc saves it already */
-          strcmp("[stack]", maps->regions[i].pathname)  /* this is maestro's stack. No need to save it */
-          ) {
-        /* FIXME: we should save the data of more segments, in a list of block to save */
-      }
-#endif
-      /* for now, we only save the data of libsimgrid (FIXME) */
-      if (strncmp("libsimgrid.so.", libname, 14) == 0
-          && maps->regions[i].perms & MAP_WRITE) {
-        libsimgrid_data_addr_start = maps->regions[i].start_addr;
-        libsimgrid_data_size =
-            (size_t) ((char *) maps->regions[i + 1].start_addr -
-                      (char *) maps->regions[i].start_addr);
-        xbt_free(tmp);
-        break;
-      }
-      xbt_free(tmp);
-    }
-  }
-
-  xbt_assert0(libsimgrid_data_addr_start != NULL,
-              "Cannot determine libsimgrid's .data segment address");
-
-  MC_UNSET_RAW_MEM;
 }
 
 /* Finish the memory subsystem */
@@ -90,53 +34,4 @@ void MC_memory_exit(void)
 {
   if (raw_heap)
     mmalloc_detach(raw_heap);
-}
-
-
-/* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */
-/* an API to query about the status of a heap, we simply call mmstats and */
-/* because I now how does structure looks like, then I redefine it here */
-
-struct mstats {
-  size_t bytes_total;           /* Total size of the heap. */
-  size_t chunks_used;           /* Chunks allocated by the user. */
-  size_t bytes_used;            /* Byte total of user-allocated chunks. */
-  size_t chunks_free;           /* Chunks in the free list. */
-  size_t bytes_free;            /* Byte total of chunks in the free list. */
-};
-
-extern struct mstats mmstats(void *);
-
-/* Copy std_heap to "to_heap" allocating the required space for it */
-size_t MC_save_heap(void **to_heap)
-{
-  size_t heap_size = mmstats(std_heap).bytes_total;
-
-  *to_heap = calloc(heap_size, 1);
-
-  xbt_assert(*to_heap != NULL);
-
-  memcpy(*to_heap, std_heap, heap_size);
-
-  return heap_size;
-}
-
-/* Copy the data segment of libsimgrid to "data" allocating the space for it */
-size_t MC_save_dataseg(void **data)
-{
-  *data = calloc(libsimgrid_data_size, 1);
-  memcpy(*data, libsimgrid_data_addr_start, libsimgrid_data_size);
-  return libsimgrid_data_size;
-}
-
-/* Restore std_heap from "src_heap" */
-void MC_restore_heap(void *src_heap, size_t size)
-{
-  memcpy(std_heap, src_heap, size);
-}
-
-/* Restore the data segment of libsimgrid from "src_data" */
-void MC_restore_dataseg(void *src_data, size_t size)
-{
-  memcpy(libsimgrid_data_addr_start, src_data, size);
-}
+}
\ No newline at end of file
diff --git a/src/mc/mc_request.c b/src/mc/mc_request.c
new file mode 100644 (file)
index 0000000..147af34
--- /dev/null
@@ -0,0 +1,75 @@
+#include "private.h"
+
+int MC_request_depend(smx_req_t r1, smx_req_t r2)
+{
+    if (r1->issuer == r2->issuer)
+    return FALSE;
+
+  if (r1->call != r2->call)
+    return FALSE;
+
+  if (r1->call == REQ_COMM_ISEND && r2->call == REQ_COMM_ISEND
+      && r1->comm_isend.rdv != r2->comm_isend.rdv)
+    return FALSE;
+
+  if (r1->call == REQ_COMM_IRECV && r2->call == REQ_COMM_IRECV
+      && r1->comm_irecv.rdv != r2->comm_irecv.rdv)
+    return FALSE;
+
+  if (r1->call == REQ_COMM_WAIT && r2->call == REQ_COMM_WAIT
+      && r1->comm_wait.comm == r2->comm_wait.comm)
+    return FALSE;
+
+  if (r1->call == REQ_COMM_WAIT && r2->call == REQ_COMM_WAIT
+      && r1->comm_wait.comm->comm.src_buff != NULL
+      && r1->comm_wait.comm->comm.dst_buff != NULL
+      && r2->comm_wait.comm->comm.src_buff != NULL
+      && r2->comm_wait.comm->comm.dst_buff != NULL
+      && r1->comm_wait.comm->comm.dst_buff != r2->comm_wait.comm->comm.src_buff
+      && r1->comm_wait.comm->comm.dst_buff != r2->comm_wait.comm->comm.dst_buff
+      && r2->comm_wait.comm->comm.dst_buff != r1->comm_wait.comm->comm.src_buff)
+    return FALSE;
+
+  return TRUE;
+}
+
+char *MC_request_to_string(smx_req_t req)
+{
+  char *type = NULL, *args = NULL, *str = NULL; 
+  smx_action_t act = NULL;
+  size_t size = 0;
+  
+  switch(req->call){
+    case REQ_COMM_ISEND:
+      type = bprintf("iSend");
+      args = bprintf("src=%s, buff=%p, size=%zu", req->issuer->name, 
+                     req->comm_isend.src_buff, req->comm_isend.src_buff_size);
+      break;
+    case REQ_COMM_IRECV:
+      size = req->comm_irecv.dst_buff_size ? *req->comm_irecv.dst_buff_size : 0;
+      type = bprintf("iRecv");
+      args = bprintf("dst=%s, buff=%p, size=%zu", req->issuer->name, 
+                     req->comm_irecv.dst_buff, size);
+      break;
+    case REQ_COMM_WAIT:
+      act = req->comm_wait.comm;
+      type = bprintf("Wait");
+      args  = bprintf("%p [%s -> %s]", act, 
+                      act->comm.src_proc ? act->comm.src_proc->name : "",
+                      act->comm.dst_proc ? act->comm.dst_proc->name : "");
+      break;
+    case REQ_COMM_TEST:
+      act = req->comm_test.comm;
+      type = bprintf("Test");
+      args  = bprintf("%p [%s -> %s]", act, 
+                      act->comm.src_proc ? act->comm.src_proc->name : "",
+                      act->comm.dst_proc ? act->comm.dst_proc->name : "");
+      break;
+    default:
+      THROW_UNIMPLEMENTED;
+  }
+  str = bprintf("[%s] %s (%s)", req->issuer->name, type, args);
+  xbt_free(type);
+  xbt_free(args);
+  return str;
+}
\ No newline at end of file
diff --git a/src/mc/mc_state.c b/src/mc/mc_state.c
new file mode 100644 (file)
index 0000000..0547bdb
--- /dev/null
@@ -0,0 +1,55 @@
+#include "../simix/private.h"
+#include "xbt/fifo.h"
+#include "private.h"
+
+static void MC_state_add_transition(mc_state_t state, mc_transition_t trans);
+
+/**
+ * \brief Creates a state data structure used by the exploration algorithm
+ */
+mc_state_t MC_state_new(void)
+{
+  mc_state_t state = NULL;
+  
+  state = xbt_new0(s_mc_state_t, 1);
+  state->interleave = xbt_setset_new_set(mc_setset);
+  state->done = xbt_setset_new_set(mc_setset);
+  
+  mc_stats->expanded_states++;
+  return state;
+}
+
+/**
+ * \brief Deletes a state data structure
+ * \param trans The state to be deleted
+ */
+void MC_state_delete(mc_state_t state)
+{
+  xbt_setset_destroy_set(state->interleave);
+  xbt_setset_destroy_set(state->done);
+  xbt_free(state);
+}
+
+void MC_state_set_executed_request(mc_state_t state, smx_req_t req)
+{
+  state->executed = *req;
+}
+
+smx_req_t MC_state_get_executed_request(mc_state_t state)
+{
+  return &state->executed;
+}
+
+smx_req_t MC_state_get_request(mc_state_t state)
+{
+  smx_process_t process = NULL;  
+  while((process = xbt_setset_set_extract(state->interleave))){
+    if(SIMIX_process_is_enabled(process)
+       && !xbt_setset_set_belongs(state->done, process)){
+      xbt_setset_set_insert(state->done, process);
+      return process->request;
+    }
+  }
+   
+  return NULL;
+}
\ No newline at end of file
diff --git a/src/mc/mc_transition.c b/src/mc/mc_transition.c
deleted file mode 100644 (file)
index d9e8b01..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-#include "private.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans, mc,
-                                "Logging specific to MC transitions");
-
-/* Creates a new iSend transition */
-mc_transition_t MC_trans_isend_new(smx_rdv_t rdv)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_isend;
-  trans->process = SIMIX_process_self();
-  trans->isend.rdv = rdv;
-  trans->name =
-      bprintf("[%s]\t iSend (%p)", trans->process->smx_host->name, trans);
-  return trans;
-}
-
-/* Creates a new iRecv transition */
-mc_transition_t MC_trans_irecv_new(smx_rdv_t rdv)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_irecv;
-  trans->process = SIMIX_process_self();
-  trans->irecv.rdv = rdv;
-  trans->name =
-      bprintf("[%s]\t iRecv (%p)", trans->process->smx_host->name, trans);
-  return trans;
-}
-
-/* Creates a new Wait transition */
-mc_transition_t MC_trans_wait_new(smx_comm_t comm)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_wait;
-  trans->process = SIMIX_process_self();
-  trans->wait.comm = comm;
-  trans->name =
-      bprintf("[%s]\t Wait (%p)", trans->process->smx_host->name, trans);
-  return trans;
-}
-
-/* Creates a new test transition */
-mc_transition_t MC_trans_test_new(smx_comm_t comm)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_test;
-  trans->process = SIMIX_process_self();
-  trans->test.comm = comm;
-  trans->name =
-      bprintf("[%s]\t Test (%p)", trans->process->smx_host->name, trans);
-  return trans;
-}
-
-/* Creates a new WaitAny transition */
-mc_transition_t MC_trans_waitany_new(xbt_dynar_t comms)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_waitany;
-  trans->process = SIMIX_process_self();
-  trans->waitany.comms = comms;
-  trans->name =
-      bprintf("[%s]\t WaitAny (%p)", trans->process->smx_host->name,
-              trans);
-  return trans;
-}
-
-/* Creates a new Random transition */
-mc_transition_t MC_trans_random_new(int value)
-{
-  mc_transition_t trans = xbt_new0(s_mc_transition_t, 1);
-
-  trans->type = mc_random;
-  trans->process = SIMIX_process_self();
-  trans->random.value = value;
-  trans->name =
-      bprintf("[%s]\t Random %d (%p)", trans->process->smx_host->name,
-              value, trans);
-
-  return trans;
-}
-
-/**
- * \brief Deletes a transition
- * \param trans The transition to be deleted
- */
-void MC_transition_delete(mc_transition_t trans)
-{
-  xbt_free(trans->name);
-  xbt_free(trans);
-}
-
-/************************** Interception Functions ****************************/
-/* These functions intercept all the actions relevant to the model-checking
- * process, the only difference between them is the type of transition they
- * create. The interception works by yielding the process performer of the
- * action, and depending on the execution mode it behaves diferently.
- * There are two running modes, a replay (back-track process) in which no 
- * transition needs to be created, or a new state expansion, which in 
- * consecuence a transition needs to be created and added to the set of
- * transitions associated to the current state.
- */
-
-/**
- * \brief Intercept an iSend action
- * \param rdv The rendez-vous of the iSend
- */
-void MC_trans_intercept_isend(smx_rdv_t rdv)
-{
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    trans = MC_trans_isend_new(rdv);
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    xbt_setset_set_insert(current_state->created_transitions, trans);
-    xbt_setset_set_insert(current_state->transitions, trans);
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/**
- * \brief Intercept an iRecv action
- * \param rdv The rendez-vous of the iRecv
- */
-void MC_trans_intercept_irecv(smx_rdv_t rdv)
-{
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    trans = MC_trans_irecv_new(rdv);
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    xbt_setset_set_insert(current_state->created_transitions, trans);
-    xbt_setset_set_insert(current_state->transitions, trans);
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/**
- * \brief Intercept a Wait action
- * \param comm The communication associated to the wait
- */
-void MC_trans_intercept_wait(smx_comm_t comm)
-{
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    trans = MC_trans_wait_new(comm);
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    xbt_setset_set_insert(current_state->created_transitions, trans);
-    xbt_setset_set_insert(current_state->transitions, trans);
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/**
- * \brief Intercept a Test action
- * \param comm The communication associated to the Test
- */
-void MC_trans_intercept_test(smx_comm_t comm)
-{
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    trans = MC_trans_test_new(comm);
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    xbt_setset_set_insert(current_state->created_transitions, trans);
-    xbt_setset_set_insert(current_state->transitions, trans);
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/**
- * \brief Intercept a WaitAny action
- * \param comms The communications associated to the WaitAny
- */
-void MC_trans_intercept_waitany(xbt_dynar_t comms)
-{
-  unsigned int index = 0;
-  smx_comm_t comm = NULL;
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    xbt_dynar_foreach(comms, index, comm) {
-      trans = MC_trans_wait_new(comm);
-      xbt_setset_set_insert(current_state->created_transitions, trans);
-      xbt_setset_set_insert(current_state->transitions, trans);
-    }
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/**
- * \brief Intercept a Random action
- * \param min The minimum value that can be returned by the Random action
- * \param max The maximum value that can be returned by the Random action
- */
-void MC_trans_intercept_random(int min, int max)
-{
-  int i;
-  mc_transition_t trans = NULL;
-  mc_state_t current_state = NULL;
-  if (!mc_replay_mode) {
-    MC_SET_RAW_MEM;
-    current_state = (mc_state_t)
-        xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
-    for (i = min; i <= max; i++) {
-      trans = MC_trans_random_new(i);
-      xbt_setset_set_insert(current_state->created_transitions, trans);
-      xbt_setset_set_insert(current_state->transitions, trans);
-    }
-    MC_UNSET_RAW_MEM;
-  }
-  SIMIX_process_yield();
-}
-
-/* Compute the subset of enabled transitions of the transition set */
-void MC_trans_compute_enabled(xbt_setset_set_t enabled,
-                              xbt_setset_set_t transitions)
-{
-  unsigned int index = 0;
-  smx_comm_t comm = NULL;
-  mc_transition_t trans = NULL;
-  xbt_setset_cursor_t cursor = NULL;
-  xbt_setset_foreach(transitions, cursor, trans) {
-    switch (trans->type) {
-      /* Wait transitions are enabled only if the communication has both a
-         sender and receiver */
-    case mc_wait:
-      if (trans->wait.comm->src_proc && trans->wait.comm->dst_proc) {
-        xbt_setset_set_insert(enabled, trans);
-        DEBUG1("Transition %p is enabled for next state", trans);
-      }
-      break;
-
-      /* WaitAny transitions are enabled if any of it's communications has both
-         a sender and a receiver */
-    case mc_waitany:
-      xbt_dynar_foreach(trans->waitany.comms, index, comm) {
-        if (comm->src_proc && comm->dst_proc) {
-          xbt_setset_set_insert(enabled, trans);
-          DEBUG1("Transition %p is enabled for next state", trans);
-          break;
-        }
-      }
-      break;
-
-      /* The rest of the transitions cannot be disabled */
-    default:
-      xbt_setset_set_insert(enabled, trans);
-      DEBUG1("Transition %p is enabled for next state", trans);
-      break;
-    }
-  }
-}
-
-/**
- * \brief Determine if two transitions are dependent
- * \param t1 a transition
- * \param t2 a transition
- * \return TRUE if \a t1 and \a t2 are dependent. FALSE otherwise.
- */
-int MC_transition_depend(mc_transition_t t1, mc_transition_t t2)
-{
-  if (t1->process == t2->process)
-    return FALSE;
-
-  if (t1->type != t2->type)
-    return FALSE;
-
-/*  if(t1->type == mc_isend && t2->type == mc_irecv)
-    return FALSE;
-
-  if(t1->type == mc_irecv && t2->type == mc_isend)
-    return FALSE;*/
-
-  if (t1->type == mc_random || t2->type == mc_random)
-    return FALSE;
-
-  if (t1->type == mc_isend && t2->type == mc_isend
-      && t1->isend.rdv != t2->isend.rdv)
-    return FALSE;
-
-  if (t1->type == mc_irecv && t2->type == mc_irecv
-      && t1->irecv.rdv != t2->irecv.rdv)
-    return FALSE;
-
-  if (t1->type == mc_wait && t2->type == mc_wait
-      && t1->wait.comm == t2->wait.comm)
-    return FALSE;
-
-  if (t1->type == mc_wait && t2->type == mc_wait
-      && t1->wait.comm->src_buff != NULL
-      && t1->wait.comm->dst_buff != NULL
-      && t2->wait.comm->src_buff != NULL
-      && t2->wait.comm->dst_buff != NULL
-      && t1->wait.comm->dst_buff != t2->wait.comm->src_buff
-      && t1->wait.comm->dst_buff != t2->wait.comm->dst_buff
-      && t2->wait.comm->dst_buff != t1->wait.comm->src_buff)
-    return FALSE;
-
-
-  return TRUE;
-}
index 7a5175e..689fe6c 100644 (file)
@@ -66,17 +66,31 @@ memory_map_t get_memory_map(void)
     if (strlen(lfields[1]) < 4)
       xbt_abort();
 
-    memreg.perms = 0;
-
-    for (i = 0; i < 3; i++)
-      if (lfields[1][i] != '-')
-        memreg.perms |= 1 << i;
+    memreg.prot = 0;
+
+    for (i = 0; i < 3; i++){
+      switch(lfields[1][i]){
+        case 'r':
+          memreg.prot |= PROT_READ;
+          break;
+        case 'w':
+          memreg.prot |= PROT_WRITE;
+          break;
+        case 'x':
+          memreg.prot |= PROT_EXEC;
+          break;
+        default:
+          break;
+      }
+    }
+    if (memreg.prot == 0)
+      memreg.prot |= PROT_NONE;
 
     if (lfields[1][4] == 'p')
-      memreg.perms |= MAP_PRIV;
+      memreg.flags |= MAP_PRIVATE;
 
     else if (lfields[1][4] == 's')
-      memreg.perms |= MAP_SHARED;
+      memreg.flags |= MAP_SHARED;
 
     /* Get the offset value */
     memreg.offset = (void *) strtoul(lfields[2], &endptr, 16);
index ec005ad..48f1ea8 100644 (file)
@@ -10,6 +10,7 @@
 #define MC_PRIVATE_H
 
 #include <stdio.h>
+#include <sys/mman.h>
 #include "mc/mc.h"
 #include "mc/datatypes.h"
 #include "xbt/fifo.h"
 
 /****************************** Snapshots ***********************************/
 
-/*typedef struct s_mc_process_checkpoint {
-       xbt_checkpoint_t machine_state;  Here we save the cpu + stack 
-} s_mc_process_checkpoint_t, *mc_process_checkpoint_t;*/
-
-typedef struct s_mc_snapshot {
-  size_t heap_size;
-  size_t data_size;
+typedef struct s_mc_mem_region{
+  void *start_addr;
   void *data;
-  void *heap;
+  size_t size;
+} s_mc_mem_region_t, *mc_mem_region_t;
 
+typedef struct s_mc_snapshot{
+  unsigned int num_reg;
+  mc_mem_region_t *regions;
 } s_mc_snapshot_t, *mc_snapshot_t;
 
-extern mc_snapshot_t initial_snapshot;
-
-size_t MC_save_heap(void **);
-void MC_restore_heap(void *, size_t);
-
-size_t MC_save_dataseg(void **);
-void MC_restore_dataseg(void *, size_t);
-
 void MC_take_snapshot(mc_snapshot_t);
 void MC_restore_snapshot(mc_snapshot_t);
 void MC_free_snapshot(mc_snapshot_t);
@@ -50,91 +42,41 @@ void MC_free_snapshot(mc_snapshot_t);
 /* Bound of the MC depth-first search algorithm */
 #define MAX_DEPTH 1000
 
-extern char mc_replay_mode;
+typedef enum{MC_EXPLORE=0, MC_STOP, MC_DEADLOCK, MC_INVPROP} e_mc_exp_ctl_t;
+
+e_mc_exp_ctl_t *mc_exp_ctl;
 
 void MC_show_stack(xbt_fifo_t stack);
 void MC_dump_stack(xbt_fifo_t stack);
-void MC_execute_surf_actions(void);
 void MC_replay(xbt_fifo_t stack);
-void MC_schedule_enabled_processes(void);
-void MC_dfs_init(void);
+void MC_wait_for_requests(void);
+void MC_get_enabled_processes();
+void MC_show_deadlock(smx_req_t req);
+
+/********************************* Requests ***********************************/
+int MC_request_depend(smx_req_t req1, smx_req_t req2);
+char* MC_request_to_string(smx_req_t req);
+
+/********************************** DPOR **************************************/
 void MC_dpor_init(void);
-void MC_dfs(void);
 void MC_dpor(void);
-void MC_dfs_exit(void);
 void MC_dpor_exit(void);
 
-
-
-/******************************* Transitions **********************************/
-typedef enum {
-  mc_isend,
-  mc_irecv,
-  mc_test,
-  mc_wait,
-  mc_waitany,
-  mc_random
-} mc_trans_type_t;
-
-typedef struct s_mc_transition {
-  XBT_SETSET_HEADERS;
-  char *name;
-  smx_process_t process;
-  mc_trans_type_t type;
-
-  union {
-    struct {
-      smx_rdv_t rdv;
-    } isend;
-
-    struct {
-      smx_rdv_t rdv;
-    } irecv;
-
-    struct {
-      smx_comm_t comm;
-    } wait;
-
-    struct {
-      smx_comm_t comm;
-    } test;
-
-    struct {
-      xbt_dynar_t comms;
-    } waitany;
-
-    struct {
-      int value;
-    } random;
-  };
-} s_mc_transition_t;
-
-mc_transition_t MC_trans_isend_new(smx_rdv_t);
-mc_transition_t MC_trans_irecv_new(smx_rdv_t);
-mc_transition_t MC_trans_wait_new(smx_comm_t);
-mc_transition_t MC_trans_test_new(smx_comm_t);
-mc_transition_t MC_trans_waitany_new(xbt_dynar_t);
-mc_transition_t MC_trans_random_new(int);
-void MC_transition_delete(mc_transition_t);
-int MC_transition_depend(mc_transition_t, mc_transition_t);
-void MC_trans_compute_enabled(xbt_setset_set_t, xbt_setset_set_t);
-
 /******************************** States **************************************/
 typedef struct mc_state {
-  xbt_setset_set_t created_transitions; /* created in this state */
-  xbt_setset_set_t transitions; /* created in this state + inherited */
-  xbt_setset_set_t enabled_transitions; /* they can be executed by the mc */
-  xbt_setset_set_t interleave;  /* the ones to be executed by the mc */
-  xbt_setset_set_t done;        /* already executed transitions */
-  mc_transition_t executed_transition;  /* last executed transition */
+  xbt_setset_set_t interleave;  /* processes to interleave by the mc */
+  xbt_setset_set_t done;        /* already executed processes */
+  s_smx_req_t executed;
 } s_mc_state_t, *mc_state_t;
 
 extern xbt_fifo_t mc_stack;
 extern xbt_setset_t mc_setset;
-extern mc_state_t mc_current_state;
 
 mc_state_t MC_state_new(void);
-void MC_state_delete(mc_state_t);
+void MC_state_delete(mc_state_t state);
+void MC_state_set_executed_request(mc_state_t state, smx_req_t req);
+smx_req_t MC_state_get_executed_request(mc_state_t state);
+smx_req_t MC_state_get_request(mc_state_t state);
 
 /****************************** Statistics ************************************/
 typedef struct mc_stats {
@@ -155,8 +97,20 @@ void MC_print_statistics(mc_stats_t);
 
 extern void *std_heap;
 extern void *raw_heap;
-extern void *libsimgrid_data_addr_start;
-extern size_t libsimgrid_data_size;
+int raw_heap_fd;
+#define STD_HEAP_SIZE   20480000        /* Maximum size of the system's heap */
+
+/* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */
+/* an API to query about the status of a heap, we simply call mmstats and */
+/* because I now how does structure looks like, then I redefine it here */
+
+struct mstats {
+  size_t bytes_total;           /* Total size of the heap. */
+  size_t chunks_used;           /* Chunks allocated by the user. */
+  size_t bytes_used;            /* Byte total of user-allocated chunks. */
+  size_t chunks_free;           /* Chunks in the free list. */
+  size_t bytes_free;            /* Byte total of chunks in the free list. */
+};
 
 #define MC_SET_RAW_MEM    mmalloc_set_current_heap(raw_heap)
 #define MC_UNSET_RAW_MEM    mmalloc_set_current_heap(std_heap)
@@ -165,18 +119,13 @@ extern size_t libsimgrid_data_size;
 /* These functions and data structures implements a binary interface for   */
 /* the proc maps ascii interface                                           */
 
-#define MAP_READ   1 << 0
-#define MAP_WRITE  1 << 1
-#define MAP_EXEC   1 << 2
-#define MAP_SHARED 1 << 3
-#define MAP_PRIV   1 << 4
-
 /* Each field is defined as documented in proc's manual page  */
 typedef struct s_map_region {
 
   void *start_addr;             /* Start address of the map */
   void *end_addr;               /* End address of the map */
-  int perms;                    /* Set of permissions */
+  int prot;                     /* Memory protection */
+  int flags;                    /* Aditional memory flags */
   void *offset;                 /* Offset in the file/whatever */
   char dev_major;               /* Major of the device */
   char dev_minor;               /* Minor of the device */
index 9599a01..633995f 100644 (file)
 m_host_t MSG_get_host_by_name(const char *name)
 {
   smx_host_t simix_h = NULL;
-  simix_h = SIMIX_host_get_by_name(name);
+  simix_h = SIMIX_req_host_get_by_name(name);
 
   if (simix_h == NULL)
     return NULL;
 
-  return (m_host_t) SIMIX_host_get_data(simix_h);
+  return (m_host_t) SIMIX_req_host_get_data(simix_h);
 }
 
 /** \ingroup msg_easier_life
@@ -67,7 +67,6 @@ void MSG_create_environment(const char *file)
   char *name;
 
   SIMIX_create_environment(file);
-  SIMIX_init();
 
   /* Initialize MSG hosts */
   xbt_dict_foreach(SIMIX_host_get_dict(), c, name, h) {
index 7629d66..84894f7 100644 (file)
@@ -70,9 +70,6 @@ void MSG_global_init(int *argc, char **argv)
     msg_global->PID = 1;
     msg_global->sent_msg = 0;
 
-    /* initialization of the mailbox module */
-    MSG_mailbox_mod_init();
-
     /* initialization of the action module */
     _MSG_action_init();
 
@@ -145,15 +142,15 @@ MSG_error_t MSG_main(void)
   /* Clean IO before the run */
   fflush(stdout);
   fflush(stderr);
-  SIMIX_init();
 
 #ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_modelcheck(1);
-  else
+  if (_surf_do_model_check){
+    MC_modelcheck();
+  }else
 #endif
-    while (SIMIX_solve(NULL, NULL) != -1.0);
-
+  {
+    SIMIX_run();
+  }
   return MSG_OK;
 }
 
@@ -209,9 +206,6 @@ MSG_error_t MSG_clean(void)
   free(msg_global);
   msg_global = NULL;
 
-  /* cleanup all resources in the mailbox module */
-  MSG_mailbox_mod_exit();
-
   /* initialization of the action module */
   _MSG_action_exit();
 
index 1055d81..bb22ab2 100644 (file)
@@ -4,8 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "msg/private.h"
-#include "simix/private.h"
+#include "private.h"
 #include "xbt/sysdep.h"
 #include "mc/mc.h"
 #include "xbt/log.h"
@@ -39,7 +38,6 @@ MSG_error_t MSG_task_execute(m_task_t task)
 {
   simdata_task_t simdata = NULL;
   m_process_t self = MSG_process_self();
-  e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   CHECK_HOST();
 
   simdata = task->simdata;
@@ -64,28 +62,21 @@ MSG_error_t MSG_task_execute(m_task_t task)
     return MSG_OK;
   }
   simdata->refcount++;
-  SIMIX_mutex_lock(simdata->mutex);
   simdata->compute =
-      SIMIX_action_execute(SIMIX_host_self(), task->name,
+      SIMIX_req_host_execute(task->name, SIMIX_host_self(),
                            simdata->computation_amount);
-  SIMIX_action_set_priority(simdata->compute, simdata->priority);
+  SIMIX_req_host_execution_set_priority(simdata->compute, simdata->priority);
 
-  /* changed to waiting action since we are always waiting one action (execute, communicate or sleep) */
   self->simdata->waiting_action = simdata->compute;
-  SIMIX_register_action_to_condition(simdata->compute, simdata->cond);
-  do {
-    SIMIX_cond_wait(simdata->cond, simdata->mutex);
-    state = SIMIX_action_get_state(simdata->compute);
-  } while (state == SURF_ACTION_READY || state == SURF_ACTION_RUNNING);
-  SIMIX_unregister_action_to_condition(simdata->compute, simdata->cond);
+  SIMIX_req_host_execution_wait(simdata->compute);
   self->simdata->waiting_action = NULL;
 
-  SIMIX_mutex_unlock(simdata->mutex);
   simdata->refcount--;
 
-  if (SIMIX_action_get_state(task->simdata->compute) == SURF_ACTION_DONE) {
+  DEBUG2("Execution task '%s' finished in state %d", task->name, SIMIX_req_host_execution_get_state(task->simdata->compute));
+  if (SIMIX_req_host_execution_get_state(task->simdata->compute) == SIMIX_DONE) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->computation_amount = 0.0;
     simdata->comm = NULL;
     simdata->compute = NULL;
@@ -93,9 +84,9 @@ MSG_error_t MSG_task_execute(m_task_t task)
     TRACE_msg_task_execute_end(task);
 #endif
     MSG_RETURN(MSG_OK);
-  } else if (SIMIX_host_get_state(SIMIX_host_self()) == 0) {
+  } else if (SIMIX_req_host_get_state(SIMIX_host_self()) == 0) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->comm = NULL;
     simdata->compute = NULL;
 #ifdef HAVE_TRACING
@@ -104,7 +95,7 @@ MSG_error_t MSG_task_execute(m_task_t task)
     MSG_RETURN(MSG_HOST_FAILURE);
   } else {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->comm = NULL;
     simdata->compute = NULL;
 #ifdef HAVE_TRACING
@@ -151,8 +142,6 @@ MSG_parallel_task_create(const char *name, int host_nb,
   /* Simulator Data */
   simdata->computation_amount = 0;
   simdata->message_size = 0;
-  simdata->cond = SIMIX_cond_init();
-  simdata->mutex = SIMIX_mutex_init();
   simdata->compute = NULL;
   simdata->comm = NULL;
   simdata->rate = -1.0;
@@ -176,7 +165,6 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task)
 {
   simdata_task_t simdata = NULL;
   m_process_t self = MSG_process_self();
-  e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   CHECK_HOST();
 
   simdata = task->simdata;
@@ -188,52 +176,45 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task)
   xbt_assert0(simdata->host_nb,
               "This is not a parallel task. Go to hell.");
 
-  DEBUG1("Computing on %s", MSG_process_self()->simdata->m_host->name);
+  DEBUG1("Parallel computing on %s", MSG_process_self()->simdata->m_host->name);
 
   simdata->refcount++;
 
-  SIMIX_mutex_lock(simdata->mutex);
   simdata->compute =
-      SIMIX_action_parallel_execute(task->name, simdata->host_nb,
-                                    simdata->host_list,
-                                    simdata->comp_amount,
-                                    simdata->comm_amount, 1.0, -1.0);
+      SIMIX_req_host_parallel_execute(task->name, simdata->host_nb,
+                                  simdata->host_list,
+                                  simdata->comp_amount,
+                                  simdata->comm_amount, 1.0, -1.0);
+  DEBUG1("Parallel execution action created: %p", simdata->compute);
 
   self->simdata->waiting_action = simdata->compute;
-  SIMIX_register_action_to_condition(simdata->compute, simdata->cond);
-  do {
-    SIMIX_cond_wait(simdata->cond, simdata->mutex);
-    state = SIMIX_action_get_state(task->simdata->compute);
-  } while (state == SURF_ACTION_READY || state == SURF_ACTION_RUNNING);
-
-  SIMIX_unregister_action_to_condition(simdata->compute, simdata->cond);
+  SIMIX_req_host_execution_wait(simdata->compute);
   self->simdata->waiting_action = NULL;
 
+  DEBUG2("Finished waiting for execution of action %p, state = %d", simdata->compute, SIMIX_req_host_execution_get_state(task->simdata->compute));
 
-  SIMIX_mutex_unlock(simdata->mutex);
   simdata->refcount--;
 
-  if (SIMIX_action_get_state(task->simdata->compute) == SURF_ACTION_DONE) {
+  if (SIMIX_req_host_execution_get_state(task->simdata->compute) == SIMIX_DONE) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->computation_amount = 0.0;
     simdata->comm = NULL;
     simdata->compute = NULL;
     MSG_RETURN(MSG_OK);
-  } else if (SIMIX_host_get_state(SIMIX_host_self()) == 0) {
+  } else if (SIMIX_req_host_get_state(SIMIX_host_self()) == 0) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->comm = NULL;
     simdata->compute = NULL;
     MSG_RETURN(MSG_HOST_FAILURE);
   } else {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
-    SIMIX_action_destroy(task->simdata->compute);
+    SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->comm = NULL;
     simdata->compute = NULL;
     MSG_RETURN(MSG_TASK_CANCELLED);
   }
-
 }
 
 
@@ -246,58 +227,35 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task)
  */
 MSG_error_t MSG_process_sleep(double nb_sec)
 {
-  smx_action_t act_sleep;
-  m_process_t proc = MSG_process_self();
-  e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
-  smx_mutex_t mutex;
-  smx_cond_t cond;
+  e_smx_state_t state;
+  /*m_process_t proc = MSG_process_self();*/
 
 #ifdef HAVE_TRACING
   TRACE_msg_process_sleep_in(MSG_process_self());
 #endif
 
   /* create action to sleep */
-  act_sleep =
-      SIMIX_action_sleep(SIMIX_process_get_host(proc->simdata->s_process),
-                         nb_sec);
-
-  mutex = SIMIX_mutex_init();
-  SIMIX_mutex_lock(mutex);
-
-  /* create conditional and register action to it */
-  cond = SIMIX_cond_init();
-
-  proc->simdata->waiting_action = act_sleep;
-  SIMIX_register_action_to_condition(act_sleep, cond);
-  do {
-    SIMIX_cond_wait(cond, mutex);
-    state = SIMIX_action_get_state(act_sleep);
-  } while (state == SURF_ACTION_READY || state == SURF_ACTION_RUNNING);
-  proc->simdata->waiting_action = NULL;
-  SIMIX_unregister_action_to_condition(act_sleep, cond);
-  SIMIX_mutex_unlock(mutex);
-
-  /* remove variables */
-  SIMIX_cond_destroy(cond);
-  SIMIX_mutex_destroy(mutex);
-
-  if (SIMIX_action_get_state(act_sleep) == SURF_ACTION_DONE) {
-    if (SIMIX_host_get_state(SIMIX_host_self()) == SURF_RESOURCE_OFF) {
-      SIMIX_action_destroy(act_sleep);
+  state = SIMIX_req_process_sleep(nb_sec);
+
+  /*proc->simdata->waiting_action = act_sleep;
+
+  FIXME: check if not setting the waiting_action breaks something on msg
+  
+  proc->simdata->waiting_action = NULL;*/
+  
+  if (state == SIMIX_DONE) {
+    if (SIMIX_req_host_get_state(SIMIX_host_self()) == SURF_RESOURCE_OFF) {
 #ifdef HAVE_TRACING
       TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
       MSG_RETURN(MSG_HOST_FAILURE);
     }
   } else {
-    SIMIX_action_destroy(act_sleep);
 #ifdef HAVE_TRACING
     TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
     MSG_RETURN(MSG_HOST_FAILURE);
   }
-
-  SIMIX_action_destroy(act_sleep);
 #ifdef HAVE_TRACING
   TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
@@ -452,11 +410,7 @@ msg_comm_t MSG_task_isend(m_task_t task, const char *alias)
 
   /* Send it by calling SIMIX network layer */
 
-  /* Kept for semantical compatibility with older implementation */
-  if (mailbox->cond)
-    SIMIX_cond_signal(mailbox->cond);
-
-  return SIMIX_network_isend(mailbox->rdv, t_simdata->message_size,
+  return SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
                              t_simdata->rate, task, sizeof(void *),
                              &t_simdata->comm);
 }
@@ -473,21 +427,12 @@ msg_comm_t MSG_task_isend(m_task_t task, const char *alias)
  */
 msg_comm_t MSG_task_irecv(m_task_t * task, const char *alias)
 {
-  smx_comm_t comm;
-  smx_rdv_t rdv = MSG_mailbox_get_by_alias(alias)->rdv;
-  msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
+  smx_rdv_t rdv = MSG_mailbox_get_by_alias(alias);
 
   CHECK_HOST();
 
   /* FIXME: these functions are not tracable */
 
-  memset(&comm, 0, sizeof(comm));
-
-  /* Kept for compatibility with older implementation */
-  xbt_assert1(!MSG_mailbox_get_cond(mailbox),
-              "A process is already blocked on this channel %s",
-              MSG_mailbox_get_alias(mailbox));
-
   /* Sanity check */
   xbt_assert0(task, "Null pointer for the task storage");
 
@@ -496,7 +441,7 @@ msg_comm_t MSG_task_irecv(m_task_t * task, const char *alias)
         ("MSG_task_get() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
-  return SIMIX_network_irecv(rdv, task, NULL);
+  return SIMIX_req_comm_irecv(rdv, task, NULL);
 }
 
 /** \ingroup msg_gos_functions
@@ -511,7 +456,7 @@ msg_comm_t MSG_task_irecv(m_task_t * task, const char *alias)
  */
 int MSG_comm_test(msg_comm_t comm)
 {
-  return SIMIX_network_test(comm);
+  return SIMIX_req_comm_test(comm);
 }
 
 /** \ingroup msg_gos_functions
@@ -522,12 +467,12 @@ int MSG_comm_test(msg_comm_t comm)
  */
 void MSG_comm_destroy(msg_comm_t comm)
 {
-  if (!(comm->src_proc == SIMIX_process_self())) {
+  if (SIMIX_req_comm_get_src_proc(comm) != SIMIX_process_self()) {
     m_task_t task;
-    task = (m_task_t) SIMIX_communication_get_src_buf(comm);
+    task = (m_task_t) SIMIX_req_comm_get_src_buff(comm);
     task->simdata->refcount--;
   }
-  SIMIX_communication_destroy(comm);
+  SIMIX_req_comm_destroy(comm);
 }
 
 /** \ingroup msg_gos_functions
@@ -543,14 +488,14 @@ MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
   xbt_ex_t e;
   MSG_error_t res = MSG_OK;
   TRY {
-    SIMIX_network_wait(comm, timeout);
+    SIMIX_req_comm_wait(comm, timeout);
 
-    if (!(comm->src_proc == SIMIX_process_self())) {
+    if (SIMIX_req_comm_get_src_proc(comm) != SIMIX_process_self()) {
       m_task_t task;
-      task = (m_task_t) SIMIX_communication_get_src_buf(comm);
+      task = (m_task_t) SIMIX_req_comm_get_src_buff(comm);
       task->simdata->refcount--;
     }
-    SIMIX_communication_destroy(comm);
+    SIMIX_req_comm_destroy(comm);
 
     /* FIXME: these functions are not tracable */
   }
@@ -598,13 +543,13 @@ void MSG_comm_waitall(msg_comm_t * comm, int nb_elem, double timeout)
 */
 int MSG_comm_waitany(xbt_dynar_t comms)
 {
-  return SIMIX_network_waitany(comms);
+  return SIMIX_req_comm_waitany(comms);
 }
 
 m_task_t MSG_comm_get_task(msg_comm_t comm)
 {
   xbt_assert0(comm, "Invalid parameters");
-  return (m_task_t) SIMIX_communication_get_src_buf(comm);
+  return (m_task_t) SIMIX_req_comm_get_src_buff(comm);
 }
 
 /** \ingroup msg_gos_functions
@@ -689,6 +634,7 @@ MSG_task_put_with_timeout(m_task_t task, m_host_t dest,
               && (channel < msg_global->max_channel), "Invalid channel %d",
               channel);
 
+  DEBUG1("MSG_task_put_with_timout: Trying to send a task to '%s'", dest->name);
   return
       MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel
                                    (dest, channel), task, timeout);
@@ -823,166 +769,3 @@ int MSG_task_listen_from(const char *alias)
 
   return MSG_process_get_PID(task->simdata->sender);
 }
-
-/** \ingroup msg_gos_functions
- * \brief Wait for at most \a max_duration second for a task reception
- on \a channel.
-
- * \a PID is updated with the PID of the first process that triggered this event if any.
- *
- * It takes three parameters:
- * \param channel the channel on which the agent should be
- listening. This value has to be >=0 and < than the maximal.
- number of channels fixed with MSG_set_channel_number().
- * \param PID a memory location for storing an int.
- * \param timeout the maximum time to wait for a task before
- giving up. In the case of a reception, *\a PID will be updated
- with the PID of the first process to send a task.
- * \return #MSG_HOST_FAILURE if the host is shut down in the meantime
- and #MSG_OK otherwise.
- */
-MSG_error_t
-MSG_channel_select_from(m_channel_t channel, double timeout, int *PID)
-{
-  m_host_t h = NULL;
-  simdata_host_t h_simdata = NULL;
-  m_task_t t;
-  int first_time = 1;
-  smx_cond_t cond;
-  msg_mailbox_t mailbox;
-
-  xbt_assert1((channel >= 0)
-              && (channel < msg_global->max_channel), "Invalid channel %d",
-              channel);
-
-  if (PID) {
-    *PID = -1;
-  }
-
-  if (timeout == 0.0) {
-    *PID = MSG_task_probe_from(channel);
-    MSG_RETURN(MSG_OK);
-  } else {
-    CHECK_HOST();
-    h = MSG_host_self();
-    h_simdata = h->simdata;
-
-    mailbox = MSG_mailbox_get_by_channel(MSG_host_self(), channel);
-
-    while (MSG_mailbox_is_empty(mailbox)) {
-      if (timeout > 0) {
-        if (!first_time) {
-          MSG_RETURN(MSG_OK);
-        }
-      }
-
-      SIMIX_mutex_lock(h_simdata->mutex);
-
-      xbt_assert1(!MSG_mailbox_get_cond(mailbox),
-                  "A process is already blocked on this channel %d",
-                  channel);
-
-      cond = SIMIX_cond_init();
-
-      MSG_mailbox_set_cond(mailbox, cond);
-
-      if (timeout > 0) {
-        SIMIX_cond_wait_timeout(cond, h_simdata->mutex, timeout);
-      } else {
-        SIMIX_cond_wait(cond, h_simdata->mutex);
-      }
-
-      SIMIX_cond_destroy(cond);
-      SIMIX_mutex_unlock(h_simdata->mutex);
-
-      if (SIMIX_host_get_state(h_simdata->smx_host) == 0) {
-        MSG_RETURN(MSG_HOST_FAILURE);
-      }
-
-      MSG_mailbox_set_cond(mailbox, NULL);
-      first_time = 0;
-    }
-
-    if (NULL == (t = MSG_mailbox_get_head(mailbox)))
-      MSG_RETURN(MSG_OK);
-
-
-    if (PID) {
-      *PID = MSG_process_get_PID(t->simdata->sender);
-    }
-
-    MSG_RETURN(MSG_OK);
-  }
-}
-
-
-MSG_error_t MSG_alias_select_from(const char *alias, double timeout,
-                                  int *PID)
-{
-  m_host_t h = NULL;
-  simdata_host_t h_simdata = NULL;
-  m_task_t t;
-  int first_time = 1;
-  smx_cond_t cond;
-  msg_mailbox_t mailbox;
-
-  if (PID) {
-    *PID = -1;
-  }
-
-  if (timeout == 0.0) {
-    *PID = MSG_task_listen_from(alias);
-    MSG_RETURN(MSG_OK);
-  } else {
-    CHECK_HOST();
-    h = MSG_host_self();
-    h_simdata = h->simdata;
-
-    DEBUG2("Probing on alias %s (%s)", alias, h->name);
-
-    mailbox = MSG_mailbox_get_by_alias(alias);
-
-    while (MSG_mailbox_is_empty(mailbox)) {
-      if (timeout > 0) {
-        if (!first_time) {
-          MSG_RETURN(MSG_OK);
-        }
-      }
-
-      SIMIX_mutex_lock(h_simdata->mutex);
-
-      xbt_assert1(!MSG_mailbox_get_cond(mailbox),
-                  "A process is already blocked on this alias %s", alias);
-
-      cond = SIMIX_cond_init();
-
-      MSG_mailbox_set_cond(mailbox, cond);
-
-      if (timeout > 0) {
-        SIMIX_cond_wait_timeout(cond, h_simdata->mutex, timeout);
-      } else {
-        SIMIX_cond_wait(cond, h_simdata->mutex);
-      }
-
-      SIMIX_cond_destroy(cond);
-      SIMIX_mutex_unlock(h_simdata->mutex);
-
-      if (SIMIX_host_get_state(h_simdata->smx_host) == 0) {
-        MSG_RETURN(MSG_HOST_FAILURE);
-      }
-
-      MSG_mailbox_set_cond(mailbox, NULL);
-      first_time = 0;
-    }
-
-    if (NULL == (t = MSG_mailbox_get_head(mailbox)))
-      MSG_RETURN(MSG_OK);
-
-
-    if (PID) {
-      *PID = MSG_process_get_PID(t->simdata->sender);
-    }
-
-    MSG_RETURN(MSG_OK);
-  }
-}
index 8cf3541..8d8c075 100644 (file)
@@ -50,12 +50,11 @@ m_host_t __MSG_host_create(smx_host_t workstation, void *data)
     sprintf(alias, "%s:%d", name, i);
 
     /* the key of the mailbox (in this case) is build from the name of the host and the channel number */
-    simdata->mailboxes[i] = MSG_mailbox_create(alias);
+    simdata->mailboxes[i] = MSG_mailbox_new(xbt_strdup(alias));
     memset(alias, 0, MAX_ALIAS_NAME + 1);
   }
 
-  simdata->mutex = SIMIX_mutex_init();
-  SIMIX_host_set_data(workstation, host);
+  SIMIX_req_host_set_data(workstation, host);
 
   /* Update global variables */
   xbt_fifo_unshift(msg_global->host, host);
@@ -148,7 +147,7 @@ void __MSG_host_destroy(m_host_t host)
 
   if (msg_global->max_channel > 0)
     free(simdata->mailboxes);
-  SIMIX_mutex_destroy(simdata->mutex);
+
   free(simdata);
 
   /* Clean host structure */
@@ -194,7 +193,7 @@ double MSG_get_host_speed(m_host_t h)
 {
   xbt_assert0((h != NULL), "Invalid parameters");
 
-  return (SIMIX_host_get_speed(h->simdata->smx_host));
+  return (SIMIX_req_host_get_speed(h->simdata->smx_host));
 }
 
 /** \ingroup m_host_management
@@ -219,7 +218,7 @@ xbt_dict_t MSG_host_get_properties(m_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters (host is NULL)");
 
-  return (SIMIX_host_get_properties(host->simdata->smx_host));
+  return (SIMIX_req_host_get_properties(host->simdata->smx_host));
 }
 
 
@@ -231,5 +230,5 @@ xbt_dict_t MSG_host_get_properties(m_host_t host)
 int MSG_host_is_avail(m_host_t h)
 {
   xbt_assert0((h != NULL), "Invalid parameters (host is NULL)");
-  return (SIMIX_host_get_state(h->simdata->smx_host));
+  return (SIMIX_req_host_get_state(h->simdata->smx_host));
 }
index cfdd557..b34debf 100644 (file)
@@ -7,7 +7,6 @@
 #include "msg/private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "../simix/private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg,
                                 "Logging specific to MSG (process)");
@@ -27,15 +26,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg,
  */
 
 /******************************** Process ************************************/
-void __MSG_process_cleanup(void *arg)
+void __MSG_process_cleanup(smx_process_t smx_proc)
 {
   /* arg is a pointer to a simix process, we can get the msg process with the field data */
-  m_process_t proc = ((smx_process_t) arg)->data;
+  m_process_t proc = SIMIX_req_process_get_data(smx_proc);
 #ifdef HAVE_TRACING
   TRACE_msg_process_end(proc);
 #endif
   xbt_fifo_remove(msg_global->process_list, proc);
-  SIMIX_process_cleanup(arg);
+  SIMIX_process_cleanup(smx_proc);
   if (proc->name) {
     free(proc->name);
     proc->name = NULL;
@@ -146,8 +145,7 @@ m_process_t MSG_process_create_with_environment(const char *name,
   smx_process_t smx_process = NULL;
   xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
 
-  smx_process = SIMIX_process_create(name, code,
-                                     (void *) process, host->name,
+  smx_process = SIMIX_process_create(name, code, (void *) process, host->name,
                                      argc, argv, properties);
   if (!smx_process) {
     xbt_free(process);
@@ -166,7 +164,7 @@ m_process_t MSG_process_create_with_environment(const char *name,
   simdata->s_process = smx_process;
 
   if (SIMIX_process_self()) {
-    simdata->PPID = MSG_process_get_PID(SIMIX_process_self()->data);
+    simdata->PPID = MSG_process_get_PID(SIMIX_process_self_get_data());
   } else {
     simdata->PPID = -1;
   }
@@ -209,17 +207,11 @@ void MSG_process_kill(m_process_t process)
          process->name, p_simdata->PID, p_simdata->m_host->name);
 
   if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) {
-    SIMIX_communication_cancel(p_simdata->waiting_task->simdata->comm);
+    SIMIX_req_comm_cancel(p_simdata->waiting_task->simdata->comm);
   }
-
-  if (p_simdata->waiting_action) {
-    DEBUG1("Canceling waiting task %s",
-           SIMIX_action_get_name(p_simdata->waiting_action));
-    SIMIX_action_cancel(p_simdata->waiting_action);
-  }
-
   xbt_fifo_remove(msg_global->process_list, process);
-  SIMIX_process_kill(process->simdata->s_process);
+  SIMIX_req_process_kill(process->simdata->s_process);
 
   return;
 }
@@ -238,7 +230,7 @@ MSG_error_t MSG_process_change_host(m_host_t host)
 #ifdef HAVE_TRACING
   TRACE_msg_process_change_host(process, now, host);
 #endif
-  SIMIX_process_change_host(process->simdata->s_process, now->name,
+  SIMIX_req_process_change_host(process->simdata->s_process, now->name,
                             host->name);
   return MSG_OK;
 }
@@ -374,7 +366,7 @@ xbt_dict_t MSG_process_get_properties(m_process_t process)
 {
   xbt_assert0((process != NULL), "Invalid parameters");
 
-  return (SIMIX_process_get_properties
+  return (SIMIX_req_process_get_properties
           (((simdata_process_t) process->simdata)->s_process));
 
 }
@@ -407,13 +399,9 @@ int MSG_process_self_PPID(void)
  */
 m_process_t MSG_process_self(void)
 {
-  smx_process_t proc = SIMIX_process_self();
-  if (proc != NULL) {
-    return (m_process_t) proc->data;
-  } else {
-    return NULL;
-  }
-
+  /* we cannot make a SIMIX request here because this may create an exception or a logging
+     event, and both mechanisms call MSG_process_self() again (via xbt_getpid()) */
+  return (m_process_t) SIMIX_process_self_get_data();
 }
 
 /** \ingroup m_process_management
@@ -432,7 +420,7 @@ MSG_error_t MSG_process_suspend(m_process_t process)
   TRACE_msg_process_suspend(process);
 #endif
 
-  SIMIX_process_suspend(process->simdata->s_process);
+  SIMIX_req_process_suspend(process->simdata->s_process);
   MSG_RETURN(MSG_OK);
 }
 
@@ -453,7 +441,7 @@ MSG_error_t MSG_process_resume(m_process_t process)
   TRACE_msg_process_resume(process);
 #endif
 
-  SIMIX_process_resume(process->simdata->s_process);
+  SIMIX_req_process_resume(process->simdata->s_process);
   MSG_RETURN(MSG_OK);
 }
 
@@ -467,5 +455,5 @@ int MSG_process_is_suspended(m_process_t process)
 {
   xbt_assert0(((process != NULL)
                && (process->simdata)), "Invalid parameters");
-  return SIMIX_process_is_suspended(process->simdata->s_process);
+  return SIMIX_req_process_is_suspended(process->simdata->s_process);
 }
index 3deb371..f8053a5 100644 (file)
 
 SG_BEGIN_DECL()
 #define MAX_ALIAS_NAME ((size_t)260)
-/*
- * Initialization of the mailbox module.
- */
-void MSG_mailbox_mod_init(void);
-
-/*
- * Terminaison of the mailbox module.
- */
-void MSG_mailbox_mod_exit(void);
-
 
 /*! \brief MSG_mailbox_new - create a new mailbox.
  *
@@ -91,41 +81,6 @@ XBT_PUBLIC(msg_mailbox_t)
 XBT_PUBLIC(msg_mailbox_t)
     MSG_mailbox_get_by_channel(m_host_t host, m_channel_t channel);
 
-/*! \brief MSG_mailbox_get_alias - get the alias associated with the mailbox.
- *
- * The function MSG_mailbox_get_alias returns the alias of the mailbox specified
- * by the parameter mailbox.
- *
- * \param mailbox      The mailbox to get the alias.
- *
- * \return     The alias of the mailbox specified by the parameter mailbox.
- */
-XBT_PUBLIC(const char *) MSG_mailbox_get_alias(msg_mailbox_t mailbox);
-
-/*! \brief MSG_mailbox_get_cond - get the simix condition of a mailbox.
- *
- * The function MSG_mailbox_get_cond returns the condition of the
- * mailbox specified by the parameter mailbox.
- *
- * \param mailbox      The mailbox to get the condition.
- *
- * \return The simix condition of the mailbox specified by the parameter mailbox.
- */
-XBT_PUBLIC(smx_cond_t)
-    MSG_mailbox_get_cond(msg_mailbox_t mailbox);
-
-/*! \brief MSG_mailbox_set_cond - set the simix condition of a mailbox.
- *
- * The function MSG_mailbox_set_cond set the condition of the mailbox
- * specified by the parameter mailbox.
- *
- * \param mailbox      The mailbox to set the condition.
- * \param cond         The new simix condition of the mailbox.
- *
- */
-XBT_PUBLIC(void) MSG_mailbox_set_cond(msg_mailbox_t mailbox,
-                                      smx_cond_t cond);
-
 /*! \brief MSG_mailbox_is_empty - test if a mailbox is empty.
  *
  * The function MSG_mailbox_is_empty tests if a mailbox is empty
index a6f053b..29ae2e5 100644 (file)
@@ -8,95 +8,46 @@
 
 #include "mailbox.h"
 #include "msg/private.h"
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg,
                                 "Logging specific to MSG (mailbox)");
 
-static xbt_dict_t msg_mailboxes = NULL;
-
-void MSG_mailbox_mod_init(void)
-{
-  msg_mailboxes = xbt_dict_new();
-}
-
-void MSG_mailbox_mod_exit(void)
-{
-  xbt_dict_free(&msg_mailboxes);
-}
-
-msg_mailbox_t MSG_mailbox_create(const char *alias)
-{
-  msg_mailbox_t mailbox = xbt_new0(s_msg_mailbox_t, 1);
-
-  mailbox->cond = NULL;
-  mailbox->alias = alias ? xbt_strdup(alias) : NULL;
-  mailbox->rdv = SIMIX_rdv_create(alias);
-
-  return mailbox;
-}
-
 msg_mailbox_t MSG_mailbox_new(const char *alias)
 {
-  msg_mailbox_t mailbox = MSG_mailbox_create(alias);
-
-  /* add the mbox in the dictionary */
-  xbt_dict_set(msg_mailboxes, alias, mailbox, MSG_mailbox_free);
-
-  return mailbox;
+  return SIMIX_req_rdv_create(alias ? xbt_strdup(alias) : NULL);
 }
 
 void MSG_mailbox_free(void *mailbox)
 {
-  msg_mailbox_t _mailbox = (msg_mailbox_t) mailbox;
-
-  free(_mailbox->alias);
-  SIMIX_rdv_destroy(_mailbox->rdv);
-
-  free(_mailbox);
-}
-
-smx_cond_t MSG_mailbox_get_cond(msg_mailbox_t mailbox)
-{
-  return mailbox->cond;
+  SIMIX_req_rdv_destroy((msg_mailbox_t)mailbox);
 }
 
 int MSG_mailbox_is_empty(msg_mailbox_t mailbox)
 {
-  return (NULL == SIMIX_rdv_get_head(mailbox->rdv));
+  return (NULL == SIMIX_req_rdv_get_head(mailbox));
 }
 
 m_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox)
 {
-  smx_comm_t comm = SIMIX_rdv_get_head(mailbox->rdv);
+  smx_action_t comm = SIMIX_req_rdv_get_head(mailbox);
 
   if (!comm)
     return NULL;
 
-  return (m_task_t) SIMIX_communication_get_data(comm);
+  return (m_task_t) SIMIX_req_comm_get_data(comm);
 }
 
 int
 MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox,
                                          m_host_t host)
 {
-  return SIMIX_rdv_get_count_waiting_comm(mailbox->rdv,
-                                          host->simdata->smx_host);
-}
-
-void MSG_mailbox_set_cond(msg_mailbox_t mailbox, smx_cond_t cond)
-{
-  mailbox->cond = cond;
-}
-
-const char *MSG_mailbox_get_alias(msg_mailbox_t mailbox)
-{
-  return mailbox->alias;
+  return SIMIX_req_rdv_comm_count_by_host(mailbox,
+                                      host->simdata->smx_host);
 }
 
 msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
 {
 
-  msg_mailbox_t mailbox = xbt_dict_get_or_null(msg_mailboxes, alias);
+  msg_mailbox_t mailbox = SIMIX_req_rdv_get_by_name(alias);
 
   if (!mailbox)
     mailbox = MSG_mailbox_new(alias);
@@ -121,7 +72,7 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
 {
   xbt_ex_t e;
   MSG_error_t ret = MSG_OK;
-  smx_comm_t comm;
+  smx_action_t comm = NULL;
 #ifdef HAVE_TRACING
   double start_time = 0;
 #endif
@@ -135,11 +86,6 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
   start_time = MSG_get_clock();
 #endif
 
-  /* Kept for compatibility with older implementation */
-  xbt_assert1(!MSG_mailbox_get_cond(mailbox),
-              "A process is already blocked on this channel %s",
-              MSG_mailbox_get_alias(mailbox));
-
   /* Sanity check */
   xbt_assert0(task, "Null pointer for the task storage");
 
@@ -149,8 +95,9 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
 
   /* Try to receive it by calling SIMIX network layer */
   TRY {
-    SIMIX_network_recv(mailbox->rdv, timeout, task, NULL, &comm);
-    //INFO2("Got task %s from %s",(*task)->name,mailbox->alias);
+    comm = SIMIX_req_comm_irecv(mailbox, task, NULL);
+    SIMIX_req_comm_wait(comm, timeout);
+    DEBUG2("Got task %s from %p",(*task)->name,mailbox);
     (*task)->simdata->refcount--;
   }
   CATCH(e) {
@@ -212,13 +159,9 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
 
   /* Try to send it by calling SIMIX network layer */
   TRY {
-    /* Kept for semantical compatibility with older implementation */
-    if (mailbox->cond)
-      SIMIX_cond_signal(mailbox->cond);
-
-    SIMIX_network_send(mailbox->rdv, t_simdata->message_size,
-                       t_simdata->rate, timeout, task, sizeof(void *),
-                       &(t_simdata->comm), task);
+    t_simdata->comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
+                       t_simdata->rate, task, sizeof(void *), task);
+    SIMIX_req_comm_wait(t_simdata->comm, timeout);
   }
 
   CATCH(e) {
index d0e1361..3c19b3a 100644 (file)
 SG_BEGIN_DECL()
 
 /**************** datatypes **********************************/
-/* this structure represents a mailbox */
-typedef struct s_msg_mailbox {
-  char *alias;                  /* the key of the mailbox in the global dictionary */
-  smx_cond_t cond;              /* the condition on the mailbox */
-  smx_rdv_t rdv;                /* SIMIX rendez-vous point */
-} s_msg_mailbox_t;
-
 typedef struct simdata_host {
   smx_host_t smx_host;          /* SURF modeling                                                                */
-  struct s_msg_mailbox **mailboxes;     /* mailboxes to store msg tasks of of the host  */
-  smx_mutex_t mutex;            /* mutex to access the host                                     */
+  msg_mailbox_t *mailboxes;     /* mailboxes to store msg tasks of of the host  */
 } s_simdata_host_t;
 
 /********************************* Task **************************************/
 
 typedef struct simdata_task {
   smx_action_t compute;         /* SURF modeling of computation  */
-  smx_comm_t comm;              /* SIMIX communication  */
+  smx_action_t comm;            /* SIMIX communication  */
   double message_size;          /* Data size  */
   double computation_amount;    /* Computation size  */
-  smx_cond_t cond;
-  smx_mutex_t mutex;            /* Task mutex */
   m_process_t sender;
   m_process_t receiver;
   m_host_t source;
@@ -102,8 +92,8 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 #define MSG_RETURN(val) do {PROCESS_SET_ERRNO(val);return(val);} while(0)
 /* #define CHECK_ERRNO()  ASSERT((PROCESS_GET_ERRNO()!=MSG_HOST_FAILURE),"Host failed, you cannot call this function.") */
 
-#define CHECK_HOST()  xbt_assert1(SIMIX_host_get_state(SIMIX_host_self())==1,\
-                                  "Host failed, you cannot call this function. (state=%d)",SIMIX_host_get_state(SIMIX_host_self()))
+#define CHECK_HOST()  xbt_assert1(SIMIX_req_host_get_state(SIMIX_host_self())==1,\
+                                  "Host failed, you cannot call this function. (state=%d)",SIMIX_req_host_get_state(SIMIX_host_self()))
 
 m_host_t __MSG_host_create(smx_host_t workstation, void *data);
 
@@ -111,7 +101,7 @@ void __MSG_host_destroy(m_host_t host);
 
 void __MSG_display_process_status(void);
 
-void __MSG_process_cleanup(void *arg);
+void __MSG_process_cleanup(smx_process_t smx_proc);
 void *_MSG_process_create_from_SIMIX(const char *name,
                                      xbt_main_func_t code, void *data,
                                      char *hostname, int argc,
index 73476e8..d5d0944 100644 (file)
@@ -71,8 +71,6 @@ m_task_t MSG_task_create(const char *name, double compute_duration,
   simdata->refcount = 1;
   simdata->sender = NULL;
   simdata->receiver = NULL;
-  simdata->cond = SIMIX_cond_init();
-  simdata->mutex = SIMIX_mutex_init();
   simdata->compute = NULL;
   simdata->comm = NULL;
 
@@ -184,12 +182,9 @@ MSG_error_t MSG_task_destroy(m_task_t task)
   if (task->name)
     free(task->name);
 
-  SIMIX_cond_destroy(task->simdata->cond);
-  SIMIX_mutex_destroy(task->simdata->mutex);
-
   action = task->simdata->compute;
   if (action)
-    SIMIX_action_destroy(action);
+    SIMIX_req_host_execution_destroy(action);
 
   /* parallel tasks only */
   if (task->simdata->host_list)
@@ -213,11 +208,11 @@ MSG_error_t MSG_task_cancel(m_task_t task)
   xbt_assert0((task != NULL), "Invalid parameter");
 
   if (task->simdata->compute) {
-    SIMIX_action_cancel(task->simdata->compute);
+    SIMIX_req_host_execution_cancel(task->simdata->compute);
     return MSG_OK;
   }
   if (task->simdata->comm) {
-    SIMIX_communication_cancel(task->simdata->comm);
+    SIMIX_req_comm_cancel(task->simdata->comm);
     return MSG_OK;
   }
   THROW_IMPOSSIBLE;
@@ -258,7 +253,7 @@ double MSG_task_get_remaining_computation(m_task_t task)
               && (task->simdata != NULL), "Invalid parameter");
 
   if (task->simdata->compute) {
-    return SIMIX_action_get_remains(task->simdata->compute);
+    return SIMIX_req_host_execution_get_remains(task->simdata->compute);
   } else {
     return task->simdata->computation_amount;
   }
@@ -274,16 +269,9 @@ double MSG_task_get_remaining_communication(m_task_t task)
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
-
-  if(!task->simdata->comm){
-         DEBUG0("you are trying to retrive remaining information on a NULL action, assuming it is zero");
-         return 0;
-  }else{
-         DEBUG1("calling SIMIX_communication_get_remains(%p)",
-                         task->simdata->comm);
-  }
-
-  return SIMIX_communication_get_remains(task->simdata->comm);
+  DEBUG1("calling SIMIX_req_communication_get_remains(%p)",
+         task->simdata->comm);
+  return SIMIX_req_comm_get_remains(task->simdata->comm);
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
@@ -295,9 +283,9 @@ int MSG_task_is_latency_bounded(m_task_t task)
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
-  DEBUG1("calling SIMIX_communication_is_latency_bounded(%p)",
+  DEBUG1("calling SIMIX_req_communication_is_latency_bounded(%p)",
          task->simdata->comm);
-  return SIMIX_communication_is_latency_bounded(task->simdata->comm);
+  return SIMIX_req_comm_is_latency_bounded(task->simdata->comm);
 }
 #endif
 
@@ -328,6 +316,6 @@ void MSG_task_set_priority(m_task_t task, double priority)
 
   task->simdata->priority = 1 / priority;
   if (task->simdata->compute)
-    SIMIX_action_set_priority(task->simdata->compute,
-                              task->simdata->priority);
+    SIMIX_req_host_execution_set_priority(task->simdata->compute,
+                                      task->simdata->priority);
 }
index b84b7b1..71eb57a 100644 (file)
@@ -232,10 +232,6 @@ xbt_dynar_t SD_simulate(double how_long)
     first_time = 0;
   }
 
-  if (how_long > 0) {
-    surf_timer_model->extension.timer.set(surf_get_clock() + how_long,
-                                          NULL, NULL);
-  }
   sd_global->watch_point_reached = 0;
 
   /* explore the runnable tasks */
@@ -253,13 +249,11 @@ xbt_dynar_t SD_simulate(double how_long)
          !sd_global->watch_point_reached) {
     surf_model_t model = NULL;
     /* dumb variables */
-    void *fun = NULL;
-    void *arg = NULL;
 
 
     DEBUG1("Total time: %f", total_time);
 
-    elapsed_time = surf_solve();
+    elapsed_time = surf_solve(how_long > 0 ? surf_get_clock() + how_long : -1.0);
     DEBUG1("surf_solve() returns %f", elapsed_time);
     if (elapsed_time > 0.0)
       total_time += elapsed_time;
@@ -339,9 +333,6 @@ xbt_dynar_t SD_simulate(double how_long)
           xbt_dynar_push(changed_tasks, &task);
       }
     }
-
-    while (surf_timer_model->extension.timer.get(&fun, (void *) &arg)) {
-    }
   }
 
   if (!sd_global->watch_point_reached && how_long<0){
diff --git a/src/simix/host_private.h b/src/simix/host_private.h
new file mode 100644 (file)
index 0000000..63041a1
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _SIMIX_HOST_PRIVATE_H
+#define _SIMIX_HOST_PRIVATE_H
+
+#include "simix/datatypes.h"
+#include "smurf_private.h"
+
+/** @brief Host datatype */
+typedef struct s_smx_host {
+  char *name;              /**< @brief host name if any */
+  void *host;                   /* SURF modeling */
+  xbt_swag_t process_list;
+  void *data;              /**< @brief user data */
+} s_smx_host_t;
+
+smx_host_t SIMIX_host_create(const char *name, void *workstation, void *data);
+void SIMIX_host_destroy(void *host);
+void SIMIX_host_set_data(smx_host_t host, void *data);
+void* SIMIX_host_get_data(smx_host_t host);
+xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
+double SIMIX_host_get_speed(smx_host_t host);
+double SIMIX_host_get_available_speed(smx_host_t host);
+int SIMIX_host_get_state(smx_host_t host);
+smx_action_t SIMIX_host_execute(const char *name,
+    smx_host_t host, double computation_amount);
+smx_action_t SIMIX_host_parallel_execute(const char *name,
+    int host_nb, smx_host_t *host_list,
+    double *computation_amount, double *communication_amount,
+    double amount, double rate);
+void SIMIX_host_execution_destroy(smx_action_t action);
+void SIMIX_host_execution_cancel(smx_action_t action);
+double SIMIX_host_execution_get_remains(smx_action_t action);
+e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action);
+void SIMIX_host_execution_set_priority(smx_action_t action, double priority);
+void SIMIX_pre_host_execution_wait(smx_req_t req);
+
+void SIMIX_host_execution_suspend(smx_action_t action);
+void SIMIX_host_execution_resume(smx_action_t action);
+
+void SIMIX_post_host_execute(smx_action_t action);
+
+#endif
+
diff --git a/src/simix/network_private.h b/src/simix/network_private.h
new file mode 100644 (file)
index 0000000..e49a47a
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _SIMIX_NETWORK_PRIVATE_H
+#define _SIMIX_NETWORK_PRIVATE_H
+
+#include "simix/datatypes.h"
+#include "smurf_private.h"
+
+/** @brief Rendez-vous point datatype */
+typedef struct s_smx_rvpoint {
+  char *name;
+  xbt_fifo_t comm_fifo;
+  void *data;
+} s_smx_rvpoint_t;
+
+void SIMIX_network_init(void);
+void SIMIX_network_exit(void);
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_action_t comm);
+#endif
+
+smx_rdv_t SIMIX_rdv_create(const char *name);
+void SIMIX_rdv_destroy(smx_rdv_t rdv);
+smx_rdv_t SIMIX_rdv_get_by_name(const char *name);
+int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host);
+smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv);
+smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
+                              double task_size, double rate,
+                              void *src_buff, size_t src_buff_size, void *data);
+smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
+                              void *dst_buff, size_t *dst_buff_size);
+void SIMIX_comm_destroy(smx_action_t action);
+void SIMIX_comm_destroy_internal_actions(smx_action_t action);
+void SIMIX_pre_comm_wait(smx_req_t req);
+void SIMIX_pre_comm_waitany(smx_req_t req);
+void SIMIX_post_comm(smx_action_t action);
+void SIMIX_pre_comm_test(smx_req_t req);
+void SIMIX_comm_cancel(smx_action_t action);
+double SIMIX_comm_get_remains(smx_action_t action);
+e_smx_state_t SIMIX_comm_get_state(smx_action_t action);
+void SIMIX_comm_suspend(smx_action_t action);
+void SIMIX_comm_resume(smx_action_t action);
+void* SIMIX_comm_get_data(smx_action_t action);
+void* SIMIX_comm_get_src_buff(smx_action_t action);
+void* SIMIX_comm_get_dst_buff(smx_action_t action);
+size_t SIMIX_comm_get_src_buff_size(smx_action_t action);
+size_t SIMIX_comm_get_dst_buff_size(smx_action_t action);
+smx_process_t SIMIX_comm_get_src_proc(smx_action_t action);
+smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action);
+#endif
+
index 653575e..74a851e 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_PRIVATE_H
-#define SIMIX_PRIVATE_H
+#ifndef _SIMIX_PRIVATE_H
+#define _SIMIX_PRIVATE_H
 
 #include "simix/simix.h"
 #include "surf/surf.h"
 #include "xbt/function_types.h"
 #include "xbt/ex_interface.h"
 #include "instr/private.h"
+#include "process_private.h"
+#include "host_private.h"
+#include "network_private.h"
+#include "smurf_private.h"
+#include "synchro_private.h"
 
-/******************************** Datatypes ***********************************/
-
-
-/*********************************** Host *************************************/
-
-/** @brief Host datatype
-    @ingroup m_datatypes_management_details */
-typedef struct s_smx_host {
-  char *name;              /**< @brief host name if any */
-  void *host;                   /* SURF modeling */
-  xbt_swag_t process_list;
-  void *data;              /**< @brief user data */
-} s_smx_host_t;
+extern int _surf_do_model_check;
 
 /********************************** Simix Global ******************************/
 
@@ -46,8 +39,7 @@ typedef struct SIMIX_Global {
   xbt_dict_t registered_functions;
   smx_creation_func_t create_process_function;
   void_f_pvoid_t kill_process_function;
-  void_f_pvoid_t cleanup_process_function;
-  xbt_dict_t msg_sizes; /* pimple to get an histogram of message sizes in the simulation */
+  void_pfn_smxprocess_t cleanup_process_function;
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   xbt_dict_t latency_limited_dict;
 #endif
@@ -55,149 +47,124 @@ typedef struct SIMIX_Global {
 
 extern SIMIX_Global_t simix_global;
 
-/******************************** Process *************************************/
-
-/** @brief Process datatype 
-    @ingroup m_datatypes_management_details @{ */
-typedef struct s_smx_process {
-  s_xbt_swag_hookup_t process_hookup;
-  s_xbt_swag_hookup_t synchro_hookup;   /* process_to_run or mutex->sleeping and co */
-  s_xbt_swag_hookup_t host_proc_hookup;
-  s_xbt_swag_hookup_t destroy_hookup;
-
-  char *name;                   /**< @brief process name if any */
-  smx_host_t smx_host;          /* the host on which the process is running */
-  smx_context_t context;        /* the context that executes the scheduler function */
-  ex_ctx_t *exception;
-  int blocked:1;
-  int suspended:1;
-  int iwannadie:1;
-  smx_mutex_t mutex;            /* mutex on which the process is blocked  */
-  smx_cond_t cond;              /* cond on which the process is blocked  */
-  smx_sem_t sem;                /* semaphore on which the process is blocked  */
-  smx_action_t waiting_action;
-  xbt_dict_t properties;
-  void *data;                   /* kept for compatibility, it should be replaced with moddata */
-
-} s_smx_process_t;
-/** @} */
-
-typedef struct s_smx_process_arg {
-  const char *name;
-  xbt_main_func_t code;
-  void *data;
-  char *hostname;
-  int argc;
-  char **argv;
-  double kill_time;
-  xbt_dict_t properties;
-} s_smx_process_arg_t, *smx_process_arg_t;
-
-void SIMIX_create_maestro_process(void);
-void SIMIX_process_empty_trash(void);
-void SIMIX_process_schedule(smx_process_t process);
-ex_ctx_t *SIMIX_process_get_exception(void);
-void SIMIX_process_exception_terminate(xbt_ex_t * e);
-
-/******************************* Networking ***********************************/
-
-/** @brief Rendez-vous point datatype */
-typedef struct s_smx_rvpoint {
-  char *name;
-  smx_mutex_t read;
-  smx_mutex_t write;
-  xbt_fifo_t comm_fifo;
-  void *data;
-} s_smx_rvpoint_t;
-
-typedef struct s_smx_comm {
-
-
-  smx_comm_type_t type;         /* Type of the communication (comm_send,comm_recv) */
-  smx_rdv_t rdv;                /* Rendez-vous where the comm is queued */
-  smx_sem_t sem;                /* Semaphore associated to the surf simulation */
-  int refcount;                 /* Number of processes involved in the cond */
-
-  /* Surf action data */
-  smx_process_t src_proc;
-  smx_process_t dst_proc;
-  smx_action_t src_timeout;
-  smx_action_t dst_timeout;
-  smx_action_t act;
-  double rate;
-  double task_size;
-
-  /* Data to be transfered */
-  void *src_buff;
-  void *dst_buff;
-  size_t src_buff_size;
-  size_t *dst_buff_size;
-  char copied;
-
-  void *data;                   /* User data associated to communication */
-} s_smx_comm_t;
-
-void SIMIX_network_copy_data(smx_comm_t comm);
-smx_comm_t SIMIX_communication_new(smx_comm_type_t type);
-static XBT_INLINE void SIMIX_communication_use(smx_comm_t comm);
-static XBT_INLINE void SIMIX_communication_wait_for_completion(smx_comm_t
-                                                               comm,
-                                                               double
-                                                               timeout);
-static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_comm_t comm);
-static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_comm_t comm);
 
-/********************************* Action *************************************/
+/*********************************** Time ************************************/
+
+/** @brief Timer datatype */
+typedef struct s_smx_timer {
+  double date;
+  void* func;
+  void* args;
+} s_smx_timer_t;
 
-typedef enum { ready, ongoing, done, failed } smx_action_state_t;
+/********************************* Action *************************************/
 
-/** @brief Action datatype
-    @ingroup m_datatypes_management_details */
+typedef enum {
+  SIMIX_ACTION_EXECUTE,
+  SIMIX_ACTION_PARALLEL_EXECUTE,
+  SIMIX_ACTION_COMMUNICATE,
+  SIMIX_ACTION_SLEEP,
+  SIMIX_ACTION_SYNCHRO,
+  SIMIX_ACTION_IO
+} e_smx_action_type_t;
+
+typedef enum {
+  SIMIX_COMM_SEND,
+  SIMIX_COMM_RECEIVE,
+  SIMIX_COMM_READY,
+  SIMIX_COMM_DONE
+} e_smx_comm_type_t;
+
+/** @brief Action datatype */
 typedef struct s_smx_action {
-  char *name;              /**< @brief action name if any */
-  xbt_fifo_t cond_list;         /*< conditional variables that must be signaled when the action finish. */
-  xbt_fifo_t sem_list;          /*< semaphores that must be signaled when the action finish. */
-  void *data;              /**< @brief user data */
-  int refcount;            /**< @brief reference counter */
-  surf_action_t surf_action;    /* SURF modeling of computation  */
-  smx_host_t source;
+
+  e_smx_action_type_t type;          /* Type of SIMIX action*/
+  e_smx_state_t state;               /* State of the action */
+  char *name;                        /* Action name if any */
+  xbt_fifo_t request_list;           /* List of requests on this action */
+
+  /* Data specific to each action type */
+  union {
+
+    struct {
+      smx_host_t host;                /* The host where the execution takes place */
+      surf_action_t surf_exec;        /* The Surf execution action encapsulated */
+    } execution; /* Possibly parallel execution */
+
+    struct {
+      e_smx_comm_type_t type;         /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
+      smx_rdv_t rdv;                  /* Rendez-vous where the comm is queued */
+      int refcount;                   /* Number of processes involved in the cond */
+
+      /* Surf action data */
+      surf_action_t surf_comm;        /* The Surf communication action encapsulated */
+      surf_action_t src_timeout;      /* Surf's actions to instrument the timeouts */
+      surf_action_t dst_timeout;      /* Surf's actions to instrument the timeouts */
+      smx_process_t src_proc;
+      smx_process_t dst_proc;
+      double rate;
+      double task_size;
+
+      /* Data to be transfered */
+      void *src_buff;
+      void *dst_buff;
+      size_t src_buff_size;
+      size_t *dst_buff_size;
+      char copied;
+
+      void *data;                     /* User data associated to communication */
+    } comm;    
+
+    struct {
+      smx_host_t host;                /* The host that is sleeping */
+      surf_action_t surf_sleep;       /* The Surf sleeping action encapsulated */
+    } sleep;
+
+    struct {
+      surf_action_t sleep;
+    } synchro;
+    
+  };
+
 #ifdef HAVE_TRACING
-  long long int counter;        /* simix action unique identifier for instrumentation */
-  char *category;               /* simix action category for instrumentation */
+  long long int counter;              /* simix action unique identifier for instrumentation */
+  char *category;                     /* simix action category for instrumentation */
 #endif
 } s_smx_action_t;
 
-/************************** Configuration support *****************************/
-
-extern int _simix_init_status;  /* 0: beginning of time; FIXME: KILLME ?
-                                   1: pre-inited (cfg_set created);
-                                   2: inited (running) */
-
-#define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_model->extension.workstation. \
-                                 get_state(SIMIX_host_self()->host)==SURF_RESOURCE_ON,\
-                                  "Host failed, you cannot call this function.")
-
-smx_host_t __SIMIX_host_create(const char *name, void *workstation,
-                               void *data);
-void __SIMIX_host_destroy(void *host);
-void __SIMIX_cond_wait(smx_cond_t cond);
-void __SIMIX_cond_display_actions(smx_cond_t cond);
-void __SIMIX_action_display_conditions(smx_action_t action);
+/* FIXME: check if we can delete this function */
+static XBT_INLINE e_smx_state_t SIMIX_action_map_state(e_surf_action_state_t state)
+{
+  switch (state) {
+    case SURF_ACTION_READY:
+      return SIMIX_READY;
+    case SURF_ACTION_RUNNING:
+      return SIMIX_RUNNING;
+    case SURF_ACTION_FAILED:
+      return SIMIX_FAILED;
+    case SURF_ACTION_DONE:
+      return SIMIX_DONE;
+    default:
+      xbt_die("Unexpected SURF action state");
+  }
+}
 
 /******************************** Context *************************************/
 
 /* The following function pointer types describe the interface that any context
    factory should implement */
 
+
 typedef smx_context_t(*smx_pfn_context_factory_create_context_t)
- (xbt_main_func_t, int, char **, void_f_pvoid_t, void *);
+ (xbt_main_func_t, int, char **, void_pfn_smxprocess_t, smx_process_t);
 typedef int (*smx_pfn_context_factory_finalize_t) (smx_context_factory_t
                                                    *);
 typedef void (*smx_pfn_context_free_t) (smx_context_t);
 typedef void (*smx_pfn_context_start_t) (smx_context_t);
 typedef void (*smx_pfn_context_stop_t) (smx_context_t);
 typedef void (*smx_pfn_context_suspend_t) (smx_context_t context);
-typedef void (*smx_pfn_context_resume_t) (smx_context_t new_context);
+typedef void (*smx_pfn_context_runall_t) (xbt_swag_t processes);
+typedef smx_process_t (*smx_pfn_context_self_t) (void);
 
 /* interface of the context factories */
 typedef struct s_smx_context_factory {
@@ -206,7 +173,8 @@ typedef struct s_smx_context_factory {
   smx_pfn_context_free_t free;
   smx_pfn_context_stop_t stop;
   smx_pfn_context_suspend_t suspend;
-  smx_pfn_context_resume_t resume;
+  smx_pfn_context_runall_t runall;
+  smx_pfn_context_self_t self;
   const char *name;
 } s_smx_context_factory_t;
 
@@ -251,13 +219,12 @@ void SIMIX_ctx_sysv_factory_init(smx_context_factory_t * factory);
  */
 static XBT_INLINE smx_context_t SIMIX_context_new(xbt_main_func_t code,
                                                   int argc, char **argv,
-                                                  void_f_pvoid_t
-                                                  cleanup_func,
-                                                  void *cleanup_arg)
+                                                  void_pfn_smxprocess_t cleanup_func,
+                                                  smx_process_t simix_process)
 {
 
   return (*(simix_global->context_factory->create_context))
-      (code, argc, argv, cleanup_func, cleanup_arg);
+      (code, argc, argv, cleanup_func, simix_process);
 }
 
 /**
@@ -279,16 +246,6 @@ static XBT_INLINE void SIMIX_context_stop(smx_context_t context)
   (*(simix_global->context_factory->stop)) (context);
 }
 
-/**
- \brief resumes the execution of a context
- \param old_context the actual context from which is resuming
- \param new_context the context to resume
- */
-static XBT_INLINE void SIMIX_context_resume(smx_context_t new_context)
-{
-  (*(simix_global->context_factory->resume)) (new_context);
-}
-
 /**
  \brief suspends a context and return the control back to the one which
         scheduled it
@@ -299,4 +256,26 @@ static XBT_INLINE void SIMIX_context_suspend(smx_context_t context)
   (*(simix_global->context_factory->suspend)) (context);
 }
 
+/**
+ \brief executes all the processes (in parallel if possible)
+ \param processes the swag of processes to execute
+ */
+static XBT_INLINE void SIMIX_context_runall(xbt_swag_t processes)
+{
+  (*(simix_global->context_factory->runall)) (processes);
+}
+
+/**
+ \brief returns the current running process 
+ */
+static XBT_INLINE smx_process_t SIMIX_context_self(void)
+{
+  if (simix_global->context_factory == NULL) {
+    return NULL;
+  }
+
+  return (*(simix_global->context_factory->self))();
+}
+
+
 #endif
diff --git a/src/simix/process_private.h b/src/simix/process_private.h
new file mode 100644 (file)
index 0000000..3641d74
--- /dev/null
@@ -0,0 +1,77 @@
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _SIMIX_PROCESS_PRIVATE_H
+#define _SIMIX_PROCESS_PRIVATE_H
+
+#include "simix/datatypes.h"
+#include "smurf_private.h"
+#include "xbt/setset.h"
+
+/** @brief Process datatype */
+typedef struct s_smx_process {
+  XBT_SETSET_HEADERS;
+  s_xbt_swag_hookup_t process_hookup;
+  s_xbt_swag_hookup_t synchro_hookup;   /* process_to_run or mutex->sleeping and co */
+  s_xbt_swag_hookup_t host_proc_hookup;
+  s_xbt_swag_hookup_t destroy_hookup;
+  
+  unsigned long pid;
+  char *name;                   /**< @brief process name if any */
+  smx_host_t smx_host;          /* the host on which the process is running */
+  smx_context_t context;        /* the context (either uctx or thread) that executes the user function */
+  xbt_running_ctx_t *running_ctx;
+  int doexception:1;
+  int blocked:1;
+  int suspended:1;
+  int iwannadie:1;
+  smx_action_t waiting_action;
+  xbt_dict_t properties;
+  smx_req_t request;
+  void *data;                   /* kept for compatibility, it should be replaced with moddata */
+
+} s_smx_process_t;
+
+typedef struct s_smx_process_arg {
+  const char *name;
+  xbt_main_func_t code;
+  void *data;
+  char *hostname;
+  int argc;
+  char **argv;
+  double kill_time;
+  xbt_dict_t properties;
+} s_smx_process_arg_t, *smx_process_arg_t;
+
+void SIMIX_process_kill(smx_process_t process, smx_process_t killer);
+void SIMIX_process_killall(void);
+smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args);
+void SIMIX_create_maestro_process(void);
+void SIMIX_process_empty_trash(void);
+void SIMIX_process_yield(void);
+xbt_running_ctx_t *SIMIX_process_get_running_context(void);
+void SIMIX_process_exception_terminate(xbt_ex_t * e);
+void SIMIX_process_change_host(smx_process_t process,
+    const char *source, const char *dest);
+void SIMIX_pre_process_suspend(smx_req_t req);
+void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
+void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
+void* SIMIX_process_get_data(smx_process_t process);
+void SIMIX_process_set_data(smx_process_t process, void *data);
+smx_host_t SIMIX_process_get_host(smx_process_t process);
+const char* SIMIX_process_get_name(smx_process_t process);
+int SIMIX_process_is_suspended(smx_process_t process);
+int SIMIX_process_is_enabled(smx_process_t process);
+xbt_dict_t SIMIX_process_get_properties(smx_process_t process);
+void SIMIX_pre_process_sleep(smx_req_t req);
+smx_action_t SIMIX_process_sleep(smx_process_t process, double duration);
+void SIMIX_post_process_sleep(smx_action_t action);
+
+void SIMIX_process_sleep_suspend(smx_action_t action);
+void SIMIX_process_sleep_resume(smx_action_t action);
+void SIMIX_process_sleep_destroy(smx_action_t action);
+
+#endif
diff --git a/src/simix/smurf_private.h b/src/simix/smurf_private.h
new file mode 100644 (file)
index 0000000..3a31142
--- /dev/null
@@ -0,0 +1,456 @@
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _SIMIX_SMURF_PRIVATE_H
+#define _SIMIX_SMURF_PRIVATE_H
+
+/********************************* Requests ***********************************/
+typedef enum {
+  REQ_HOST_GET_BY_NAME,
+  REQ_HOST_GET_NAME,
+  REQ_HOST_GET_PROPERTIES,
+  REQ_HOST_GET_SPEED,
+  REQ_HOST_GET_AVAILABLE_SPEED,
+  REQ_HOST_GET_STATE,
+  REQ_HOST_GET_DATA,
+  REQ_HOST_SET_DATA,
+  REQ_HOST_EXECUTE,
+  REQ_HOST_PARALLEL_EXECUTE,
+  REQ_HOST_EXECUTION_DESTROY,
+  REQ_HOST_EXECUTION_CANCEL,
+  REQ_HOST_EXECUTION_GET_REMAINS,
+  REQ_HOST_EXECUTION_GET_STATE,
+  REQ_HOST_EXECUTION_SET_PRIORITY,
+  REQ_HOST_EXECUTION_WAIT,
+  REQ_PROCESS_CREATE,
+  REQ_PROCESS_KILL,
+  REQ_PROCESS_CHANGE_HOST,
+  REQ_PROCESS_SUSPEND,
+  REQ_PROCESS_RESUME,
+  REQ_PROCESS_COUNT,
+  REQ_PROCESS_GET_DATA,
+  REQ_PROCESS_SET_DATA,
+  REQ_PROCESS_GET_HOST,
+  REQ_PROCESS_GET_NAME,
+  REQ_PROCESS_IS_SUSPENDED,
+  REQ_PROCESS_GET_PROPERTIES,
+  REQ_PROCESS_SLEEP,
+  REQ_RDV_CREATE,
+  REQ_RDV_DESTROY,
+  REQ_RDV_GEY_BY_NAME,
+  REQ_RDV_COMM_COUNT_BY_HOST,
+  REQ_RDV_GET_HEAD,
+  REQ_COMM_ISEND,
+  REQ_COMM_IRECV,
+  REQ_COMM_DESTROY,
+  REQ_COMM_CANCEL,
+  REQ_COMM_WAITANY,
+  REQ_COMM_WAIT,
+  REQ_COMM_TEST,
+  REQ_COMM_GET_REMAINS,
+  REQ_COMM_GET_STATE,
+  REQ_COMM_GET_DATA,
+  REQ_COMM_GET_SRC_BUFF,
+  REQ_COMM_GET_DST_BUFF,
+  REQ_COMM_GET_SRC_BUFF_SIZE,
+  REQ_COMM_GET_DST_BUFF_SIZE,
+  REQ_COMM_GET_SRC_PROC,
+  REQ_COMM_GET_DST_PROC,
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  REQ_COMM_IS_LATENCY_BOUNDED,
+#endif
+  REQ_MUTEX_INIT,
+  REQ_MUTEX_DESTROY,
+  REQ_MUTEX_LOCK,
+  REQ_MUTEX_TRYLOCK,
+  REQ_MUTEX_UNLOCK,
+  REQ_COND_INIT,
+  REQ_COND_DESTROY,
+  REQ_COND_SIGNAL,
+  REQ_COND_WAIT,
+  REQ_COND_WAIT_TIMEOUT,
+  REQ_COND_BROADCAST,
+  REQ_SEM_INIT,
+  REQ_SEM_DESTROY,
+  REQ_SEM_RELEASE,
+  REQ_SEM_WOULD_BLOCK,
+  REQ_SEM_ACQUIRE,
+  REQ_SEM_ACQUIRE_TIMEOUT,
+  REQ_SEM_GET_CAPACITY
+} e_smx_req_t;
+
+typedef struct s_smx_req {
+  s_xbt_swag_hookup_t state_hookup;
+  e_smx_req_t call;
+  smx_process_t issuer;
+
+  union {
+
+    struct {
+      const char *name;
+      smx_host_t result;
+    } host_get_by_name;
+
+    struct {
+      smx_host_t host;
+      const char* result;
+    } host_get_name;
+
+    struct {
+      smx_host_t host;
+      xbt_dict_t result;
+    } host_get_properties;
+
+    struct {
+      smx_host_t host;
+      double result;
+    } host_get_speed;
+
+    struct {
+      smx_host_t host;
+      double result;
+    } host_get_available_speed;
+
+    struct {
+      smx_host_t host;
+      int result;
+    } host_get_state;
+
+    struct {
+      smx_host_t host;
+      void* result;
+    } host_get_data;
+
+    struct {
+      smx_host_t host;
+      void* data;
+    } host_set_data;
+
+    struct {
+      const char* name;
+      smx_host_t host;
+      double computation_amount;
+      smx_action_t result;
+    } host_execute;
+
+    struct {
+      const char *name;
+      int host_nb;
+      smx_host_t *host_list;
+      double *computation_amount;
+      double *communication_amount;
+      double amount;
+      double rate;
+      smx_action_t result;
+    } host_parallel_execute;
+
+    struct {
+      smx_action_t execution;
+    } host_execution_destroy;
+
+    struct {
+      smx_action_t execution;
+    } host_execution_cancel;
+
+    struct {
+      smx_action_t execution;
+      double result;
+    } host_execution_get_remains;
+
+    struct {
+      smx_action_t execution;
+      e_smx_state_t result;
+    } host_execution_get_state;
+
+    struct {
+      smx_action_t execution;
+      double priority;
+    } host_execution_set_priority;
+
+    struct {
+      smx_action_t execution;
+    } host_execution_wait;
+
+    struct {
+      const char *name;
+      xbt_main_func_t code;
+      void *data;
+      const char *hostname;
+      int argc;
+      char **argv;
+      xbt_dict_t properties;
+      smx_process_t result;
+    } process_create;
+
+    struct {
+      smx_process_t process;
+    } process_kill;
+
+    struct {
+      smx_process_t process;
+      const char *source;
+      const char *dest;
+    } process_change_host;
+
+    struct {
+      smx_process_t process;
+    } process_suspend;
+
+    struct {
+      smx_process_t process;
+    } process_resume;
+
+    struct {
+      int result;
+    } process_count;
+
+    struct {
+      smx_process_t process;
+      void* result;
+    } process_get_data;
+
+    struct {
+      smx_process_t process;
+      void* data;
+    } process_set_data;
+
+    struct {
+      smx_process_t process;
+      smx_host_t result;
+    } process_get_host;
+
+    struct {
+      smx_process_t process;
+      const char *result;
+    } process_get_name;
+
+    struct {
+      smx_process_t process;
+      int result;
+    } process_is_suspended;
+
+    struct {
+      smx_process_t process;
+      xbt_dict_t result;
+    } process_get_properties;
+
+    struct {
+      double duration;
+      e_smx_state_t result;
+    } process_sleep;
+
+    struct {
+      const char *name;
+      smx_rdv_t result;
+    } rdv_create;
+
+    struct {
+      smx_rdv_t rdv;
+    } rdv_destroy;
+
+    struct {
+      const char* name;
+      smx_rdv_t result;
+    } rdv_get_by_name;
+    
+    struct {
+      smx_rdv_t rdv;
+      smx_host_t host;
+      unsigned int result; 
+    } rdv_comm_count_by_host;
+
+    struct {
+      smx_rdv_t rdv;
+      smx_action_t result;
+    } rdv_get_head;
+    struct {
+      smx_rdv_t rdv;
+      double task_size;
+      double rate;
+      void *src_buff;
+      size_t src_buff_size;
+      void *data;
+      smx_action_t result;      
+    } comm_isend;
+
+    struct {
+      smx_rdv_t rdv;
+      void *dst_buff;
+      size_t *dst_buff_size;
+      smx_action_t result;
+    } comm_irecv;
+
+    struct {
+      smx_action_t comm;
+    } comm_destroy;
+
+    struct {
+      smx_action_t comm;
+    } comm_cancel;
+    struct {
+      xbt_dynar_t comms;
+      unsigned int result;
+    } comm_waitany;
+    struct {
+      smx_action_t comm;
+      double timeout;
+    } comm_wait;
+
+    struct {
+      smx_action_t comm;
+      int result;
+    } comm_test;
+
+    struct {
+      smx_action_t comm;
+      double result;
+    } comm_get_remains;
+    struct {
+      smx_action_t comm;
+      e_smx_state_t result;
+    } comm_get_state;
+    struct {
+      smx_action_t comm;
+      void *result;    
+    } comm_get_data;
+    struct {
+      smx_action_t comm;
+      void *result;
+    } comm_get_src_buff;
+    struct {
+      smx_action_t comm;
+      void *result;
+    } comm_get_dst_buff;
+    
+    struct {
+      smx_action_t comm;
+      size_t result;
+    } comm_get_src_buff_size;
+    
+    struct {
+      smx_action_t comm;
+      size_t result;
+    } comm_get_dst_buff_size;
+    
+    struct {
+      smx_action_t comm;
+      smx_process_t result;
+    } comm_get_src_proc;
+    
+    struct {
+      smx_action_t comm;
+      smx_process_t result;
+    } comm_get_dst_proc;
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+    struct {
+      smx_action_t comm;
+      int result;
+    } comm_is_latency_bounded;
+#endif
+
+    struct {
+      smx_mutex_t result;
+    } mutex_init;
+
+    struct {
+      smx_mutex_t mutex;
+    } mutex_lock;
+
+    struct {
+      smx_mutex_t mutex;
+      int result;
+    } mutex_trylock;
+
+    struct {
+      smx_mutex_t mutex;
+    } mutex_unlock;
+
+    struct {
+      smx_mutex_t mutex;
+    } mutex_destroy;
+
+    struct {
+      smx_cond_t result;
+    } cond_init;
+
+    struct {
+      smx_cond_t cond;
+    } cond_destroy;
+
+    struct {
+      smx_cond_t cond;
+    } cond_signal;
+
+    struct {
+      smx_cond_t cond;
+      smx_mutex_t mutex;
+    } cond_wait;
+
+    struct {
+      smx_cond_t cond;
+      smx_mutex_t mutex;
+      double timeout;
+    } cond_wait_timeout;
+
+    struct {
+      smx_cond_t cond;
+    } cond_broadcast;
+
+    struct {
+      int capacity;
+      smx_sem_t result;
+    } sem_init;
+
+    struct {
+      smx_sem_t sem;
+    } sem_destroy;
+
+    struct {
+      smx_sem_t sem;
+    } sem_release;
+
+    struct {
+      smx_sem_t sem;
+      int result;
+    } sem_would_block;
+
+    struct {
+      smx_sem_t sem;
+    } sem_acquire;
+
+    struct {
+      smx_sem_t sem;
+      double timeout;
+    } sem_acquire_timeout;
+
+    struct {
+      smx_sem_t sem;
+      int result;
+    } sem_get_capacity;
+  };
+} s_smx_req_t, *smx_req_t;
+
+/******************************** General *************************************/
+
+void SIMIX_request_init(void);
+void SIMIX_request_destroy(void);
+void SIMIX_request_push(smx_req_t);
+smx_req_t SIMIX_request_pop(void);
+void SIMIX_request_answer(smx_req_t);
+void SIMIX_request_pre(smx_req_t);
+void SIMIX_request_post(smx_action_t);
+int SIMIX_request_isVisible(smx_req_t req);
+int SIMIX_request_isEnabled(smx_req_t req);
+#endif
+
diff --git a/src/simix/smx_action.c b/src/simix/smx_action.c
deleted file mode 100644 (file)
index 5912913..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "private.h"
-#include "xbt/log.h"
-#include "xbt/ex.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_action, simix,
-                                "Logging specific to SIMIX (action)");
-
-/************************************* Actions *********************************/
-/** \brief Creates a new SIMIX action to communicate two hosts.
- *
- *     This function creates a SURF action and allocates the data necessary to create the SIMIX action. It can raise a network_error exception if the host is unavailable.
- *     \param sender SIMIX host sender
- *     \param receiver SIMIX host receiver
- *     \param name Action name
- *     \param size Communication size (in bytes)
- *     \param rate Communication rate between hosts.
- *     \return A new SIMIX action
- * */
-smx_action_t SIMIX_action_communicate(smx_host_t sender,
-                                      smx_host_t receiver,
-                                      const char *name, double size,
-                                      double rate)
-{
-  smx_action_t act;
-
-  /* check if the host is active */
-  if (surf_workstation_model->extension.
-      workstation.get_state(sender->host) != SURF_RESOURCE_ON) {
-    THROW1(network_error, 0,
-           "Host %s failed, you cannot call this function", sender->name);
-  }
-  if (surf_workstation_model->extension.workstation.
-      get_state(receiver->host) != SURF_RESOURCE_ON) {
-    THROW1(network_error, 0,
-           "Host %s failed, you cannot call this function",
-           receiver->name);
-  }
-
-  /* alloc structures */
-  act = xbt_new0(s_smx_action_t, 1);
-  act->cond_list = xbt_fifo_new();
-  act->sem_list = xbt_fifo_new();
-
-  /* initialize them */
-  act->name = xbt_strdup(name);
-  act->source = sender;
-#ifdef HAVE_TRACING
-  act->category = NULL;
-#endif
-
-  act->surf_action =
-      surf_workstation_model->extension.workstation.
-      communicate(sender->host, receiver->host, size, rate);
-  surf_workstation_model->action_data_set(act->surf_action, act);
-
-  DEBUG1("Create communicate action %p", act);
-  return act;
-}
-
-/** \brief Creates a new SIMIX action to execute an action.
- *
- *     This function creates a SURF action and allocates the data necessary to create the SIMIX action. It can raise a host_error exception if the host crashed.
- *     \param host SIMIX host where the action will be executed
- *     \param name Action name
- *     \param amount Task amount (in bytes)
- *     \return A new SIMIX action
- * */
-smx_action_t SIMIX_action_execute(smx_host_t host, const char *name,
-                                  double amount)
-{
-  smx_action_t act;
-
-  /* check if the host is active */
-  if (surf_workstation_model->extension.
-      workstation.get_state(host->host) != SURF_RESOURCE_ON) {
-    THROW1(host_error, 0, "Host %s failed, you cannot call this function",
-           host->name);
-  }
-
-  /* alloc structures */
-  act = xbt_new0(s_smx_action_t, 1);
-  act->cond_list = xbt_fifo_new();
-  act->sem_list = xbt_fifo_new();
-
-  /* initialize them */
-  act->source = host;
-  act->name = xbt_strdup(name);
-#ifdef HAVE_TRACING
-  act->category = NULL;
-#endif
-
-  /* set execute */
-  act->surf_action =
-      surf_workstation_model->extension.workstation.execute(host->host,
-                                                            amount);
-
-  surf_workstation_model->action_data_set(act->surf_action, act);
-
-  DEBUG1("Create execute action %p", act);
-#ifdef HAVE_TRACING
-  TRACE_smx_action_execute(act);
-  TRACE_surf_action(act->surf_action, act->category);
-#endif
-  return act;
-}
-
-/** \brief Creates a new sleep SIMIX action.
- *
- * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX action. It can raise a host_error exception if the
- * host crashed. The default SIMIX name of the action is "sleep".
- *
- *     \param host SIMIX host where the sleep will run.
- *     \param duration Time duration of the sleep.
- *     \return A new SIMIX action
- * */
-smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
-{
-  char name[] = "sleep";
-  smx_action_t act;
-
-  /* check if the host is active */
-  if (surf_workstation_model->extension.
-      workstation.get_state(host->host) != SURF_RESOURCE_ON) {
-    THROW1(host_error, 0, "Host %s failed, you cannot call this function",
-           host->name);
-  }
-
-  /* alloc structures */
-  act = xbt_new0(s_smx_action_t, 1);
-  act->cond_list = xbt_fifo_new();
-  act->sem_list = xbt_fifo_new();
-
-  /* initialize them */
-  act->source = host;
-  act->name = xbt_strdup(name);
-#ifdef HAVE_TRACING
-  act->category = NULL;
-#endif
-
-  act->surf_action =
-      surf_workstation_model->extension.workstation.sleep(host->host,
-                                                          duration);
-
-  surf_workstation_model->action_data_set(act->surf_action, act);
-
-  DEBUG1("Create sleep action %p", act);
-  return act;
-}
-
-/**
- *     \brief Cancels an action.
- *
- *     This functions stops the execution of an action. It calls a surf functions.
- *     \param action The SIMIX action
- */
-XBT_INLINE void SIMIX_action_cancel(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  DEBUG1("Cancel action %p", action);
-  if (action->surf_action) {
-    surf_workstation_model->action_cancel(action->surf_action);
-  }
-  return;
-}
-
-/**
- *     \brief Changes the action's priority
- *
- *     This functions changes the priority only. It calls a surf functions.
- *     \param action The SIMIX action
- *     \param priority The new priority
- */
-XBT_INLINE void SIMIX_action_set_priority(smx_action_t action,
-                                          double priority)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  surf_workstation_model->set_priority(action->surf_action, priority);
-  return;
-}
-
-/**
- *     \brief Resumes the execution of an action.
- *
- *  This functions restarts the execution of an action. It just calls the right SURF function.
- *  \param action The SIMIX action
- *  \param priority The new priority
- */
-XBT_INLINE void SIMIX_action_resume(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  surf_workstation_model->resume(action->surf_action);
-  return;
-}
-
-/**
- *  \brief Suspends the execution of an action.
- *
- *  This functions suspends the execution of an action. It just calls the right SURF function.
- *  \param action The SIMIX action
- *  \param priority The new priority
- */
-XBT_INLINE void SIMIX_action_suspend(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  surf_workstation_model->suspend(action->surf_action);
-  return;
-}
-
-/**
- *     \brief Destroys an action
- *
- *     Destroys an action, freing its memory. This function cannot be called if there are a conditional waiting for it.
- *     \param action The SIMIX action
- */
-int SIMIX_action_destroy(smx_action_t action)
-{
-  XBT_IN3("(%p:'%s',%d)", action, action->name, action->refcount);
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  action->refcount--;
-  if (action->refcount > 0)
-    return 0;
-
-  xbt_assert1((xbt_fifo_size(action->cond_list) == 0),
-              "Conditional list not empty %d. There is a problem. Cannot destroy it now!",
-              xbt_fifo_size(action->cond_list));
-
-  xbt_assert1((xbt_fifo_size(action->sem_list) == 0),
-              "Semaphore list not empty %d. There is a problem. Cannot destroy it now!",
-              xbt_fifo_size(action->sem_list));
-
-  DEBUG1("Destroy action %p", action);
-  if (action->name)
-    xbt_free(action->name);
-
-  xbt_fifo_free(action->cond_list);
-  xbt_fifo_free(action->sem_list);
-
-  if (action->surf_action)
-    action->surf_action->model_type->action_unref(action->surf_action);
-#ifdef HAVE_TRACING
-  TRACE_smx_action_destroy(action);
-#endif
-  xbt_free(action);
-  return 1;
-}
-
-/**
- *     \brief Increase refcount of anan action
- *
- *     \param action The SIMIX action
- */
-XBT_INLINE void SIMIX_action_use(smx_action_t action)
-{
-  XBT_IN3("(%p:'%s',%d)", action, action->name, action->refcount);
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  action->refcount++;
-
-  return;
-}
-
-/**
- *     \brief Decrease refcount of anan action
- *
- *     \param action The SIMIX action
- */
-XBT_INLINE void SIMIX_action_release(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-
-  action->refcount--;
-
-  return;
-}
-
-/**
- *  \brief Set an action to a condition
- *
- *  Creates the "link" between an action and a condition. You have to call this function when you create an action and want to wait its ending.
- *  \param action SIMIX action
- *  \param cond SIMIX cond
- */
-void SIMIX_register_action_to_condition(smx_action_t action,
-                                        smx_cond_t cond)
-{
-  xbt_assert0((action != NULL) && (cond != NULL), "Invalid parameters");
-
-  DEBUG2("Register action %p to cond %p", action, cond);
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_cond_display_actions(cond);
-
-  xbt_fifo_push(cond->actions, action);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_cond_display_actions(cond);
-
-  DEBUG2("Register condition %p to action %p", cond, action);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_action_display_conditions(action);
-
-  xbt_fifo_push(action->cond_list, cond);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_action_display_conditions(action);
-}
-
-/**
- *  \brief Unset an action to a condition.
- *
- *  Destroys the "links" from the condition to this action.
- *  \param action SIMIX action
- *  \param cond SIMIX cond
- */
-void SIMIX_unregister_action_to_condition(smx_action_t action,
-                                          smx_cond_t cond)
-{
-  xbt_assert0((action != NULL) && (cond != NULL), "Invalid parameters");
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_cond_display_actions(cond);
-
-  xbt_fifo_remove_all(cond->actions, action);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_cond_display_actions(cond);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_action_display_conditions(action);
-
-  xbt_fifo_remove_all(action->cond_list, cond);
-
-  if (XBT_LOG_ISENABLED(simix_action, xbt_log_priority_debug))
-    __SIMIX_action_display_conditions(action);
-}
-
-/**
- *  \brief Link an action to a semaphore
- *
- *  When the action terminates, the semaphore gets signaled automatically.
- */
-XBT_INLINE void SIMIX_register_action_to_semaphore(smx_action_t action,
-                                                   smx_sem_t sem)
-{
-
-  DEBUG2("Register action %p to semaphore %p (and otherwise)", action,
-         sem);
-  xbt_fifo_push(sem->actions, action);
-  xbt_fifo_push(action->sem_list, sem);
-}
-
-/**
- *  \brief Unset an action to a semaphore.
- *
- *  Destroys the "links" from the semaphore to this action.
- */
-XBT_INLINE void SIMIX_unregister_action_to_semaphore(smx_action_t action,
-                                                     smx_sem_t sem)
-{
-  xbt_fifo_remove_all(sem->actions, action);
-  xbt_fifo_remove_all(action->sem_list, sem);
-}
-
-/**
- *     \brief Return how much remais to be done in the action.
- *
- *     \param action The SIMIX action
- *     \return Remains cost
- */
-XBT_INLINE double SIMIX_action_get_remains(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-  return surf_workstation_model->get_remains(action->surf_action);
-}
-
-#ifdef HAVE_LATENCY_BOUND_TRACKING
-XBT_INLINE int SIMIX_action_is_latency_bounded(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-  return surf_workstation_model->get_latency_limited(action->surf_action);
-}
-#endif
-
-smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
-                                           smx_host_t * host_list,
-                                           double *computation_amount,
-                                           double *communication_amount,
-                                           double amount, double rate)
-{
-  void **workstation_list = NULL;
-  smx_action_t act;
-  int i;
-
-  /* alloc structures */
-  act = xbt_new0(s_smx_action_t, 1);
-  act->cond_list = xbt_fifo_new();
-  act->sem_list = xbt_fifo_new();
-
-  /* initialize them */
-  act->name = xbt_strdup(name);
-#ifdef HAVE_TRACING
-  act->category = NULL;
-#endif
-
-  /* set action */
-
-  workstation_list = xbt_new0(void *, host_nb);
-  for (i = 0; i < host_nb; i++)
-    workstation_list[i] = host_list[i]->host;
-
-  act->surf_action =
-      surf_workstation_model->extension.workstation.
-      execute_parallel_task(host_nb, workstation_list, computation_amount,
-                            communication_amount, amount, rate);
-
-  surf_workstation_model->action_data_set(act->surf_action, act);
-
-  return act;
-}
-
-XBT_INLINE e_surf_action_state_t SIMIX_action_get_state(smx_action_t
-                                                        action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-  return surf_workstation_model->action_state_get(action->surf_action);
-}
-
-void __SIMIX_cond_display_actions(smx_cond_t cond)
-{
-  xbt_fifo_item_t item = NULL;
-  smx_action_t action = NULL;
-
-  DEBUG1("Actions for condition %p", cond);
-  xbt_fifo_foreach(cond->actions, item, action, smx_action_t)
-      DEBUG2("\t %p [%s]", action, action->name);
-}
-
-void __SIMIX_action_display_conditions(smx_action_t action)
-{
-  xbt_fifo_item_t item = NULL;
-  smx_cond_t cond = NULL;
-
-  DEBUG1("Conditions for action %p", action);
-  xbt_fifo_foreach(action->cond_list, item, cond, smx_cond_t)
-      DEBUG1("\t %p", cond);
-}
-
-XBT_INLINE char *SIMIX_action_get_name(smx_action_t action)
-{
-  xbt_assert0((action != NULL), "Invalid parameter");
-  return action->name;
-}
-
-/** @brief Change the name of the action. Warning, the string you provide is not strdup()ed */
-XBT_INLINE void SIMIX_action_set_name(smx_action_t action, char *name)
-{
-  xbt_free(action->name);
-  action->name = name;
-}
-
-/** @brief broadcast any condition and release any semaphore including this action */
-void SIMIX_action_signal_all(smx_action_t action)
-{
-  smx_cond_t cond;
-  smx_sem_t sem;
-
-  while ((cond = xbt_fifo_pop(action->cond_list)))
-    SIMIX_cond_broadcast(cond);
-
-  while ((sem = xbt_fifo_pop(action->sem_list)))
-    SIMIX_sem_release(sem);
-}
index fe09611..2c9a758 100644 (file)
@@ -22,7 +22,8 @@ void smx_ctx_base_factory_init(smx_context_factory_t * factory)
   (*factory)->free = smx_ctx_base_free;
   (*factory)->stop = smx_ctx_base_stop;
   (*factory)->suspend = NULL;
-  (*factory)->resume = NULL;
+  (*factory)->runall = NULL;
+  (*factory)->self = smx_ctx_base_self;
 
   (*factory)->name = "base context factory";
 }
@@ -38,8 +39,8 @@ smx_context_t
 smx_ctx_base_factory_create_context_sized(size_t size,
                                           xbt_main_func_t code, int argc,
                                           char **argv,
-                                          void_f_pvoid_t cleanup_func,
-                                          void *cleanup_arg)
+                                          void_pfn_smxprocess_t cleanup_func,
+                                          smx_process_t process)
 {
   smx_context_t context = xbt_malloc0(size);
 
@@ -47,7 +48,7 @@ smx_ctx_base_factory_create_context_sized(size_t size,
      otherwise is the context for maestro */
   if (code) {
     context->cleanup_func = cleanup_func;
-    context->cleanup_arg = cleanup_arg;
+    context->process = process;
     context->argc = argc;
     context->argv = argv;
     context->code = code;
@@ -80,6 +81,11 @@ void smx_ctx_base_stop(smx_context_t context)
 {
 
   if (context->cleanup_func)
-    (*(context->cleanup_func)) (context->cleanup_arg);
+    (*(context->cleanup_func)) (context->process);
 
 }
+
+smx_process_t smx_ctx_base_self(void)
+{
+  return simix_global->current_process;
+}
index 6d002cf..daf5676 100644 (file)
@@ -15,14 +15,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jmsg, bindings, "MSG for Java(TM)");
 static smx_context_t
 smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
                                     char **argv,
-                                    void_f_pvoid_t cleanup_func,
-                                    void *cleanup_arg);
+                                    void_pfn_smxprocess_t cleanup_func,
+                                    smx_process_t process);
 
 static void smx_ctx_java_free(smx_context_t context);
 static void smx_ctx_java_start(smx_context_t context);
 static void smx_ctx_java_stop(smx_context_t context);
 static void smx_ctx_java_suspend(smx_context_t context);
 static void smx_ctx_java_resume(smx_context_t new_context);
+static void smx_ctx_java_runall(xbt_swag_t processes);
 
 void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory)
 {
@@ -34,16 +35,15 @@ void SIMIX_ctx_java_factory_init(smx_context_factory_t * factory)
   (*factory)->free = smx_ctx_java_free;
   (*factory)->stop = smx_ctx_java_stop;
   (*factory)->suspend = smx_ctx_java_suspend;
-  (*factory)->resume = smx_ctx_java_resume;
-
+  (*factory)->runall = smx_ctx_java_runall;
   (*factory)->name = "ctx_java_factory";
 }
 
 static smx_context_t
 smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
                                     char **argv,
-                                    void_f_pvoid_t cleanup_func,
-                                    void *cleanup_arg)
+                                    void_pfn_smxprocess_t cleanup_func,
+                                    smx_process_t process)
 {
   smx_ctx_java_t context = xbt_new0(s_smx_ctx_java_t, 1);
 
@@ -51,7 +51,7 @@ smx_ctx_java_factory_create_context(xbt_main_func_t code, int argc,
      otherwise is the context for maestro */
   if (code) {
     context->super.cleanup_func = cleanup_func;
-    context->super.cleanup_arg = cleanup_arg;
+    context->super.process = process;
     context->jprocess = (jobject) code;
     context->jenv = get_current_thread_env();
     jprocess_start(((smx_ctx_java_t) context)->jprocess,
@@ -87,7 +87,7 @@ static void smx_ctx_java_stop(smx_context_t context)
   smx_ctx_java_t ctx_java;
 
   if (context->cleanup_func)
-    (*(context->cleanup_func)) (context->cleanup_arg);
+    (*(context->cleanup_func)) (context->process);
 
   ctx_java = (smx_ctx_java_t) context;
 
@@ -142,3 +142,13 @@ static void smx_ctx_java_resume(smx_context_t new_context)
 {
   jprocess_schedule(new_context);
 }
+
+static void smx_ctx_java_runall(xbt_swag_t processes)
+{
+  smx_process_t process;
+  while((process = xbt_swag_extract(processes))){
+    simix_global->current_process = process;
+    smx_ctx_java_resume(process->context);
+    simix_global->current_process = simix_global->maestro_process;
+  }
+}
index cce495c..fc577da 100644 (file)
@@ -17,6 +17,8 @@ SG_BEGIN_DECL()
 typedef void (*SIMIX_ctx_factory_initializer_t)(smx_context_factory_t *);
 extern SIMIX_ctx_factory_initializer_t factory_initializer_to_use;
 
+extern int _surf_parallel_contexts;
+
 /* *********************** */
 /* Context type definition */
 /* *********************** */
@@ -29,8 +31,8 @@ typedef struct s_smx_context {
   xbt_main_func_t code;
   int argc;
   char **argv;
-  void_f_pvoid_t cleanup_func;
-  void *cleanup_arg;
+  void_pfn_smxprocess_t cleanup_func;
+  smx_process_t process;
 } s_smx_ctx_base_t;
 /* methods of this class */
 void smx_ctx_base_factory_init(smx_context_factory_t * factory);
@@ -40,10 +42,11 @@ smx_context_t
 smx_ctx_base_factory_create_context_sized(size_t size,
                                           xbt_main_func_t code, int argc,
                                           char **argv,
-                                          void_f_pvoid_t cleanup_func,
-                                          void *cleanup_arg);
+                                          void_pfn_smxprocess_t cleanup,
+                                          smx_process_t process);
 void smx_ctx_base_free(smx_context_t context);
 void smx_ctx_base_stop(smx_context_t context);
+smx_process_t smx_ctx_base_self(void);
 
 SG_END_DECL()
 #endif                          /* !_XBT_CONTEXT_PRIVATE_H */
index 0c39246..215e157 100644 (file)
@@ -18,13 +18,13 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ruby);
 
 static smx_context_t
 smx_ctx_ruby_create_context(xbt_main_func_t code, int argc, char **argv,
-                            void_f_pvoid_t cleanup_func,
-                            void *cleanup_arg);
+    void_pfn_smxprocess_t cleanup_func,
+    smx_process_t process);
 
 static void smx_ctx_ruby_stop(smx_context_t context);
 static void smx_ctx_ruby_suspend(smx_context_t context);
 static void smx_ctx_ruby_resume(smx_context_t new_context);
-
+static void smx_ctx_ruby_runall(xbt_swag_t processes);
 
 void SIMIX_ctx_ruby_factory_init(smx_context_factory_t * factory)
 {
@@ -35,21 +35,22 @@ void SIMIX_ctx_ruby_factory_init(smx_context_factory_t * factory)
   /* Do not overload that method (*factory)->free */
   (*factory)->stop = smx_ctx_ruby_stop;
   (*factory)->suspend = smx_ctx_ruby_suspend;
-  (*factory)->resume = smx_ctx_ruby_resume;
   (*factory)->name = "smx_ruby_context_factory";
+  (*factory)->runall = smx_ctx_ruby_runall;
   ruby_init();
   ruby_init_loadpath();
 }
 
 static smx_context_t
 smx_ctx_ruby_create_context(xbt_main_func_t code, int argc, char **argv,
-                            void_f_pvoid_t cleanup_func, void *cleanup_arg)
+    void_pfn_smxprocess_t cleanup_func,
+    smx_process_t process)
 {
 
   smx_ctx_ruby_t context = (smx_ctx_ruby_t)
       smx_ctx_base_factory_create_context_sized(sizeof(s_smx_ctx_ruby_t),
                                                 code, argc, argv,
-                                                cleanup_func, cleanup_arg);
+                                                cleanup_func, process);
 
   /* if the user provided a function for the process , then use it
      Otherwise it's the context for maestro */
@@ -110,3 +111,13 @@ static void smx_ctx_ruby_resume(smx_context_t new_context)
   rb_process_schedule(ctx_ruby->process);
 
 }
+
+static void smx_ctx_ruby_runall(xbt_swag_t processes)
+{
+  smx_process_t process;
+  while((process = xbt_swag_extract(processes))){
+    simix_global->current_process = process;
+    smx_ctx_ruby_resume(process->context);
+    simix_global->current_process = simix_global->maestro_process;
+  } 
+}
\ No newline at end of file
index a1dc635..9774fda 100644 (file)
@@ -25,11 +25,11 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
 static smx_context_t
 smx_ctx_sysv_create_context(xbt_main_func_t code, int argc, char **argv,
-                            void_f_pvoid_t cleanup_func,
-                            void *cleanup_arg);
+    void_pfn_smxprocess_t cleanup_func,
+    smx_process_t process);
 
 
-static void smx_ctx_sysv_wrapper(void);
+static void smx_ctx_sysv_wrapper(smx_ctx_sysv_t context);
 
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t * factory)
 {
@@ -41,15 +41,15 @@ void SIMIX_ctx_sysv_factory_init(smx_context_factory_t * factory)
   (*factory)->free = smx_ctx_sysv_free;
   (*factory)->stop = smx_ctx_sysv_stop;
   (*factory)->suspend = smx_ctx_sysv_suspend;
-  (*factory)->resume = smx_ctx_sysv_resume;
+  (*factory)->runall = smx_ctx_sysv_runall;
   (*factory)->name = "smx_sysv_context_factory";
 }
 
 smx_context_t
 smx_ctx_sysv_create_context_sized(size_t size, xbt_main_func_t code,
                                   int argc, char **argv,
-                                  void_f_pvoid_t cleanup_func,
-                                  void *cleanup_arg)
+                                  void_pfn_smxprocess_t cleanup_func,
+                                  smx_process_t process)
 {
 
   smx_ctx_sysv_t context =
@@ -58,7 +58,7 @@ smx_ctx_sysv_create_context_sized(size_t size, xbt_main_func_t code,
                                                                  argc,
                                                                  argv,
                                                                  cleanup_func,
-                                                                 cleanup_arg);
+                                                                 process);
 
   /* If the user provided a function for the process then use it
      otherwise is the context for maestro */
@@ -83,7 +83,8 @@ smx_ctx_sysv_create_context_sized(size_t size, xbt_main_func_t code,
                                 context->uc.uc_stack.ss_size);
 #endif                          /* HAVE_VALGRIND_VALGRIND_H */
 
-    makecontext(&((smx_ctx_sysv_t) context)->uc, smx_ctx_sysv_wrapper, 0);
+    makecontext(&((smx_ctx_sysv_t) context)->uc, (void (*)())smx_ctx_sysv_wrapper,
+                sizeof(void*)/sizeof(int), context);
   }
 
   return (smx_context_t) context;
@@ -92,12 +93,13 @@ smx_ctx_sysv_create_context_sized(size_t size, xbt_main_func_t code,
 
 static smx_context_t
 smx_ctx_sysv_create_context(xbt_main_func_t code, int argc, char **argv,
-                            void_f_pvoid_t cleanup_func, void *cleanup_arg)
+    void_pfn_smxprocess_t cleanup_func,
+    smx_process_t process)
 {
 
   return smx_ctx_sysv_create_context_sized(sizeof(s_smx_ctx_sysv_t),
                                            code, argc, argv, cleanup_func,
-                                           cleanup_arg);
+                                           process);
 
 }
 
@@ -122,18 +124,8 @@ void smx_ctx_sysv_stop(smx_context_t context)
   smx_ctx_sysv_suspend(context);
 }
 
-void smx_ctx_sysv_wrapper()
-{
-  /*FIXME: I would like to avoid accessing simix_global to get the current
-     context by passing it as an argument of the wrapper function. The problem
-     is that this function is called from smx_ctx_sysv_start, and uses
-     makecontext for calling it, and the stupid posix specification states that
-     all the arguments of the function should be int(32 bits), making it useless
-     in 64-bit architectures where pointers are 64 bit long.
-   */
-  smx_ctx_sysv_t context =
-      (smx_ctx_sysv_t) simix_global->current_process->context;
-
+void smx_ctx_sysv_wrapper(smx_ctx_sysv_t context)
+{ 
   (context->super.code) (context->super.argc, context->super.argv);
 
   smx_ctx_sysv_stop((smx_context_t) context);
@@ -159,3 +151,13 @@ void smx_ctx_sysv_resume(smx_context_t new_context)
 
   xbt_assert0((rv == 0), "Context swapping failure");
 }
+
+void smx_ctx_sysv_runall(xbt_swag_t processes)
+{
+  smx_process_t process;
+  while((process = xbt_swag_extract(processes))){
+    simix_global->current_process = process;
+    smx_ctx_sysv_resume(process->context);
+    simix_global->current_process = simix_global->maestro_process;
+  }
+}
index a383295..ab7d479 100644 (file)
@@ -38,12 +38,14 @@ typedef struct s_smx_ctx_sysv {
 smx_context_t
 smx_ctx_sysv_create_context_sized(size_t structure_size,
                                   xbt_main_func_t code, int argc,
-                                  char **argv, void_f_pvoid_t cleanup_func,
-                                  void *cleanup_arg);
+                                  char **argv,
+                                  void_pfn_smxprocess_t cleanup_func,
+                                  smx_process_t process);
 void smx_ctx_sysv_free(smx_context_t context);
 void smx_ctx_sysv_stop(smx_context_t context);
 void smx_ctx_sysv_suspend(smx_context_t context);
 void smx_ctx_sysv_resume(smx_context_t new_context);
+void smx_ctx_sysv_runall(xbt_swag_t processes);
 
 SG_END_DECL()
 #endif                          /* !_XBT_CONTEXT_SYSV_PRIVATE_H */
index 95989a8..3d5ab92 100644 (file)
@@ -27,13 +27,16 @@ typedef struct s_smx_ctx_thread {
 static smx_context_t
 smx_ctx_thread_factory_create_context(xbt_main_func_t code, int argc,
                                       char **argv,
-                                      void_f_pvoid_t cleanup_func,
-                                      void *cleanup_arg);
+                                      void_pfn_smxprocess_t cleanup_func,
+                                      smx_process_t process);
 
 static void smx_ctx_thread_free(smx_context_t context);
 static void smx_ctx_thread_stop(smx_context_t context);
 static void smx_ctx_thread_suspend(smx_context_t context);
 static void smx_ctx_thread_resume(smx_context_t new_context);
+static void smx_ctx_thread_runall_serial(xbt_swag_t processes);
+static void smx_ctx_thread_runall_parallel(xbt_swag_t processes);
+static smx_process_t smx_ctx_thread_self(void);
 
 static void *smx_ctx_thread_wrapper(void *param);
 
@@ -47,20 +50,26 @@ void SIMIX_ctx_thread_factory_init(smx_context_factory_t * factory)
   (*factory)->free = smx_ctx_thread_free;
   (*factory)->stop = smx_ctx_thread_stop;
   (*factory)->suspend = smx_ctx_thread_suspend;
-  (*factory)->resume = smx_ctx_thread_resume;
+
+  if(_surf_parallel_contexts)
+    (*factory)->runall = smx_ctx_thread_runall_parallel;
+  else
+    (*factory)->runall = smx_ctx_thread_runall_serial;
+  
+  (*factory)->self = smx_ctx_thread_self;
   (*factory)->name = "ctx_thread_factory";
 }
 
 static smx_context_t
 smx_ctx_thread_factory_create_context(xbt_main_func_t code, int argc,
                                       char **argv,
-                                      void_f_pvoid_t cleanup_func,
-                                      void *cleanup_arg)
+                                      void_pfn_smxprocess_t cleanup_func,
+                                      smx_process_t process)
 {
   smx_ctx_thread_t context = (smx_ctx_thread_t)
       smx_ctx_base_factory_create_context_sized(sizeof(s_smx_ctx_thread_t),
                                                 code, argc, argv,
-                                                cleanup_func, cleanup_arg);
+                                                cleanup_func, process);
 
   /* If the user provided a function for the process then use it
      otherwise is the context for maestro */
@@ -69,14 +78,11 @@ smx_ctx_thread_factory_create_context(xbt_main_func_t code, int argc,
     context->end = xbt_os_sem_init(0);
 
 
-    /* create and start the process */
-    /* NOTE: The first argument to xbt_os_thread_create used to be the process *
-     * name, but now the name is stored at SIMIX level, so we pass a null      */
-    context->thread =
-        xbt_os_thread_create(NULL, smx_ctx_thread_wrapper, context);
-
-    /* wait the starting of the newly created process */
-    xbt_os_sem_acquire(context->end);
+    /* delay the thread creation until first run */
+    context->thread = NULL;
+  } else {
+    xbt_os_thread_set_extra_data(process);
   }
 
   return (smx_context_t) context;
@@ -86,16 +92,20 @@ static void smx_ctx_thread_free(smx_context_t pcontext)
 {
   smx_ctx_thread_t context = (smx_ctx_thread_t) pcontext;
 
-  /* check if this is the context of maestro (it doesn't has a real thread) */
+  /* check if the context has a thread or not */
+  /* if it doesn't, it is maestro's context or the context never run */
   if (context->thread) {
     /* wait about the thread terminason */
     xbt_os_thread_join(context->thread, NULL);
-
-    /* destroy the synchronisation objects */
-    xbt_os_sem_destroy(context->begin);
-    xbt_os_sem_destroy(context->end);
   }
+  
+  /* destroy the synchronisation objects */
+  if(context->begin)
+    xbt_os_sem_destroy(context->begin);
 
+  if(context->end)
+    xbt_os_sem_destroy(context->end);
+  
   smx_ctx_base_free(pcontext);
 }
 
@@ -131,12 +141,45 @@ static void *smx_ctx_thread_wrapper(void *param)
 
 static void smx_ctx_thread_suspend(smx_context_t context)
 {
-  xbt_os_sem_release(((smx_ctx_thread_t) context)->end);
-  xbt_os_sem_acquire(((smx_ctx_thread_t) context)->begin);
+  if(((smx_ctx_thread_t) context)->thread){
+    xbt_os_sem_release(((smx_ctx_thread_t) context)->end);
+    xbt_os_sem_acquire(((smx_ctx_thread_t) context)->begin);
+  }
 }
 
-static void smx_ctx_thread_resume(smx_context_t new_context)
+static void smx_ctx_thread_runall_serial(xbt_swag_t processes)
 {
-  xbt_os_sem_release(((smx_ctx_thread_t) new_context)->begin);
-  xbt_os_sem_acquire(((smx_ctx_thread_t) new_context)->end);
+  smx_process_t process;
+  while((process = xbt_swag_extract(processes))){
+    /* if the context has no thread associated, create one for it (first run) */
+    if(!(((smx_ctx_thread_t)process->context)->thread)){
+      ((smx_ctx_thread_t)process->context)->thread =
+        xbt_os_thread_create(NULL, smx_ctx_thread_wrapper, process->context, process);
+      xbt_os_sem_acquire(((smx_ctx_thread_t)process->context)->end);
+    }
+    xbt_os_sem_release(((smx_ctx_thread_t) (process->context))->begin);
+    xbt_os_sem_acquire(((smx_ctx_thread_t) (process->context))->end);
+  }  
+}
+
+static void smx_ctx_thread_runall_parallel(xbt_swag_t processes){
+  smx_process_t process, p_next;
+  xbt_swag_foreach_safe(process, p_next, processes){
+    /* if the context has no thread associated, create one for it (first run) */
+    if(!(((smx_ctx_thread_t)process->context)->thread)){
+      ((smx_ctx_thread_t)process->context)->thread =
+        xbt_os_thread_create(NULL, smx_ctx_thread_wrapper, process->context, process);
+      xbt_os_sem_acquire(((smx_ctx_thread_t)process->context)->end);
+    }
+    xbt_os_sem_release(((smx_ctx_thread_t) (process->context))->begin);
+  }
+
+  while((process = xbt_swag_extract(processes))){
+    xbt_os_sem_acquire(((smx_ctx_thread_t) (process->context))->end);
+  }
 }
+
+static smx_process_t smx_ctx_thread_self(void)
+{
+  return (smx_process_t) xbt_os_thread_get_extra_data();
+}
\ No newline at end of file
index e97d574..539a0ed 100644 (file)
@@ -63,14 +63,7 @@ static void parse_process_finalize(void)
 
     DEBUG3("Process %s(%s) will be started at time %f", arg->name,
            arg->hostname, start_time);
-    if (simix_global->create_process_function)
-      surf_timer_model->extension.timer.set(start_time, (void *)
-                                            simix_global->create_process_function,
-                                            arg);
-    else
-      surf_timer_model->extension.timer.set(start_time, (void *)
-                                            &SIMIX_process_create, arg);
-
+    SIMIX_timer_set(start_time, &SIMIX_process_create_from_wrapper, arg);
   } else {                      // start_time <= SIMIX_get_clock()
     DEBUG2("Starting Process %s(%s) right now", parse_argv[0], parse_host);
 
@@ -92,13 +85,9 @@ static void parse_process_finalize(void)
     }
     if (kill_time > SIMIX_get_clock()) {
       if (simix_global->kill_process_function)
-        surf_timer_model->extension.timer.set(start_time, (void *)
-                                              simix_global->kill_process_function,
-                                              process);
+        SIMIX_timer_set(start_time, simix_global->kill_process_function, process);
       else
-        surf_timer_model->extension.timer.set(kill_time, (void *)
-                                              &SIMIX_process_kill,
-                                              (void *) process);
+        SIMIX_timer_set(start_time, &SIMIX_process_kill, process);
     }
     xbt_free(parse_host);
   }
index 0007cf9..20ce044 100644 (file)
@@ -42,7 +42,7 @@ void SIMIX_create_environment(const char *file)
   parse_platform_file(file);
   surf_config_models_create_elms();
   start = xbt_os_time();
-
+  /* FIXME: what time are we measuring ??? */
   end = xbt_os_time();
   DEBUG1("PARSE TIME: %lg", (end - start));
 
@@ -52,6 +52,7 @@ void SIMIX_create_environment(const char *file)
 
   xbt_dict_foreach(surf_model_resource_set(surf_workstation_model), cursor,
                    name, workstation) {
-    __SIMIX_host_create(name, workstation, NULL);
+    SIMIX_host_create(name, workstation, NULL);
   }
+  surf_presolve();
 }
index 1d958a5..e0ca93b 100644 (file)
@@ -5,10 +5,12 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.h"
+#include "xbt/heap.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/str.h"
 #include "xbt/ex.h"             /* ex_backtrace_display */
+
 XBT_LOG_EXTERNAL_CATEGORY(simix);
 XBT_LOG_EXTERNAL_CATEGORY(simix_action);
 XBT_LOG_EXTERNAL_CATEGORY(simix_deployment);
@@ -21,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
                                 "Logging specific to SIMIX (kernel)");
 
 SIMIX_Global_t simix_global = NULL;
-
+static xbt_heap_t simix_timers = NULL;
 
 /* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
 #include <signal.h>
@@ -74,7 +76,6 @@ void SIMIX_global_init(int *argc, char **argv)
     simix_global->kill_process_function = NULL;
     simix_global->cleanup_process_function = SIMIX_process_cleanup;
 
-    simix_global->msg_sizes = xbt_dict_new();
 #ifdef HAVE_LATENCY_BOUND_TRACKING
     simix_global->latency_limited_dict = xbt_dict_new();
 #endif
@@ -83,169 +84,22 @@ void SIMIX_global_init(int *argc, char **argv)
     SIMIX_create_maestro_process();
 
     /* context exception handlers */
-    __xbt_ex_ctx = SIMIX_process_get_exception;
+    __xbt_running_ctx_fetch = SIMIX_process_get_running_context;
     __xbt_ex_terminate = SIMIX_process_exception_terminate;
 
+    /* Initialize request mechanism */
+    SIMIX_request_init();
 
+    /* Initialize the SIMIX network module */
+    SIMIX_network_init();
+    
     /* Prepare to display some more info when dying on Ctrl-C pressing */
     signal(SIGINT, inthandler);
     surf_init(argc, argv);      /* Initialize SURF structures */
   }
-}
-
-/* Debug purpose, incomplete */
-void SIMIX_display_process_status(void)
-{
-  smx_process_t process = NULL;
-  xbt_fifo_item_t item = NULL;
-  smx_action_t act;
-  int nbprocess = xbt_swag_size(simix_global->process_list);
-
-  INFO1("%d processes are still running, waiting for something.",
-        nbprocess);
-  /*  List the process and their state */
-  INFO0
-      ("Legend of the following listing: \"<process> on <host>: <status>.\"");
-  xbt_swag_foreach(process, simix_global->process_list) {
-    char *who, *who2;
-
-    who = bprintf("%s on %s: %s",
-                  process->name,
-                  process->smx_host->name,
-                  (process->blocked) ? "[BLOCKED] "
-                  : ((process->suspended) ? "[SUSPENDED] " : ""));
-
-    if (process->mutex) {
-      who2 =
-          bprintf("%s Blocked on mutex %p", who,
-                  (XBT_LOG_ISENABLED
-                   (simix_kernel,
-                    xbt_log_priority_verbose)) ? process->mutex : (void *)
-                  0xdead);
-      free(who);
-      who = who2;
-    } else if (process->cond) {
-      who2 =
-          bprintf
-          ("%s Blocked on condition %p; Waiting for the following actions:",
-           who,
-           (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
-           process->cond : (void *) 0xdead);
-      free(who);
-      who = who2;
-      xbt_fifo_foreach(process->cond->actions, item, act, smx_action_t) {
-        who2 =
-            bprintf("%s '%s'(%p)", who, act->name,
-                    (XBT_LOG_ISENABLED
-                     (simix_kernel, xbt_log_priority_verbose))
-                    ? act : (void *) 0xdead);
-        free(who);
-        who = who2;
-      }
-    } else if (process->sem) {
-      who2 =
-          bprintf
-          ("%s Blocked on semaphore %p; Waiting for the following actions:",
-           who,
-           (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
-           process->sem : (void *) 0xdead);
-      free(who);
-      who = who2;
-      xbt_fifo_foreach(process->sem->actions, item, act, smx_action_t) {
-        who2 =
-            bprintf("%s '%s'(%p)", who, act->name,
-                    (XBT_LOG_ISENABLED
-                     (simix_kernel, xbt_log_priority_verbose))
-                    ? act : (void *) 0xdead);
-        free(who);
-        who = who2;
-      }
-
-    } else {
-      who2 =
-          bprintf
-          ("%s Blocked in an unknown status (please report this bug)",
-           who);
-      free(who);
-      who = who2;
-    }
-    INFO1("%s.", who);
-    free(who);
-  }
-}
-
-
-/**
- * \brief Launch the SIMIX simulation, debug purpose
- */
-void __SIMIX_main(void)
-{
-  smx_process_t process = NULL;
-  smx_cond_t cond = NULL;
-  smx_action_t smx_action;
-  xbt_fifo_t actions_done = xbt_fifo_new();
-  xbt_fifo_t actions_failed = xbt_fifo_new();
-
-  /* Clean IO before the run */
-  fflush(stdout);
-  fflush(stderr);
-
-  //surf_solve(); /* Takes traces into account. Returns 0.0 */
-  /* xbt_fifo_size(msg_global->process_to_run) */
-
-  while (SIMIX_solve(actions_done, actions_failed) != -1.0) {
-
-    while ((smx_action = xbt_fifo_pop(actions_failed))) {
-
-      xbt_fifo_item_t _cursor;
-
-      DEBUG1("** %s failed **", smx_action->name);
-      xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
-        xbt_swag_foreach(process, cond->sleeping) {
-          DEBUG2("\t preparing to wake up %s on %s",
-                 process->name, process->smx_host->name);
-        }
-        SIMIX_cond_broadcast(cond);
-        /* remove conditional from action */
-        SIMIX_unregister_action_to_condition(smx_action, cond);
-      }
-    }
-
-    while ((smx_action = xbt_fifo_pop(actions_done))) {
-      xbt_fifo_item_t _cursor;
-
-      DEBUG1("** %s done **", smx_action->name);
-      xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
-        xbt_swag_foreach(process, cond->sleeping) {
-          DEBUG2("\t preparing to wake up %s on %s",
-                 process->name, process->smx_host->name);
-        }
-        SIMIX_cond_broadcast(cond);
-        /* remove conditional from action */
-        SIMIX_unregister_action_to_condition(smx_action, cond);
-      }
-    }
+  if (!simix_timers) {
+    simix_timers = xbt_heap_new(8, &free);
   }
-  return;
-}
-
-/**
- * \brief Kill all running process
- *  Only maestro can kill everyone :)
- */
-void SIMIX_process_killall()
-{
-  smx_process_t p = NULL;
-  xbt_assert0((simix_global->current_process ==
-               simix_global->maestro_process),
-              "You are not supposed to run this function here!");
-
-  while ((p = xbt_swag_extract(simix_global->process_list)))
-    SIMIX_process_kill(p);
-
-  SIMIX_process_empty_trash();
-
-  return;
 }
 
 /**
@@ -258,6 +112,13 @@ void SIMIX_clean(void)
   /* Kill everyone (except maestro) */
   SIMIX_process_killall();
 
+  /* Exit the SIMIX network module */
+  SIMIX_network_exit();
+  
+  /* Exit request mechanism */
+  SIMIX_request_destroy();
+  
+  xbt_heap_free(simix_timers);
   /* Free the remaining data structures */
   xbt_swag_free(simix_global->process_to_run);
   xbt_swag_free(simix_global->process_to_destroy);
@@ -267,19 +128,18 @@ void SIMIX_clean(void)
   xbt_dict_free(&(simix_global->registered_functions));
   xbt_dict_free(&(simix_global->host));
 
-  xbt_dict_free(&(simix_global->msg_sizes));
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   xbt_dict_free(&(simix_global->latency_limited_dict));
 #endif
 
   /* Let's free maestro now */
   SIMIX_context_free(simix_global->maestro_process->context);
-  xbt_free(simix_global->maestro_process->exception);
+  xbt_free(simix_global->maestro_process->running_ctx);
   xbt_free(simix_global->maestro_process);
   simix_global->maestro_process = NULL;
 
   /* Restore the default exception setup */
-  __xbt_ex_ctx = &__xbt_ex_ctx_default;
+  __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
   __xbt_ex_terminate = &__xbt_ex_terminate_default;
 
   /* Finish context module and SURF */
@@ -304,16 +164,56 @@ XBT_INLINE double SIMIX_get_clock(void)
   return surf_get_clock();
 }
 
-/**
- *     \brief Finish the simulation initialization
- *
- *      Must be called before the first call to SIMIX_solve()
- */
-XBT_INLINE void SIMIX_init(void)
+void SIMIX_run(void)
 {
-  surf_presolve();
+  double time = 0;
+  smx_req_t req;
+  xbt_swag_t set;
+  surf_action_t action;
+  smx_timer_t timer;
+  surf_model_t model;
+  unsigned int iter;
+  do {
+    do {
+      DEBUG0("New Schedule Round");
+      SIMIX_context_runall(simix_global->process_to_run);
+      while((req = SIMIX_request_pop())){
+        DEBUG1("Handling request %p", req);
+        SIMIX_request_pre(req);
+      }
+    } while (xbt_swag_size(simix_global->process_to_run));
+
+    time = surf_solve(SIMIX_timer_next());
+
+    /* Notify all the hosts that have failed */
+    /* FIXME: iterate through the list of failed host and mark each of them */
+    /* as failed. On each host, signal all the running processes with host_fail */
+    
+    /* Handle any pending timer */
+    while (xbt_heap_size(simix_timers) > 0 && SIMIX_get_clock() >= SIMIX_timer_next()) {
+       //FIXME: make the timers being real callbacks
+       // (i.e. provide dispatchers that read and expand the args) 
+       timer = xbt_heap_pop(simix_timers);
+       if (timer->func)
+         ((void (*)(void*))timer->func)(timer->args);
+    }
+    /* Wake up all process waiting for the action finish */
+    xbt_dynar_foreach(model_list, iter, model) {
+      for(set = model->states.failed_action_set;
+          set;
+          set = (set == model->states.failed_action_set)
+                ? model->states.done_action_set
+                : NULL) {
+        while ((action = xbt_swag_extract(set)))
+          SIMIX_request_post((smx_action_t)action->data);
+      }
+    }
+  } while(time != -1.0);
+
 }
 
+
 /**
  *     \brief Does a turn of the simulation
  *
@@ -322,6 +222,8 @@ XBT_INLINE void SIMIX_init(void)
  *     \param actions_failed List of actions failed
  *     \return The time spent to execute the simulation or -1 if the simulation ended
  */
+/* FIXME: this function is now deprecated, remove it */
+#if 0
 double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 {
 
@@ -330,6 +232,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
   double elapsed_time = 0.0;
   static int state_modifications = 1;
   int actions_on_system = 0;
+  smx_timer_t timer;
 
   SIMIX_process_empty_trash();
   if (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_debug) &&
@@ -339,7 +242,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 
   while ((process = xbt_swag_extract(simix_global->process_to_run))) {
     DEBUG2("Scheduling %s on %s", process->name, process->smx_host->name);
-    SIMIX_process_schedule(process);
+    /*SIMIX_process_schedule(process);*/
   }
 
   {
@@ -361,18 +264,26 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
         actions_on_system = 1;
       }
     }
+    if (xbt_heap_size(simix_timers) > 0) {
+      actions_on_system = 1;
+    }
+
     /* only calls surf_solve if there are actions to run */
     if (!state_modifications && actions_on_system) {
-      DEBUG1("%f : Calling surf_solve", SIMIX_get_clock());
-      elapsed_time = surf_solve();
-      DEBUG1("Elapsed_time %f", elapsed_time);
+      DEBUG1("Calling surf_solve(%f)", SIMIX_timer_next());
+      elapsed_time = surf_solve(SIMIX_timer_next());
+      DEBUG1("Elapsed time %f", elapsed_time);
     }
 
     actions_on_system = 0;
-    while (surf_timer_model->extension.timer.get(&fun, (void *) &arg)) {
+    while (xbt_heap_size(simix_timers) > 0 && SIMIX_get_clock() >= SIMIX_timer_next()) {
+      timer = xbt_heap_pop(simix_timers);
+      fun = timer->func;
+      arg = timer->args;
+      free(timer);
       /* change in process, don't quit */
       actions_on_system = 1;
-      DEBUG2("got %p %p", fun, arg);
+      DEBUG3("got %p %p at %f", fun, arg, timer->date);
       if (fun == SIMIX_process_create) {
         smx_process_arg_t args = arg;
         DEBUG2("Launching %s on %s", args->name, args->hostname);
@@ -387,9 +298,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
         }
 
         if (args->kill_time > SIMIX_get_clock()) {
-          surf_timer_model->extension.timer.set(args->kill_time, (void *)
-                                                &SIMIX_process_kill,
-                                                (void *) process);
+          SIMIX_timer_set(args->kill_time, &SIMIX_process_kill, process);
         }
         xbt_free(args);
       } else if (fun == simix_global->create_process_function) {
@@ -410,24 +319,20 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
         }
         if (args->kill_time > SIMIX_get_clock()) {
           if (simix_global->kill_process_function)
-            surf_timer_model->extension.timer.set(args->kill_time, (void *)
-                                                  simix_global->
-                                                  kill_process_function,
-                                                  process);
+            SIMIX_timer_set(args->kill_time, simix_global->kill_process_function, process);
           else
-            surf_timer_model->extension.timer.set(args->kill_time, (void *)
-                                                  &SIMIX_process_kill,
-                                                  (void *) process);
+            SIMIX_timer_set(args->kill_time, &SIMIX_process_kill, process);
         }
         xbt_free(args);
       } else if (fun == SIMIX_process_kill) {
         process = arg;
         DEBUG2("Killing %s on %s", process->name, process->smx_host->name);
-        SIMIX_process_kill(process);
+        SIMIX_process_kill(process, SIMIX_process_self());
       } else if (fun == simix_global->kill_process_function) {
         process = arg;
         (*simix_global->kill_process_function) (process);
       } else {
+        //FIXME: ((void (*)(void*))fun)(arg);
         THROW_IMPOSSIBLE;
       }
     }
@@ -444,17 +349,22 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
       while ((action = xbt_swag_extract(model->states.failed_action_set))) {
         smx_action = action->data;
         if (smx_action) {
-          SIMIX_action_signal_all(smx_action);
+//          SIMIX_action_signal_all(smx_action);
         }
       }
       while ((action = xbt_swag_extract(model->states.done_action_set))) {
         smx_action = action->data;
         if (smx_action) {
-          SIMIX_action_signal_all(smx_action);
+//          SIMIX_action_signal_all(smx_action);
         }
       }
     }
   }
+
+  if (xbt_heap_size(simix_timers) > 0) {
+    actions_on_system = 1;
+  }
+
   state_modifications = 0;
   if (!actions_on_system)
     elapsed_time = -1;
@@ -473,8 +383,11 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
       INFO0("Return a Warning.");
     }
   }
+
+  DEBUG1("SIMIX_solve() finished, elapsed_time = %f", elapsed_time);
   return elapsed_time;
 }
+#endif
 
 /**
  *     \brief Set the date to execute a function
@@ -487,12 +400,17 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
  */
 XBT_INLINE void SIMIX_timer_set(double date, void *function, void *arg)
 {
-  surf_timer_model->extension.timer.set(date, function, arg);
+  smx_timer_t timer = xbt_new0(s_smx_timer_t, 1);
+
+  timer->date = date;
+  timer->func = function;
+  timer->args = arg;
+  xbt_heap_push(simix_timers, timer, date);
 }
 
-XBT_INLINE int SIMIX_timer_get(void **function, void **arg)
+XBT_INLINE double SIMIX_timer_next(void)
 {
-  return surf_timer_model->extension.timer.get(function, arg);
+  return xbt_heap_size(simix_timers) > 0 ? xbt_heap_maxkey(simix_timers) : -1.0;
 }
 
 /**
@@ -534,8 +452,93 @@ XBT_INLINE void SIMIX_function_register_process_kill(void_f_pvoid_t
  *     \param function cleanup process function
  *
  */
-XBT_INLINE void SIMIX_function_register_process_cleanup(void_f_pvoid_t
+XBT_INLINE void SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t
                                                         function)
 {
   simix_global->cleanup_process_function = function;
 }
+
+
+void SIMIX_display_process_status(void)
+{
+  if (simix_global->process_list == NULL) {
+    return;
+  }
+
+  smx_process_t process = NULL;
+  /*xbt_fifo_item_t item = NULL;
+  smx_action_t act;*/
+  int nbprocess = xbt_swag_size(simix_global->process_list);
+
+  INFO1("%d processes are still running, waiting for something.", nbprocess);
+  /*  List the process and their state */
+  INFO0
+    ("Legend of the following listing: \"<process> on <host>: <status>.\"");
+  xbt_swag_foreach(process, simix_global->process_list) {
+    char *who, *who2;
+
+    asprintf(&who, "%s on %s: %s",
+             process->name,
+             process->smx_host->name,
+             (process->blocked) ? "[BLOCKED] "
+             : ((process->suspended) ? "[SUSPENDED] " : ""));
+
+    if (process->waiting_action) {
+      who2 = bprintf("Waiting for action %p to finish", process->waiting_action);
+    }
+
+      /*
+    if (process->mutex) {
+      who2 =
+        bprintf("%s Blocked on mutex %p", who,
+                (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
+                process->mutex : (void *) 0xdead);
+      free(who);
+      who = who2;
+    } else if (process->cond) {
+      who2 =
+        bprintf
+        ("%s Blocked on condition %p; Waiting for the following actions:",
+         who,
+         (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
+         process->cond : (void *) 0xdead);
+      free(who);
+      who = who2;
+      xbt_fifo_foreach(process->cond->actions, item, act, smx_action_t) {
+        who2 =
+          bprintf("%s '%s'(%p)", who, act->name,
+                  (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose))
+                  ? act : (void *) 0xdead);
+        free(who);
+        who = who2;
+      }
+    } else if (process->sem) {
+      who2 =
+        bprintf
+        ("%s Blocked on semaphore %p; Waiting for the following actions:",
+         who,
+         (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose)) ?
+         process->sem : (void *) 0xdead);
+      free(who);
+      who = who2;
+      xbt_fifo_foreach(process->sem->actions, item, act, smx_action_t) {
+        who2 =
+          bprintf("%s '%s'(%p)", who, act->name,
+                  (XBT_LOG_ISENABLED(simix_kernel, xbt_log_priority_verbose))
+                  ? act : (void *) 0xdead);
+        free(who);
+        who = who2;
+      }
+
+    } else {
+      who2 =
+        bprintf
+        ("%s Blocked in an unknown status (please report this bug)", who);
+      free(who);
+      who = who2;
+    }
+    */
+    INFO1("%s.", who);
+    free(who);
+  }
+}
index fd71067..e8d184a 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
                                 "Logging specific to SIMIX (hosts)");
 
-/********************************* Host **************************************/
-smx_host_t __SIMIX_host_create(const char *name,
+
+static void SIMIX_execution_finish(smx_action_t action);
+
+/**
+ * \brief Internal function to create a SIMIX host.
+ * \param name name of the host to create
+ * \param workstation the SURF workstation to encapsulate
+ * \param data some user data (may be NULL)
+ */
+smx_host_t SIMIX_host_create(const char *name,
                                void *workstation, void *data)
 {
   smx_host_t smx_host = xbt_new0(s_smx_host_t, 1);
@@ -28,76 +36,17 @@ smx_host_t __SIMIX_host_create(const char *name,
 
   /* Update global variables */
   xbt_dict_set(simix_global->host, smx_host->name, smx_host,
-               &__SIMIX_host_destroy);
+               &SIMIX_host_destroy);
 
   return smx_host;
 }
 
 /**
- * \brief Set the user data of a #smx_host_t.
- *
- * This functions checks whether some data has already been associated to \a host or not and attach \a data to \a host if it is possible.
- *     \param host SIMIX host
- *     \param data User data
- *
- */
-XBT_INLINE void SIMIX_host_set_data(smx_host_t host, void *data)
-{
-  xbt_assert0((host != NULL), "Invalid parameters");
-  xbt_assert0((host->data == NULL), "Data already set");
-
-  /* Assign data */
-  host->data = data;
-
-  return;
-}
-
-/**
- * \brief Return the user data of a #smx_host_t.
- *
- * This functions checks whether \a host is a valid pointer or not and return the user data associated to \a host if it is possible.
- * \param host SIMIX host
- */
-XBT_INLINE void *SIMIX_host_get_data(smx_host_t host)
-{
-  xbt_assert0((host != NULL), "Invalid parameters");
-
-  /* Return data */
-  return host->data;
-}
-
-/**
- * \brief Return the name of the #smx_host_t.
+ * \brief Internal function to destroy a SIMIX host.
  *
- * This functions checks whether \a host is a valid pointer or not and return its name.
- * \param host SIMIX host
- */
-XBT_INLINE const char *SIMIX_host_get_name(smx_host_t host)
-{
-
-  xbt_assert0((host != NULL), "Invalid parameters");
-
-  /* Return data */
-  return host->name;
-}
-
-/**
- * \brief Return the location on which the current process is executed.
- *
- * Return the host,  more details in #SIMIX_process_get_host
- * \return SIMIX host
- */
-XBT_INLINE smx_host_t SIMIX_host_self(void)
-{
-  return SIMIX_process_get_host(SIMIX_process_self());
-}
-
-/*
- * Real function for destroy a host.
- * MSG_host_destroy is just  a front_end that also removes it from
- * msg_global->host
+ * \param h the host to destroy (a smx_host_t)
  */
-void __SIMIX_host_destroy(void *h)
+void SIMIX_host_destroy(void *h)
 {
   smx_host_t host = (smx_host_t) h;
 
@@ -115,6 +64,7 @@ void __SIMIX_host_destroy(void *h)
       free(msg);
       msg = tmp;
     }
+    SIMIX_display_process_status();
     THROW1(arg_error, 0, "%s", msg);
   }
 
@@ -128,116 +78,323 @@ void __SIMIX_host_destroy(void *h)
 }
 
 /**
- * \brief Return the current number of #smx_host_t.
+ * \brief Returns a dict of all hosts.
  *
- * \return Number of hosts
+ * \return List of all hosts (as a #xbt_dict_t)
  */
-XBT_INLINE int SIMIX_host_get_number(void)
+xbt_dict_t SIMIX_host_get_dict(void)
 {
-  return (xbt_dict_size(simix_global->host));
+  return simix_global->host;
 }
 
-
-/**
- * \brief Return an array of all the #smx_host_t.
- *
- * \return List of all hosts (in a newly allocated table)
- */
-smx_host_t *SIMIX_host_get_table(void)
+smx_host_t SIMIX_host_get_by_name(const char *name)
 {
-  smx_host_t *res = xbt_new(smx_host_t, xbt_dict_size(simix_global->host));
-  smx_host_t h;
-  xbt_dict_cursor_t c;
-  char *name;
-  int i = 0;
+  xbt_assert0(((simix_global != NULL)
+               && (simix_global->host != NULL)),
+              "Environment not set yet");
 
-  xbt_dict_foreach(simix_global->host, c, name, h)
-      res[i++] = h;
+  return xbt_dict_get_or_null(simix_global->host, name);
+}
 
-  return res;
+smx_host_t SIMIX_host_self(void)
+{
+  smx_process_t process = SIMIX_process_self();
+  return (process == NULL) ? NULL : SIMIX_process_get_host(process);
 }
 
-/**
- * \brief Return a dict of all the #smx_host_t.
- *
- * \return List of all hosts (as a #xbt_dict_t)
- */
-XBT_INLINE xbt_dict_t SIMIX_host_get_dict(void)
+/* needs to be public and without request because it is called
+   by exceptions and logging events */
+const char* SIMIX_host_self_get_name(void)
 {
-  return simix_global->host;
+  smx_host_t host = SIMIX_host_self();
+  if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
+    return "";
+
+  return SIMIX_host_get_name(host);
 }
 
-/**
- * \brief Return the speed of the processor.
- *
- * Return the speed (in Mflop/s), regardless of the current load on the machine.
- * \param host SIMIX host
- * \return Speed
- */
-XBT_INLINE double SIMIX_host_get_speed(smx_host_t host)
+const char* SIMIX_host_get_name(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
-  return (surf_workstation_model->extension.workstation.
-          get_speed(host->host, 1.0));
+  return host->name;
 }
 
-/**
- * \brief Return the available speed of the processor.
- *
- * Return the available speed (in Mflop/s).
- * \return Speed
- */
-XBT_INLINE double SIMIX_host_get_available_speed(smx_host_t host)
+xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
 {
-  xbt_assert0((host != NULL), "Invalid parameters");
+  xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
-  return (surf_workstation_model->extension.workstation.
-          get_available_speed(host->host));
+  return surf_workstation_model->extension.workstation.get_properties(host->host);
 }
 
-/**
- * \brief Return the host by its name
- *
- * Finds a smx_host_t using its name.
- * \param name The name of an host.
- * \return The corresponding host
- */
-XBT_INLINE smx_host_t SIMIX_host_get_by_name(const char *name)
+double SIMIX_host_get_speed(smx_host_t host)
 {
-  xbt_assert0(((simix_global != NULL)
-               && (simix_global->host != NULL)),
-              "Environment not set yet");
+  xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
-  return xbt_dict_get_or_null(simix_global->host, name);
+  return surf_workstation_model->extension.workstation.
+      get_speed(host->host, 1.0);
 }
 
-/**
- * \brief Returns a xbt_dynar_t consisting of the list of properties assigned to this host
- *
- * \param host a host
- * \return the dynamic array consisting of property names
- */
-XBT_INLINE xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
+double SIMIX_host_get_available_speed(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
-  return surf_workstation_model->extension.
-      workstation.get_properties(host->host);
+  return surf_workstation_model->extension.workstation.
+      get_available_speed(host->host);
 }
 
+int SIMIX_host_get_state(smx_host_t host)
+{
+  xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
-/**
- * \brief Return the state of a workstation
- *
- * Return the state of a workstation. Two states are possible, 1 if the host is active or 0 if it has crashed.
- * \param host The SIMIX host
- * \return 1 if host is available or 0 if not.
- */
-XBT_INLINE int SIMIX_host_get_state(smx_host_t host)
+  return surf_workstation_model->extension.workstation.
+      get_state(host->host);
+}
+
+void* SIMIX_host_self_get_data(void)
+{
+  return SIMIX_host_get_data(SIMIX_host_self());
+}
+
+void SIMIX_host_self_set_data(void *data)
+{
+  SIMIX_host_set_data(SIMIX_host_self(), data);
+}
+
+void* SIMIX_host_get_data(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
 
-  return (surf_workstation_model->extension.workstation.
-          get_state(host->host));
+  return host->data;
+}
+
+void SIMIX_host_set_data(smx_host_t host, void *data)
+{
+  xbt_assert0((host != NULL), "Invalid parameters");
+  xbt_assert0((host->data == NULL), "Data already set");
+
+  host->data = data;
+}
+
+smx_action_t SIMIX_host_execute(const char *name, smx_host_t host,
+                                double computation_amount)
+{
+  /* alloc structures and initialize */
+  smx_action_t action = xbt_new0(s_smx_action_t, 1);
+  action->type = SIMIX_ACTION_EXECUTE;
+  action->name = xbt_strdup(name);
+  action->request_list = xbt_fifo_new();
+  action->state = SIMIX_RUNNING;
+  action->execution.host = host;
+  
+#ifdef HAVE_TRACING
+  action->category = NULL;
+#endif
+
+#ifdef HAVE_MC
+  /* set surf's action */
+  if(!_surf_do_model_check)
+#endif
+  {
+  action->execution.surf_exec =
+    surf_workstation_model->extension.workstation.execute(host->host, 
+                                                          computation_amount);
+  surf_workstation_model->action_data_set(action->execution.surf_exec, action);
+  }
+  
+#ifdef HAVE_TRACING
+  TRACE_smx_host_execute(action);
+  TRACE_surf_action(action->execution.surf_exec, action->category);
+#endif
+
+  DEBUG1("Create execute action %p", action);
+  
+  return action;
+}
+
+smx_action_t SIMIX_host_parallel_execute( const char *name,
+    int host_nb, smx_host_t *host_list,
+    double *computation_amount, double *communication_amount,
+    double amount, double rate)
+{
+  void **workstation_list = NULL;
+  int i;
+
+  /* alloc structures and initialize */
+  smx_action_t action = xbt_new0(s_smx_action_t, 1);
+  action->type = SIMIX_ACTION_PARALLEL_EXECUTE;
+  action->name = xbt_strdup(name);
+  action->request_list = xbt_fifo_new();
+  action->state = SIMIX_RUNNING;
+  action->execution.host = NULL; /* FIXME: do we need the list of hosts? */
+#ifdef HAVE_TRACING
+  action->category = NULL;
+#endif
+
+  /* set surf's action */
+  workstation_list = xbt_new0(void *, host_nb);
+  for (i = 0; i < host_nb; i++)
+    workstation_list[i] = host_list[i]->host;
+
+#ifdef HAVE_MC
+  /* set surf's action */
+  if(!_surf_do_model_check)
+#endif  
+  {
+  action->execution.surf_exec = 
+    surf_workstation_model->extension.workstation.
+    execute_parallel_task(host_nb, workstation_list, computation_amount,
+                          communication_amount, amount, rate);
+
+  surf_workstation_model->action_data_set(action->execution.surf_exec, action);
+  }
+  DEBUG1("Create parallel execute action %p", action);
+
+  return action;
+}
+
+void SIMIX_host_execution_destroy(smx_action_t action)
+{
+  DEBUG1("Destroy action %p", action);
+
+  if (action->name)
+    xbt_free(action->name);
+
+  xbt_fifo_free(action->request_list);
+
+  if (action->execution.surf_exec){
+    surf_workstation_model->action_unref(action->execution.surf_exec);
+    action->execution.surf_exec = NULL;
+  }
+  
+#ifdef HAVE_TRACING
+  TRACE_smx_action_destroy(action);
+#endif
+  xbt_free(action);
+}
+
+void SIMIX_host_execution_cancel(smx_action_t action)
+{
+  DEBUG1("Cancel action %p", action);
+
+  if(action->execution.surf_exec) 
+    surf_workstation_model->action_cancel(action->execution.surf_exec);
+}
+
+double SIMIX_host_execution_get_remains(smx_action_t action)
+{
+  double result = 0;
+  
+  if(action->state == SIMIX_RUNNING)
+    result = surf_workstation_model->get_remains(action->execution.surf_exec);
+
+  return result;
+}
+
+e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action)
+{
+  return action->state;
+}
+
+void SIMIX_host_execution_set_priority(smx_action_t action, double priority)
+{
+  surf_workstation_model->set_priority(action->execution.surf_exec, priority);
+}
+
+void SIMIX_pre_host_execution_wait(smx_req_t req)
+{
+  smx_action_t action = req->host_execution_wait.execution;
+
+  DEBUG2("Wait for execution of action %p, state %d", action, action->state);
+
+  /* Associate this request to the action */
+  xbt_fifo_push(action->request_list, req);
+  req->issuer->waiting_action = action;
+
+#ifdef HAVE_MC
+  /* set surf's action */
+  if(_surf_do_model_check){
+    action->state = SIMIX_DONE;
+    SIMIX_execution_finish(action);
+  }
+#endif  
+    
+  /* If the action is already finished then perform the error handling */
+  if (action->state != SIMIX_RUNNING)
+    SIMIX_execution_finish(action);
+}
+
+void SIMIX_host_execution_suspend(smx_action_t action)
+{
+    surf_workstation_model->suspend(action->execution.surf_exec);
 }
+
+void SIMIX_host_execution_resume(smx_action_t action)
+{
+    surf_workstation_model->suspend(action->execution.surf_exec);
+}
+
+void SIMIX_execution_finish(smx_action_t action)
+{
+  xbt_fifo_item_t item;
+  smx_req_t req;
+
+  xbt_fifo_foreach(action->request_list, item, req, smx_req_t) {
+
+    switch (action->state) {
+
+      case SIMIX_DONE:
+        /* do nothing, action done*/
+       DEBUG0("SIMIX_execution_finished: execution successful");
+        break;
+        
+      case SIMIX_FAILED:
+        TRY {
+         DEBUG1("SIMIX_execution_finished: host '%s' failed", req->issuer->smx_host->name);
+          THROW0(host_error, 0, "Host failed");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+         req->issuer->doexception = 1;
+       }
+      break;
+        
+      case SIMIX_CANCELED:
+        TRY {
+         DEBUG0("SIMIX_execution_finished: execution canceled");
+          THROW0(cancel_error, 0, "Canceled");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+         req->issuer->doexception = 1;
+        }
+       break;
+        
+      default:
+        THROW_IMPOSSIBLE;
+    }
+    req->issuer->waiting_action = NULL;
+    SIMIX_request_answer(req);
+  }
+}
+
+void SIMIX_post_host_execute(smx_action_t action)
+{
+  /* FIXME: check if the host running the action failed or not*/
+  /*if(surf_workstation_model->extension.workstation.get_state(action->host->host))*/
+
+  /* If the host running the action didn't fail, then the action was cancelled */
+  if (surf_workstation_model->action_state_get(action->execution.surf_exec) == SURF_ACTION_FAILED)
+     action->state = SIMIX_CANCELED;
+  else
+     action->state = SIMIX_DONE;
+
+  if (action->execution.surf_exec){
+    surf_workstation_model->action_unref(action->execution.surf_exec);
+    action->execution.surf_exec = NULL;
+  }
+  
+  /* If there are requests associated with the action, then answer them */
+  if (xbt_fifo_size(action->request_list))
+    SIMIX_execution_finish(action);
+}
+
index 99ab952..0da3641 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
                                 "Logging specific to SIMIX (network)");
 
+static xbt_dict_t rdv_points = NULL;
+
+static XBT_INLINE void SIMIX_comm_start(smx_action_t action);
+static void SIMIX_comm_finish(smx_action_t action);
+static void SIMIX_waitany_req_remove_from_actions(smx_req_t req);
+static void SIMIX_comm_copy_data(smx_action_t comm);
+static smx_action_t SIMIX_comm_new(e_smx_comm_type_t type);
+static XBT_INLINE void SIMIX_comm_wait_for_completion(smx_action_t comm,
+                                                      double timeout);
+static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm);
+static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm);
+static smx_action_t SIMIX_rdv_get_request(smx_rdv_t rdv, e_smx_comm_type_t type);
+static void SIMIX_rdv_free(void *data);
+
+void SIMIX_network_init(void)
+{
+  rdv_points = xbt_dict_new();
+}
+
+void SIMIX_network_exit(void)
+{
+  xbt_dict_free(&rdv_points);
+}
+
 /******************************************************************************/
 /*                           Rendez-Vous Points                               */
 /******************************************************************************/
 
-/**
- *  \brief Creates a new rendez-vous point
- *  \param name The name of the rendez-vous point
- *  \return The created rendez-vous point
- */
 smx_rdv_t SIMIX_rdv_create(const char *name)
 {
-  smx_rdv_t rdv = xbt_new0(s_smx_rvpoint_t, 1);
-  rdv->name = name ? xbt_strdup(name) : NULL;
-  rdv->read = SIMIX_mutex_init();
-  rdv->write = SIMIX_mutex_init();
-  rdv->comm_fifo = xbt_fifo_new();
+  /* two processes may have pushed the same rdv_create request at the same time */
+  smx_rdv_t rdv = name ? xbt_dict_get_or_null(rdv_points, name) : NULL;
+
+  if (!rdv) {
+    rdv = xbt_new0(s_smx_rvpoint_t, 1);
+    rdv->name = name ? xbt_strdup(name) : NULL;
+    rdv->comm_fifo = xbt_fifo_new();
 
+    if (name)
+      xbt_dict_set(rdv_points, name, rdv, SIMIX_rdv_free);
+  }
   return rdv;
 }
 
-/**
- *  \brief Destroy a rendez-vous point
- *  \param name The rendez-vous point to destroy
- */
 void SIMIX_rdv_destroy(smx_rdv_t rdv)
 {
+  if (rdv->name)
+    xbt_dict_remove(rdv_points, rdv->name); 
+}
+
+void SIMIX_rdv_free(void *data)
+{
+  smx_rdv_t rdv = (smx_rdv_t) data;
   if (rdv->name)
     xbt_free(rdv->name);
-  SIMIX_mutex_destroy(rdv->read);
-  SIMIX_mutex_destroy(rdv->write);
   xbt_fifo_free(rdv->comm_fifo);
-  xbt_free(rdv);
+  xbt_free(rdv);  
+}
+
+smx_rdv_t SIMIX_rdv_get_by_name(const char *name)
+{
+  return xbt_dict_get_or_null(rdv_points, name);
+}
+
+int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
+{
+  smx_action_t comm = NULL;
+  xbt_fifo_item_t item = NULL;
+  int count = 0;
+
+  xbt_fifo_foreach(rdv->comm_fifo, item, comm, smx_action_t) {
+    if (comm->comm.src_proc->smx_host == host)
+      count++;
+  }
+
+  return count;
+}
+
+smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv)
+{
+  return xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
 }
 
 /**
@@ -51,10 +100,10 @@ void SIMIX_rdv_destroy(smx_rdv_t rdv)
  *  \param rdv The rendez-vous point
  *  \param comm The communication request
  */
-static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_comm_t comm)
+static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm)
 {
   xbt_fifo_push(rdv->comm_fifo, comm);
-  comm->rdv = rdv;
+  comm->comm.rdv = rdv;
 }
 
 /**
@@ -62,27 +111,27 @@ static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_comm_t comm)
  *  \param rdv The rendez-vous point
  *  \param comm The communication request
  */
-static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_comm_t comm)
+static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm)
 {
   xbt_fifo_remove(rdv->comm_fifo, comm);
-  comm->rdv = NULL;
+  comm->comm.rdv = NULL;
 }
 
 /**
  *  \brief Checks if there is a communication request queued in a rendez-vous matching our needs
  *  \param type The type of communication we are looking for (comm_send, comm_recv)
- *  \return The communication request if found, NULL otherwise.
+ *  \return The communication request if found, NULL otherwise
  */
-smx_comm_t SIMIX_rdv_get_request(smx_rdv_t rdv, smx_comm_type_t type)
+smx_action_t SIMIX_rdv_get_request(smx_rdv_t rdv, e_smx_comm_type_t type)
 {
-  smx_comm_t comm = (smx_comm_t)
+  smx_action_t comm = (smx_action_t)
       xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
 
-  if (comm && comm->type == type) {
+  if (comm && comm->comm.type == type) {
     DEBUG0("Communication request found!");
     xbt_fifo_shift(rdv->comm_fifo);
-    SIMIX_communication_use(comm);
-    comm->rdv = NULL;
+    comm->comm.refcount++;
+    comm->comm.rdv = NULL;
     return comm;
   }
 
@@ -90,303 +139,509 @@ smx_comm_t SIMIX_rdv_get_request(smx_rdv_t rdv, smx_comm_type_t type)
   return NULL;
 }
 
+/******************************************************************************/
+/*                            Comunication Actions                            */
+/******************************************************************************/
+
 /**
- *  \brief counts the number of communication requests of a given host pending
- *         on a rendez-vous point
- *  \param rdv The rendez-vous point
- *  \param host The host to be counted
- *  \return The number of comm request pending in the rdv
+ *  \brief Creates a new comunicate action
+ *  \param type The type of request (comm_send, comm_recv)
+ *  \return The new comunicate action
  */
-int SIMIX_rdv_get_count_waiting_comm(smx_rdv_t rdv, smx_host_t host)
+smx_action_t SIMIX_comm_new(e_smx_comm_type_t type)
 {
-  smx_comm_t comm = NULL;
-  xbt_fifo_item_t item = NULL;
-  int count = 0;
+  smx_action_t act;
 
-  xbt_fifo_foreach(rdv->comm_fifo, item, comm, smx_comm_t) {
-    if (comm->src_proc->smx_host == host)
-      count++;
-  }
+  /* alloc structures */
+  act = xbt_new0(s_smx_action_t, 1);
+  act->type = SIMIX_ACTION_COMMUNICATE;
+  act->state = SIMIX_WAITING;
+  act->request_list = xbt_fifo_new();
 
-  return count;
+  /* set communication */
+  act->comm.type = type;
+  act->comm.refcount = 1;
+
+#ifdef HAVE_TRACING
+  act->category = NULL;
+#endif
+
+  DEBUG1("Create communicate action %p", act);
+  
+  return act;
 }
 
 /**
- *  \brief returns the communication at the head of the rendez-vous
- *  \param rdv The rendez-vous point
- *  \return The communication or NULL if empty
+ *  \brief Destroy a communicate action
+ *  \param action The communicate action to be destroyed
  */
-XBT_INLINE smx_comm_t SIMIX_rdv_get_head(smx_rdv_t rdv)
+void SIMIX_comm_destroy(smx_action_t action)
 {
-  return (smx_comm_t)
-      xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
-}
+  DEBUG1("Destroy action %p", action);
 
-/** @brief adds some API-related data to the rendez-vous point */
-XBT_INLINE void SIMIX_rdv_set_data(smx_rdv_t rdv, void *data)
-{
-  rdv->data = data;
-}
+  if(!(action->comm.refcount > 0))
+         xbt_die(bprintf("the refcount of comm %p is already 0 before decreasing it. That's a bug!",action));
 
-/** @brief gets API-related data from the rendez-vous point */
-XBT_INLINE void *SIMIX_rdv_get_data(smx_rdv_t rdv)
-{
-  return rdv->data;
-}
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  //save is latency limited flag to use afterwards
+  if (action->comm.surf_comm) {
+    DEBUG2("adding key %p with latency limited value %d to the dict", action,
+           SIMIX_comm_is_latency_bounded(action));
+    xbt_dicti_set(simix_global->latency_limited_dict, (uintptr_t) action,
+                  SIMIX_comm_is_latency_bounded(action));
+  }
+#endif
 
-/******************************************************************************/
-/*                           Communication Requests                           */
-/******************************************************************************/
+  action->comm.refcount--;
+  if (action->comm.refcount > 0)
+    return;
+  VERB2("Really free communication %p; refcount is now %d", action,
+        action->comm.refcount);
 
-/**
- *  \brief Creates a new communication request
- *  \param type The type of communication (comm_send, comm_recv)
- *  \return The new communication request
- */
-smx_comm_t SIMIX_communication_new(smx_comm_type_t type)
+#ifdef HAVE_TRACING
+  TRACE_smx_action_destroy(action);
+#endif
+
+  if (action->name)
+    xbt_free(action->name);
+
+  xbt_fifo_free(action->request_list);
+
+  SIMIX_comm_destroy_internal_actions(action);
+
+  xbt_free(action);
+}
+
+void SIMIX_comm_destroy_internal_actions(smx_action_t action)
 {
-  /* alloc structures */
-  smx_comm_t comm = xbt_new0(s_smx_comm_t, 1);
-  comm->type = type;
-  comm->sem = SIMIX_sem_init(0);
-  comm->refcount = 1;
-  VERB2("Create communication %p; refcount initially %d", comm,
-         comm->refcount);
+  if (action->comm.surf_comm){
+    action->comm.surf_comm->model_type->action_unref(action->comm.surf_comm);
+    action->comm.surf_comm = NULL;
+  }
+
+  if (action->comm.src_timeout){
+    action->comm.src_timeout->model_type->action_unref(action->comm.src_timeout);
+    action->comm.src_timeout = NULL;
+  }
 
-  return comm;
+  if (action->comm.dst_timeout){
+    action->comm.dst_timeout->model_type->action_unref(action->comm.dst_timeout);
+    action->comm.dst_timeout = NULL;
+  }
 }
 
-/**
- *  \brief Destroy a communication request
- *  \param comm The request to be destroyed
- */
-void SIMIX_communication_destroy(smx_comm_t comm)
+smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
+                              double task_size, double rate,
+                              void *src_buff, size_t src_buff_size, void *data)
 {
-  VERB2("Destroy communication %p; refcount initially %d", comm,
-        comm->refcount);
+  smx_action_t action;
 
-  if(!(comm->refcount>0))
-         xbt_die(bprintf("the refcount of comm %p is already 0 before decreasing it. That's a bug!",comm));
+  /* Look for communication request matching our needs.
+     If it is not found then create it and push it into the rendez-vous point */
+  action = SIMIX_rdv_get_request(rdv, SIMIX_COMM_RECEIVE);
+
+  if (!action) {
+    action = SIMIX_comm_new(SIMIX_COMM_SEND);
+    SIMIX_rdv_push(rdv, action);
+  }else{
+    action->state = SIMIX_READY;
+    action->comm.type = SIMIX_COMM_READY;
+  }
 
-#ifdef HAVE_LATENCY_BOUND_TRACKING
-  //save is latency limited flag to use afterwards
-  if (comm->act) {
-    DEBUG2("adding key %p with latency limited value %d to the dict", comm,
-           SIMIX_action_is_latency_bounded(comm->act));
-    xbt_dicti_set(simix_global->latency_limited_dict, (uintptr_t) comm,
-                  SIMIX_action_is_latency_bounded(comm->act));
+  /* Setup the communication request */
+  action->comm.src_proc = src_proc;
+  action->comm.task_size = task_size;
+  action->comm.rate = rate;
+  action->comm.src_buff = src_buff;
+  action->comm.src_buff_size = src_buff_size;
+  action->comm.data = data;
+#ifdef HAVE_MC
+  if(_surf_do_model_check){
+    action->state = SIMIX_RUNNING;
+    return action;
   }
 #endif
+  SIMIX_comm_start(action);
+  return action;
+}
 
-  comm->refcount--;
-  if (comm->refcount > 0)
-    return;
-  VERB2("Really free communication %p; refcount is now %d", comm,
-        comm->refcount);
+smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
+                      void *dst_buff, size_t *dst_buff_size)
+{
+  smx_action_t action;
+
+  /* Look for communication request matching our needs.
+   * If it is not found then create it and push it into the rendez-vous point
+   */
+  action = SIMIX_rdv_get_request(rdv, SIMIX_COMM_SEND);
 
-  if (comm->sem) {
-    SIMIX_sem_destroy(comm->sem);
-    comm->sem = NULL;
+  if (!action) {
+    action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
+    SIMIX_rdv_push(rdv, action);
+  } else {
+    action->state = SIMIX_READY;
+    action->comm.type = SIMIX_COMM_READY;
   }
 
-  if (comm->act) {
-    SIMIX_action_destroy(comm->act);
-    comm->act = NULL;
+  /* Setup communication request */
+  action->comm.dst_proc = dst_proc;
+  action->comm.dst_buff = dst_buff;
+  action->comm.dst_buff_size = dst_buff_size;
+
+#ifdef HAVE_MC
+  if(_surf_do_model_check){
+    action->state = SIMIX_RUNNING;
+    return action;
   }
+#endif
+
+  SIMIX_comm_start(action);
+  return action;
+}
 
-  if (comm->src_timeout) {
-    SIMIX_action_destroy(comm->src_timeout);
-    comm->src_timeout = NULL;
+void SIMIX_pre_comm_wait(smx_req_t req)
+{
+  smx_action_t action = req->comm_wait.comm;
+  double timeout = req->comm_wait.timeout;
+  surf_action_t sleep;
+
+  /* Associate this request to the action */
+  xbt_fifo_push(action->request_list, req);
+  req->issuer->waiting_action = action;
+
+#ifdef HAVE_MC
+  if(_surf_do_model_check){
+    action->state = SIMIX_DONE;
+    SIMIX_comm_finish(action);
   }
+#endif
 
-  if (comm->dst_timeout) {
-    SIMIX_action_destroy(comm->dst_timeout);
-    comm->dst_timeout = NULL;
+  /* If the action has already finish perform the error handling, */
+  /* otherwise set up a waiting timeout on the right side         */
+  if (action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING) {
+    SIMIX_comm_finish(action);
+  } else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
+    sleep = surf_workstation_model->extension.workstation.sleep(req->issuer->smx_host->host, timeout);
+    surf_workstation_model->action_data_set(sleep, action);
+
+    if (req->issuer == action->comm.src_proc)
+      action->comm.src_timeout = sleep;
+    else
+      action->comm.dst_timeout = sleep;
   }
+}
 
+void SIMIX_pre_comm_test(smx_req_t req)
+{
+  smx_action_t action = req->comm_test.comm;
+  req->comm_test.result = (action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING);
 
+  if (req->comm_test.result) {
+    xbt_fifo_push(action->request_list, req);
+    SIMIX_comm_finish(action);
+  }
+  else {
+    SIMIX_request_answer(req);
+  }
+}
 
-  xbt_free(comm);
+void SIMIX_pre_comm_waitany(smx_req_t req)
+{
+  smx_action_t action;
+  unsigned int cursor = 0;
+  xbt_dynar_t actions = req->comm_waitany.comms;
+  xbt_dynar_foreach(actions, cursor, action){
+    /* Associate this request to the action */
+    xbt_fifo_push(action->request_list, req);
+    if(action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING){
+      SIMIX_comm_finish(action);
+      break;
+    }
+  }
 }
 
-/**
- *  \brief Increase the number of users of the communication.
- *  \param comm The communication request
- *  Each communication request can be used by more than one process, so it is
- *  necessary to know number of them at destroy time, to avoid freeing stuff that
- *  maybe is in use by others.
- *  \
- */
-static XBT_INLINE void SIMIX_communication_use(smx_comm_t comm)
+void SIMIX_waitany_req_remove_from_actions(smx_req_t req)
 {
-  comm->refcount++;
+  smx_action_t action;
+  unsigned int cursor = 0;
+  xbt_dynar_t actions = req->comm_waitany.comms;
 
-  VERB2("Use communication %p; refcount is now %d", comm,
-           comm->refcount);
+  xbt_dynar_foreach(actions, cursor, action){
+    xbt_fifo_remove(action->request_list, req);
+  }
 }
 
 /**
  *  \brief Start the simulation of a communication request
- *  \param comm The communication request
+ *  \param action The communication action
  */
-static XBT_INLINE void SIMIX_communication_start(smx_comm_t comm)
+static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
 {
   /* If both the sender and the receiver are already there, start the communication */
-  if (comm->src_proc && comm->dst_proc) {
-    DEBUG1("Starting communication %p", comm);
-    comm->act = SIMIX_action_communicate(comm->src_proc->smx_host,
-                                         comm->dst_proc->smx_host, NULL,
-                                         comm->task_size, comm->rate);
+  if (action->state == SIMIX_READY) {
+    smx_host_t sender = action->comm.src_proc->smx_host;
+    smx_host_t receiver = action->comm.dst_proc->smx_host;
+
+    DEBUG3("Starting communication %p from '%s' to '%s'", action,
+         SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
+
+    action->comm.surf_comm =
+      surf_workstation_model->extension.workstation.
+      communicate(sender->host, receiver->host, action->comm.task_size, action->comm.rate);
+
+    surf_workstation_model->action_data_set(action->comm.surf_comm, action);
+
+    action->state = SIMIX_RUNNING;
+
 #ifdef HAVE_TRACING
-    TRACE_smx_action_communicate(comm->act, comm->src_proc);
-    TRACE_surf_action(comm->act->surf_action, comm->act->category);
+    TRACE_smx_action_communicate(comm, comm->comm.src_proc);
+    TRACE_surf_action(comm->surf_action, comm->category);
 #endif
 
+    /* If a link is failed, detect it immediately */
+    if (surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED) {
+      DEBUG2("Communication from '%s' to '%s' failed to start because of a link failure",
+         SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
+      action->state = SIMIX_LINK_FAILURE;
+      SIMIX_comm_destroy_internal_actions(action);
+    }
+
     /* If any of the process is suspend, create the action but stop its execution,
        it will be restarted when the sender process resume */
-    if (SIMIX_process_is_suspended(comm->src_proc) ||
-        SIMIX_process_is_suspended(comm->dst_proc)) {
-      SIMIX_action_suspend(comm->act);
+    if (SIMIX_process_is_suspended(action->comm.src_proc) ||
+        SIMIX_process_is_suspended(action->comm.dst_proc)) {
+      /* FIXME: check what should happen with the action state */
+      surf_workstation_model->suspend(action->comm.surf_comm);
     }
+  }
+}
 
-    /* Add the communication as user data of the action */
-    comm->act->data = comm;
+void SIMIX_comm_finish(smx_action_t action)
+{
+  smx_req_t req;
+
+  while((req = xbt_fifo_shift(action->request_list))){
+
+    /* If a waitany request is waiting for this action to finish, then remove
+       it from the other actions in the waitany list. Afterwards, get the
+       position of the actual action in the waitany request's actions dynar and
+       return it as the result of the call */
+    if(req->call == REQ_COMM_WAITANY){
+      SIMIX_waitany_req_remove_from_actions(req);
+      req->comm_waitany.result = xbt_dynar_search(req->comm_waitany.comms, &action);
+    }
 
-    /* The semaphore will only get signaled once, but since the first unlocked guy will
-     * release_forever() the semaphore, that will unlock the second (and any other)
-     * communication partner */
-    SIMIX_register_action_to_semaphore(comm->act, comm->sem);
+    /* If the action is still in a rendez-vous point then remove from it */
+    if(action->comm.rdv)
+      SIMIX_rdv_remove(action->comm.rdv, action);
+
+    DEBUG1("SIMIX_comm_finish: action state = %d", action->state);
+
+    /* Check out for errors */
+    switch (action->state) {
+
+      case SIMIX_DONE:
+        DEBUG1("Communication %p complete!", action);
+        SIMIX_comm_copy_data(action);
+        break;
+
+      case SIMIX_SRC_TIMEOUT:
+        TRY {
+          THROW0(timeout_error, 0, "Communication timeouted because of sender");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+          req->issuer->doexception = 1;
+        }
+        break;
+
+      case SIMIX_DST_TIMEOUT:
+        TRY {
+          THROW0(timeout_error, 0, "Communication timeouted because of receiver");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+          req->issuer->doexception = 1;
+        }
+        break;
+
+      case SIMIX_SRC_HOST_FAILURE:
+        TRY {
+          if(req->issuer == action->comm.src_proc)
+            THROW0(host_error, 0, "Host failed");
+          else
+            THROW0(network_error, 0, "Remote peer failed");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+          req->issuer->doexception = 1;
+        }
+        break;
+
+      case SIMIX_DST_HOST_FAILURE:
+        TRY {
+          if (req->issuer == action->comm.dst_proc)
+            THROW0(host_error, 0, "Host failed");
+          else
+            THROW0(network_error, 0, "Remote peer failed");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+          req->issuer->doexception = 1;
+        }
+        break;
+
+      case SIMIX_LINK_FAILURE:
+        TRY {
+         DEBUG5("Link failure in action %p between '%s' and '%s': posting an exception to the issuer: %s (%p)",
+             action, action->comm.src_proc->smx_host->name, action->comm.dst_proc->smx_host->name,
+             req->issuer->name, req->issuer);
+          THROW0(network_error, 0, "Link failure");
+        }
+       CATCH(req->issuer->running_ctx->exception) {
+          req->issuer->doexception = 1;
+        }
+        break;
+
+      default:
+        THROW_IMPOSSIBLE;
+    }
+    req->issuer->waiting_action = NULL;
+    SIMIX_request_answer(req);
   }
 }
 
-/**
- * \brief Performs error checking and cleanup
- * \param comm The communication
- */
-static XBT_INLINE void SIMIX_communication_cleanup(smx_comm_t comm)
-{
-  DEBUG1("Checking errors and cleaning communication %p", comm);
-
-  /* Make sure that everyone sleeping on that semaphore is awake, and that nobody will ever block on it */
-  SIMIX_sem_release_forever(comm->sem);
-
-  /* Check for errors other than timeouts */
-  if (!SIMIX_host_get_state(SIMIX_host_self())) {
-    if (comm->rdv)
-      SIMIX_rdv_remove(comm->rdv, comm);
-    SIMIX_communication_destroy(comm);
-    THROW0(host_error, 0, "Host failed");
-  } else if (SIMIX_action_get_state(comm->act) == SURF_ACTION_FAILED) {
-    SIMIX_communication_destroy(comm);
-    THROW0(network_error, 0, "Link failure");
-  } else if (!SIMIX_host_get_state(SIMIX_process_get_host(comm->dst_proc))
-             ||
-             !SIMIX_host_get_state(SIMIX_process_get_host(comm->src_proc)))
-  {
-    /* We test both src&dst because we dunno who we are today, and we already tested myself above.
-     *    So, at the end, we test the remote peer only
-     * Moreover, we have to test it because if the remote peer fails, the action comm->act is not done nor failed.
-     *    In that case, we got awaken by the little endless actions created in the SIMIX_sem_acquire(comm->sem)
-     *    at the beginning of this function. */
-    SIMIX_communication_destroy(comm);
-    THROW0(network_error, 0, "Remote peer failed");
-
+void SIMIX_post_comm(smx_action_t action)
+{
+  /* Update action state */
+  if(action->comm.src_timeout &&
+     surf_workstation_model->action_state_get(action->comm.src_timeout) == SURF_ACTION_DONE)
+     action->state = SIMIX_SRC_TIMEOUT;
+  else if(action->comm.dst_timeout &&
+          surf_workstation_model->action_state_get(action->comm.dst_timeout) == SURF_ACTION_DONE)
+     action->state = SIMIX_DST_TIMEOUT;
+  else if(action->comm.src_timeout &&
+          surf_workstation_model->action_state_get(action->comm.src_timeout) == SURF_ACTION_FAILED)
+     action->state = SIMIX_SRC_HOST_FAILURE;
+  else if(action->comm.dst_timeout &&
+          surf_workstation_model->action_state_get(action->comm.dst_timeout) == SURF_ACTION_FAILED)
+     action->state = SIMIX_DST_HOST_FAILURE;
+  else if(action->comm.surf_comm &&
+          surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED)
+     action->state = SIMIX_LINK_FAILURE;
+  else
+    action->state = SIMIX_DONE;
+
+  DEBUG1("SIMIX_post_comm: action state = %d", action->state);
+
+  /* After this point the surf actions associated with the simix communicate
+     action are no longer needed, thus we delete them. */
+  SIMIX_comm_destroy_internal_actions(action);
+
+  /* If there are requests associated with the action, then answer them */
+  if(xbt_fifo_size(action->request_list))
+    SIMIX_comm_finish(action);
+}
+
+void SIMIX_comm_cancel(smx_action_t action)
+{
+  /* If the action is a waiting state means that it is still in a rdv */
+  /* so remove from it and delete it */
+  if (action->state == SIMIX_WAITING) {
+    SIMIX_rdv_remove(action->comm.rdv, action);
+    action->state = SIMIX_FAILED;
+  } else {
+    surf_workstation_model->action_cancel(action->comm.surf_comm);
   }
-  /* Copy network data */
-  SIMIX_network_copy_data(comm);
+}
 
-  SIMIX_communication_destroy(comm);
+void SIMIX_comm_suspend(smx_action_t action)
+{
+  /*FIXME: shall we suspend also the timeout actions? */
+  surf_workstation_model->suspend(action->comm.surf_comm);
 }
 
+void SIMIX_comm_resume(smx_action_t action)
+{
+  /*FIXME: check what happen with the timeouts */
+  surf_workstation_model->resume(action->comm.surf_comm);
+}
+
+
+/************* Action Getters **************/
+
 /**
- *  \brief Waits for communication completion
- *  \param comm The communication
- *  \param timeout The max amount of time to wait for the communication to finish
- *
- *  Throws:
- *   - host_error if local peer failed
- *   - timeout_error if communication reached the timeout specified (either because of local peer or remote peer)
- *   - network_error if network failed or remote peer failed
+ *  \brief get the amount remaining from the communication
+ *  \param action The communication
  */
-static XBT_INLINE void SIMIX_communication_wait_for_completion(smx_comm_t
-                                                               comm,
-                                                               double
-                                                               timeout)
+double SIMIX_comm_get_remains(smx_action_t action)
 {
-  smx_action_t act_sleep = NULL;
-  int src_timeout = 0;
-  int dst_timeout = 0;
+  double remains;
 
-  DEBUG1("Waiting for the completion of communication %p", comm);
+  switch (action->state) {
 
-  if (timeout >= 0) {
-    act_sleep = SIMIX_action_sleep(SIMIX_host_self(), timeout);
-    if (SIMIX_process_self() == comm->src_proc)
-      comm->src_timeout = act_sleep;
-    else
-      comm->dst_timeout = act_sleep;
-    SIMIX_action_set_name(act_sleep,
-                          bprintf
-                          ("Timeout for comm %p and wait on semaphore %p (max_duration:%f)",
-                           comm, comm->sem, timeout));
-    SIMIX_register_action_to_semaphore(act_sleep, comm->sem);
-    SIMIX_process_self()->waiting_action = act_sleep;
-    SIMIX_sem_block_onto(comm->sem);
-    SIMIX_process_self()->waiting_action = NULL;
-    SIMIX_unregister_action_to_semaphore(act_sleep, comm->sem);
-  } else {
-    SIMIX_sem_acquire(comm->sem);
-  }
+    case SIMIX_RUNNING:
+      remains = surf_workstation_model->get_remains(action->comm.surf_comm);
+      break;
 
-  /* Check for timeouts */
-  if ((src_timeout = ((comm->src_timeout)
-                      && (SIMIX_action_get_state(comm->src_timeout) ==
-                          SURF_ACTION_DONE)))
-      || (dst_timeout = ((comm->dst_timeout)
-                         && (SIMIX_action_get_state(comm->dst_timeout) ==
-                             SURF_ACTION_DONE)))) {
-    /* Somebody did a timeout! */
-    if (src_timeout)
-      DEBUG1("Communication timeout from the src! %p", comm);
-    if (dst_timeout)
-      DEBUG1("Communication timeout from the dst! %p", comm);
-
-    if (comm->act
-        && SIMIX_action_get_state(comm->act) == SURF_ACTION_RUNNING)
-      SIMIX_communication_cancel(comm);
-    else if (comm->rdv)
-      SIMIX_rdv_remove(comm->rdv, comm);
-
-    /* Make sure that everyone sleeping on that semaphore is awake, and that nobody will ever block on it */
-    SIMIX_sem_release_forever(comm->sem);
-    SIMIX_communication_destroy(comm);
-
-    THROW1(timeout_error, 0, "Communication timeouted because of %s",
-           src_timeout ? "the source" : "the destination");
+    case SIMIX_WAITING:
+    case SIMIX_READY:
+      remains = 0; /*FIXME: check what should be returned */
+      break;
+
+    default:
+      remains = 0; /*FIXME: is this correct? */
+      break;
   }
+  return remains;
+}
 
-  DEBUG1("Communication %p complete!", comm);
-  SIMIX_communication_cleanup(comm);
+e_smx_state_t SIMIX_comm_get_state(smx_action_t action)
+{
+  return action->state;
 }
 
 /**
- *  \brief Cancels a communication
- *  \brief comm The communication to cancel
+ *  \brief Return the user data associated to the communication
+ *  \param action The communication
+ *  \return the user data
  */
-XBT_INLINE void SIMIX_communication_cancel(smx_comm_t comm)
+void* SIMIX_comm_get_data(smx_action_t action)
 {
-  if (comm->act)
-    SIMIX_action_cancel(comm->act);
+  return action->comm.data;
 }
 
-/**
- *  \brief get the amount remaining from the communication
- *  \param comm The communication
- */
-XBT_INLINE double SIMIX_communication_get_remains(smx_comm_t comm)
+void* SIMIX_comm_get_src_buff(smx_action_t action)
+{
+  return action->comm.src_buff;
+}
+
+void* SIMIX_comm_get_dst_buff(smx_action_t action)
+{
+  return action->comm.dst_buff;
+}
+
+size_t SIMIX_comm_get_src_buff_size(smx_action_t action)
+{
+  return action->comm.src_buff_size;
+}
+
+size_t SIMIX_comm_get_dst_buff_size(smx_action_t action)
 {
-  DEBUG1("calling SIMIX_action_get_remains(%p)", comm->act);
-  return SIMIX_action_get_remains(comm->act);
+  size_t buff_size;
+
+  if (action->comm.dst_buff_size)
+    buff_size = *(action->comm.dst_buff_size);
+  else
+    buff_size = 0;
+
+  return buff_size;
+}
+
+smx_process_t SIMIX_comm_get_src_proc(smx_action_t action)
+{
+  return action->comm.src_proc;
+}
+
+smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action)
+{
+  return action->comm.dst_proc;
 }
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
@@ -394,15 +649,15 @@ XBT_INLINE double SIMIX_communication_get_remains(smx_comm_t comm)
  *  \brief verify if communication is latency bounded
  *  \param comm The communication
  */
-XBT_INLINE int SIMIX_communication_is_latency_bounded(smx_comm_t comm)
+XBT_INLINE int SIMIX_comm_is_latency_bounded(smx_action_t action)
 {
   //try to find comm on the list of finished flows
   uintptr_t key = 0;
   uintptr_t data = 0;
   xbt_dict_cursor_t cursor;
   xbt_dict_foreach(simix_global->latency_limited_dict, cursor, key, data) {
-    DEBUG2("comparing key=%p with comm=%p", (void *) key, (void *) comm);
-    if ((void *) comm == (void *) key) {
+    DEBUG2("comparing key=%p with comm=%p", (void *) key, (void *) action);
+    if ((void *) action == (void *) key) {
       DEBUG2("key %p found, return value latency limited value %d",
              (void *) key, (int) data);
       xbt_dict_cursor_free(&cursor);
@@ -410,307 +665,63 @@ XBT_INLINE int SIMIX_communication_is_latency_bounded(smx_comm_t comm)
     }
   }
 
-  DEBUG1("calling SIMIX_action_is_latency_bounded(%p)", comm->act);
-  return SIMIX_action_is_latency_bounded(comm->act);
+  return surf_workstation_model->get_latency_limited(action->comm.surf_comm);
 }
 #endif
 
 /******************************************************************************/
-/*                    SIMIX_network_copy_data callbacks                       */
+/*                    SIMIX_comm_copy_data callbacks                       */
 /******************************************************************************/
-static void (*SIMIX_network_copy_data_callback) (smx_comm_t, size_t) =
-    &SIMIX_network_copy_pointer_callback;
+static void (*SIMIX_comm_copy_data_callback) (smx_action_t, size_t) =
+    &SIMIX_comm_copy_pointer_callback;
 
 void
-SIMIX_network_set_copy_data_callback(void (*callback) (smx_comm_t, size_t))
+SIMIX_comm_set_copy_data_callback(void (*callback) (smx_action_t, size_t))
 {
-  SIMIX_network_copy_data_callback = callback;
+  SIMIX_comm_copy_data_callback = callback;
 }
 
-void SIMIX_network_copy_pointer_callback(smx_comm_t comm, size_t buff_size)
+void SIMIX_comm_copy_pointer_callback(smx_action_t comm, size_t buff_size)
 {
   xbt_assert1((buff_size == sizeof(void *)),
               "Cannot copy %zu bytes: must be sizeof(void*)", buff_size);
-  *(void **) (comm->dst_buff) = comm->src_buff;
+  *(void **) (comm->comm.dst_buff) = comm->comm.src_buff;
 }
 
-void SIMIX_network_copy_buffer_callback(smx_comm_t comm, size_t buff_size)
+void SIMIX_comm_copy_buffer_callback(smx_action_t comm, size_t buff_size)
 {
-  memcpy(comm->dst_buff, comm->src_buff, buff_size);
+  memcpy(comm->comm.dst_buff, comm->comm.src_buff, buff_size);
 }
 
 /**
  *  \brief Copy the communication data from the sender's buffer to the receiver's one
  *  \param comm The communication
  */
-void SIMIX_network_copy_data(smx_comm_t comm)
+void SIMIX_comm_copy_data(smx_action_t comm)
 {
-  size_t buff_size = comm->src_buff_size;
-  uintptr_t casted_size = 0;
-  uintptr_t amount = 0;
+  size_t buff_size = comm->comm.src_buff_size;
   /* If there is no data to be copy then return */
-  if (!comm->src_buff || !comm->dst_buff || comm->copied == 1)
+  if (!comm->comm.src_buff || !comm->comm.dst_buff || comm->comm.copied == 1)
     return;
 
   DEBUG6("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)",
          comm,
-         comm->src_proc->smx_host->name, comm->src_buff,
-         comm->dst_proc->smx_host->name, comm->dst_buff, buff_size);
+         comm->comm.src_proc->smx_host->name, comm->comm.src_buff,
+         comm->comm.dst_proc->smx_host->name, comm->comm.dst_buff, buff_size);
 
   /* Copy at most dst_buff_size bytes of the message to receiver's buffer */
-  if (comm->dst_buff_size)
-    buff_size = MIN(buff_size, *(comm->dst_buff_size));
+  if (comm->comm.dst_buff_size)
+    buff_size = MIN(buff_size, *(comm->comm.dst_buff_size));
 
   /* Update the receiver's buffer size to the copied amount */
-  if (comm->dst_buff_size)
-    *comm->dst_buff_size = buff_size;
+  if (comm->comm.dst_buff_size)
+    *comm->comm.dst_buff_size = buff_size;
 
   if (buff_size == 0)
     return;
-  (*SIMIX_network_copy_data_callback) (comm, buff_size);
+  (*SIMIX_comm_copy_data_callback) (comm, buff_size);
 
   /* Set the copied flag so we copy data only once */
   /* (this function might be called from both communication ends) */
-  comm->copied = 1;
-
-  /* pimple to display the message sizes */
-  {
-    casted_size = comm->task_size;
-    amount = xbt_dicti_get(simix_global->msg_sizes, casted_size);
-    amount++;
-
-    xbt_dicti_set(simix_global->msg_sizes, casted_size, amount);
-  }
-}
-
-/**
- *  \brief Return the user data associated to the communication
- *  \param comm The communication
- *  \return the user data
- */
-XBT_INLINE void *SIMIX_communication_get_data(smx_comm_t comm)
-{
-  return comm->data;
-}
-
-XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm)
-{
-  return comm->src_buff;
-}
-
-XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm)
-{
-  return comm->dst_buff;
-}
-
-XBT_PUBLIC(size_t) SIMIX_communication_get_src_buf_size(smx_comm_t comm)
-{
-  return comm->src_buff_size;
-}
-
-XBT_PUBLIC(size_t) SIMIX_communication_get_dst_buf_size(smx_comm_t comm)
-{
-  return *(comm->dst_buff_size);
-}
-
-/******************************************************************************/
-/*                        Synchronous Communication                           */
-/******************************************************************************/
-/**
- *  \brief Put a send communication request in a rendez-vous point and waits for
- *         its completion (blocking)
- *  \param rdv The rendez-vous point
- *  \param task_size The size of the communication action (for surf simulation)
- *  \param rate The rate of the communication action (for surf)
- *  \param timeout The timeout used for the waiting the completion 
- *  \param src_buff The source buffer containing the message to be sent
- *  \param src_buff_size The size of the source buffer
- *  \param comm_ref The communication object used for the send  (useful if someone else wants to cancel this communication afterward)
- *  \param data User data associated to the communication object
- *  Throws:
- *   - host_error if peer failed
- *   - timeout_error if communication reached the timeout specified
- *   - network_error if network failed or peer issued a timeout
- */
-XBT_INLINE void SIMIX_network_send(smx_rdv_t rdv, double task_size,
-                                   double rate, double timeout,
-                                   void *src_buff, size_t src_buff_size,
-                                   smx_comm_t * comm_ref, void *data)
-{
-  xbt_ex_t e;
-  smx_comm_t comm = *comm_ref =
-             SIMIX_network_isend(rdv, task_size, rate, src_buff, src_buff_size,
-                                 data);
-  TRY {
-    SIMIX_network_wait(comm, timeout);
-  }
-  TRY_CLEANUP {
-    SIMIX_communication_destroy(comm);
-  }
-  CATCH(e) {
-    RETHROW;
-  }
-}
-
-/**
- *  \brief Put a receive communication request in a rendez-vous point and waits
- *         for its completion (blocking)
- *  \param rdv The rendez-vous point
- *  \param timeout The timeout used for the waiting the completion 
- *  \param dst_buff The destination buffer to copy the received message
- *  \param src_buff_size The size of the destination buffer
- *  \param comm_ref The communication object used for the send (useful if someone else wants to cancel this communication afterward)
- *  Throws:
- *   - host_error if peer failed
- *   - timeout_error if communication reached the timeout specified
- *   - network_error if network failed or peer issued a timeout
- */
-XBT_INLINE void SIMIX_network_recv(smx_rdv_t rdv, double timeout,
-                                   void *dst_buff, size_t * dst_buff_size,
-                                   smx_comm_t * comm_ref)
-{
-  xbt_ex_t e;
-  smx_comm_t comm = *comm_ref =
-      (smx_comm_t) SIMIX_network_irecv(rdv, dst_buff, dst_buff_size);
-  TRY {
-    SIMIX_network_wait(comm, timeout);
-  }
-  TRY_CLEANUP {
-    SIMIX_communication_destroy(comm);
-  }
-  CATCH(e) {
-    RETHROW;
-  }
-}
-
-/******************************************************************************/
-/*                        Asynchronous Communication                          */
-/******************************************************************************/
-smx_comm_t SIMIX_network_isend(smx_rdv_t rdv, double task_size,
-                               double rate, void *src_buff,
-                               size_t src_buff_size, void *data)
-{
-  smx_comm_t comm;
-
-  /*If running in model-checking mode then intercept the communication action */
-#ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_trans_intercept_isend(rdv);
-#endif
-  /* Look for communication request matching our needs.
-     If it is not found then create it and push it into the rendez-vous point */
-  comm = SIMIX_rdv_get_request(rdv, comm_recv);
-
-  if (!comm) {
-    comm = SIMIX_communication_new(comm_send);
-    SIMIX_rdv_push(rdv, comm);
-  }
-
-  /* Setup the communication request */
-  comm->src_proc = SIMIX_process_self();
-  comm->task_size = task_size;
-  comm->rate = rate;
-  comm->src_buff = src_buff;
-  comm->src_buff_size = src_buff_size;
-  comm->data = data;
-
-  SIMIX_communication_start(comm);
-  return comm;
-}
-
-smx_comm_t SIMIX_network_irecv(smx_rdv_t rdv, void *dst_buff,
-                               size_t * dst_buff_size)
-{
-  smx_comm_t comm;
-
-  /*If running in model-checking mode then intercept the communication action */
-#ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_trans_intercept_irecv(rdv);
-#endif
-  /* Look for communication request matching our needs.
-   * If it is not found then create it and push it into the rendez-vous point
-   */
-  comm = SIMIX_rdv_get_request(rdv, comm_send);
-
-  if (!comm) {
-    comm = SIMIX_communication_new(comm_recv);
-    SIMIX_rdv_push(rdv, comm);
-  }
-
-  /* Setup communication request */
-  comm->dst_proc = SIMIX_process_self();
-  comm->dst_buff = dst_buff;
-  comm->dst_buff_size = dst_buff_size;
-
-  SIMIX_communication_start(comm);
-  return comm;
-}
-
-/** @brief blocks until the communication terminates or the timeout occurs */
-XBT_INLINE void SIMIX_network_wait(smx_comm_t comm, double timeout)
-{
-  /*If running in model-checking mode then intercept the communication action */
-#ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_trans_intercept_wait(comm);
-#endif
-  SIMIX_communication_use(comm);
-  /* Wait for communication completion */
-  SIMIX_communication_wait_for_completion(comm, timeout);
-}
-
-/** @Returns whether the (asynchronous) communication is done yet or not */
-XBT_INLINE int SIMIX_network_test(smx_comm_t comm)
-{
-  /*If running in model-checking mode then intercept the communication action */
-#ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_trans_intercept_test(comm);
-#endif
-
-  /* Copy data if the communication is done */
-  if (comm->sem && !SIMIX_sem_would_block(comm->sem)) {
-    /* Copy network data */
-    SIMIX_network_copy_data(comm);
-    return TRUE;
-  }
-  return FALSE;
-}
-
-/** @brief wait for the completion of any communication of a set
- *
- *  @Returns the rank in the dynar of communication which finished; destroy it after identifying which one it is
- */
-unsigned int SIMIX_network_waitany(xbt_dynar_t comms)
-{
-  xbt_dynar_t sems = xbt_dynar_new(sizeof(smx_sem_t), NULL);
-  unsigned int cursor, found_comm = -1;
-  smx_comm_t comm, comm_finished = NULL;
-
-  /*If running in model-checking mode then intercept the communication action */
-#ifdef HAVE_MC
-  if (_surf_do_model_check)
-    MC_trans_intercept_waitany(comms);
-#endif
-  xbt_dynar_foreach(comms, cursor, comm)
-      xbt_dynar_push(sems, &(comm->sem));
-
-  DEBUG1("Waiting for the completion of communication set %p", comms);
-
-  found_comm = SIMIX_sem_acquire_any(sems);
-  xbt_dynar_free_container(&sems);
-  xbt_assert0(found_comm != -1,
-              "Cannot find which communication finished");
-  xbt_dynar_get_cpy(comms, found_comm, &comm_finished);
-
-  DEBUG2("Communication %p of communication set %p finished",
-         comm_finished, comms);
-
-  /* let the regular code deal with the communication end (errors checking and cleanup).
-   * A bit of useless work will be done, but that's good for source factorization */
-  SIMIX_sem_release_forever(comm_finished->sem);
-  SIMIX_communication_use(comm_finished);
-  SIMIX_communication_wait_for_completion(comm_finished, -1);
-  return found_comm;
+  comm->comm.copied = 1;
 }
index 620f242..7272966 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
                                 "Logging specific to SIMIX (process)");
 
+static unsigned long simix_process_count = 0;
+
 /**
- * \brief Move a process to the list of process to destroy. *
+ * \brief Move a process to the list of processes to destroy.
  */
-void SIMIX_process_cleanup(void *arg)
+void SIMIX_process_cleanup(smx_process_t process)
 {
-  xbt_swag_remove(arg, simix_global->process_to_run);
-  xbt_swag_remove(arg, simix_global->process_list);
-  xbt_swag_remove(arg, ((smx_process_t) arg)->smx_host->process_list);
-  xbt_swag_insert(arg, simix_global->process_to_destroy);
+  DEBUG1("Cleanup process %s", process->name);
+  xbt_swag_remove(process, simix_global->process_to_run);
+  xbt_swag_remove(process, simix_global->process_list);
+  xbt_swag_remove(process, process->smx_host->process_list);
+  xbt_swag_insert(process, simix_global->process_to_destroy);
 }
 
 /** 
@@ -38,8 +41,8 @@ void SIMIX_process_empty_trash(void)
     SIMIX_context_free(process->context);
 
     /* Free the exception allocated at creation time */
-    if (process->exception)
-      free(process->exception);
+    if (process->running_ctx)
+      free(process->running_ctx);
     if (process->properties)
       xbt_dict_free(&process->properties);
 
@@ -54,44 +57,70 @@ void SIMIX_process_empty_trash(void)
  */
 void SIMIX_create_maestro_process()
 {
-  smx_process_t process = NULL;
-  process = xbt_new0(s_smx_process_t, 1);
-
-  /* Process data */
-  process->name = (char *) "";
-
-  process->exception = xbt_new(ex_ctx_t, 1);
-  XBT_CTX_INITIALIZE(process->exception);
-
-  /* Create a dummy context for maestro */
-  process->context = SIMIX_context_new(NULL, 0, NULL, NULL, NULL);
+  smx_process_t maestro = NULL;
+  
+  /* Create maestro process and intilialize it */
+  maestro = xbt_new0(s_smx_process_t, 1);
+  maestro->pid = simix_process_count++;
+  maestro->name = (char *) "";
+  maestro->running_ctx = xbt_new(xbt_running_ctx_t, 1);
+  XBT_RUNNING_CTX_INITIALIZE(maestro->running_ctx);
+  maestro->context = SIMIX_context_new(NULL, 0, NULL, NULL, maestro);
+
+  simix_global->maestro_process = maestro;
+  simix_global->current_process = maestro;
+  
+  return;
+}
 
-  /* Set it as the maestro process */
-  simix_global->maestro_process = process;
-  simix_global->current_process = process;
+/**
+ * \brief Same as SIMIX_process_create() but with only one argument (used by timers).
+ * \return the process created
+ */
+smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args) {
+
+  smx_process_t process;
+
+  if (simix_global->create_process_function) {
+    process = simix_global->create_process_function(args->name,
+       args->code,
+       args->data,
+       args->hostname,
+       args->argc,
+       args->argv,
+       args->properties);
+  }
+  else {
+    process = SIMIX_process_create(args->name,
+       args->code,
+       args->data,
+       args->hostname,
+       args->argc,
+       args->argv,
+       args->properties);
+  }
+  // FIXME: to simplify this, simix_global->create_process_function could just
+  // be SIMIX_process_create() by default (and the same thing in smx_deployment.c)
 
-  return;
+  return process;
 }
 
 /**
- * \brief Creates and runs a new #smx_process_t.
+ * \brief Internal function to create a process.
  *
- * A constructor for #m_process_t taking four arguments and returning the corresponding object. The structure (and the corresponding thread) is created, and put in the list of ready process.
+ * This function actually creates the process.
+ * It may be called when a REQ_PROCESS_CREATE request occurs,
+ * or directly for SIMIX internal purposes.
  *
- * \param name a name for the object. It is for user-level information and can be NULL.
- * \param data a pointer to any data one may want to attach to the new object.  It is for user-level information and can be NULL. It can be retrieved with the function \ref MSG_process_get_data.
- * \param host the location where the new agent is executed.
- * \param argc first argument passed to \a code
- * \param argv second argument passed to \a code
- * \param clean_process_function The cleanup function of user process. It will be called when the process finish. This function have to call the SIMIX_process_cleanup.
- * \see smx_process_t
- * \return The new corresponding object.
+ * \return the process created
  */
 smx_process_t SIMIX_process_create(const char *name,
-                                   xbt_main_func_t code, void *data,
-                                   const char *hostname, int argc,
-                                   char **argv, xbt_dict_t properties)
-{
+                                   xbt_main_func_t code,
+                                                    void *data,
+                                                          const char *hostname,
+                                                          int argc, char **argv,
+                                                          xbt_dict_t properties) {
+
   smx_process_t process = NULL;
   smx_host_t host = SIMIX_host_get_by_name(hostname);
 
@@ -100,415 +129,399 @@ smx_process_t SIMIX_process_create(const char *name,
   if (!SIMIX_host_get_state(host)) {
     WARN2("Cannot launch process '%s' on failed host '%s'", name,
           hostname);
-    return NULL;
   }
-  process = xbt_new0(s_smx_process_t, 1);
+  else {
+    process = xbt_new0(s_smx_process_t, 1);
 
-  xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
+    xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
 
-  /* Process data */
-  process->name = xbt_strdup(name);
-  process->smx_host = host;
-  process->mutex = NULL;
-  process->cond = NULL;
-  process->iwannadie = 0;
-  process->data = data;
+    /* Process data */
+    process->pid = simix_process_count++;
+    process->name = xbt_strdup(name);
+    process->smx_host = host;
+    process->iwannadie = 0;
+    process->data = data;
 
-  VERB1("Create context %s", process->name);
-  process->context = SIMIX_context_new(code, argc, argv,
-                                       simix_global->cleanup_process_function,
-                                       process);
+    VERB1("Create context %s", process->name);
+    process->context = SIMIX_context_new(code, argc, argv,
+       simix_global->cleanup_process_function, process);
 
-  process->exception = xbt_new(ex_ctx_t, 1);
-  XBT_CTX_INITIALIZE(process->exception);
+    process->running_ctx = xbt_new(xbt_running_ctx_t, 1);
+    XBT_RUNNING_CTX_INITIALIZE(process->running_ctx);
 
-  /* Add properties */
-  process->properties = properties;
+    /* Add properties */
+    process->properties = properties;
 
-  /* Add the process to it's host process list */
-  xbt_swag_insert(process, host->process_list);
+    /* Add the process to it's host process list */
+    xbt_swag_insert(process, host->process_list);
 
-  DEBUG1("Start context '%s'", process->name);
+    DEBUG1("Start context '%s'", process->name);
 
-  /* Now insert it in the global process list and in the process to run list */
-  xbt_swag_insert(process, simix_global->process_list);
-  DEBUG2("Inserting %s(%s) in the to_run list", process->name, host->name);
-  xbt_swag_insert(process, simix_global->process_to_run);
+    /* Now insert it in the global process list and in the process to run list */
+    xbt_swag_insert(process, simix_global->process_list);
+    DEBUG2("Inserting %s(%s) in the to_run list", process->name, host->name);
+    xbt_swag_insert(process, simix_global->process_to_run);
+  }
 
   return process;
 }
 
-/** \brief Kill a SIMIX process
+/**
+ * \brief Internal function to kill a SIMIX process.
+ *
+ * This function may be called when a REQ_PROCESS_KILL request occurs,
+ * or directly for SIMIX internal purposes.
  *
- * This function simply kills a \a process... scarry isn't it ? :).
  * \param process poor victim
+ */
+void SIMIX_process_kill(smx_process_t process, smx_process_t killer) {
+
+  DEBUG2("Killing process %s on %s", process->name, process->smx_host->name);
+
+  process->iwannadie = 1;
+  process->blocked = 0;
+  process->suspended = 0;
+  /* FIXME: set doexception to 0 also? */
+  
+  if (process->waiting_action) {
+
+    switch (process->waiting_action->type) {
+
+      case SIMIX_ACTION_EXECUTE:          
+      case SIMIX_ACTION_PARALLEL_EXECUTE:
+        SIMIX_host_execution_destroy(process->waiting_action);
+        break;
+
+      case SIMIX_ACTION_COMMUNICATE:
+        SIMIX_comm_destroy(process->waiting_action);
+        break;
+
+      case SIMIX_ACTION_SLEEP:
+       SIMIX_process_sleep_destroy(process->waiting_action);
+       break;
+
+      case SIMIX_ACTION_SYNCHRO:
+       SIMIX_synchro_stop_waiting(process, process->request);
+       SIMIX_synchro_destroy(process->waiting_action);
+       break;
+
+      case SIMIX_ACTION_IO:
+       THROW_UNIMPLEMENTED;
+       break;
+    }
+  }
+
+  /* If I'm killing myself then stop, otherwise schedule the process to kill. */
+  if (process == killer) {
+    SIMIX_context_stop(process->context);
+  }
+  else {
+    xbt_swag_insert(process, simix_global->process_to_run);
+  }
+}
+
+/**
+ * \brief Kills all running processes.
  *
+ * Only maestro can kill everyone.
  */
-void SIMIX_process_kill(smx_process_t process)
+void SIMIX_process_killall(void)
 {
-  DEBUG2("Killing process %s on %s", process->name,
-         process->smx_host->name);
+  smx_process_t p = NULL;
 
-  process->iwannadie = 1;
+  while ((p = xbt_swag_extract(simix_global->process_list)))
+    SIMIX_process_kill(p, SIMIX_process_self());
 
-  /* If I'm killing myself then stop otherwise schedule the process to kill
-   * Two different behaviors, if I'm killing my self, remove from mutex and condition and stop. Otherwise, first we must schedule the process, wait its ending and after remove it from mutex and condition */
-  if (process == SIMIX_process_self()) {
-    /* Cleanup if we were waiting for something */
-    if (process->mutex)
-      xbt_swag_remove(process, process->mutex->sleeping);
+  SIMIX_process_empty_trash();
+}
 
-    if (process->cond)
-      xbt_swag_remove(process, process->cond->sleeping);
-    if (process->waiting_action) {
-      SIMIX_unregister_action_to_condition(process->waiting_action,
-                                           process->cond);
-      SIMIX_action_destroy(process->waiting_action);
-    }
+void SIMIX_process_change_host(smx_process_t process,
+    const char *source, const char *dest)
+{
+  smx_host_t h1 = NULL;
+  smx_host_t h2 = NULL;
+  xbt_assert0((process != NULL), "Invalid parameters");
+  h1 = SIMIX_host_get_by_name(source);
+  h2 = SIMIX_host_get_by_name(dest);
+  process->smx_host = h2;
+  xbt_swag_remove(process, h1->process_list);
+  xbt_swag_insert(process, h2->process_list);
+}
 
-    if (process->sem) {
-      xbt_fifo_remove(process->sem->sleeping, process);
+void SIMIX_pre_process_suspend(smx_req_t req)
+{
+  smx_process_t process = req->process_suspend.process;
+  SIMIX_process_suspend(process, req->issuer);
 
-      if (process->waiting_action) {
-        SIMIX_unregister_action_to_semaphore(process->waiting_action,
-                                             process->sem);
-        SIMIX_action_destroy(process->waiting_action);
-      }
-    }
+  if (process != req->issuer) {
+    SIMIX_request_answer(req);
+  }
+  /* If we are suspending ourselves, then just do not replay the request. */
+}
 
-    SIMIX_context_stop(process->context);
+void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+{
+  xbt_assert0(process, "Invalid parameters");
 
-  } else {
-    DEBUG4("%s(%p) here! killing %s(%p)",
-           simix_global->current_process->name,
-           simix_global->current_process, process->name, process);
+  process->suspended = 1;
 
-    /* Cleanup if it were waiting for something */
-    if (process->mutex) {
-      xbt_swag_remove(process, process->mutex->sleeping);
-      process->mutex = NULL;
-    }
+  /* If we are suspending another process, and it is waiting on an action,
+     suspend it's action. */
+  if (process != issuer) {
+
+    if (process->waiting_action) {
+
+      switch (process->waiting_action->type) {
 
-    if (process->cond) {
-      xbt_swag_remove(process, process->cond->sleeping);
+        case SIMIX_ACTION_EXECUTE:
+        case SIMIX_ACTION_PARALLEL_EXECUTE:
+          SIMIX_host_execution_suspend(process->waiting_action);
+          break;
 
-      if (process->waiting_action) {
-        SIMIX_unregister_action_to_condition(process->waiting_action,
-                                             process->cond);
-        SIMIX_action_destroy(process->waiting_action);
+        case SIMIX_ACTION_COMMUNICATE:
+          SIMIX_comm_suspend(process->waiting_action);
+          break;
+
+        case SIMIX_ACTION_SLEEP:
+          SIMIX_process_sleep_suspend(process->waiting_action);
+          break;
+
+        default:
+          THROW_IMPOSSIBLE;
       }
-      process->cond = NULL;
     }
+  }
+}
+
+void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
+{
+  xbt_assert0((process != NULL), "Invalid parameters");
+
+  process->suspended = 0;
 
-    if (process->sem) {
-      xbt_fifo_remove(process->sem->sleeping, process);
+  /* If we are resuming another process, resume the action it was waiting for
+     if any. Otherwise add it to the list of process to run in the next round. */
+  if (process != issuer) {
 
-      if (process->waiting_action) {
-        SIMIX_unregister_action_to_semaphore(process->waiting_action,
-                                             process->sem);
-        SIMIX_action_destroy(process->waiting_action);
+    if (process->waiting_action) {
+
+      switch(process->waiting_action->type) {
+
+        case SIMIX_ACTION_EXECUTE:          
+        case SIMIX_ACTION_PARALLEL_EXECUTE:
+          SIMIX_host_execution_resume(process->waiting_action);
+          break;
+          
+        case SIMIX_ACTION_COMMUNICATE:
+          SIMIX_comm_resume(process->waiting_action);
+          break;
+          
+        case SIMIX_ACTION_SLEEP:
+          SIMIX_process_sleep_resume(process->waiting_action);
+          break;
+          
+        default:
+          THROW_IMPOSSIBLE;
       }
-      process->sem = NULL;
+    } else {
+      xbt_swag_insert(process, simix_global->process_to_run);
     }
+  }
+}
 
-    /* make sure that the process gets awake soon enough, now that we've set its iwannadie to 1 */
-    process->blocked = 0;
-    process->suspended = 0;
-    xbt_swag_insert(process, simix_global->process_to_run);
+int SIMIX_process_count(void)
+{
+  return xbt_swag_size(simix_global->process_list);
+}
+
+void* SIMIX_process_self_get_data(void)
+{
+  smx_process_t me = SIMIX_process_self();
+  if (!me) {
+    return NULL;
   }
+  return SIMIX_process_get_data(me);
 }
 
-/**
- * \brief Return the user data of a #smx_process_t.
- *
- * This functions checks whether \a process is a valid pointer or not and return the user data associated to \a process if it is possible.
- * \param process SIMIX process
- * \return A void pointer to the user data
- */
-XBT_INLINE void *SIMIX_process_get_data(smx_process_t process)
+void SIMIX_process_self_set_data(void *data)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
-  return (process->data);
+  SIMIX_process_set_data(SIMIX_process_self(), data);
 }
 
-/**
- * \brief Set the user data of a #m_process_t.
- *
- * This functions checks whether \a process is a valid pointer or not and set the user data associated to \a process if it is possible.
- * \param process SIMIX process
- * \param data User data
- */
-XBT_INLINE void SIMIX_process_set_data(smx_process_t process, void *data)
+void* SIMIX_process_get_data(smx_process_t process)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
+  return process->data;
+}
 
+void SIMIX_process_set_data(smx_process_t process, void *data)
+{
   process->data = data;
-  return;
 }
 
-/**
- * \brief Return the location on which an agent is running.
- *
- * This functions checks whether \a process is a valid pointer or not and return the m_host_t corresponding to the location on which \a process is running.
- * \param process SIMIX process
- * \return SIMIX host
- */
-XBT_INLINE smx_host_t SIMIX_process_get_host(smx_process_t process)
+smx_host_t SIMIX_process_get_host(smx_process_t process)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
-  return (process->smx_host);
+  return process->smx_host;
 }
 
-/**
- * \brief Return the name of an agent.
- *
- * This functions checks whether \a process is a valid pointer or not and return its name.
- * \param process SIMIX process
- * \return The process name
- */
-XBT_INLINE const char *SIMIX_process_get_name(smx_process_t process)
+/* needs to be public and without request because it is called
+   by exceptions and logging events */
+const char* SIMIX_process_self_get_name(void) {
+
+  smx_process_t process = SIMIX_process_self();
+  if (process == NULL || process == simix_global->maestro_process)
+    return "";
+
+  return SIMIX_process_get_name(process);
+}
+
+const char* SIMIX_process_get_name(smx_process_t process)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
-  return (process->name);
+  return process->name;
 }
 
-/**
- * \brief Changes the name of an agent.
- *
- * This functions checks whether \a process is a valid pointer or not and return its name.
- * \param process SIMIX process
- * \param name The new process name
- */
-XBT_INLINE void SIMIX_process_set_name(smx_process_t process, char *name)
+int SIMIX_process_is_suspended(smx_process_t process)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
-  process->name = name;
+  return process->suspended;
 }
 
-/** \ingroup m_process_management
- * \brief Return the properties
- *
- * This functions returns the properties associated with this process
- */
-XBT_INLINE xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
+int SIMIX_process_is_enabled(smx_process_t process)
+{
+  if(process->request && SIMIX_request_isEnabled(process->request))
+    return TRUE;
+
+  return FALSE;
+}
+
+xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
 {
   return process->properties;
 }
 
-/**
- * \brief Return the current agent.
- *
- * This functions returns the currently running #smx_process_t.
- * \return The SIMIX process
- */
-XBT_INLINE smx_process_t SIMIX_process_self(void)
+void SIMIX_pre_process_sleep(smx_req_t req)
 {
-  if (simix_global)
-    return simix_global->current_process;
-  return NULL;
+#ifdef HAVE_MC
+  if(_surf_do_model_check){
+    req->process_sleep.result = SIMIX_DONE;
+    SIMIX_request_answer(req);
+  }
+#endif
+  smx_action_t action = SIMIX_process_sleep(req->issuer, req->process_sleep.duration);
+  xbt_fifo_push(action->request_list, req);
+  req->issuer->waiting_action = action;
 }
 
-/**
- * \brief Suspend the process.
- *
- * This functions suspend the process by suspending the action on
- * which it was waiting for the completion.
- *
- * \param process SIMIX process
- */
-void SIMIX_process_suspend(smx_process_t process)
+smx_action_t SIMIX_process_sleep(smx_process_t process, double duration)
 {
-  xbt_assert0(process, "Invalid parameters");
+  smx_action_t action;
+  smx_host_t host = process->smx_host;
+
+  /* check if the host is active */
+  if (surf_workstation_model->extension.
+      workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+    THROW1(host_error, 0, "Host %s failed, you cannot call this function",
+           host->name);
+  }
 
-  if (process != SIMIX_process_self()) {
+  action = xbt_new0(s_smx_action_t, 1);
+  action->type = SIMIX_ACTION_SLEEP;
+  action->request_list = xbt_fifo_new();
+  action->name = xbt_strdup("sleep");
+#ifdef HAVE_TRACING
+  action->category = NULL;
+#endif
 
-    if (process->mutex) {
-      /* process blocked on a mutex or sem, only set suspend=1 */
-      process->suspended = 1;
-    } else if (process->cond) {
-      /* process blocked cond, suspend all actions */
+  action->sleep.host = host;
+  action->sleep.surf_sleep =
+      surf_workstation_model->extension.workstation.sleep(host->host, duration);
 
-      /* temporaries variables */
-      smx_cond_t c;
-      xbt_fifo_item_t i;
-      smx_action_t act;
+  surf_workstation_model->action_data_set(action->sleep.surf_sleep, action);
+  DEBUG1("Create sleep action %p", action);
 
-      process->suspended = 1;
-      c = process->cond;
-      xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
-        SIMIX_action_suspend(act);
-      }
-    } else if (process->sem) {
-      smx_sem_t s;
-      xbt_fifo_item_t i;
-      smx_action_t act;
-
-      process->suspended = 1;
-      s = process->sem;
-      xbt_fifo_foreach(s->actions, i, act, smx_action_t) {
-        SIMIX_action_suspend(act);
-      }
-    } else {
-      process->suspended = 1;
-    }
-  } else {
-    /* process executing, I can create an action and suspend it */
-    smx_action_t dummy;
-    smx_cond_t cond;
-    char name[] = "dummy";
-    process->suspended = 1;
-
-    cond = SIMIX_cond_init();
-    dummy = SIMIX_action_execute(SIMIX_process_get_host(process), name, 0);
-    SIMIX_process_self()->waiting_action = dummy;
-    SIMIX_action_suspend(dummy);
-    SIMIX_register_action_to_condition(dummy, cond);
-    __SIMIX_cond_wait(cond);
-    SIMIX_process_self()->waiting_action = NULL;
-    SIMIX_unregister_action_to_condition(dummy, cond);
-    SIMIX_action_destroy(dummy);
-    SIMIX_cond_destroy(cond);
-  }
-  return;
+  return action;
 }
 
-/**
- * \brief Resume a suspended process.
- *
- * This functions resume a suspended process by resuming the task on which it was waiting for the completion.
- * \param process SIMIX process
- */
-void SIMIX_process_resume(smx_process_t process)
+void SIMIX_post_process_sleep(smx_action_t action)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
-  SIMIX_CHECK_HOST();
-
-  if (process == SIMIX_process_self())
-    return;
-
-  if (process->mutex) {
-    DEBUG0("Resume process blocked on a mutex or semaphore");
-    process->suspended = 0;     /* It'll wake up by itself when mutex releases */
-    return;
-  } else if (process->cond) {
-    /* temporaries variables */
-    smx_cond_t c;
-    xbt_fifo_item_t i;
-    smx_action_t act;
-    DEBUG0("Resume process blocked on a conditional");
-    process->suspended = 0;
-    c = process->cond;
-    xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
-      SIMIX_action_resume(act);
-    }
-    SIMIX_cond_signal(c);
-    return;
-  } else if (process->sem) {
-    /* temporaries variables */
-    smx_sem_t s;
-    xbt_fifo_item_t i;
-    smx_action_t act;
-    DEBUG0("Resume process blocked on a semaphore");
-    process->suspended = 0;
-    s = process->sem;
-    xbt_fifo_foreach(s->actions, i, act, smx_action_t) {
-      SIMIX_action_resume(act);
-    }
-    return;
-  } else {
-    process->suspended = 0;
-    xbt_swag_insert(process, simix_global->process_to_run);
+  e_smx_state_t state = SIMIX_action_map_state(surf_workstation_model->action_state_get(action->sleep.surf_sleep));
+  smx_req_t req;
+
+  while ((req = xbt_fifo_shift(action->request_list))) {
+    req->process_sleep.result = state;
+    req->issuer->waiting_action = NULL;
+    SIMIX_request_answer(req);
   }
+
+  SIMIX_process_sleep_destroy(action);
 }
 
-/**
- * \brief Migrates an agent to another location.
- *
- * This function changes the value of the host on which \a process is running.
- */
-void SIMIX_process_change_host(smx_process_t process, char *source,
-                               char *dest)
+void SIMIX_process_sleep_destroy(smx_action_t action)
 {
-  smx_host_t h1 = NULL;
-  smx_host_t h2 = NULL;
-  xbt_assert0((process != NULL), "Invalid parameters");
-  h1 = SIMIX_host_get_by_name(source);
-  h2 = SIMIX_host_get_by_name(dest);
-  process->smx_host = h2;
-  xbt_swag_remove(process, h1->process_list);
-  xbt_swag_insert(process, h2->process_list);
+  DEBUG1("Destroy action %p", action);
+  if (action->name)
+    xbt_free(action->name);
+  if (action->sleep.surf_sleep)
+    action->sleep.surf_sleep->model_type->action_unref(action->sleep.surf_sleep);
+#ifdef HAVE_TRACING
+  TRACE_smx_action_destroy(act);
+#endif
+  xbt_fifo_free(action->request_list);
+  xbt_free(action);
 }
 
-/**
- * \brief Returns true if the process is suspended .
- *
- * This checks whether a process is suspended or not by inspecting the task on which it was waiting for the completion.
- * \param process SIMIX process
- * \return 1, if the process is suspended, else 0.
- */
-XBT_INLINE int SIMIX_process_is_suspended(smx_process_t process)
+void SIMIX_process_sleep_suspend(smx_action_t action)
 {
-  xbt_assert0((process != NULL), "Invalid parameters");
+  surf_workstation_model->suspend(action->sleep.surf_sleep);
+}
 
-  return (process->suspended);
+void SIMIX_process_sleep_resume(smx_action_t action)
+{
+  surf_workstation_model->resume(action->sleep.surf_sleep);
 }
 
 /**
- * \brief Returns the amount of SIMIX processes in the system
+ * \brief Returns the current agent.
+ *
+ * This functions returns the currently running SIMIX process.
  *
- * Maestro internal process is not counted, only user code processes are
+ * \return The SIMIX process
  */
-XBT_INLINE int SIMIX_process_count()
+XBT_INLINE smx_process_t SIMIX_process_self(void)
 {
-  return xbt_swag_size(simix_global->process_list);
+  if(simix_global)
+    return SIMIX_context_self();
+  return NULL;
 }
 
 /** 
- * Calling this function makes the process process to yield. The process
- * that scheduled it returns from __SIMIX_process_schedule as if nothing
- * had happened.
- * 
- * Only the processes can call this function, giving back the control
- * to the maestro
+ * Calling this function makes the process to yield.
+ * Only the processes can call this function, giving back the control to maestro
  */
 void SIMIX_process_yield(void)
 {
-  DEBUG1("Yield process '%s'", simix_global->current_process->name);
-  xbt_assert0((simix_global->current_process !=
-               simix_global->maestro_process),
-              "You are not supposed to run this function in maestro context!");
-
-
+  smx_process_t self = SIMIX_process_self();
+  
+  DEBUG1("Yield process '%s'", self->name);
+  
   /* Go into sleep and return control to maestro */
-  SIMIX_context_suspend(simix_global->current_process->context);
-  /* Ok, maestro returned control to us */
-
-  if (simix_global->current_process->iwannadie)
-    SIMIX_context_stop(simix_global->current_process->context);
-}
-
-void SIMIX_process_schedule(smx_process_t new_process)
-{
-  xbt_assert0(simix_global->current_process ==
-              simix_global->maestro_process,
-              "This function can only be called from maestro context");
-  DEBUG1("Scheduling context: '%s'", new_process->name);
-
-  /* update the current process */
-  simix_global->current_process = new_process;
-
-  /* schedule the context */
-  SIMIX_context_resume(new_process->context);
-  DEBUG1("Resumed from scheduling context: '%s'", new_process->name);
+  SIMIX_context_suspend(self->context);
 
-  /* restore the current process to the previously saved process */
-  simix_global->current_process = simix_global->maestro_process;
+  /* Ok, maestro returned control to us */
+  DEBUG1("Maestro returned control to me: '%s'", self->name);
+  
+  if (self->iwannadie)
+    SIMIX_context_stop(self->context);
+
+  if (self->doexception) {
+    DEBUG0("Wait, maestro left me an exception");
+    self->doexception = 0;
+    RETHROW;
+  }
 }
 
 /* callback: context fetching */
-ex_ctx_t *SIMIX_process_get_exception(void)
+xbt_running_ctx_t *SIMIX_process_get_running_context(void)
 {
-  return simix_global->current_process->exception;
+  return simix_global->current_process->running_ctx;
 }
 
 /* callback: termination */
diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c
new file mode 100644 (file)
index 0000000..c6c278a
--- /dev/null
@@ -0,0 +1,450 @@
+#include "private.h"
+#include "xbt/fifo.h"
+#include "xbt/xbt_os_thread.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_smurf, simix,
+                                "Logging specific to SIMIX (SMURF)");
+
+static xbt_dynar_t req_vector;
+static xbt_os_mutex_t sync_req_vector;
+
+void SIMIX_request_init(void)
+{
+  sync_req_vector = xbt_os_mutex_init();
+  req_vector = xbt_dynar_new(sizeof(void *), NULL);
+}
+
+void SIMIX_request_destroy(void)
+{
+  xbt_os_mutex_destroy(sync_req_vector);
+  xbt_dynar_free(&req_vector);
+}
+
+void SIMIX_request_push(smx_req_t req)
+{
+  req->issuer = SIMIX_process_self();
+  if(req->issuer != simix_global->maestro_process){
+    xbt_os_mutex_acquire(sync_req_vector);
+    xbt_dynar_set_as(req_vector, req->issuer->pid, smx_req_t, req);
+    xbt_os_mutex_release(sync_req_vector);
+    req->issuer->request = req;
+    DEBUG2("Yield process '%s' on request of type %d", req->issuer->name, req->call);
+    SIMIX_process_yield();
+  }else{
+    SIMIX_request_pre(req);
+  }
+}
+
+smx_req_t SIMIX_request_pop(void)
+{
+  smx_req_t request = NULL;
+  xbt_os_mutex_acquire(sync_req_vector);
+  while(xbt_dynar_length(req_vector)){
+    request = xbt_dynar_pop_as(req_vector, smx_req_t);
+    if(request)
+      break;
+  }
+  xbt_os_mutex_release(sync_req_vector);
+  return request;
+}
+
+void SIMIX_request_answer(smx_req_t req)
+{
+  if(req->issuer != simix_global->maestro_process){
+    req->issuer->request = NULL;    
+    xbt_swag_insert(req->issuer, simix_global->process_to_run);
+  }
+}
+
+int SIMIX_request_isVisible(smx_req_t req)
+{
+  if(req->call != REQ_COMM_ISEND && req->call != REQ_COMM_IRECV
+   && req->call != REQ_COMM_WAIT && req->call != REQ_COMM_WAITANY
+   && req->call != REQ_COMM_TEST)
+    return FALSE;
+  return TRUE;
+}
+
+int SIMIX_request_isEnabled(smx_req_t req)
+{
+  unsigned int index = 0;
+  smx_action_t act;
+  
+  switch(req->call){
+    case REQ_COMM_WAIT:
+      /*FIXME: check also that src and dst processes are not suspended */
+      if(req->comm_wait.comm->comm.src_proc 
+         && req->comm_wait.comm->comm.dst_proc)
+        return TRUE;
+      return FALSE;
+      break;
+      
+    case REQ_COMM_WAITANY:
+      xbt_dynar_foreach(req->comm_waitany.comms, index, act) {
+        if (act->comm.src_proc && act->comm.dst_proc){
+          return TRUE;
+        }
+      }
+      return FALSE;
+      break;
+
+    default:    
+      return TRUE;
+  }
+}
+
+
+void SIMIX_request_pre(smx_req_t req)
+{
+  switch (req->call) {
+
+    case REQ_HOST_GET_BY_NAME:
+      req->host_get_by_name.result =
+        SIMIX_host_get_by_name(req->host_get_by_name.name);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_NAME:
+      req->host_get_name.result =      SIMIX_host_get_name(req->host_get_name.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_PROPERTIES:
+      req->host_get_properties.result =
+        SIMIX_host_get_properties(req->host_get_properties.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_SPEED:
+      req->host_get_speed.result = 
+        SIMIX_host_get_speed(req->host_get_speed.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_AVAILABLE_SPEED:
+      req->host_get_available_speed.result =
+       SIMIX_host_get_available_speed(req->host_get_available_speed.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_STATE:
+      req->host_get_state.result = 
+        SIMIX_host_get_state(req->host_get_state.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_GET_DATA:
+      req->host_get_data.result =      SIMIX_host_get_data(req->host_get_data.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_SET_DATA:
+      SIMIX_host_set_data(req->host_set_data.host, req->host_set_data.data);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTE:
+      req->host_execute.result = SIMIX_host_execute(
+         req->host_execute.name,
+         req->host_execute.host,
+         req->host_execute.computation_amount);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_PARALLEL_EXECUTE:
+      req->host_parallel_execute.result = SIMIX_host_parallel_execute(
+         req->host_parallel_execute.name,
+         req->host_parallel_execute.host_nb,
+         req->host_parallel_execute.host_list,
+         req->host_parallel_execute.computation_amount,
+         req->host_parallel_execute.communication_amount,
+         req->host_parallel_execute.amount,
+         req->host_parallel_execute.rate);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_DESTROY:
+      SIMIX_host_execution_destroy(req->host_execution_destroy.execution);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_CANCEL:
+      SIMIX_host_execution_cancel(req->host_execution_cancel.execution);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_GET_REMAINS:
+      req->host_execution_get_remains.result =
+        SIMIX_host_execution_get_remains(req->host_execution_get_remains.execution);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_GET_STATE:
+      req->host_execution_get_state.result =
+       SIMIX_host_execution_get_state(req->host_execution_get_state.execution);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_SET_PRIORITY:
+      SIMIX_host_execution_set_priority(
+         req->host_execution_set_priority.execution,
+         req->host_execution_set_priority.priority);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_HOST_EXECUTION_WAIT:
+      SIMIX_pre_host_execution_wait(req);
+      break;
+    case REQ_PROCESS_CREATE:
+      req->process_create.result = SIMIX_process_create(
+         req->process_create.name,
+         req->process_create.code,
+         req->process_create.data,
+         req->process_create.hostname,
+         req->process_create.argc,
+         req->process_create.argv,
+         req->process_create.properties);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_KILL:
+      SIMIX_process_kill(req->process_kill.process, req->issuer);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_CHANGE_HOST:
+      SIMIX_process_change_host(
+         req->process_change_host.process,
+         req->process_change_host.source,
+         req->process_change_host.dest);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_SUSPEND:
+      SIMIX_pre_process_suspend(req);
+      break;
+    case REQ_PROCESS_RESUME:
+      SIMIX_process_resume(req->process_resume.process, req->issuer);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_COUNT:
+      req->process_count.result = SIMIX_process_count();
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_GET_DATA:
+      req->process_get_data.result =
+        SIMIX_process_get_data(req->process_get_data.process);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_SET_DATA:
+      SIMIX_process_set_data(
+         req->process_set_data.process,
+         req->process_set_data.data);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_GET_HOST:
+      req->process_get_host.result = SIMIX_process_get_host(req->process_get_host.process);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_GET_NAME:
+      req->process_get_name.result = SIMIX_process_get_name(req->process_get_name.process);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_IS_SUSPENDED:
+      req->process_is_suspended.result =
+        SIMIX_process_is_suspended(req->process_is_suspended.process);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_GET_PROPERTIES:
+      req->process_get_properties.result =
+        SIMIX_process_get_properties(req->process_get_properties.process);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_PROCESS_SLEEP:
+      SIMIX_pre_process_sleep(req);
+      break;
+    case REQ_RDV_CREATE:
+      req->rdv_create.result = SIMIX_rdv_create(req->rdv_create.name);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_RDV_DESTROY:
+      SIMIX_rdv_destroy(req->rdv_destroy.rdv);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_RDV_GEY_BY_NAME:
+      req->rdv_get_by_name.result = 
+        SIMIX_rdv_get_by_name(req->rdv_get_by_name.name);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_RDV_COMM_COUNT_BY_HOST:
+      req->rdv_comm_count_by_host.result = SIMIX_rdv_comm_count_by_host(
+         req->rdv_comm_count_by_host.rdv,
+         req->rdv_comm_count_by_host.host);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_RDV_GET_HEAD:
+      req->rdv_get_head.result =       SIMIX_rdv_get_head(req->rdv_get_head.rdv);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_ISEND:
+      req->comm_isend.result = SIMIX_comm_isend(
+         req->issuer,
+         req->comm_isend.rdv,
+         req->comm_isend.task_size,
+         req->comm_isend.rate,
+         req->comm_isend.src_buff,
+         req->comm_isend.src_buff_size,
+         req->comm_isend.data);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_IRECV:
+      req->comm_irecv.result = SIMIX_comm_irecv(
+         req->issuer,
+         req->comm_irecv.rdv,
+         req->comm_irecv.dst_buff,
+         req->comm_irecv.dst_buff_size);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_DESTROY:
+      SIMIX_comm_destroy(req->comm_destroy.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_CANCEL:
+      SIMIX_comm_cancel(req->comm_cancel.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_WAITANY:
+      SIMIX_pre_comm_waitany(req);
+      break;
+    case REQ_COMM_WAIT:
+      SIMIX_pre_comm_wait(req);
+      break;
+    case REQ_COMM_TEST:
+      SIMIX_pre_comm_test(req);
+      break;
+    case REQ_COMM_GET_REMAINS:
+      req->comm_get_remains.result = 
+        SIMIX_comm_get_remains(req->comm_get_remains.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_STATE:
+      req->comm_get_state.result = 
+        SIMIX_comm_get_state(req->comm_get_state.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_DATA:
+      req->comm_get_data.result = SIMIX_comm_get_data(req->comm_get_data.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_SRC_BUFF:
+      req->comm_get_src_buff.result =
+       SIMIX_comm_get_src_buff(req->comm_get_src_buff.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_DST_BUFF:
+      req->comm_get_dst_buff.result =
+        SIMIX_comm_get_dst_buff(req->comm_get_dst_buff.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_SRC_BUFF_SIZE:
+      req->comm_get_src_buff_size.result = 
+        SIMIX_comm_get_src_buff_size(req->comm_get_src_buff_size.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_DST_BUFF_SIZE:
+      req->comm_get_dst_buff_size.result =
+       SIMIX_comm_get_dst_buff_size(req->comm_get_dst_buff_size.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_SRC_PROC:
+      req->comm_get_src_proc.result = 
+        SIMIX_comm_get_src_proc(req->comm_get_src_proc.comm);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COMM_GET_DST_PROC:
+      req->comm_get_dst_proc.result =
+        SIMIX_comm_get_dst_proc(req->comm_get_dst_proc.comm);
+      SIMIX_request_answer(req);
+      break;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+    case REQ_COMM_IS_LATENCY_BOUNDED:
+      req->comm_is_latency_bounded.result =
+       SIMIX_comm_is_latency_bounded(req->comm_is_latency_bounded.comm);
+      SIMIX_request_answer(req);
+      break;
+#endif
+    case REQ_MUTEX_INIT:
+      req->mutex_init.result = SIMIX_mutex_init();
+      SIMIX_request_answer(req);
+      break;
+    case REQ_MUTEX_DESTROY:
+      SIMIX_mutex_destroy(req->mutex_destroy.mutex);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_MUTEX_LOCK:
+      SIMIX_pre_mutex_lock(req);
+      break;
+    case REQ_MUTEX_TRYLOCK:
+      req->mutex_trylock.result =
+             SIMIX_mutex_trylock(req->mutex_trylock.mutex, req->issuer);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_MUTEX_UNLOCK:
+      SIMIX_mutex_unlock(req->mutex_unlock.mutex, req->issuer);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COND_INIT:
+      req->cond_init.result = SIMIX_cond_init();
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COND_DESTROY:
+      SIMIX_cond_destroy(req->cond_destroy.cond);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COND_SIGNAL:
+      SIMIX_cond_signal(req->cond_signal.cond);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_COND_WAIT:
+      SIMIX_pre_cond_wait(req);
+      break;
+    case REQ_COND_WAIT_TIMEOUT:
+      SIMIX_pre_cond_wait_timeout(req);
+      break;
+    case REQ_COND_BROADCAST:
+      SIMIX_cond_broadcast(req->cond_broadcast.cond);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_SEM_INIT:
+      req->sem_init.result = SIMIX_sem_init(req->sem_init.capacity);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_SEM_DESTROY:
+      SIMIX_sem_destroy(req->sem_destroy.sem);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_SEM_RELEASE:
+      SIMIX_sem_release(req->sem_release.sem);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_SEM_WOULD_BLOCK:
+      req->sem_would_block.result =
+       SIMIX_sem_would_block(req->sem_would_block.sem);
+      SIMIX_request_answer(req);
+      break;
+    case REQ_SEM_ACQUIRE:
+      SIMIX_pre_sem_acquire(req);
+      break;
+    case REQ_SEM_ACQUIRE_TIMEOUT:
+      SIMIX_pre_sem_acquire_timeout(req);
+      break;
+    case REQ_SEM_GET_CAPACITY:
+      req->sem_get_capacity.result = 
+        SIMIX_sem_get_capacity(req->sem_get_capacity.sem);
+      SIMIX_request_answer(req);
+      break;
+  }
+}
+
+void SIMIX_request_post(smx_action_t action)
+{
+  switch(action->type) {
+    case SIMIX_ACTION_EXECUTE:
+    case SIMIX_ACTION_PARALLEL_EXECUTE:
+      SIMIX_post_host_execute(action);
+      break;
+    case SIMIX_ACTION_COMMUNICATE:
+      SIMIX_post_comm(action);
+      break;
+    case SIMIX_ACTION_SLEEP:
+      SIMIX_post_process_sleep(action);
+      break;
+    case SIMIX_ACTION_SYNCHRO:
+      SIMIX_post_synchro(action);
+      break;
+    case SIMIX_ACTION_IO:
+      break;
+  }
+}
index 8cc9729..059ca6d 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix,
                                 "Logging specific to SIMIX (synchronization)");
 
+static smx_action_t SIMIX_synchro_wait(smx_host_t smx_host, double timeout);
+static void SIMIX_synchro_finish(smx_action_t action);
+static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
+                             smx_process_t issuer, smx_req_t req);
+static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
+                            smx_req_t req);
+static void SIMIX_sem_block_onto(smx_sem_t sem);
 
-/****************************** Synchronization *******************************/
+/***************************** Synchro action *********************************/
 
+static smx_action_t SIMIX_synchro_wait(smx_host_t smx_host, double timeout)
+{
+  smx_action_t action;
+  action = xbt_new0(s_smx_action_t, 1);
+  action->type = SIMIX_ACTION_SYNCHRO;
+  action->request_list = xbt_fifo_new();
+  action->name = xbt_strdup("synchro");
+  action->synchro.sleep = 
+    surf_workstation_model->extension.workstation.sleep(smx_host->host, timeout);
+
+  surf_workstation_model->action_data_set(action->synchro.sleep, action);
+  return action;
+}
+
+void SIMIX_synchro_stop_waiting(smx_process_t process, smx_req_t req)
+{
+  switch (req->call) {
+
+    case REQ_MUTEX_LOCK:
+      xbt_swag_remove(process, req->mutex_lock.mutex->sleeping);
+      break;
+
+    case REQ_COND_WAIT:
+      xbt_swag_remove(process, req->cond_wait.cond->sleeping);
+      break;
+
+    case REQ_COND_WAIT_TIMEOUT:
+      xbt_swag_remove(process, req->cond_wait_timeout.cond->sleeping);
+      break;
+
+    case REQ_SEM_ACQUIRE:
+      xbt_swag_remove(process, req->sem_acquire.sem->sleeping);
+      break;
+
+    case REQ_SEM_ACQUIRE_TIMEOUT:
+      xbt_swag_remove(process, req->sem_acquire_timeout.sem->sleeping);
+      break;
+
+    default:
+      THROW_IMPOSSIBLE;
+  }
+}
+
+void SIMIX_synchro_destroy(smx_action_t action)
+{
+  DEBUG1("Destroying synchro %p", action);
+  action->synchro.sleep->model_type->action_unref(action->synchro.sleep);
+  xbt_fifo_free(action->request_list);
+  xbt_free(action->name);
+  xbt_free(action);
+}
+
+void SIMIX_post_synchro(smx_action_t action)
+{
+  if(surf_workstation_model->action_state_get(action->synchro.sleep) == SURF_ACTION_FAILED)
+     action->state = SIMIX_FAILED;
+  else if(surf_workstation_model->action_state_get(action->synchro.sleep) == SURF_ACTION_DONE)
+     action->state = SIMIX_SRC_TIMEOUT;
+
+  action->synchro.sleep->model_type->action_unref(action->synchro.sleep);
+
+  SIMIX_synchro_finish(action);  
+}
+
+static void SIMIX_synchro_finish(smx_action_t action)
+{
+  smx_req_t req = xbt_fifo_shift(action->request_list);
+  
+  switch(action->state){
+    case SIMIX_SRC_TIMEOUT:
+      TRY {
+        THROW0(timeout_error, 0, "Synchro's wait timeout");
+      } CATCH(req->issuer->running_ctx->exception) {
+        req->issuer->doexception = 1;
+      }
+      break;
+
+    case SIMIX_FAILED:
+      TRY {
+        THROW0(host_error, 0, "Host failed");
+      } CATCH(req->issuer->running_ctx->exception) {
+        req->issuer->doexception = 1;
+      }
+      break;
+      
+    default:
+      THROW_IMPOSSIBLE;
+      break;
+  }
+
+  SIMIX_synchro_stop_waiting(req->issuer, req);
+  SIMIX_synchro_destroy(action);
+  SIMIX_request_answer(req);
+}
 /*********************************** Mutex ************************************/
 
 /**
  * \brief Initialize a mutex.
  *
- * Allocs and creates the data for the mutex. It have to be called before the utilisation of the mutex.
+ * Allocs and creates the data for the mutex.
  * \return A mutex
  */
-smx_mutex_t SIMIX_mutex_init()
+smx_mutex_t SIMIX_mutex_init(void)
 {
-  smx_mutex_t m = xbt_new0(s_smx_mutex_t, 1);
   s_smx_process_t p;            /* useful to initialize sleeping swag */
-  /* structures initialization */
-  m->refcount = 0;
-  m->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
-  return m;
+
+  smx_mutex_t mutex = xbt_new0(s_smx_mutex_t, 1);
+  mutex->locked = 0;
+  mutex->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
+  return mutex;
 }
 
 /**
- * \brief Locks a mutex.
- *
- * Tries to lock a mutex, if the mutex isn't used yet, the process can continue its execution, else it'll be blocked here. You have to call #SIMIX_mutex_unlock to free the mutex.
- * \param mutex The mutex
+ * \brief Handle mutex lock request
+ * \param req The request
  */
-void SIMIX_mutex_lock(smx_mutex_t mutex)
+void SIMIX_pre_mutex_lock(smx_req_t req)
 {
-  smx_process_t self = SIMIX_process_self();
-  xbt_assert0((mutex != NULL), "Invalid parameters");
-
-
-  if (mutex->refcount) {
-    /* somebody using the mutex, block */
-    xbt_swag_insert(self, mutex->sleeping);
-    self->mutex = mutex;
-    /* wait for some process make the unlock and wake up me from mutex->sleeping */
-    SIMIX_process_yield();
-    self->mutex = NULL;
-
-    /* verify if the process was suspended */
-    while (self->suspended) {
-      SIMIX_process_yield();
-    }
-
-    mutex->refcount = 1;
+  /*FIXME: check where to validate the arguments */
+  smx_action_t sync_act = NULL;
+  smx_mutex_t mutex = req->mutex_lock.mutex;
+  smx_process_t process = req->issuer;
+  
+  if (mutex->locked) {
+    /* FIXME: check if the host is active ? */
+    /* Somebody using the mutex, use a synchro action to get host failures */
+    sync_act = SIMIX_synchro_wait(process->smx_host, -1);
+    xbt_fifo_push(sync_act->request_list, req);
+    req->issuer->waiting_action = sync_act;
+    xbt_swag_insert(req->issuer, mutex->sleeping);   
   } else {
     /* mutex free */
-    mutex->refcount = 1;
+    mutex->locked = 1;
+    mutex->owner = req->issuer;
+    SIMIX_request_answer(req);
   }
-  return;
 }
 
 /**
  * \brief Tries to lock a mutex.
  *
- * Tries to lock a mutex, return 1 if the mutex is free, 0 else. This function does not block the process if the mutex is used.
+ * Tries to lock a mutex, return 1 if the mutex is unlocked, else 0.
+ * This function does not block and wait for the mutex to be unlocked.
  * \param mutex The mutex
+ * \param issuer The process that tries to acquire the mutex
  * \return 1 - mutex free, 0 - mutex used
  */
-XBT_INLINE int SIMIX_mutex_trylock(smx_mutex_t mutex)
+int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer)
 {
-  xbt_assert0((mutex != NULL), "Invalid parameters");
-
-  if (mutex->refcount)
+  if (mutex->locked)
     return 0;
   else {
-    mutex->refcount = 1;
+    mutex->locked = 1;
+    mutex->owner = issuer;
     return 1;
   }
 }
@@ -87,24 +182,31 @@ XBT_INLINE int SIMIX_mutex_trylock(smx_mutex_t mutex)
 /**
  * \brief Unlocks a mutex.
  *
- * Unlocks the mutex and wakes up a process blocked on it. If there are no process sleeping, only sets the mutex as free.
+ * Unlocks the mutex and gives it to a process waiting for it. 
+ * If the unlocker is not the owner of the mutex nothing happens.
+ * If there are no process waiting, it sets the mutex as free.
  * \param mutex The mutex
+ * \param issuer The process trying to unlock the mutex
  */
-void SIMIX_mutex_unlock(smx_mutex_t mutex)
+void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer)
 {
   smx_process_t p;              /*process to wake up */
 
-  xbt_assert0((mutex != NULL), "Invalid parameters");
-
+  /* If the mutex is not owned by the issuer do nothing */
+  if(issuer != mutex->owner)
+    return;
+  
   if (xbt_swag_size(mutex->sleeping) > 0) {
     p = xbt_swag_extract(mutex->sleeping);
-    mutex->refcount = 0;
-    xbt_swag_insert(p, simix_global->process_to_run);
+    SIMIX_synchro_destroy(p->waiting_action);
+    p->waiting_action = NULL;
+    mutex->owner = p;
+    SIMIX_request_answer(p->request);
   } else {
     /* nobody to wake up */
-    mutex->refcount = 0;
+    mutex->locked = 0;
+    mutex->owner = NULL;
   }
-  return;
 }
 
 /**
@@ -113,18 +215,15 @@ void SIMIX_mutex_unlock(smx_mutex_t mutex)
  * Destroys and frees the mutex's memory. 
  * \param mutex A mutex
  */
-XBT_INLINE void SIMIX_mutex_destroy(smx_mutex_t mutex)
+void SIMIX_mutex_destroy(smx_mutex_t mutex)
 {
-  if (mutex == NULL)
-    return;
-  else {
+  if(mutex){
     xbt_swag_free(mutex->sleeping);
     xbt_free(mutex);
-    return;
   }
 }
 
-/******************************** Conditional *********************************/
+/********************************* Condition **********************************/
 
 /**
  * \brief Initialize a condition.
@@ -135,159 +234,112 @@ XBT_INLINE void SIMIX_mutex_destroy(smx_mutex_t mutex)
  */
 smx_cond_t SIMIX_cond_init()
 {
-  smx_cond_t cond = xbt_new0(s_smx_cond_t, 1);
   s_smx_process_t p;
-
+  smx_cond_t cond = xbt_new0(s_smx_cond_t, 1);
   cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
-  cond->actions = xbt_fifo_new();
   cond->mutex = NULL;
   return cond;
 }
 
 /**
- * \brief Signalizes a condition.
- *
- * Signalizes a condition and wakes up a sleeping process. If there are no process sleeping, no action is done.
- * \param cond A condition
+ * \brief Handle condition waiting requests without timeouts
+ * \param The request
  */
-void SIMIX_cond_signal(smx_cond_t cond)
+void SIMIX_pre_cond_wait(smx_req_t req)
 {
-  smx_process_t proc = NULL;
-  DEBUG1("Signal condition %p", cond);
-  xbt_assert0((cond != NULL), "Invalid parameters");
-
+  smx_process_t issuer = req->issuer;
+  smx_cond_t cond = req->cond_wait.cond;
+  smx_mutex_t mutex = req->cond_wait.mutex;
 
-  if (xbt_swag_size(cond->sleeping) >= 1) {
-    proc = xbt_swag_extract(cond->sleeping);
-    xbt_swag_insert(proc, simix_global->process_to_run);
-  }
-
-  return;
+  _SIMIX_cond_wait(cond, mutex, -1, issuer, req);
 }
 
 /**
- * \brief Waits on a condition.
- *
- * Blocks a process until the signal is called. This functions frees the mutex associated and locks it after its execution.
- * \param cond A condition
- * \param mutex A mutex
+ * \brief Handle condition waiting requests with timeouts
+ * \param The request
  */
-void SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
+void SIMIX_pre_cond_wait_timeout(smx_req_t req)
 {
-  smx_action_t act_sleep;
+  smx_process_t issuer = req->issuer;
+  smx_cond_t cond = req->cond_wait_timeout.cond;
+  smx_mutex_t mutex = req->cond_wait_timeout.mutex;
+  double timeout = req->cond_wait_timeout.timeout;
+  
+  _SIMIX_cond_wait(cond, mutex, timeout, issuer, req);
+}
 
-  DEBUG1("Wait condition %p", cond);
 
+static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
+                             smx_process_t issuer, smx_req_t req)
+{
+  smx_action_t sync_act = NULL;
+  
+  DEBUG1("Wait condition %p", cond);
+  
   /* If there is a mutex unlock it */
+  /* FIXME: what happen if the issuer is not the owner of the mutex ? */
   if (mutex != NULL) {
     cond->mutex = mutex;
-    SIMIX_mutex_unlock(mutex);
+    SIMIX_mutex_unlock(mutex, issuer);
   }
 
-  /* Always create an action null in case there is a host failure */
-  act_sleep = SIMIX_action_sleep(SIMIX_host_self(), -1);
-  SIMIX_action_set_name(act_sleep, bprintf("Wait condition %p", cond));
-  SIMIX_process_self()->waiting_action = act_sleep;
-  SIMIX_register_action_to_condition(act_sleep, cond);
-  __SIMIX_cond_wait(cond);
-  SIMIX_process_self()->waiting_action = NULL;
-  SIMIX_unregister_action_to_condition(act_sleep, cond);
-  SIMIX_action_destroy(act_sleep);
-
-  /* get the mutex again if necessary */
-  if (mutex != NULL)
-    SIMIX_mutex_lock(cond->mutex);
-
-  return;
-}
-
-XBT_INLINE xbt_fifo_t SIMIX_cond_get_actions(smx_cond_t cond)
-{
-  xbt_assert0((cond != NULL), "Invalid parameters");
-  return cond->actions;
-}
-
-void __SIMIX_cond_wait(smx_cond_t cond)
-{
-  smx_process_t self = SIMIX_process_self();
-  xbt_assert0((cond != NULL), "Invalid parameters");
-
-  /* process status */
-
-  self->cond = cond;
-  xbt_swag_insert(self, cond->sleeping);
-  SIMIX_process_yield();
-  self->cond = NULL;
-  while (self->suspended) {
-    SIMIX_process_yield();
-  }
-  return;
+  sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
+  xbt_fifo_unshift(sync_act->request_list, req);
+  issuer->waiting_action = sync_act;
+  xbt_swag_insert(req->issuer, cond->sleeping);   
 }
 
 /**
- * \brief Waits on a condition with timeout.
+ * \brief Signalizes a condition.
  *
- * Same behavior of #SIMIX_cond_wait, but waits a maximum time and throws an timeout_error if it happens.
+ * Signalizes a condition and wakes up a sleeping process. 
+ * If there are no process sleeping, no action is done.
  * \param cond A condition
- * \param mutex A mutex
- * \param max_duration Timeout time
  */
-void SIMIX_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex,
-                             double max_duration)
+void SIMIX_cond_signal(smx_cond_t cond)
 {
-  smx_action_t act_sleep;
-
-  DEBUG1("Timed wait condition %p", cond);
+  smx_process_t proc = NULL;
+  smx_mutex_t mutex = NULL;
+  smx_req_t req = NULL;
+  
+  DEBUG1("Signal condition %p", cond);
 
-  /* If there is a mutex unlock it */
-  if (mutex != NULL) {
-    cond->mutex = mutex;
-    SIMIX_mutex_unlock(mutex);
+  /* If there are processes waiting for the condition choose one and try 
+     to make it acquire the mutex */
+  if ((proc = xbt_swag_extract(cond->sleeping))) {
+    
+    /* Destroy waiter's synchro action */
+    SIMIX_synchro_destroy(proc->waiting_action);
+    proc->waiting_action = NULL;
+
+    /* Now transform the cond wait request into a mutex lock one */
+    req = proc->request;
+    if(req->call == REQ_COND_WAIT)
+      mutex = req->cond_wait.mutex;
+    else
+      mutex = req->cond_wait_timeout.mutex;
+
+    req->call = REQ_MUTEX_LOCK;
+    req->mutex_lock.mutex = mutex;
+    
+    SIMIX_pre_mutex_lock(req);
   }
-
-  if (max_duration >= 0) {
-    act_sleep = SIMIX_action_sleep(SIMIX_host_self(), max_duration);
-    SIMIX_action_set_name(act_sleep,
-                          bprintf
-                          ("Timed wait condition %p (max_duration:%f)",
-                           cond, max_duration));
-    SIMIX_register_action_to_condition(act_sleep, cond);
-    SIMIX_process_self()->waiting_action = act_sleep;
-    __SIMIX_cond_wait(cond);
-    SIMIX_process_self()->waiting_action = NULL;
-    SIMIX_unregister_action_to_condition(act_sleep, cond);
-    if (SIMIX_action_get_state(act_sleep) == SURF_ACTION_DONE) {
-      SIMIX_action_destroy(act_sleep);
-      THROW1(timeout_error, 0, "Condition timeout after %f", max_duration);
-    } else {
-      SIMIX_action_destroy(act_sleep);
-    }
-
-  } else
-    SIMIX_cond_wait(cond, NULL);
-
-  /* get the mutex again if necessary */
-  if (mutex != NULL)
-    SIMIX_mutex_lock(cond->mutex);
 }
 
 /**
  * \brief Broadcasts a condition.
  *
- * Signalizes a condition and wakes up ALL sleping process. If there are no process sleeping, no action is done.
+ * Signal ALL processes waiting on a condition.
+ * If there are no process waiting, no action is done.
  * \param cond A condition
  */
 void SIMIX_cond_broadcast(smx_cond_t cond)
 {
-  smx_process_t proc = NULL;
-  smx_process_t proc_next = NULL;
-
-  xbt_assert0((cond != NULL), "Invalid parameters");
-
   DEBUG1("Broadcast condition %p", cond);
-  xbt_swag_foreach_safe(proc, proc_next, cond->sleeping) {
-    xbt_swag_remove(proc, cond->sleeping);
-    xbt_swag_insert(proc, simix_global->process_to_run);
+
+  /* Signal the condition until nobody is waiting on it */
+  while(xbt_swag_size(cond->sleeping)){
+    SIMIX_cond_signal(cond);
   }
 }
 
@@ -300,279 +352,104 @@ void SIMIX_cond_broadcast(smx_cond_t cond)
 void SIMIX_cond_destroy(smx_cond_t cond)
 {
   DEBUG1("Destroy condition %p", cond);
-  if (cond == NULL)
-    return;
-  else {
-    xbt_fifo_item_t item = NULL;
-    smx_action_t action = NULL;
 
+  if (cond != NULL){
     xbt_assert0(xbt_swag_size(cond->sleeping) == 0,
                 "Cannot destroy conditional since someone is still using it");
-    xbt_swag_free(cond->sleeping);
-
-    DEBUG1("%d actions registered", xbt_fifo_size(cond->actions));
-    __SIMIX_cond_display_actions(cond);
-    xbt_fifo_foreach(cond->actions, item, action, smx_action_t) {
-      SIMIX_unregister_action_to_condition(action, cond);
-    }
-    __SIMIX_cond_display_actions(cond);
 
-    xbt_fifo_free(cond->actions);
+    xbt_swag_free(cond->sleeping);
     xbt_free(cond);
     return;
   }
 }
 
-void SIMIX_cond_display_info(smx_cond_t cond)
-{
-  if (cond == NULL)
-    return;
-  else {
-    smx_process_t process = NULL;
-
-    INFO0("Blocked process on this condition:");
-    xbt_swag_foreach(process, cond->sleeping) {
-      INFO2("\t %s running on host %s", process->name,
-            process->smx_host->name);
-    }
-  }
-}
-
-/* ************************** Semaphores ************************************** */
+/******************************** Semaphores **********************************/
 #define SMX_SEM_NOLIMIT 99999
 /** @brief Initialize a semaphore */
-smx_sem_t SIMIX_sem_init(int capacity)
+smx_sem_t SIMIX_sem_init(unsigned int value)
 {
-  smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
+  s_smx_process_t p;
 
-  sem->sleeping = xbt_fifo_new();
-  sem->actions = xbt_fifo_new();
-  sem->capacity = capacity;
+  smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
+  sem->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
+  sem->value = value;
   return sem;
 }
 
 /** @brief Destroys a semaphore */
 void SIMIX_sem_destroy(smx_sem_t sem)
 {
-  smx_action_t action = NULL;
   DEBUG1("Destroy semaphore %p", sem);
-  if (sem == NULL)
-    return;
-
-  xbt_assert0(xbt_fifo_size(sem->sleeping) == 0,
-              "Cannot destroy semaphore since someone is still using it");
-  xbt_fifo_free(sem->sleeping);
-
-  DEBUG1("%d actions registered", xbt_fifo_size(sem->actions));
-  while ((action = xbt_fifo_pop(sem->actions)))
-    SIMIX_unregister_action_to_semaphore(action, sem);
-
-  xbt_fifo_free(sem->actions);
-  xbt_free(sem);
+  if (sem != NULL){
+    xbt_assert0(xbt_swag_size(sem->sleeping) == 0,
+                "Cannot destroy semaphore since someone is still using it");
+    xbt_swag_free(sem->sleeping);
+    xbt_free(sem);
+  }
 }
 
 /** @brief release the semaphore
  *
- * The first locked process on this semaphore is unlocked.
+ * Unlock a process waiting on the semaphore.
  * If no one was blocked, the semaphore capacity is increased by 1.
  * */
 void SIMIX_sem_release(smx_sem_t sem)
 {
   smx_process_t proc;
-
-  if (sem->capacity != SMX_SEM_NOLIMIT) {
-    sem->capacity++;
-  }
+  
   DEBUG1("Sem release semaphore %p", sem);
-  if ((proc = xbt_fifo_shift(sem->sleeping)) != NULL) {
-    xbt_swag_insert(proc, simix_global->process_to_run);
-  }
-}
-
-/** @brief make sure the semaphore will never be blocking again
- *
- * This function is not really in the semaphore spirit. It makes
- * sure that the semaphore will never be blocking anymore.
- *
- * Releasing and acquiring the semaphore after calling this
- * function is a noop. Such "broken" semaphores are useful to
- * implement something between condition variables (with broadcast)
- * and semaphore (with memory). It's like a semaphore signaled for ever.
- *
- * There is no way to reset the semaphore to a more regular state afterward.
- * */
-void SIMIX_sem_release_forever(smx_sem_t sem)
-{
-  smx_process_t proc;
-
-  sem->capacity = SMX_SEM_NOLIMIT;
-  DEBUG1("Broadcast semaphore %p", sem);
-  while ((proc = xbt_fifo_shift(sem->sleeping)) != NULL) {
-    xbt_swag_insert(proc, simix_global->process_to_run);
+  if ((proc = xbt_swag_extract(sem->sleeping))) {
+    proc = xbt_swag_extract(sem->sleeping);
+    SIMIX_synchro_destroy(proc->waiting_action);
+    proc->waiting_action = NULL;
+    SIMIX_request_answer(proc->request);
+  }else if(sem->value < SMX_SEM_NOLIMIT){
+    sem->value++;
   }
 }
 
-/**
- * \brief Low level wait on a semaphore
- *
- * This function does not test the capacity of the semaphore and direcly locks
- * the calling process on the semaphore (until someone call SIMIX_sem_release()
- * on this semaphore). Do not call this function if you did not attach any action
- * to this semaphore to be awaken. Note also that you may miss host failure if you
- * do not attach a dummy action beforehand. SIMIX_sem_acquire does all these
- * things for you so you it may be preferable to use.
- */
-void SIMIX_sem_block_onto(smx_sem_t sem)
-{
-  smx_process_t self = SIMIX_process_self();
-
-  /* process status */
-  self->sem = sem;
-  xbt_fifo_push(sem->sleeping, self);
-  SIMIX_process_yield();
-  self->sem = NULL;
-  while (self->suspended)
-    SIMIX_process_yield();
-}
-
 /** @brief Returns true if acquiring this semaphore would block */
 XBT_INLINE int SIMIX_sem_would_block(smx_sem_t sem)
 {
-  return (sem->capacity <= 0);
+  return (sem->value <= 0);
 }
 
-/** @brief Returns the current capacity of the semaphore
- *
- * If it's negative, that's the amount of processes locked on the semaphore
- */
+/** @brief Returns the current capacity of the semaphore */
 int SIMIX_sem_get_capacity(smx_sem_t sem)
 {
-  return sem->capacity;
+  return sem->value;
 }
 
-/**
- * \brief Waits on a semaphore
- *
- * If the capacity>0, decrease the capacity.
- *
- * If capacity==0, locks the current process
- * until someone call SIMIX_sem_release() on this semaphore
- */
-void SIMIX_sem_acquire(smx_sem_t sem)
+static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
+                            smx_req_t req)
 {
-  SIMIX_sem_acquire_timeout(sem, -1);
+  smx_action_t sync_act = NULL;
+  
+  DEBUG2("Wait semaphore %p (timeout:%f)", sem, timeout);
+  if(sem->value <= 0){
+    sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
+    xbt_fifo_unshift(sync_act->request_list, req);
+    issuer->waiting_action = sync_act;
+    xbt_swag_insert(issuer, sem->sleeping);
+  }else{
+    sem->value--;
+    SIMIX_request_answer(req);
+  }
 }
 
 /**
- * \brief Tries to acquire a semaphore before a timeout
- *
- * Same behavior of #SIMIX_sem_acquire, but waits a maximum time and throws an timeout_error if it happens.
+ * \brief Handle sem acquire requests without timeouts
  */
-void SIMIX_sem_acquire_timeout(smx_sem_t sem, double max_duration)
+void SIMIX_pre_sem_acquire(smx_req_t req)
 {
-  smx_action_t act_sleep;
-
-  DEBUG2("Wait semaphore %p (timeout:%f)", sem, max_duration);
-
-  if (sem->capacity == SMX_SEM_NOLIMIT) {
-    DEBUG1("semaphore %p wide open", sem);
-    return;                     /* don't even decrease it if wide open */
-  }
-
-  /* If capacity sufficient, decrease it */
-  if (sem->capacity > 0) {
-    DEBUG1("semaphore %p has enough capacity", sem);
-    sem->capacity--;
-    return;
-  }
-
-  /* Always create an action null in case there is a host failure */
-  act_sleep = SIMIX_action_sleep(SIMIX_host_self(), max_duration);
-  SIMIX_action_set_name(act_sleep,
-                        bprintf("Locked in semaphore %p (max_duration:%f)",
-                                sem, max_duration));
-  SIMIX_process_self()->waiting_action = act_sleep;
-  SIMIX_register_action_to_semaphore(act_sleep, sem);
-  SIMIX_sem_block_onto(sem);
-  SIMIX_process_self()->waiting_action = NULL;
-  SIMIX_unregister_action_to_semaphore(act_sleep, sem);
-  if (max_duration >= 0
-      && SIMIX_action_get_state(act_sleep) == SURF_ACTION_DONE) {
-    SIMIX_action_destroy(act_sleep);
-    THROW1(timeout_error, 0, "Semaphore acquire timeouted after %f",
-           max_duration);
-  } else {
-    if (sem->capacity != SMX_SEM_NOLIMIT) {
-      /* Take the released token */
-      sem->capacity--;
-    }
-    SIMIX_action_destroy(act_sleep);
-  }
-  DEBUG1("End of Wait on semaphore %p", sem);
+  _SIMIX_sem_wait(req->sem_acquire.sem, -1, req->issuer, req);
 }
 
 /**
- * \brief Blocks on a set of semaphore
- *
- * If any of the semaphores has some more capacity, it gets decreased.
- * If not, blocks until the capacity of one of the semaphores becomes more friendly.
- *
- * \return the rank in the dynar of the semaphore which just got locked from the set
+ * \brief Handle sem acquire requests with timeouts
  */
-unsigned int SIMIX_sem_acquire_any(xbt_dynar_t sems)
+void SIMIX_pre_sem_acquire_timeout(smx_req_t req)
 {
-  smx_sem_t sem;
-  unsigned int counter, result = -1;
-  smx_action_t act_sleep;
-  smx_process_t self = SIMIX_process_self();
-
-  xbt_assert0(xbt_dynar_length(sems),
-              "I refuse to commit sucide by locking on an **empty** set of semaphores!!");
-  DEBUG2("Wait on semaphore set %p (containing %ld semaphores)", sems,
-         xbt_dynar_length(sems));
-
-  xbt_dynar_foreach(sems, counter, sem) {
-    if (!SIMIX_sem_would_block(sem)) {
-      DEBUG1("Semaphore %p wouldn't block; get it without waiting", sem);
-      SIMIX_sem_acquire(sem);
-      return counter;
-    }
-  }
-
-  /* Always create an action null in case there is a host failure */
-  act_sleep = SIMIX_action_sleep(SIMIX_host_self(), -1);
-  SIMIX_action_set_name(act_sleep, bprintf("Locked in semaphore %p", sem));
-  self->waiting_action = act_sleep;
-  SIMIX_register_action_to_semaphore(act_sleep,
-                                     xbt_dynar_get_as(sems, 0, smx_sem_t));
-
-  /* Get listed as member of all the provided semaphores */
-  self->sem = xbt_dynar_getfirst_as(sems, smx_sem_t);
-  xbt_dynar_foreach(sems, counter, sem) {
-    xbt_fifo_push(sem->sleeping, self);
-  }
-  SIMIX_process_yield();
-  self->sem = NULL;
-  while (self->suspended)
-    SIMIX_process_yield();
-
-  /* at least one of the semaphore unsuspended us -- great, let's search the first one (and get out of the others) */
-  xbt_dynar_foreach(sems, counter, sem) {
-    if (!xbt_fifo_remove(sem->sleeping, self) && result == -1) {
-      if (sem->capacity != SMX_SEM_NOLIMIT) {
-        /* Take the released token */
-        sem->capacity--;
-      }
-      result = counter;
-    }
-  }
-  xbt_assert0(result != -1, "Cannot find which semaphore unlocked me!");
-
-  /* Destroy the waiting action */
-  self->waiting_action = NULL;
-  SIMIX_unregister_action_to_semaphore(act_sleep,
-                                       xbt_dynar_get_as(sems, 0,
-                                                        smx_sem_t));
-  SIMIX_action_destroy(act_sleep);
-  return result;
+  _SIMIX_sem_wait(req->sem_acquire_timeout.sem,
+                  req->sem_acquire_timeout.timeout, req->issuer, req);  
 }
diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c
new file mode 100644 (file)
index 0000000..ea732ee
--- /dev/null
@@ -0,0 +1,990 @@
+#include "private.h"
+
+/**
+ * \brief Returns a host given its name.
+ *
+ * \param name The name of the host to get
+ * \return The corresponding host
+ */
+smx_host_t SIMIX_req_host_get_by_name(const char *name)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_BY_NAME;
+  req.host_get_by_name.name = name;
+  SIMIX_request_push(&req);
+  return req.host_get_by_name.result;
+}
+
+/**
+ * \brief Returns the name of a host.
+ *
+ * \param host A SIMIX host
+ * \return The name of this host
+ */
+const char* SIMIX_req_host_get_name(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_NAME;
+  req.host_get_name.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_name.result;
+}
+
+/**
+ * \brief Returns a dict of the properties assigned to a host.
+ *
+ * \param host A host
+ * \return The properties of this host
+ */
+xbt_dict_t SIMIX_req_host_get_properties(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_PROPERTIES;
+  req.host_get_properties.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_properties.result;
+}
+
+/**
+ * \brief Returns the speed of the processor.
+ *
+ * The speed returned does not take into account the current load on the machine.
+ * \param host A SIMIX host
+ * \return The speed of this host (in Mflop/s)
+ */
+double SIMIX_req_host_get_speed(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_SPEED;
+  req.host_get_speed.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_speed.result;
+}
+
+/**
+ * \brief Returns the available speed of the processor.
+ *
+ * \return Speed currently available (in Mflop/s)
+ */
+double SIMIX_req_host_get_available_speed(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_AVAILABLE_SPEED;
+  req.host_get_available_speed.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_available_speed.result;
+}
+
+/**
+ * \brief Returns the state of a host.
+ *
+ * Two states are possible: 1 if the host is active or 0 if it has crashed.
+ * \param host A SIMIX host
+ * \return 1 if the host is available, 0 otherwise
+ */
+int SIMIX_req_host_get_state(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_STATE;
+  req.host_get_state.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_state.result;
+}
+
+/**
+ * \brief Returns the user data associated to a host.
+ *
+ * \param host SIMIX host
+ * \return the user data of this host
+ */
+void* SIMIX_req_host_get_data(smx_host_t host)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_GET_DATA;
+  req.host_get_data.host = host;
+  SIMIX_request_push(&req);
+  return req.host_get_data.result;
+}
+
+/**
+ * \brief Sets the user data associated to a host.
+ *
+ * The host must not have previous user data associated to it.
+ * \param A host SIMIX host
+ * \param data The user data to set
+ */
+void SIMIX_req_host_set_data(smx_host_t host, void *data)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_SET_DATA;
+  req.host_set_data.host = host;
+  req.host_set_data.data = data;
+  SIMIX_request_push(&req);
+}
+
+/** \brief Creates an action that executes some computation of an host.
+ *
+ * This function creates a SURF action and allocates the data necessary
+ * to create the SIMIX action. It can raise a host_error exception if the host crashed.
+ *
+ * \param name Name of the execution action to create
+ * \param host SIMIX host where the action will be executed
+ * \param amount Computation amount (in bytes)
+ * \return A new SIMIX execution action
+ */
+smx_action_t SIMIX_req_host_execute(const char *name, smx_host_t host,
+                                double computation_amount)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTE;
+  req.host_execute.name = name;
+  req.host_execute.host = host;
+  req.host_execute.computation_amount = computation_amount;
+  SIMIX_request_push(&req);
+  return req.host_execute.result;
+}
+
+/** \brief Creates an action that may involve parallel computation on
+ * several hosts and communication between them.
+ *
+ * \param name Name of the execution action to create
+ * \param host_nb Number of hosts where the action will be executed
+ * \param host_list Array (of size host_nb) of hosts where the action will be executed
+ * \param computation_amount Array (of size host_nb) of computation amount of hosts (in bytes)
+ * \param communication_amount Array (of size host_nb * host_nb) representing the communication
+ * amount between each pair of hosts
+ * \param amount the SURF action amount
+ * \param rate the SURF action rate
+ * \return A new SIMIX execution action
+ */
+smx_action_t SIMIX_req_host_parallel_execute(const char *name,
+                                         int host_nb,
+                                         smx_host_t *host_list,
+                                         double *computation_amount,
+                                         double *communication_amount,
+                                         double amount,
+                                         double rate)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_PARALLEL_EXECUTE;
+  req.host_parallel_execute.name = name;
+  req.host_parallel_execute.host_nb = host_nb;
+  req.host_parallel_execute.host_list = host_list;
+  req.host_parallel_execute.computation_amount = computation_amount;
+  req.host_parallel_execute.communication_amount = communication_amount;
+  req.host_parallel_execute.amount = amount;
+  req.host_parallel_execute.rate = rate;
+  SIMIX_request_push(&req);
+  return req.host_parallel_execute.result;
+}
+
+/**
+ * \brief Destroys an execution action.
+ *
+ * Destroys an action, freing its memory. This function cannot be called if there are a conditional waiting for it.
+ * \param action The execution action to destroy
+ */
+void SIMIX_req_host_execution_destroy(smx_action_t execution)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_DESTROY;
+  req.host_execution_destroy.execution = execution;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Cancels an execution action.
+ *
+ * This functions stops the execution. It calls a surf function.
+ * \param action The execution action to cancel
+ */
+void SIMIX_req_host_execution_cancel(smx_action_t execution)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_CANCEL;
+  req.host_execution_cancel.execution = execution;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Returns how much of an execution action remains to be done.
+ *
+ * \param Action The execution action
+ * \return The remaining amount
+ */
+double SIMIX_req_host_execution_get_remains(smx_action_t execution)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_GET_REMAINS;
+  req.host_execution_get_remains.execution = execution;
+  SIMIX_request_push(&req);
+  return req.host_execution_get_remains.result;
+}
+
+/**
+ * \brief Returns the state of an execution action.
+ *
+ * \param execution The execution action
+ * \return The state
+ */
+e_smx_state_t SIMIX_req_host_execution_get_state(smx_action_t execution)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_GET_STATE;
+  req.host_execution_get_state.execution = execution;
+  SIMIX_request_push(&req);
+  return req.host_execution_get_state.result;
+}
+
+/**
+ * \brief Changes the priority of an execution action.
+ *
+ * This functions changes the priority only. It calls a surf function.
+ * \param execution The execution action
+ * \param priority The new priority
+ */
+void SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_SET_PRIORITY;
+  req.host_execution_set_priority.execution = execution;
+  req.host_execution_set_priority.priority = priority;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Waits for the completion of an execution action.
+ *
+ * \param execution The execution action
+ */
+void SIMIX_req_host_execution_wait(smx_action_t execution)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_HOST_EXECUTION_WAIT;
+  req.host_execution_wait.execution = execution;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Creates and runs a new SIMIX process.
+ *
+ * The structure and the corresponding threada are created and put in the list of ready processes.
+ *
+ * \param name a name for the process. It is for user-level information and can be NULL.
+ * \param code the main function of the process
+ * \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can be NULL.
+ * It can be retrieved with the function \ref SIMIX_req_process_get_data.
+ * \param hostname name of the host where the new agent is executed.
+ * \param argc first argument passed to \a code
+ * \param argv second argument passed to \a code
+ * \param properties the properties of the process
+ * \return The new process
+ */
+smx_process_t SIMIX_req_process_create(const char *name,
+                                   xbt_main_func_t code,
+                                   void *data,
+                                   const char *hostname,
+                                   int argc, char **argv,
+                                   xbt_dict_t properties)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_CREATE;
+  req.process_create.name = name;
+  req.process_create.code = code;
+  req.process_create.data = data;
+  req.process_create.hostname = hostname;
+  req.process_create.argc = argc;
+  req.process_create.argv = argv;
+  req.process_create.properties = properties;
+  SIMIX_request_push(&req);
+  return req.process_create.result;
+}
+
+/** \brief Kills a SIMIX process.
+ *
+ * This function simply kills a  process.
+ *
+ * \param process poor victim
+ */
+void SIMIX_req_process_kill(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_KILL;
+  req.process_kill.process = process;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Migrates an agent to another location.
+ *
+ * This function changes the value of the host on which \a process is running.
+ *
+ * \param process the process to migrate
+ * \param source name of the previous host
+ * \param dest name of the new host
+ */
+void SIMIX_req_process_change_host(smx_process_t process, const char *source, const char *dest)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_CHANGE_HOST;
+  req.process_change_host.process = process;
+  req.process_change_host.source = source;
+  req.process_change_host.dest = dest;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Suspends a process.
+ *
+ * This function suspends the process by suspending the action
+ * it was waiting for completion.
+ *
+ * \param process a SIMIX process
+ */
+void SIMIX_req_process_suspend(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_SUSPEND;
+  req.process_suspend.process = process;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Resumes a suspended process.
+ *
+ * This function resumes a suspended process by resuming the action
+ * it was waiting for completion.
+ *
+ * \param process a SIMIX process
+ */
+void SIMIX_req_process_resume(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_RESUME;
+  req.process_resume.process = process;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Returns the amount of SIMIX processes in the system
+ *
+ * Maestro internal process is not counted, only user code processes are
+ */
+int SIMIX_req_process_count(void)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_COUNT;
+  SIMIX_request_push(&req);
+  return req.process_count.result;
+}
+
+/**
+ * \brief Return the user data of a #smx_process_t.
+ *
+ * This functions checks whether \a process is a valid pointer or not and return the user data associated to \a process if it is possible.
+ * \param process SIMIX process
+ * \return A void pointer to the user data
+ */
+void* SIMIX_req_process_get_data(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_GET_DATA;
+  req.process_get_data.process = process;
+  SIMIX_request_push(&req);
+  return req.process_get_data.result;
+}
+
+/**
+ * \brief Set the user data of a #m_process_t.
+ *
+ * This functions checks whether \a process is a valid pointer or not and set the user data associated to \a process if it is possible.
+ * \param process SIMIX process
+ * \param data User data
+ */
+void SIMIX_req_process_set_data(smx_process_t process, void *data)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_SET_DATA;
+  req.process_set_data.process = process;
+  req.process_set_data.data = data;
+  SIMIX_request_push(&req);
+}
+
+/**
+ * \brief Return the location on which an agent is running.
+ *
+ * This functions checks whether \a process is a valid pointer or not and return the m_host_t corresponding to the location on which \a process is running.
+ * \param process SIMIX process
+ * \return SIMIX host
+ */
+smx_host_t SIMIX_req_process_get_host(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_GET_HOST;
+  req.process_get_host.process = process;
+  SIMIX_request_push(&req);
+  return req.process_get_host.result;
+}
+
+/**
+ * \brief Return the name of an agent.
+ *
+ * This functions checks whether \a process is a valid pointer or not and return its name.
+ * \param process SIMIX process
+ * \return The process name
+ */
+const char* SIMIX_req_process_get_name(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_GET_NAME;
+  req.process_get_name.process = process;
+  SIMIX_request_push(&req);
+  return req.process_get_name.result;
+}
+
+/**
+ * \brief Returns true if the process is suspended .
+ *
+ * This checks whether a process is suspended or not by inspecting the task on which it was waiting for the completion.
+ * \param process SIMIX process
+ * \return 1, if the process is suspended, else 0.
+ */
+int SIMIX_req_process_is_suspended(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_IS_SUSPENDED;
+  req.process_is_suspended.process = process;
+  SIMIX_request_push(&req);
+  return req.process_is_suspended.result;
+}
+
+/** \ingroup m_process_management
+ * \brief Return the properties
+ *
+ * This functions returns the properties associated with this process
+ */
+xbt_dict_t SIMIX_req_process_get_properties(smx_process_t process)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_GET_PROPERTIES;
+  req.process_get_properties.process = process;
+  SIMIX_request_push(&req);
+  return req.process_get_properties.result;
+}
+
+/** \brief Creates a new sleep SIMIX action.
+ *
+ * This function creates a SURF action and allocates the data necessary
+ * to create the SIMIX action. It can raise a host_error exception if the
+ * host crashed. The default SIMIX name of the action is "sleep".
+ *
+ *     \param duration Time duration of the sleep.
+ *     \return A result telling whether the sleep was successful
+ */
+e_smx_state_t SIMIX_req_process_sleep(double duration)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_PROCESS_SLEEP;
+  req.process_sleep.duration = duration;
+  SIMIX_request_push(&req);
+  return req.process_sleep.result;
+}
+
+/**
+ *  \brief Creates a new rendez-vous point
+ *  \param name The name of the rendez-vous point
+ *  \return The created rendez-vous point
+ */
+smx_rdv_t SIMIX_req_rdv_create(const char *name)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_RDV_CREATE;
+  req.rdv_create.name = name;
+  
+  SIMIX_request_push(&req);
+  return req.rdv_create.result;
+}
+
+
+/**
+ *  \brief Destroy a rendez-vous point
+ *  \param name The rendez-vous point to destroy
+ */
+void SIMIX_req_rdv_destroy(smx_rdv_t rdv)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_RDV_DESTROY; 
+  req.rdv_destroy.rdv = rdv;
+  
+  SIMIX_request_push(&req);
+}
+
+smx_rdv_t SIMIX_req_rdv_get_by_name(const char *name)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_RDV_GEY_BY_NAME;
+  req.rdv_get_by_name.name = name;
+  SIMIX_request_push(&req);
+  return req.rdv_get_by_name.result;
+}
+
+/**
+ *  \brief counts the number of communication requests of a given host pending
+ *         on a rendez-vous point
+ *  \param rdv The rendez-vous point
+ *  \param host The host to be counted
+ *  \return The number of comm request pending in the rdv
+ */
+int SIMIX_req_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_RDV_COMM_COUNT_BY_HOST; 
+  req.rdv_comm_count_by_host.rdv = rdv;
+  req.rdv_comm_count_by_host.host = host;
+  
+  SIMIX_request_push(&req);
+  return req.rdv_comm_count_by_host.result;
+}
+
+/**
+ *  \brief returns the communication at the head of the rendez-vous
+ *  \param rdv The rendez-vous point
+ *  \return The communication or NULL if empty
+ */
+smx_action_t SIMIX_req_rdv_get_head(smx_rdv_t rdv)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_RDV_GET_HEAD; 
+  req.rdv_get_head.rdv = rdv;
+  
+  SIMIX_request_push(&req);
+  return req.rdv_get_head.result;
+}
+
+smx_action_t SIMIX_req_comm_isend(smx_rdv_t rdv, double task_size, double rate,
+                              void *src_buff, size_t src_buff_size, void *data)
+{
+  s_smx_req_t req;
+
+  xbt_assert0(rdv, "No rendez-vous point defined for isend");
+
+  req.call = REQ_COMM_ISEND;
+  req.comm_isend.rdv = rdv;
+  req.comm_isend.task_size = task_size;
+  req.comm_isend.rate = rate;
+  req.comm_isend.src_buff = src_buff;
+  req.comm_isend.src_buff_size = src_buff_size;
+  req.comm_isend.data = data;
+  
+  SIMIX_request_push(&req);
+  return req.comm_isend.result;
+}
+
+smx_action_t SIMIX_req_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size)
+{
+  s_smx_req_t req;
+
+  xbt_assert0(rdv, "No rendez-vous point defined for isend");
+
+  req.call = REQ_COMM_IRECV;
+  req.comm_irecv.rdv = rdv;
+  req.comm_irecv.dst_buff = dst_buff;
+  req.comm_irecv.dst_buff_size = dst_buff_size;
+
+  SIMIX_request_push(&req);
+  return req.comm_irecv.result;
+}
+
+void SIMIX_req_comm_destroy(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_DESTROY;
+  req.comm_destroy.comm = comm;
+  
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_comm_cancel(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_CANCEL;
+  req.comm_cancel.comm = comm;
+  
+  SIMIX_request_push(&req);
+}
+
+unsigned int SIMIX_req_comm_waitany(xbt_dynar_t comms)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_WAITANY;
+  req.comm_waitany.comms = comms;
+  
+  SIMIX_request_push(&req);
+  return req.comm_waitany.result;
+}
+
+void SIMIX_req_comm_wait(smx_action_t comm, double timeout)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_WAIT;
+  req.comm_wait.comm = comm;
+  req.comm_wait.timeout = timeout;
+  
+  SIMIX_request_push(&req);
+}
+
+int SIMIX_req_comm_test(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_TEST;
+  req.comm_test.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_test.result;
+}
+
+double SIMIX_req_comm_get_remains(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_REMAINS;
+  req.comm_get_remains.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_remains.result;
+}
+
+e_smx_state_t SIMIX_req_comm_get_state(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_STATE;
+  req.comm_get_state.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_state.result;
+}
+
+void *SIMIX_req_comm_get_data(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_DATA;
+  req.comm_get_data.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_data.result;
+}
+
+void *SIMIX_req_comm_get_src_buff(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_SRC_BUFF;
+  req.comm_get_src_buff.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_src_buff.result;
+}
+
+void *SIMIX_req_comm_get_dst_buff(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_DST_BUFF;
+  req.comm_get_dst_buff.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_dst_buff.result;
+}
+
+size_t SIMIX_req_comm_get_src_buff_size(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_SRC_BUFF_SIZE;
+  req.comm_get_src_buff_size.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_src_buff_size.result;
+}
+
+size_t SIMIX_req_comm_get_dst_buff_size(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_DST_BUFF_SIZE;
+  req.comm_get_dst_buff_size.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_dst_buff_size.result;
+}
+
+smx_process_t SIMIX_req_comm_get_src_proc(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_SRC_PROC;
+  req.comm_get_src_proc.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_src_proc.result;
+}
+
+smx_process_t SIMIX_req_comm_get_dst_proc(smx_action_t comm)
+{
+  s_smx_req_t req;
+  
+  req.call = REQ_COMM_GET_DST_PROC;
+  req.comm_get_dst_proc.comm = comm;
+  
+  SIMIX_request_push(&req);
+  return req.comm_get_dst_proc.result;
+}
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+int SIMIX_req_comm_is_latency_bounded(smx_action_t comm)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COMM_IS_LATENCY_BOUNDED;
+  req.comm_is_latency_bounded.comm = comm;
+
+  SIMIX_request_push(&req);
+  return req.comm_is_latency_bounded.result;
+}
+#endif
+
+smx_mutex_t SIMIX_req_mutex_init(void)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_MUTEX_INIT;
+
+  SIMIX_request_push(&req);
+  return req.mutex_init.result;
+}
+
+void SIMIX_req_mutex_destroy(smx_mutex_t mutex)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_MUTEX_DESTROY;
+  req.mutex_destroy.mutex = mutex;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_mutex_lock(smx_mutex_t mutex)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_MUTEX_LOCK;
+  req.mutex_lock.mutex = mutex;
+
+  SIMIX_request_push(&req);
+}
+
+int SIMIX_req_mutex_trylock(smx_mutex_t mutex)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_MUTEX_TRYLOCK;
+  req.mutex_trylock.mutex = mutex;
+
+  SIMIX_request_push(&req);
+  return req.mutex_trylock.result;
+}
+
+void SIMIX_req_mutex_unlock(smx_mutex_t mutex)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_MUTEX_UNLOCK;
+  req.mutex_unlock.mutex = mutex;
+
+  SIMIX_request_push(&req);
+}
+
+
+smx_cond_t SIMIX_req_cond_init(void)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_INIT;
+
+  SIMIX_request_push(&req);
+  return req.cond_init.result;
+}
+
+void SIMIX_req_cond_destroy(smx_cond_t cond)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_DESTROY;
+  req.cond_destroy.cond = cond;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_cond_signal(smx_cond_t cond)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_SIGNAL;
+  req.cond_signal.cond = cond;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_WAIT;
+  req.cond_wait.cond = cond;
+  req.cond_wait.mutex = mutex;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_cond_wait_timeout(smx_cond_t cond,
+                                         smx_mutex_t mutex,
+                                         double timeout)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_WAIT_TIMEOUT;
+  req.cond_wait_timeout.cond = cond;
+  req.cond_wait_timeout.mutex = mutex;
+  req.cond_wait_timeout.timeout = timeout;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_cond_broadcast(smx_cond_t cond)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_COND_BROADCAST;
+  req.cond_broadcast.cond = cond;
+
+  SIMIX_request_push(&req);
+}
+
+
+smx_sem_t SIMIX_req_sem_init(int capacity)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_INIT;
+  req.sem_init.capacity = capacity;
+
+  SIMIX_request_push(&req);
+  return req.sem_init.result;
+}
+
+void SIMIX_req_sem_destroy(smx_sem_t sem)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_DESTROY;
+  req.sem_destroy.sem = sem;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_sem_release(smx_sem_t sem)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_RELEASE;
+  req.sem_release.sem = sem;
+
+  SIMIX_request_push(&req);
+}
+
+int SIMIX_req_sem_would_block(smx_sem_t sem)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_WOULD_BLOCK;
+  req.sem_would_block.sem = sem;
+
+  SIMIX_request_push(&req);
+  return req.sem_would_block.result;
+}
+
+void SIMIX_req_sem_acquire(smx_sem_t sem)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_ACQUIRE;
+  req.sem_acquire.sem = sem;
+
+  SIMIX_request_push(&req);
+}
+
+void SIMIX_req_sem_acquire_timeout(smx_sem_t sem, double timeout)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_ACQUIRE_TIMEOUT;
+  req.sem_acquire_timeout.sem = sem;
+  req.sem_acquire_timeout.timeout = timeout;
+
+  SIMIX_request_push(&req);
+}
+
+int SIMIX_req_sem_get_capacity(smx_sem_t sem)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SEM_GET_CAPACITY;
+  req.sem_get_capacity.sem = sem;
+
+  SIMIX_request_push(&req);
+  return req.sem_get_capacity.result;
+}
+
+
+
diff --git a/src/simix/synchro_private.h b/src/simix/synchro_private.h
new file mode 100644 (file)
index 0000000..cd16d9f
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _SIMIX_SYNCHRO_PRIVATE_H
+#define _SIMIX_SYNCHRO_PRIVATE_H
+
+#include "xbt/swag.h"
+#include "xbt/xbt_os_thread.h"
+
+typedef struct s_smx_mutex {
+  unsigned int locked;
+  smx_process_t owner;
+  xbt_swag_t sleeping;          /* list of sleeping process */
+} s_smx_mutex_t;
+
+typedef struct s_smx_cond {
+  smx_mutex_t mutex;
+  xbt_swag_t sleeping;          /* list of sleeping process */
+} s_smx_cond_t;
+
+typedef struct s_smx_sem {
+  unsigned int value;
+  xbt_swag_t sleeping;          /* list of sleeping process */
+} s_smx_sem_t;
+
+void SIMIX_post_synchro(smx_action_t action);
+void SIMIX_synchro_stop_waiting(smx_process_t process, smx_req_t req);
+void SIMIX_synchro_destroy(smx_action_t action);
+
+smx_mutex_t SIMIX_mutex_init(void);
+void SIMIX_mutex_destroy(smx_mutex_t mutex);
+void SIMIX_pre_mutex_lock(smx_req_t req);
+int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer);
+void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer);
+
+smx_cond_t SIMIX_cond_init(void);
+void SIMIX_cond_destroy(smx_cond_t cond);
+void SIMIX_cond_signal(smx_cond_t cond);
+void SIMIX_pre_cond_wait(smx_req_t req);
+void SIMIX_pre_cond_wait_timeout(smx_req_t req);
+void SIMIX_cond_broadcast(smx_cond_t cond);
+
+smx_sem_t SIMIX_sem_init(unsigned int value);
+void SIMIX_sem_destroy(smx_sem_t sem);
+void SIMIX_sem_release(smx_sem_t sem);
+int SIMIX_sem_would_block(smx_sem_t sem);
+void SIMIX_pre_sem_acquire(smx_req_t req);
+void SIMIX_pre_sem_acquire_timeout(smx_req_t req);
+int SIMIX_sem_get_capacity(smx_sem_t sem);
+#endif
index c87a523..aea894b 100644 (file)
@@ -30,7 +30,7 @@ typedef struct s_smpi_mpi_request {
   int tag;
   MPI_Comm comm;
   smx_rdv_t rdv;
-  smx_comm_t pair;
+  smx_action_t pair;
   int complete;
   MPI_Request match;
   unsigned flags;
index be4baca..08d9b30 100644 (file)
@@ -73,12 +73,12 @@ void smpi_mpi_start(MPI_Request request)
     smpi_process_post_recv(request);
     print_request("New recv", request);
     request->pair =
-        SIMIX_network_irecv(request->rdv, request->buf, &request->size);
+        SIMIX_req_comm_irecv(request->rdv, request->buf, &request->size);
   } else {
     smpi_process_post_send(request->comm, request);     // FIXME
     print_request("New send", request);
     request->pair =
-        SIMIX_network_isend(request->rdv, request->size, -1.0,
+        SIMIX_req_comm_isend(request->rdv, request->size, -1.0,
                             request->buf, request->size, NULL);
   }
 }
@@ -187,12 +187,12 @@ static void finish_wait(MPI_Request * request, MPI_Status * status)
     status->MPI_SOURCE = (*request)->src;
     status->MPI_TAG = (*request)->tag;
     status->MPI_ERROR = MPI_SUCCESS;
-    status->count = SIMIX_communication_get_dst_buf_size((*request)->pair);
+    status->count = SIMIX_req_comm_get_dst_buff_size((*request)->pair);
   }
-  SIMIX_communication_destroy((*request)->pair);
+  SIMIX_req_comm_destroy((*request)->pair);
   print_request("finishing wait", *request);
   if ((*request)->complete == 1) {
-    SIMIX_rdv_destroy((*request)->rdv);
+    SIMIX_req_rdv_destroy((*request)->rdv);
   } else {
     (*request)->match->complete = 1;
     (*request)->match->match = MPI_REQUEST_NULL;
@@ -236,7 +236,7 @@ int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
 void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
 {
   print_request("wait", *request);
-  SIMIX_network_wait((*request)->pair, -1.0);
+  SIMIX_req_comm_wait((*request)->pair, -1.0);
   finish_wait(request, status);
 }
 
@@ -259,7 +259,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[],
     }
     if (index == MPI_UNDEFINED) {
       // Otherwise, wait for a request to complete
-      comms = xbt_dynar_new(sizeof(smx_comm_t), NULL);
+      comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
       map = xbt_new(int, count);
       size = 0;
       DEBUG0("Wait for one of");
@@ -272,7 +272,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[],
         }
       }
       if (size > 0) {
-        index = SIMIX_network_waitany(comms);
+        index = SIMIX_req_comm_waitany(comms);
         index = map[index];
         finish_wait(&requests[index], status);
       }
index 5a830aa..f10012e 100644 (file)
@@ -38,30 +38,14 @@ void smpi_bench_destroy(void)
 
 static void smpi_execute_flops(double flops)
 {
-  smx_host_t host;
   smx_action_t action;
-  smx_mutex_t mutex;
-  smx_cond_t cond;
-  e_surf_action_state_t state;
-
+  smx_host_t host;
   host = SIMIX_host_self();
-  mutex = SIMIX_mutex_init();
-  cond = SIMIX_cond_init();
+
   DEBUG1("Handle real computation time: %f flops", flops);
-  action = SIMIX_action_execute(host, "computation", flops);
-  SIMIX_mutex_lock(mutex);
-  SIMIX_register_action_to_condition(action, cond);
-  for (state = SIMIX_action_get_state(action);
-       state == SURF_ACTION_READY ||
-       state == SURF_ACTION_RUNNING;
-       state = SIMIX_action_get_state(action)) {
-    SIMIX_cond_wait(cond, mutex);
-  }
-  SIMIX_unregister_action_to_condition(action, cond);
-  SIMIX_mutex_unlock(mutex);
-  SIMIX_action_destroy(action);
-  SIMIX_cond_destroy(cond);
-  SIMIX_mutex_destroy(mutex);
+  action = SIMIX_req_host_execute("computation", host, flops);
+  SIMIX_req_host_execution_wait(action);
+  SIMIX_req_host_execution_destroy(action);
 }
 
 static void smpi_execute(double duration)
index 3e0d59a..71362f6 100644 (file)
@@ -42,7 +42,7 @@ void smpi_process_init(int *argc, char ***argv)
     proc = SIMIX_process_self();
     index = atoi((*argv)[1]);
     data = smpi_process_remote_data(index);
-    SIMIX_process_set_data(proc, data);
+    SIMIX_req_process_set_data(proc, data);
     if (*argc > 2) {
       free((*argv)[1]);
       memmove(&(*argv)[1], &(*argv)[2], sizeof(char *) * (*argc - 2));
@@ -102,7 +102,7 @@ int smpi_global_size(void) {
 
 smpi_process_data_t smpi_process_data(void)
 {
-  return SIMIX_process_get_data(SIMIX_process_self());
+  return SIMIX_req_process_get_data(SIMIX_process_self());
 }
 
 smpi_process_data_t smpi_process_remote_data(int index)
@@ -186,7 +186,7 @@ void smpi_process_post_send(MPI_Comm comm, MPI_Request request)
       return;
     }
   }
-  request->rdv = SIMIX_rdv_create(NULL);
+  request->rdv = SIMIX_req_rdv_create(NULL);
   xbt_fifo_push(data->pending_sent, request);
 }
 
@@ -212,7 +212,7 @@ void smpi_process_post_recv(MPI_Request request)
       return;
     }
   }
-  request->rdv = SIMIX_rdv_create(NULL);
+  request->rdv = SIMIX_req_rdv_create(NULL);
   xbt_fifo_push(data->pending_recv, request);
 }
 
@@ -221,8 +221,8 @@ void smpi_global_init(void)
   int i;
   MPI_Group group;
 
-  SIMIX_network_set_copy_data_callback
-      (&SIMIX_network_copy_buffer_callback);
+  SIMIX_comm_set_copy_data_callback
+      (&SIMIX_comm_copy_buffer_callback);
   process_count = SIMIX_process_count();
   process_data = xbt_new(smpi_process_data_t, process_count);
   for (i = 0; i < process_count; i++) {
@@ -318,14 +318,13 @@ int MAIN__(void)
   /* Clean IO before the run */
   fflush(stdout);
   fflush(stderr);
-  SIMIX_init();
 
 #ifdef HAVE_MC
   if (_surf_do_model_check)
-    MC_modelcheck(1);
+    MC_modelcheck();
   else
 #endif
-    while (SIMIX_solve(NULL, NULL) != -1.0);
+    SIMIX_run();
 
   if (xbt_cfg_get_int(_surf_cfg_set, "smpi/display_timing"))
     INFO1("simulation time %g", SIMIX_get_clock());
index 86cb9d2..23e4796 100644 (file)
@@ -101,7 +101,7 @@ int PMPI_Abort(MPI_Comm comm, int errorcode)
   smpi_bench_end();
   smpi_process_destroy();
   // FIXME: should kill all processes in comm instead
-  SIMIX_process_kill(SIMIX_process_self());
+  SIMIX_req_process_kill(SIMIX_process_self());
   return MPI_SUCCESS;
 }
 
index 29f570b..16b7117 100644 (file)
@@ -34,9 +34,9 @@ unsigned int smpi_sleep(unsigned int seconds)
 
   smpi_bench_end();
   host = SIMIX_host_self();
-  action = SIMIX_action_sleep(host, (double)seconds);
+  action = SIMIX_req_action_sleep(host, (double)seconds);
   smpi_process_wait_action(action);
-  SIMIX_action_destroy(action);
+  SIMIX_req_action_destroy(action);
   smpi_bench_begin();
   return 0;
 }
@@ -45,7 +45,7 @@ void smpi_exit(int status)
 {
   smpi_bench_end();
   smpi_process_finalize();
-  SIMIX_process_kill(SIMIX_process_self());
+  SIMIX_req_process_kill(SIMIX_process_self());
   return;
 }
 */
index a31ee9b..ad9b625 100644 (file)
@@ -400,9 +400,9 @@ void surf_presolve(void)
       model->model_private->update_actions_state(NOW, 0.0);
 }
 
-double surf_solve(void)
+double surf_solve(double max_date)
 {
-  double min = -1.0;
+  double min = -1.0; /* duration */
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   double value = -1.0;
@@ -411,7 +411,9 @@ double surf_solve(void)
   tmgr_trace_event_t event = NULL;
   unsigned int iter;
 
-  min = -1.0;
+  if (max_date != -1.0 && max_date != NOW) {
+    min = max_date - NOW;
+  }
 
   DEBUG0("Looking for next action end");
   xbt_dynar_foreach(model_list, iter, model) {
@@ -451,6 +453,7 @@ double surf_solve(void)
     }
   }
 
+
   /* FIXME: Moved this test to here to avoid stoping simulation if there are actions running on cpus and all cpus are with availability = 0. 
    * This may cause an infinite loop if one cpu has a trace with periodicity = 0 and the other a trace with periodicity > 0.
    * The options are: all traces with same periodicity(0 or >0) or we need to change the way how the events are managed */
index 68869a6..04c3f52 100644 (file)
@@ -168,6 +168,13 @@ static void _surf_cfg_cb_model_check(const char *name, int pos)
   xbt_dict_preinit();
 }
 
+int _surf_parallel_contexts = 0;
+
+static void _surf_cfg_cb_parallel_contexts(const char *name, int pos)
+{
+  _surf_parallel_contexts = 1;
+}
+
 static void _surf_cfg_cb__surf_network_fullduplex(const char *name,
                                                   int pos)
 {
@@ -297,6 +304,13 @@ void surf_config_init(int *argc, char **argv)
        _surf_cfg_cb_model_check which sets it's value to 1 (instead of the defalut value 0)
        xbt_cfg_set_int(_surf_cfg_set, "model-check", default_value_int); */
 
+    /* parallel contexts */
+    default_value_int = 0;
+    xbt_cfg_register(&_surf_cfg_set, "parallel-contexts",
+                     "Activate the parallel execution of user contexts (EXPERIMENTAL -- pthreads only)",
+                     xbt_cfgelm_int, &default_value_int, 0, 1,
+                     _surf_cfg_cb_parallel_contexts, NULL);
+
     default_value_int = 0;
     xbt_cfg_register(&_surf_cfg_set, "fullduplex",
                      "Update the constraint set propagating recursively to others constraints",
@@ -350,7 +364,6 @@ void surf_config_models_setup(const char *platform_file)
   int workstation_id = -1;
   char *network_model_name = NULL;
   char *cpu_model_name = NULL;
-  surf_timer_model_init(platform_file);
 
   workstation_model_name =
       xbt_cfg_get_string(_surf_cfg_set, "workstation/model");
diff --git a/src/surf/surf_model_timer.c b/src/surf/surf_model_timer.c
deleted file mode 100644 (file)
index 4cf18e1..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "xbt/ex.h"
-#include "surf_private.h"
-#include "xbt/dict.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_timer, surf,
-                                "Logging specific to SURF (timer)");
-
-typedef struct surf_action_timer {
-  s_surf_action_t generic_action;
-} s_surf_action_timer_t, *surf_action_timer_t;
-
-typedef struct command {
-  s_surf_resource_t generic_resource;   /* Must remain first, since we add this to a trace */
-  void *function;
-  void *args;
-  s_xbt_swag_hookup_t command_set_hookup;
-  surf_action_timer_t action;
-} s_command_t, *command_t;
-
-
-surf_model_t surf_timer_model = NULL;
-static tmgr_trace_t empty_trace = NULL;
-static xbt_swag_t command_pending = NULL;
-static xbt_swag_t command_to_run = NULL;
-static xbt_heap_t timer_heap = NULL;
-
-static command_t command_new(void *fun, void *args)
-{
-  command_t command = xbt_new0(s_command_t, 1);
-
-  command->generic_resource.model = surf_timer_model;
-  command->function = fun;
-  command->args = args;
-  xbt_swag_insert(command, command_pending);
-  command->action =
-      surf_action_new(sizeof(s_surf_action_timer_t), 0, surf_timer_model,
-                      0);
-  return command;
-}
-
-static void command_free(command_t command)
-{
-  if (xbt_swag_belongs(command, command_to_run)) {
-    xbt_swag_remove(command, command_to_run);
-  } else if (xbt_swag_belongs(command, command_pending)) {
-    xbt_swag_remove(command, command_pending);
-  }
-  xbt_swag_remove(command->action,
-                  surf_timer_model->states.running_action_set);
-  xbt_free(command->action);
-  surf_resource_free((surf_resource_t) command);
-  return;
-}
-
-static void parse_timer(void)
-{
-}
-
-static void parse_file(const char *file)
-{
-}
-
-static int resource_used(void *resource_id)
-{
-  return 1;
-}
-
-static void timer_action_state_set(surf_action_t action,
-                                   e_surf_action_state_t state)
-{
-  DIE_IMPOSSIBLE;
-  return;
-}
-
-static double share_resources(double now)
-{
-  if (xbt_heap_size(timer_heap)) {
-    DEBUG1("Share resoure returning %lf", xbt_heap_maxkey(timer_heap));
-    return (xbt_heap_maxkey(timer_heap));
-  } else
-    return -1.0;
-}
-
-static void update_actions_state(double now, double delta)
-{
-  while ((xbt_heap_size(timer_heap)) > 0
-         && (xbt_heap_maxkey(timer_heap) <= now + delta))
-    xbt_heap_pop(timer_heap);
-  return;
-}
-
-static void update_resource_state(void *id,
-                                  tmgr_trace_event_t event_type,
-                                  double value, double date)
-{
-  command_t command = id;
-
-  /* Move this command to the list of commands to execute */
-  xbt_swag_remove(command, command_pending);
-  xbt_swag_insert(command, command_to_run);
-  tmgr_trace_event_free(event_type);
-
-  DEBUG1("Insert command on date %lf", date);
-
-  return;
-}
-
-static void set(double date, void *function, void *arg)
-{
-  command_t command = NULL;
-
-  command = command_new(function, arg);
-
-  tmgr_history_add_trace(history, empty_trace, date, 0, command);
-  xbt_heap_push(timer_heap, NULL, date);
-
-  DEBUG1("Putting value %lf on heap", date);
-}
-
-
-static int get(void **function, void **arg)
-{
-  command_t command = NULL;
-
-  command = xbt_swag_extract(command_to_run);
-  if (command) {
-    *function = command->function;
-    *arg = command->args;
-    command_free(command);
-    return 1;
-  } else {
-    return 0;
-  }
-}
-
-static void action_suspend(surf_action_t action)
-{
-  DIE_IMPOSSIBLE;
-}
-
-static void action_resume(surf_action_t action)
-{
-  DIE_IMPOSSIBLE;
-}
-
-static int action_is_suspended(surf_action_t action)
-{
-  DIE_IMPOSSIBLE;
-  return 0;
-}
-
-static void timer_finalize(void)
-{
-  xbt_heap_free(timer_heap);
-  timer_heap = NULL;
-
-  tmgr_trace_free(empty_trace);
-  empty_trace = NULL;
-
-  xbt_swag_free(command_pending);
-  xbt_swag_free(command_to_run);
-
-  surf_model_exit(surf_timer_model);
-  surf_timer_model = NULL;
-}
-
-static void surf_timer_model_init_internal(void)
-{
-  surf_timer_model = surf_model_init();
-
-  surf_timer_model->name = "TIMER";
-  surf_timer_model->action_state_set = timer_action_state_set;
-
-  surf_timer_model->model_private->resource_used = resource_used;
-  surf_timer_model->model_private->share_resources = share_resources;
-  surf_timer_model->model_private->update_actions_state =
-      update_actions_state;
-  surf_timer_model->model_private->update_resource_state =
-      update_resource_state;
-  surf_timer_model->model_private->finalize = timer_finalize;
-
-  surf_timer_model->suspend = action_suspend;
-  surf_timer_model->resume = action_resume;
-  surf_timer_model->is_suspended = action_is_suspended;
-
-  surf_timer_model->extension.timer.set = set;
-  surf_timer_model->extension.timer.get = get;
-
-  {
-    s_command_t var;
-    command_pending =
-        xbt_swag_new(xbt_swag_offset(var, command_set_hookup));
-    command_to_run =
-        xbt_swag_new(xbt_swag_offset(var, command_set_hookup));
-  }
-
-  empty_trace = tmgr_empty_trace_new();
-  timer_heap = xbt_heap_new(8, NULL);
-}
-
-void surf_timer_model_init(const char *filename)
-{
-  if (surf_timer_model)
-    return;
-  surf_timer_model_init_internal();
-  xbt_dynar_push(model_list, &surf_timer_model);
-}
index fae042b..1065cc5 100644 (file)
@@ -949,7 +949,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
 /*******************************************************************************/
 XBT_TEST_UNIT("insert",test_dynar_insert,"Using the xbt_dynar_insert and xbt_dynar_remove functions")
 {
-  xbt_dynar_t d = xbt_dynar_new(sizeof(int), NULL);
+  xbt_dynar_t d = xbt_dynar_new(sizeof(unsigned int), NULL);
   unsigned int cursor;
   int cpt;
 
index 35b8b27..cd6d584 100644 (file)
@@ -66,7 +66,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mecanism");
 
 /* default __ex_ctx callback function */
-ex_ctx_t *__xbt_ex_ctx_default(void)
+xbt_running_ctx_t *__xbt_ex_ctx_default(void)
 {
   /* Don't scream: this is a default which is never used (so, yes,
      there is one setjump container by running entity).
@@ -78,7 +78,7 @@ ex_ctx_t *__xbt_ex_ctx_default(void)
      It also gets overriden in xbt/context.c when using ucontextes (as well as
      in Java for now, but after the java overhaul, it will get cleaned out)
    */
-  static ex_ctx_t ctx = XBT_CTX_INITIALIZER;
+  static xbt_running_ctx_t ctx = XBT_RUNNING_CTX_INITIALIZER;
 
   return &ctx;
 }
@@ -174,7 +174,7 @@ void __xbt_ex_terminate_default(xbt_ex_t * e)
 }
 
 /* the externally visible API */
-XBT_EXPORT_NO_IMPORT(ex_ctx_cb_t) __xbt_ex_ctx = &__xbt_ex_ctx_default;
+XBT_EXPORT_NO_IMPORT(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
 XBT_EXPORT_NO_IMPORT(ex_term_cb_t) __xbt_ex_terminate =
     &__xbt_ex_terminate_default;
 
index b9cf578..7963a46 100644 (file)
@@ -107,13 +107,19 @@ void *mmalloc_attach(int fd, void *baseaddr)
   mdp->morecore = __mmalloc_mmap_morecore;
   mdp->fd = fd;
   mdp->base = mdp->breakval = mdp->top = baseaddr;
-
+  mdp->next_mdesc = NULL;
+  mdp->refcount = 1;
+  
   /* If we have not been passed a valid open file descriptor for the file
      to map to, then we go for an anonymous map */
 
-  if (mdp->fd < 0)
+  if (mdp->fd < 0){
     mdp->flags |= MMALLOC_ANONYMOUS;
-
+    sem_init(&mdp->sem, 0, 1);
+  }else{
+    sem_init(&mdp->sem, 1, 1);
+  }
+  
   /* If we have not been passed a valid open file descriptor for the file
      to map to, then open /dev/zero and use that to map to. */
 
@@ -127,15 +133,18 @@ void *mmalloc_attach(int fd, void *baseaddr)
   } else {
     abort();
   }
-  mdp = (struct mdesc *) mbase;
 
-  {                             /* create the mutex within that heap */
-    void *old_heap = mmalloc_get_current_heap();
-    mmalloc_set_current_heap(mbase);
-    mdp->mutex = xbt_os_mutex_init();
-    mmalloc_set_current_heap(old_heap);
-  }
+  /* Add the new heap to the linked list of heaps attached by mmalloc */  
+  if(__mmalloc_default_mdp){
+    mdp = __mmalloc_default_mdp;
+    while(mdp->next_mdesc)
+      mdp = mdp->next_mdesc;
 
+    LOCK(mdp);
+      mdp->next_mdesc = (struct mdesc *)mbase;
+    UNLOCK(mdp);
+  }
+  
   return ((void *) mbase);
 }
 
@@ -165,7 +174,7 @@ void *mmalloc_attach(int fd, void *baseaddr)
 static struct mdesc *reuse(int fd)
 {
   struct mdesc mtemp;
-  struct mdesc *mdp = NULL;
+  struct mdesc *mdp = NULL, *mdptemp = NULL;
 
   if (lseek(fd, 0L, SEEK_SET) != 0)
     return NULL;
@@ -183,18 +192,23 @@ static struct mdesc *reuse(int fd)
     mdp = (struct mdesc *) mtemp.base;
     mdp->fd = fd;
     mdp->morecore = __mmalloc_mmap_morecore;
-    mdp->mutex = xbt_os_mutex_init();
+    if(!mdp->refcount){
+      sem_init(&mdp->sem, 1, 1);
+      mdp->refcount++;
+    }
     if (mdp->mfree_hook != NULL) {
       mmcheckf((void *) mdp, (void (*)(void)) NULL, 1);
     }
   }
-
-  {                             /* create the mutex within that heap */
-    void *old_heap = mmalloc_get_current_heap();
-    mmalloc_set_current_heap(mdp);
-    mdp->mutex = xbt_os_mutex_init();
-    mmalloc_set_current_heap(old_heap);
-  }
-
+  
+  /* Add the new heap to the linked list of heaps attached by mmalloc */  
+  mdptemp = __mmalloc_default_mdp;
+  while(mdptemp->next_mdesc)
+    mdptemp = mdptemp->next_mdesc;
+
+  LOCK(mdptemp);
+    mdptemp->next_mdesc = mdp;
+  UNLOCK(mdptemp);
+  
   return (mdp);
 }
index 43e1ab3..e1157ed 100644 (file)
 void mmalloc_pre_detach(void *md)
 {
   struct mdesc *mdp = md;
-  xbt_os_mutex_t mutex = mdp->mutex;
-  mdp->mutex = NULL;
-  xbt_os_mutex_destroy(mutex);
+
+  if(--mdp->refcount == 0){
+    LOCK(mdp) ;
+    sem_destroy(&mdp->sem);
+  }
 }
 
 void *mmalloc_detach(void *md)
 {
-  struct mdesc mtemp;
+  struct mdesc *mdp = (struct mdesc *)md;
+  struct mdesc mtemp, *mdptemp;
+
+  if (mdp != NULL) {
+    /* Remove the heap from the linked list of heaps attached by mmalloc */
+    mdptemp = __mmalloc_default_mdp;
+    while(mdptemp->next_mdesc != mdp )
+      mdptemp = mdptemp->next_mdesc;
 
-  if (md != NULL) {
+    mdptemp->next_mdesc = mdp->next_mdesc;
 
     mmalloc_pre_detach(md);
     mtemp = *(struct mdesc *) md;
index a146c96..d6df507 100644 (file)
@@ -25,13 +25,14 @@ void mmalloc_set_current_heap(void *new_heap)
 #ifdef MMALLOC_WANT_OVERIDE_LEGACY
 void *malloc(size_t n)
 {
+  void *mdp = __mmalloc_current_heap;
 #ifdef HAVE_MMAP
-  if (!__mmalloc_current_heap)
+  if (!mdp)
     mmalloc_preinit();
 #endif
-  LOCK(__mmalloc_current_heap);
-  void *ret = mmalloc(__mmalloc_current_heap, n);
-  UNLOCK(__mmalloc_current_heap);
+  LOCK(mdp);
+  void *ret = mmalloc(mdp, n);
+  UNLOCK(mdp);
 
   return ret;
 }
@@ -39,13 +40,14 @@ void *malloc(size_t n)
 void *calloc(size_t nmemb, size_t size)
 {
   size_t total_size = nmemb * size;
+  void *mdp = __mmalloc_current_heap;
 #ifdef HAVE_MMAP
-  if (!__mmalloc_current_heap)
+  if (!mdp)
     mmalloc_preinit();
 #endif
-  LOCK(__mmalloc_current_heap);
-  void *ret = mmalloc(__mmalloc_current_heap, total_size);
-  UNLOCK(__mmalloc_current_heap);
+  LOCK(mdp);
+  void *ret = mmalloc(mdp, total_size);
+  UNLOCK(mdp);
 
   /* Fill the allocated memory with zeroes to mimic calloc behaviour */
   memset(ret, '\0', total_size);
@@ -56,30 +58,32 @@ void *calloc(size_t nmemb, size_t size)
 void *realloc(void *p, size_t s)
 {
   void *ret = NULL;
+  void *mdp = __mmalloc_current_heap;
 #ifdef HAVE_MMAP
-  if (!__mmalloc_current_heap)
+  if (!mdp)
     mmalloc_preinit();
 #endif
-  LOCK(__mmalloc_current_heap);
+  LOCK(mdp);
   if (s) {
     if (p)
-      ret = mrealloc(__mmalloc_current_heap, p, s);
+      ret = mrealloc(mdp, p, s);
     else
-      ret = mmalloc(__mmalloc_current_heap, s);
+      ret = mmalloc(mdp, s);
   } else {
     if (p)
-      mfree(__mmalloc_current_heap, p);
+      mfree(mdp, p);
   }
-  UNLOCK(__mmalloc_current_heap);
+  UNLOCK(mdp);
 
   return ret;
 }
 
 void free(void *p)
 {
-  LOCK(__mmalloc_current_heap);
-  mfree(__mmalloc_current_heap, p);
-  UNLOCK(__mmalloc_current_heap);
+  void *mdp = __mmalloc_current_heap;
+  LOCK(mdp);
+  mfree(mdp, p);
+  UNLOCK(mdp);
 }
 #endif
 
@@ -97,14 +101,39 @@ void *mmalloc_get_default_md(void)
 
 static void mmalloc_fork_prepare(void)
 {
-  if (__mmalloc_default_mdp)
-    LOCK(__mmalloc_default_mdp);
+  struct mdesc* mdp = NULL;
+  if ((mdp =__mmalloc_default_mdp)){
+    while(mdp){
+      LOCK(mdp);
+      if(mdp->fd >= 0){
+        mdp->refcount++;
+      }
+      mdp = mdp->next_mdesc;
+    }
+  }
+}
+
+static void mmalloc_fork_parent(void)
+{
+  struct mdesc* mdp = NULL;
+  if ((mdp =__mmalloc_default_mdp)){
+    while(mdp){
+      if(mdp->fd < 0)
+        UNLOCK(mdp);
+      mdp = mdp->next_mdesc;
+    }
+  }
 }
 
-static void mmalloc_fork_finish(void)
+static void mmalloc_fork_child(void)
 {
-  if (__mmalloc_default_mdp)
-    UNLOCK(__mmalloc_default_mdp);
+  struct mdesc* mdp = NULL;
+  if ((mdp =__mmalloc_default_mdp)){
+    while(mdp){
+      UNLOCK(mdp);
+      mdp = mdp->next_mdesc;
+    }
+  }
 }
 
 /* Initialize the default malloc descriptor. */
@@ -115,7 +144,7 @@ void mmalloc_preinit(void)
         mmalloc_attach(-1, (char *) sbrk(0) + HEAP_OFFSET);
     /* Fixme? only the default mdp in protected against forks */
     if (xbt_os_thread_atfork(mmalloc_fork_prepare,
-                             mmalloc_fork_finish, mmalloc_fork_finish) != 0)
+                             mmalloc_fork_parent, mmalloc_fork_child) != 0)
       abort();
   }
   xbt_assert(__mmalloc_default_mdp != NULL);
index d72000b..a84d175 100644 (file)
@@ -16,6 +16,7 @@
 #include "portable.h"
 #include "xbt/xbt_os_thread.h"
 #include "xbt/mmalloc.h"
+#include <semaphore.h>
 
 #ifdef HAVE_LIMITS_H
 #  include <limits.h>
@@ -140,7 +141,16 @@ struct mstats {
    if such a file exists. */
 
 struct mdesc {
-  xbt_os_mutex_t mutex;
+
+  /* Semaphore locking the access to the heap */
+  sem_t sem;
+
+  /* Number of processes that attached the heap */
+  unsigned int refcount;
+
+  /* Chained lists of mdescs */
+  struct mdesc *next_mdesc;
+  
   /* The "magic number" for an mmalloc file. */
   char magic[MMALLOC_MAGIC_SIZE];
 
@@ -298,19 +308,17 @@ extern void *__mmalloc_remap_core(struct mdesc *mdp);
    ? __mmalloc_default_mdp  \
    : (struct mdesc *) (md))
 
-/* Thread-safety (if the mutex is already created)*/
+/* Thread-safety (if the sem is already created)*/
 #define LOCK(md)                                        \
-  do {                                                  \
+  do {\
     struct mdesc *lock_local_mdp = MD_TO_MDP(md);       \
-    if (lock_local_mdp->mutex)                          \
-      xbt_os_mutex_acquire(lock_local_mdp->mutex);     \
+    sem_wait(&lock_local_mdp->sem);     \
   } while (0)
 
 #define UNLOCK(md)                                        \
   do {                                                  \
     struct mdesc *unlock_local_mdp = MD_TO_MDP(md);       \
-    if (unlock_local_mdp->mutex)                          \
-      xbt_os_mutex_release(unlock_local_mdp->mutex);     \
+    sem_post(&unlock_local_mdp->sem);     \
   } while (0)
 
 #endif                          /* __MMPRIVATE_H */
diff --git a/src/xbt/threadpool.c b/src/xbt/threadpool.c
new file mode 100644 (file)
index 0000000..271dad4
--- /dev/null
@@ -0,0 +1,113 @@
+/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "threadpool_private.h"
+
+static void *_xbt_tpool_worker_main(void *tpool);
+
+xbt_tpool_t xbt_tpool_new(unsigned int num_workers, unsigned int max_jobs)
+{
+  unsigned int i;
+  xbt_os_thread_t worker = NULL;
+
+  /* Initialize thread pool data structure */
+  xbt_tpool_t tpool = xbt_new0(s_xbt_tpool_t, 1);
+  tpool->mutex = xbt_os_mutex_init();
+  tpool->job_posted = xbt_os_cond_init();
+  tpool->job_taken = xbt_os_cond_init();
+  tpool->all_jobs_done = xbt_os_cond_init();
+  tpool->jobs_queue = xbt_dynar_new(sizeof(s_xbt_tpool_job_t), NULL);
+  tpool->num_workers = num_workers;
+  tpool->max_jobs = max_jobs;
+  
+  /* Create the pool of worker threads */
+  for(i=0; i < num_workers; i++){
+    worker = xbt_os_thread_create(NULL, _xbt_tpool_worker_main, tpool, NULL);
+    xbt_os_thread_detach(worker);
+  }
+  
+  return tpool;
+}
+
+void xbt_tpool_destroy(xbt_tpool_t tpool)
+{ 
+  /* Lock the pool, then signal every worker an wait for each to finish */
+  xbt_os_mutex_acquire(tpool->mutex);
+  tpool->flags = TPOOL_DESTROY; 
+
+  while(tpool->num_workers){
+    xbt_os_cond_signal(tpool->job_posted);
+    xbt_os_cond_wait(tpool->job_posted, tpool->mutex);
+  }
+
+  /* Destroy pool's data structures */
+  xbt_os_cond_destroy(tpool->job_posted);
+  xbt_os_cond_destroy(tpool->job_taken);
+  xbt_os_cond_destroy(tpool->all_jobs_done);
+  xbt_os_mutex_release(tpool->mutex);
+  xbt_os_mutex_destroy(tpool->mutex);  
+  xbt_free(tpool);
+}
+
+void xbt_tpool_queue_job(xbt_tpool_t tpool, void_f_pvoid_t fun, void* fun_arg)
+{
+  s_xbt_tpool_job_t job;
+  job.fun = fun;
+  job.fun_arg = fun_arg;
+
+  /* Wait until we can lock on the pool with some space on it for the job */
+  xbt_os_mutex_acquire(tpool->mutex);
+  while(xbt_dynar_length(tpool->jobs_queue) == tpool->max_jobs)
+    xbt_os_cond_wait(tpool->job_taken, tpool->mutex); 
+
+  /* Push the job in the queue, signal the workers and unlock the pool */
+  xbt_dynar_push_as(tpool->jobs_queue, s_xbt_tpool_job_t, job);
+  xbt_os_cond_signal(tpool->job_posted);
+  xbt_os_mutex_release(tpool->mutex);    
+  return;
+}
+
+void xbt_tpool_wait_all(xbt_tpool_t tpool)
+{
+  xbt_os_mutex_acquire(tpool->mutex);
+  while(xbt_dynar_length(tpool->jobs_queue))
+    xbt_os_cond_wait(tpool->job_taken, tpool->mutex);
+  xbt_os_mutex_release(tpool->mutex);
+  
+  return;
+}
+
+static void *_xbt_tpool_worker_main(void *arg)
+{
+  s_xbt_tpool_job_t job;
+  xbt_tpool_t tpool = (xbt_tpool_t)arg;
+  
+  /* Worker's main loop */
+  while(1){
+    xbt_os_mutex_acquire(tpool->mutex);
+
+    /* If there are no jobs in the queue wait for one */
+    if(!xbt_dynar_length(tpool->jobs_queue))
+      xbt_os_cond_wait(tpool->job_posted, tpool->mutex);
+
+    /* If we are shutting down, signal the destroyer so it can kill the other */
+    /* workers, unlock the pool and return  */
+    if(tpool->flags == TPOOL_DESTROY){
+      tpool->num_workers--;
+      xbt_os_cond_signal(tpool->job_taken);
+      xbt_os_mutex_release(tpool->mutex);
+      return NULL;
+    }
+
+    /* Get a job, signal the pool to inform jobs submitters and unlock it */
+    job = xbt_dynar_pop_as(tpool->jobs_queue, s_xbt_tpool_job_t);
+    xbt_os_cond_signal(tpool->job_taken);
+    xbt_os_mutex_release(tpool->mutex);
+  
+    /* Run the job and loop again ... */
+    job.fun(job.fun_arg);
+  }
+}
\ No newline at end of file
diff --git a/src/xbt/threadpool_private.h b/src/xbt/threadpool_private.h
new file mode 100644 (file)
index 0000000..fee8965
--- /dev/null
@@ -0,0 +1,36 @@
+/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _XBT_THREADPOOL_PRIVATE_H
+#define _XBT_THREADPOOL_PRIVATE_H
+
+#include "xbt/threadpool.h"
+#include "xbt/xbt_os_thread.h"
+#include "xbt/sysdep.h"
+#include "xbt/dynar.h"
+
+typedef enum{
+  TPOOL_WAIT = 0,
+  TPOOL_DESTROY
+} e_xbt_tpool_flag_t;
+
+typedef struct s_xbt_tpool {
+  xbt_os_mutex_t mutex;           /* pool's mutex */
+  xbt_os_cond_t job_posted;       /* job is posted */
+  xbt_os_cond_t job_taken;        /* job is taken */
+  xbt_os_cond_t all_jobs_done;    /* all jobs are finished */ 
+  xbt_dynar_t jobs_queue;
+  e_xbt_tpool_flag_t flags;
+  unsigned int num_workers;
+  unsigned int max_jobs;
+} s_xbt_tpool_t;
+
+typedef struct s_xbt_tpool_job {
+  void_f_pvoid_t fun;
+  void *fun_arg;
+} s_xbt_tpool_job_t, *xbt_tpool_job_t;
+
+#endif
\ No newline at end of file
index 3ab06fe..f7ca02d 100644 (file)
@@ -23,14 +23,14 @@ static double format_begin_of_time = -1;
     if (precision == -1 && length == -1) { \
       tmp = bprintf("%" letter, data); \
     } else if (precision == -1) { \
-      sprintf(tmpfmt,"%% %d" letter,length); \
+      sprintf(tmpfmt,"%%%d" letter,length); \
       tmp = bprintf(tmpfmt, data); \
       length = -1; \
     } else if (length == -1) { \
       tmp = bprintf("%.*" letter, precision, data);\
       precision = -1; \
     } else { \
-      sprintf(tmpfmt,"%% %d.*" letter,length); \
+      sprintf(tmpfmt,"%%%d.*" letter,length); \
       tmp = bprintf(tmpfmt, precision, data); \
       length = precision = -1; \
     } \
@@ -214,7 +214,7 @@ static void xbt_log_layout_format_dynamic(xbt_log_layout_t l,
     if (precision == -1 && length == -1) { \
       p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%" letter, data); \
     } else if (precision == -1) { \
-      sprintf(tmpfmt,"%% %d" letter,length); \
+      sprintf(tmpfmt,"%%%d" letter,length); \
       p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), tmpfmt, data); \
       length = -1; \
     } else if (length == -1) { \
@@ -223,7 +223,7 @@ static void xbt_log_layout_format_dynamic(xbt_log_layout_t l,
                    data);\
       precision = -1; \
     } else { \
-      sprintf(tmpfmt,"%% %d.%d" letter,length, \
+      sprintf(tmpfmt,"%%%d.%d" letter,length, \
           (int) MIN(XBT_LOG_BUFF_SIZE - (p - ev->buffer), precision));\
       p += sprintf(p, tmpfmt, data);\
       length = precision = -1; \
index 10f8266..6a124de 100644 (file)
@@ -43,7 +43,8 @@ typedef struct xbt_os_thread_ {
   char *name;
   void *param;
   pvoid_f_pvoid_t start_routine;
-  ex_ctx_t *exception;
+  xbt_running_ctx_t *running_ctx;
+  void *extra_data;
 } s_xbt_os_thread_t;
 static xbt_os_thread_t main_thread = NULL;
 
@@ -58,9 +59,9 @@ static void xbt_os_thread_free_thread_data(void *d)
 }
 
 /* callback: context fetching */
-static ex_ctx_t *_os_thread_ex_ctx(void)
+static xbt_running_ctx_t *_os_thread_get_running_ctx(void)
 {
-  return xbt_os_thread_self()->exception;
+  return xbt_os_thread_self()->running_ctx;
 }
 
 /* callback: termination */
@@ -82,15 +83,20 @@ void xbt_os_thread_mod_preinit(void)
   if ((errcode = pthread_key_create(&xbt_self_thread_key, NULL)))
     THROW0(system_error, errcode,
            "pthread_key_create failed for xbt_self_thread_key");
-
+  
   main_thread = xbt_new(s_xbt_os_thread_t, 1);
   main_thread->name = (char *) "main";
   main_thread->start_routine = NULL;
   main_thread->param = NULL;
-  main_thread->exception = xbt_new(ex_ctx_t, 1);
-  XBT_CTX_INITIALIZE(main_thread->exception);
+  main_thread->running_ctx = xbt_new(xbt_running_ctx_t, 1);
+  XBT_RUNNING_CTX_INITIALIZE(main_thread->running_ctx);
 
-  __xbt_ex_ctx = _os_thread_ex_ctx;
+  if ((errcode = pthread_setspecific(xbt_self_thread_key, main_thread)))
+    THROW0(system_error, errcode,
+           "pthread_setspecific failed for xbt_self_thread_key");
+
+  
+  __xbt_running_ctx_fetch = _os_thread_get_running_ctx;
   __xbt_ex_terminate = _os_thread_ex_terminate;
 
   thread_mod_inited = 1;
@@ -109,7 +115,7 @@ void xbt_os_thread_mod_postexit(void)
 
   //   if ((errcode=pthread_key_delete(xbt_self_thread_key)))
   //     THROW0(system_error,errcode,"pthread_key_delete failed for xbt_self_thread_key");
-  free(main_thread->exception);
+  free(main_thread->running_ctx);
   free(main_thread);
   main_thread = NULL;
   thread_mod_inited = 0;
@@ -118,7 +124,7 @@ void xbt_os_thread_mod_postexit(void)
 #endif
 
   /* Restore the default exception setup */
-  __xbt_ex_ctx = &__xbt_ex_ctx_default;
+  __xbt_running_ctx_fetch = &__xbt_ex_ctx_default;
   __xbt_ex_terminate = &__xbt_ex_terminate_default;
 }
 
@@ -142,7 +148,8 @@ static void *wrapper_start_routine(void *s)
 
 xbt_os_thread_t xbt_os_thread_create(const char *name,
                                      pvoid_f_pvoid_t start_routine,
-                                     void *param)
+                                     void *param,
+                                     void *extra_data)
 {
   int errcode;
 
@@ -150,9 +157,10 @@ xbt_os_thread_t xbt_os_thread_create(const char *name,
   res_thread->name = xbt_strdup(name);
   res_thread->start_routine = start_routine;
   res_thread->param = param;
-  res_thread->exception = xbt_new(ex_ctx_t, 1);
-  XBT_CTX_INITIALIZE(res_thread->exception);
-
+  res_thread->running_ctx = xbt_new(xbt_running_ctx_t, 1);
+  XBT_RUNNING_CTX_INITIALIZE(res_thread->running_ctx);
+  res_thread->extra_data = extra_data;
+  
   if ((errcode = pthread_create(&(res_thread->t), NULL,
                                 wrapper_start_routine, res_thread)))
     THROW1(system_error, errcode,
@@ -172,6 +180,16 @@ const char *xbt_os_thread_self_name(void)
   return me ? me->name : "main";
 }
 
+void xbt_os_thread_set_extra_data(void *data)
+{
+  xbt_os_thread_self()->extra_data = data;
+}
+
+void *xbt_os_thread_get_extra_data(void)
+{
+  return xbt_os_thread_self()->extra_data;
+}
+
 void xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return)
 {
 
@@ -180,8 +198,8 @@ void xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return)
   if ((errcode = pthread_join(thread->t, thread_return)))
     THROW1(system_error, errcode, "pthread_join failed: %s",
            strerror(errcode));
-  if (thread->exception)
-    free(thread->exception);
+  if (thread->running_ctx)
+    free(thread->running_ctx);
 
   if (thread->name)
     free(thread->name);
@@ -205,12 +223,15 @@ xbt_os_thread_t xbt_os_thread_self(void)
     return NULL;
 
   res = pthread_getspecific(xbt_self_thread_key);
-  if (!res)
-    res = main_thread;
 
   return res;
 }
 
+void xbt_os_thread_detach(xbt_os_thread_t thread)
+{
+  pthread_detach(thread->t);
+}
+
 #include <sched.h>
 void xbt_os_thread_yield(void)
 {
@@ -457,7 +478,7 @@ xbt_os_sem_t xbt_os_sem_init(unsigned int value)
 #else                           /* damn, no sem_init(). Reimplement it */
 
   xbt_os_mutex_acquire(next_sem_ID_lock);
-  res->name = bprintf("/%d.%d", (*xbt_getpid) (), ++next_sem_ID);
+  res->name = bprintf("/%d", ++next_sem_ID);
   xbt_os_mutex_release(next_sem_ID_lock);
 
   res->ps = sem_open(res->name, O_CREAT, 0644, value);
@@ -710,6 +731,12 @@ void xbt_os_thread_exit(int *retval)
     ExitThread(0);
 }
 
+void xbt_os_thread_detach(xbt_os_thread_t thread)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+
 xbt_os_thread_t xbt_os_thread_self(void)
 {
   return TlsGetValue(xbt_self_thread_key);
index 12143a7..c85bf2d 100644 (file)
@@ -45,7 +45,7 @@ xbt_thread_t xbt_thread_create(const char *name, void_f_pvoid_t code,
   res->code = code;
   DEBUG1("Create thread %p", res);
   res->os_thread =
-      xbt_os_thread_create(name, xbt_thread_create_wrapper, res);
+      xbt_os_thread_create(name, xbt_thread_create_wrapper, res, NULL);
   return res;
 }
 
index ba5d8e3..dccc235 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef CONTEXT_THREADS
 #ifndef WIN32
-
+#ifdef HAVE_PTHREAD_H
 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
  * The decision (and the loading) is made in xbt/context.c.
  */
@@ -47,7 +47,7 @@ void xbt_os_thread_mod_postexit(void)
 
 xbt_os_thread_t xbt_os_thread_create(const char *name,
                                      pvoid_f_pvoid_t start_routine,
-                                     void *param)
+                                     void *param, void *data)
 {
   xbt_backtrace_display_current();
   xbt_die
@@ -61,6 +61,13 @@ void xbt_os_thread_exit(int *retcode)
       ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
 }
 
+void xbt_os_thread_detach(xbt_os_thread_t worker)
+{
+  xbt_backtrace_display_current();
+  xbt_die
+      ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
+}
+
 xbt_os_thread_t xbt_os_thread_self(void)
 {
   xbt_backtrace_display_current();
@@ -149,3 +156,4 @@ void xbt_os_cond_destroy(xbt_os_cond_t cond)
 }
 #endif
 #endif
+#endif
index a46072e..7c6bc74 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "simix/simix.h"        /* used implementation */
 #include "simix/datatypes.h"
+#include "../simix/private.h" /* FIXME */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt,
                                 "Synchronization mechanism");
@@ -61,11 +62,10 @@ xbt_thread_t xbt_thread_create(const char *name, void_f_pvoid_t code,
   res->userparam = param;
   res->code = code;
   res->father_data = SIMIX_process_get_data(SIMIX_process_self());
-  //   char*name = bprintf("%s#%p",SIMIX_process_get_name(SIMIX_process_self()), param);
+  /*   char*name = bprintf("%s#%p",SIMIX_process_self_get_name(), param); */
   res->s_process = SIMIX_process_create(name,
                                         xbt_thread_create_wrapper, res,
-                                        SIMIX_host_get_name(SIMIX_host_self
-                                                            ()), 0, NULL,
+                                        SIMIX_host_self_get_name(), 0, NULL,
                                         /*props */ NULL);
   res->joinable = joinable;
   res->done = 0;
@@ -106,14 +106,14 @@ void xbt_thread_join(xbt_thread_t thread)
 
 void xbt_thread_cancel(xbt_thread_t thread)
 {
-  SIMIX_process_kill(thread->s_process);
+  SIMIX_process_kill(thread->s_process, SIMIX_process_self());
   free(thread->name);
   free(thread);
 }
 
 void xbt_thread_exit()
 {
-  SIMIX_process_kill(SIMIX_process_self());
+  SIMIX_process_kill(SIMIX_process_self(), SIMIX_process_self());
 }
 
 xbt_thread_t xbt_thread_self(void)
@@ -134,22 +134,22 @@ struct s_xbt_mutex_ {
 
 xbt_mutex_t xbt_mutex_init(void)
 {
-  return (xbt_mutex_t) SIMIX_mutex_init();
+  return (xbt_mutex_t) SIMIX_req_mutex_init();
 }
 
 void xbt_mutex_acquire(xbt_mutex_t mutex)
 {
-  SIMIX_mutex_lock((smx_mutex_t) mutex);
+  SIMIX_req_mutex_lock((smx_mutex_t) mutex);
 }
 
 void xbt_mutex_release(xbt_mutex_t mutex)
 {
-  SIMIX_mutex_unlock((smx_mutex_t) mutex);
+  SIMIX_req_mutex_unlock((smx_mutex_t) mutex);
 }
 
 void xbt_mutex_destroy(xbt_mutex_t mutex)
 {
-  SIMIX_mutex_destroy((smx_mutex_t) mutex);
+  SIMIX_req_mutex_destroy((smx_mutex_t) mutex);
 }
 
 /***** condition related functions *****/
@@ -159,30 +159,30 @@ struct s_xbt_cond_ {
 
 xbt_cond_t xbt_cond_init(void)
 {
-  return (xbt_cond_t) SIMIX_cond_init();
+  return (xbt_cond_t) SIMIX_req_cond_init();
 }
 
 void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex)
 {
-  SIMIX_cond_wait((smx_cond_t) cond, (smx_mutex_t) mutex);
+  SIMIX_req_cond_wait((smx_cond_t) cond, (smx_mutex_t) mutex);
 }
 
 void xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay)
 {
-  SIMIX_cond_wait_timeout((smx_cond_t) cond, (smx_mutex_t) mutex, delay);
+  SIMIX_req_cond_wait_timeout((smx_cond_t) cond, (smx_mutex_t) mutex, delay);
 }
 
 void xbt_cond_signal(xbt_cond_t cond)
 {
-  SIMIX_cond_signal((smx_cond_t) cond);
+  SIMIX_req_cond_signal((smx_cond_t) cond);
 }
 
 void xbt_cond_broadcast(xbt_cond_t cond)
 {
-  SIMIX_cond_broadcast((smx_cond_t) cond);
+  SIMIX_req_cond_broadcast((smx_cond_t) cond);
 }
 
 void xbt_cond_destroy(xbt_cond_t cond)
 {
-  SIMIX_cond_destroy((smx_cond_t) cond);
+  SIMIX_req_cond_destroy((smx_cond_t) cond);
 }
index c8ea62e..96fab4b 100644 (file)
@@ -7,12 +7,14 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "gras/Virtu/virtu_sg.h"
+#include "simix/simix.h"
 
 /*
  * Time elapsed since the begining of the simulation.
  */
 double xbt_time()
 {
+  /* FIXME: check if we should use the request mechanism or not */
   return SIMIX_get_clock();
 }
 
@@ -21,25 +23,11 @@ double xbt_time()
  */
 void xbt_sleep(double sec)
 {
-  smx_action_t act_sleep;
-  smx_process_t proc = SIMIX_process_self();
-  smx_mutex_t mutex;
-  smx_cond_t cond;
-  /* create action to sleep */
-  act_sleep = SIMIX_action_sleep(SIMIX_process_get_host(proc), sec);
-
-  mutex = SIMIX_mutex_init();
-  SIMIX_mutex_lock(mutex);
-  /* create conditional and register action to it */
-  cond = SIMIX_cond_init();
-
-  SIMIX_register_action_to_condition(act_sleep, cond);
-  SIMIX_cond_wait(cond, mutex);
-  SIMIX_mutex_unlock(mutex);
-
-  /* remove variables */
-  SIMIX_cond_destroy(cond);
-  SIMIX_mutex_destroy(mutex);
-  SIMIX_action_destroy(act_sleep);
+  SIMIX_req_process_sleep(sec);
+}
 
+const char *xbt_procname(void)
+{
+  return SIMIX_process_self_get_name();
 }
+
old mode 100755 (executable)
new mode 100644 (file)
index abe3d7c..803f3e3
@@ -1,14 +1,15 @@
 p Runs the 'msg_handle' test within the simulator (simulation times valid for 32bits architectures)
 
-$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml
-> [Tremblay:server:(1) 0.000000] [test/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [test/INFO] Launch client (port=4000)
-> [Tremblay:server:(1) 1.000312] [test/INFO] Initialization done.
-> [Tremblay:server:(1) 1.000312] [test/INFO] gras_msg_handle(0) works as expected (immediate timeout)
-> [Fafard:client:(2) 1.000312] [test/INFO] Initialization done.
-> [Tremblay:server:(1) 2.000312] [test/INFO] gras_msg_handle(1) works as expected (delayed timeout)
-> [Tremblay:server:(1) 5.000312] [test/INFO] Unlock pal
-> [Tremblay:server:(1) 5.020863] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 5.020863] [test/INFO] Got the message
-> [Fafard:client:(2) 5.020863] [test/INFO] gras_msg_handle(-1) works as expected (locked)
-> [Fafard:client:(2) 5.020863] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (port=4000)
+> [  1.000312] (1:server@Tremblay) Initialization done.
+> [  1.000312] (1:server@Tremblay) gras_msg_handle(0) works as expected (immediate timeout)
+> [  1.000312] (2:client@Fafard) Initialization done.
+> [  2.000312] (1:server@Tremblay) gras_msg_handle(1) works as expected (delayed timeout)
+> [  5.000312] (1:server@Tremblay) Unlock pal
+> [  5.020863] (1:server@Tremblay) Exiting GRAS
+> [  5.020863] (2:client@Fafard) Got the message
+> [  5.020863] (2:client@Fafard) gras_msg_handle(-1) works as expected (locked)
+> [  5.020863] (2:client@Fafard) Exiting GRAS
old mode 100755 (executable)
new mode 100644 (file)
index f6a6f35..ae7ee24
@@ -1,15 +1,16 @@
 p Runs the 'msg_handle' test within the simulator (simulation times valid for 64bits architectures)
 
-$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml
-> [Tremblay:server:(1) 0.000000] [test/INFO] Launch server (port=4000)
-> [Fafard:client:(2) 0.000000] [test/INFO] Launch client (port=4000)
-> [Tremblay:server:(1) 1.000312] [test/INFO] Initialization done.
-> [Tremblay:server:(1) 1.000312] [test/INFO] gras_msg_handle(0) works as expected (immediate timeout)
-> [Fafard:client:(2) 1.000312] [test/INFO] Initialization done.
-> [Tremblay:server:(1) 2.000312] [test/INFO] gras_msg_handle(1) works as expected (delayed timeout)
-> [Tremblay:server:(1) 5.000312] [test/INFO] Unlock pal
-> [Tremblay:server:(1) 5.020863] [gras/INFO] Exiting GRAS
-> [Fafard:client:(2) 5.020863] [test/INFO] Got the message
-> [Fafard:client:(2) 5.020863] [test/INFO] gras_msg_handle(-1) works as expected (locked)
-> [Fafard:client:(2) 5.020863] [gras/INFO] Exiting GRAS
+! output sort
+$ $SG_TEST_EXENV gras/msg_handle/msg_handle_simulator$EXEEXT ${srcdir:=.}/../examples/msg/small_platform.xml ${srcdir:=.}/gras/msg_handle/msg_handle.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:server@Tremblay) Launch server (port=4000)
+> [  0.000000] (2:client@Fafard) Launch client (port=4000)
+> [  1.000312] (1:server@Tremblay) Initialization done.
+> [  1.000312] (1:server@Tremblay) gras_msg_handle(0) works as expected (immediate timeout)
+> [  1.000312] (2:client@Fafard) Initialization done.
+> [  2.000312] (1:server@Tremblay) gras_msg_handle(1) works as expected (delayed timeout)
+> [  5.000312] (1:server@Tremblay) Unlock pal
+> [  5.020863] (1:server@Tremblay) Exiting GRAS
+> [  5.020863] (2:client@Fafard) Got the message
+> [  5.020863] (2:client@Fafard) gras_msg_handle(-1) works as expected (locked)
+> [  5.020863] (2:client@Fafard) Exiting GRAS
 
index 4474fbd..18169cc 100644 (file)
@@ -1,5 +1,6 @@
-$ msg/get_sender ${srcdir:=.}/msg/get_sender.xml
-> [toto:send:(1) 0.000000] [test/INFO] Sending
-> [toto:receive:(2) 0.000000] [test/INFO] Receiving
-> [toto:receive:(2) 0.000000] [test/INFO] Got a message sent by 'send'
-> [toto:send:(1) 1.000000] [test/INFO] Exiting
+! output sort
+$ msg/get_sender ${srcdir:=.}/msg/get_sender.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:send@toto) Sending
+> [  0.000000] (2:receive@toto) Receiving
+> [  0.000000] (2:receive@toto) Got a message sent by 'send'
+> [  1.000000] (1:send@toto) Exiting
index f06077b..9eb3cd9 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic0 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [1.000100] [basic0/INFO] Simulation time: 1.000100
\ No newline at end of file
+$ simdag/basic0 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  1.000100] (0:@) Simulation time: 1.000100
index 40623c1..92e5ef4 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic1 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [16.000100] [basic1/INFO] Simulation time: 16.000100
\ No newline at end of file
+$ simdag/basic1 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [ 16.000100] (0:@) Simulation time: 16.000100
index 1c53cb4..42976e1 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic2 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [10.600100] [basic2/INFO] Simulation time: 10.600100
\ No newline at end of file
+$ simdag/basic2 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [ 10.600100] (0:@) Simulation time: 10.600100
index 09dba46..aa8fad9 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic3 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [0.000000] [basic3/INFO] Simulation time: 0.000000
\ No newline at end of file
+$ simdag/basic3 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  0.000000] (0:@) Simulation time: 0.000000
index 8ba69c8..9fc3132 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic4 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [0.000100] [basic4/INFO] Simulation time: 0.000100
+$ simdag/basic4 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  0.000100] (0:@) Simulation time: 0.000100
index e4db2a1..3042022 100644 (file)
@@ -1,3 +1,3 @@
-$ simdag/basic5 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [0.002500] [basic5/INFO] Simulation time: 0.002500
+$ simdag/basic5 ${srcdir:=.}/simdag/basic_platform.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  0.002500] (0:@) Simulation time: 0.002500
index 19ff006..df6ea58 100644 (file)
@@ -1,4 +1,4 @@
-$ simdag/basic6 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir}
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> [2.000000] [basic6/INFO] Simulation time: 2.000000
+$ simdag/basic6 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
+> [  2.000000] (0:@) Simulation time: 2.000000
 
index aea6357..1e12d7d 100644 (file)
@@ -1,6 +1,6 @@
 
 p all 2 all test, only fat pipe switch is used concurrently
 
-$ simdag/network/mxn/test_intra_all2all ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/mxn/test_intra_all2all ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 8
index b359b34..5ff4c3d 100644 (file)
@@ -1,6 +1,6 @@
 
 p sending on different paths test
 
-$ simdag/network/mxn/test_intra_independent_comm ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/mxn/test_intra_independent_comm ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 3
index ff918d9..ad7384b 100644 (file)
@@ -1,7 +1,7 @@
 
 p scatter test
 
-$ simdag/network/mxn/test_intra_scatter ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/mxn/test_intra_scatter ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 8
 
index 1a847ce..8b37fdf 100644 (file)
@@ -1,19 +1,19 @@
 
 p latency check, 1 byte, shared link
 
-$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1.5
 
 p latency check, 1 byte, fat pipe
 
-$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1.5
 
 p latency check, 1 byte, link - switch - link 
 
-$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 3
 
index d12ccb5..bee669e 100644 (file)
@@ -1,19 +1,19 @@
 
 p latency check, 2 x 1 byte, same direction, shared link
 
-$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 2.5
 
 p latency check, 2 x 1 byte, same direction, fat pipe
 
-$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1.5
 
 p latency check, 2 x 1 byte, same direction, link - switch - link 
 
-$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 4
 
index 98440b4..1933875 100644 (file)
@@ -1,19 +1,19 @@
 
 p latency check, 2 x 1 byte, opposite direction, shared link
 
-$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 2.5
 
 p latency check, 2 x 1 byte, opposite direction, fat pipe
 
-$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1.5
 
 p latency check, 2 x 1 byte, opposite direction, link - switch - link 
 
-$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 4
 
index 515591e..e47412b 100644 (file)
@@ -1,6 +1,6 @@
 
 p latency bounded by large latency link
 
-$ simdag/network/p2p/test_latency_bound ${srcdir:=.}/simdag/network/p2p/platform_2p_1bb.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/p2p/test_latency_bound ${srcdir:=.}/simdag/network/p2p/platform_2p_1bb.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 10001.5
index 075a3b9..c017a26 100644 (file)
@@ -1,8 +1,8 @@
 
 p Reinitialization test
 
-$ simdag/network/test_reinit_costs ${srcdir:=.}/simdag/network/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/network/test_reinit_costs ${srcdir:=.}/simdag/network/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 0
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1.5
index 47b18ba..b53988e 100644 (file)
@@ -1,12 +1,12 @@
 
 p par task comp only, no comm, homogeneous
 
-$ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1
 
 p par task comp only, no comm, heterogeneous
 
-$ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl_hetero.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl_hetero.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1
index b30e9ef..b8e4a6e 100644 (file)
@@ -1,6 +1,6 @@
 
 p seq task comp only, no comm
 
-$ simdag/partask/test_comp_only_seq ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ simdag/partask/test_comp_only_seq ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --surf-path=${srcdir} --log=sd_kernel.thres=warning --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > 1
index f3ebc6c..02bf6b7 100644 (file)
@@ -1,69 +1,69 @@
-$ ./basic_parsing_test one_cluster.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_cluster.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 5, link number: 8
 
-$ ./basic_parsing_test one_host_availability.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_properties.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_properties.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_state_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_state_off.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_state_off.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_state_on.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_state_on.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_trace_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_trace_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host_trace_inside.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host_trace_inside.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_host.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_host.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 1
 
-$ ./basic_parsing_test one_link_availability.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_link_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 2
 
-$ ./basic_parsing_test one_link_fatpipe.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_link_fatpipe.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 2
 
-$ ./basic_parsing_test one_link_shared.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_link_shared.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 2
 
-$ ./basic_parsing_test one_link_state_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_link_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 1, link number: 2
 
-$ ./basic_parsing_test three_hosts_non_symmetric_route.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test three_hosts_non_symmetric_route.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 3, link number: 4
 
-$ ./basic_parsing_test two_clusters.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_clusters.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 10, link number: 16
 
-$ ./basic_parsing_test two_hosts_multi_hop.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_hosts_multi_hop.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 2, link number: 4
 
-$ ./basic_parsing_test two_hosts_one_link.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_hosts_one_link.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 2, link number: 2
 
 $ ./basic_parsing_test ./four_hosts_floyd.xml
@@ -72,4 +72,4 @@ $ ./basic_parsing_test ./four_hosts_floyd.xml
 
 $ ./basic_parsing_test ./four_hosts_floyd_bis.xml
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
-> Workstation number: 5, link number: 7
\ No newline at end of file
+> Workstation number: 5, link number: 7
index 6062846..a32ff38 100644 (file)
@@ -1,5 +1,7 @@
-$ simdag/platforms/basic_parsing_test --cfg=path:simdag/platforms one_cluster_properties_override.xml
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'path' to 'simdag/platforms'
+! output sort
+$ simdag/platforms/basic_parsing_test --cfg=path:simdag/platforms one_cluster_properties_override.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'path' to 'simdag/platforms'
 
-$ simdag/platforms/basic_parsing_test --cfg=path:simdag/platforms one_host_trace_file.xml
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'path' to 'simdag/platforms'
+! output sort
+$ simdag/platforms/basic_parsing_test --cfg=path:simdag/platforms one_host_trace_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) Configuration change: Set 'path' to 'simdag/platforms'
index 5bc06c9..4a02863 100644 (file)
@@ -1,6 +1,6 @@
 #! ./tesh
-$ ./basic_parsing_test one_cluster_fullduplex.xml FULL_LINK
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test one_cluster_fullduplex.xml FULL_LINK --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 5, link number: 14
 > Route between bob3.hamburger.edu and bob3.hamburger.edu
 >      Route size 3
@@ -153,8 +153,8 @@ $ ./basic_parsing_test one_cluster_fullduplex.xml FULL_LINK
 >      Link bob_cluster_link_6_DOWN: latency = 0.000050, bandwidth = 125000000.000000
 >      Route latency = 0.000600, route bandwidth = 125000000.000000
 
-$ ./basic_parsing_test two_clusters_symmetric.xml FULL_LINK
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_clusters_symmetric.xml FULL_LINK --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 4, link number: 10
 > Route between bob1.hamburger.edu and bob1.hamburger.edu
 >      Route size 3
@@ -285,8 +285,8 @@ $ ./basic_parsing_test two_clusters_symmetric.xml FULL_LINK
 >      Link alice_cluster_link_1: latency = 0.000050, bandwidth = 125000000.000000
 >      Route latency = 0.000600, route bandwidth = 125000000.000000
 
-$ ./basic_parsing_test two_hosts_one_link_symmetrical.xml FULL_LINK
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_hosts_one_link_symmetrical.xml FULL_LINK --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 2, link number: 4
 > Route between alice and alice
 >      Route size 1
@@ -309,8 +309,8 @@ $ ./basic_parsing_test two_hosts_one_link_symmetrical.xml FULL_LINK
 >      Link __loopback__: latency = 0.000015, bandwidth = 498000000.000000
 >      Route latency = 0.000015, route bandwidth = 498000000.000000
 
-$ ./basic_parsing_test two_hosts_one_link_fullduplex.xml FULL_LINK
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./basic_parsing_test two_hosts_one_link_fullduplex.xml FULL_LINK --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > Workstation number: 2, link number: 3
 > Route between alice and alice
 >      Route size 1
@@ -327,4 +327,4 @@ $ ./basic_parsing_test two_hosts_one_link_fullduplex.xml FULL_LINK
 > Route between bob and bob
 >      Route size 1
 >      Link __loopback__: latency = 0.000015, bandwidth = 498000000.000000
->      Route latency = 0.000015, route bandwidth = 498000000.000000
\ No newline at end of file
+>      Route latency = 0.000015, route bandwidth = 498000000.000000
index 2bae114..d3ff0f4 100644 (file)
@@ -1,5 +1,5 @@
-$ ./flatifier$EXEEXT one_cluster.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_cluster.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -95,8 +95,8 @@ $ ./flatifier$EXEEXT one_cluster.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_availability.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -109,8 +109,8 @@ $ ./flatifier$EXEEXT one_host_availability.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_properties.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_properties.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -127,8 +127,8 @@ $ ./flatifier$EXEEXT one_host_properties.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_state_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -141,8 +141,8 @@ $ ./flatifier$EXEEXT one_host_state_file.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_state_off.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_state_off.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -155,8 +155,8 @@ $ ./flatifier$EXEEXT one_host_state_off.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_state_on.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_state_on.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -169,8 +169,8 @@ $ ./flatifier$EXEEXT one_host_state_on.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_trace_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_trace_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -183,8 +183,8 @@ $ ./flatifier$EXEEXT one_host_trace_file.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host_trace_inside.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host_trace_inside.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -197,8 +197,8 @@ $ ./flatifier$EXEEXT one_host_trace_inside.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_host.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_host.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -211,8 +211,8 @@ $ ./flatifier$EXEEXT one_host.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_link_availability.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_link_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -226,8 +226,8 @@ $ ./flatifier$EXEEXT one_link_availability.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_link_fatpipe.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_link_fatpipe.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -241,8 +241,8 @@ $ ./flatifier$EXEEXT one_link_fatpipe.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_link_shared.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_link_shared.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -256,8 +256,8 @@ $ ./flatifier$EXEEXT one_link_shared.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT one_link_state_file.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT one_link_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -271,8 +271,8 @@ $ ./flatifier$EXEEXT one_link_state_file.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -314,8 +314,8 @@ $ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT two_clusters.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT two_clusters.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -649,8 +649,8 @@ $ ./flatifier$EXEEXT two_clusters.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT two_hosts_multi_hop.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT two_hosts_multi_hop.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
@@ -676,8 +676,8 @@ $ ./flatifier$EXEEXT two_hosts_multi_hop.xml
 > </AS>
 > </platform>
 
-$ ./flatifier$EXEEXT two_hosts_one_link.xml
-> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+$ ./flatifier$EXEEXT two_hosts_one_link.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) surf_workstation_model_init_ptask_L07
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "simgrid.dtd">
 > <platform version="3">
diff --git a/teshupdate.pl b/teshupdate.pl
new file mode 100755 (executable)
index 0000000..d845792
--- /dev/null
@@ -0,0 +1,24 @@
+#! /usr/bin/perl
+
+# This script is only there temporarly for the time that we convert all the tesh files into the new log formating allowing to sort the output
+# Ouf, cette phrase est trop longue et illisible, desole (mt)
+
+use strict;
+
+while (<>) {
+    if (/\$ (.*)$/) {
+       print "! output sort\n";
+       print "\$ $1 ".'--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n'."\n";
+    } elsif (/\> \[([^:]*):([^:]*):([^(]*)\(([0-9]*)\) ([0-9.]*)\] \[([^\]]*)\] (.*)/) { # ) {
+      my ($host,$proc,$thread,$pid,$time,$msg) = ($1,$2,$3,$4,$5,$7);
+#      print "h=$host,p=$proc,pid=$pid,t=$time; $_";
+      $time = sprintf "%10.6f",$time;
+      print "> [$time] ($pid:$proc\@$host) $msg\n";
+    } elsif (/\> \[([0-9.]*)\] \[([^\]]*)\] (.*)/) {
+      my ($time,$msg) = ($1,$3);
+      $time = sprintf "%10.6f",$time;
+      print "> [$time] (0:@) $msg\n";
+    } else {
+       print $_;
+    }
+}
index 430586e..55ca396 100644 (file)
@@ -21,4 +21,4 @@ target_link_libraries(maxmin_bench simgrid )
 target_link_libraries(surf_usage simgrid ) 
 target_link_libraries(surf_usage2 simgrid ) 
 target_link_libraries(trace_usage simgrid )
-endif(NOT WIN32)
\ No newline at end of file
+endif(NOT WIN32)
index 75c08d3..0384a71 100644 (file)
@@ -95,7 +95,7 @@ void test(char *platform)
       surf_network_model->extension.network.communicate("Cpu A", "Cpu B",
                                                         150.0, -1.0);
 
-  surf_solve();                 /* Takes traces into account. Returns 0.0 */
+  surf_solve(-1.0);                 /* Takes traces into account. Returns 0.0 */
   do {
     surf_action_t action = NULL;
     now = surf_get_clock();
@@ -127,7 +127,7 @@ void test(char *platform)
 
   } while ((xbt_swag_size(surf_network_model->states.running_action_set) ||
             xbt_swag_size(surf_cpu_model->states.running_action_set)) &&
-           surf_solve() >= 0.0);
+           surf_solve(-1.0) >= 0.0);
 
   DEBUG0("Simulation Terminated");
 }
index eda5f21..a2baf5c 100644 (file)
@@ -84,7 +84,7 @@ void test(char *platform)
       surf_workstation_model->extension.workstation.
       communicate(workstationA, workstationB, 150.0, -1.0);
 
-  surf_solve();                 /* Takes traces into account. Returns 0.0 */
+  surf_solve(-1.0);                 /* Takes traces into account. Returns 0.0 */
   do {
     surf_action_t action = NULL;
     unsigned int iter;
@@ -109,7 +109,7 @@ void test(char *platform)
         running = 1;
       }
     }
-  } while (running && surf_solve() >= 0.0);
+  } while (running && surf_solve(-1.0) >= 0.0);
 
   DEBUG0("Simulation Terminated");
 
index 5ad1fba..ad4566e 100644 (file)
@@ -15,4 +15,4 @@ else(NOT WIN32)
 target_link_libraries(log_usage gras )
 target_link_libraries(graphxml_usage simgrid )
 target_link_libraries(heap_bench gras )
-endif(NOT WIN32)
\ No newline at end of file
+endif(NOT WIN32)
index 113e780..f463dae 100644 (file)
@@ -112,6 +112,28 @@ By default, the commands output is matched against the one expected,
 and an error is raised on discrepency. Metacomands to change this:
  "output ignore"  -> output completely discarded 
  "output display" -> output displayed (but not verified)
+ "output sort"    -> sorts the display before verifying it (see below)
+
+SORTING OUTPUT
+--------------
+Sorting the output seems to be a strange idea, but it is mandatory in
+SimGrid since the processes run out of order at any scheduling point
+(ie, every processes ready to run at simulated time t run in
+parallel). To ensure that the simulator outputs still match, we have
+to sort the output back before comparing it. 
+
+We expect the simulators to run with that log formating argument:
+   -log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+Then, tesh sorts string on the 20 first lines only, and is stable when
+line beginings are equal. This should ensure that:
+ (1) tesh is effective (no false positive, no false negative)
+ (2) scheduling points are separated from each other 
+ (3) at each scheduling point, processes are separated from each other 
+ (4) the order of what a given process says at a given scheduling
+     point is preserved.
+     
+This is of course very SimGrid oriented, breaking the generality of
+tesh, but who cares, actually?     
  
 ENVIRONMENT
 -----------
index d8e21f3..41af0d5 100644 (file)
@@ -85,7 +85,7 @@ void rctx_init(void)
   sigwaiter_cond = xbt_os_cond_init();
   xbt_os_mutex_acquire(sigwaiter_mutex);
   sigwaiter_thread = xbt_os_thread_create("Armaggedon request waiter",
-                                          armageddon_sigwaiter, NULL);
+                                          armageddon_sigwaiter, NULL, NULL);
   /* Wait for thread to start... */
   xbt_os_cond_wait(sigwaiter_cond, sigwaiter_mutex);
   xbt_os_mutex_release(sigwaiter_mutex);
@@ -211,6 +211,7 @@ void rctx_empty(rctx_t rc)
   rc->is_background = 0;
   rc->is_stoppable = 0;
   rc->output = e_output_check;
+  rc->output_sort = 0;
   rc->brokenpipe = 0;
   rc->timeout = 0;
   rc->interrupted = 0;
@@ -225,6 +226,7 @@ rctx_t rctx_new()
   rctx_t res = xbt_new0(s_rctx_t, 1);
 
   res->input = xbt_strbuff_new();
+  res->output_sort = 0;
   res->output_wanted = xbt_strbuff_new();
   res->output_got = xbt_strbuff_new();
   res->interruption = xbt_os_mutex_init();
@@ -339,6 +341,10 @@ void rctx_pushline(const char *filepos, char kind, char *line)
       VERB2("[%s] (next command must return code %d)",
             filepos, rctx->expected_return);
 
+    } else if (!strncmp(line, "output sort", strlen("output sort"))) {
+      rctx->output_sort = 1;
+      VERB1("[%s] (sort output of next command)", filepos);
+
     } else if (!strncmp(line, "output ignore", strlen("output ignore"))) {
       rctx->output = e_output_ignore;
       VERB1("[%s] (ignore output of next command)", filepos);
@@ -592,9 +598,9 @@ void rctx_start(void)
 
     rctx->reader_done = 0;
     rctx->reader =
-        xbt_os_thread_create("reader", thread_reader, (void *) rctx);
+        xbt_os_thread_create("reader", thread_reader, (void *) rctx, NULL);
     rctx->writer =
-        xbt_os_thread_create("writer", thread_writer, (void *) rctx);
+        xbt_os_thread_create("writer", thread_writer, (void *) rctx, NULL);
 
   } else {                      /* child */
     close(child_in[1]);
@@ -625,7 +631,7 @@ void rctx_start(void)
     DEBUG2("RCTX: new bg=%p, new fg=%p", old, rctx);
 
     DEBUG2("Launch a thread to wait for %s %d", old->cmd, old->pid);
-    runner = xbt_os_thread_create(old->cmd, rctx_wait, (void *) old);
+    runner = xbt_os_thread_create(old->cmd, rctx_wait, (void *) old, NULL);
     old->runner = runner;
     VERB3("Launched thread %p to wait for %s %d", runner, old->cmd,
           old->pid);
@@ -634,6 +640,23 @@ void rctx_start(void)
   }
 }
 
+/* Helper function to sort the output */
+static int cmpstringp(const void *p1, const void *p2) {
+  /* Sort only using the 19 first chars (date+pid)
+   * If the dates are the same, then, sort using pointer address (be stable wrt output of each process)
+   */
+  const char *s1 = *((const char**) p1);
+  const char *s2 = *((const char**) p2);
+
+  DEBUG2("Compare strings '%s' and '%s'", s1, s2);
+
+  int res = strncmp(s1, s2, 19);
+  if (res == 0)
+    return p1>p2;
+  return res;
+}
+
+
 /* Waits for the child to end (or to timeout), and check its
    ending conditions. This is launched from rctx_start but either in main
    thread (for foreground jobs) or in a separate one for background jobs.
@@ -767,6 +790,20 @@ void *rctx_wait(void *r)
     errcode = 1;
   }
 
+  if (rctx->output_sort) {
+    xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
+    xbt_dynar_sort(a,cmpstringp);
+    char *sorted_output = xbt_str_join(a, "\n");
+    strcpy(rctx->output_got->data, sorted_output);
+    xbt_free(sorted_output);
+    xbt_dynar_free(&a);
+    /* If an empty line moved in first position, move it back to the end */
+    if (rctx->output_got->data[0]=='\n') {
+      fprintf(stderr,"XXX");
+      memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1);
+      rctx->output_got->data[rctx->output_got->used-1] = '\n';
+    }
+  }
   if ((errcode && errcode != 1) || rctx->interrupted) {
     /* checking output, and matching */
     xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
index a188bd5..7721e3e 100644 (file)
@@ -46,6 +46,7 @@ typedef struct {
   int end_time;                 /* begin_time + timeout, as epoch */
   char *expected_signal;        /* name of signal to raise (or NULL if none) */
   int expected_return;          /* the exepeted return code of following command */
+  int output_sort:1;            /* whether the output must be sorted before comparison */
 
   /* buffers */
   xbt_strbuff_t input;